@enadhq/enad-react-sdk 0.0.6 → 1.0.2
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/README.md +288 -0
- package/dist/client/cart/adapters/brink.d.ts +29 -0
- package/dist/client/cart/adapters/brink.d.ts.map +1 -0
- package/dist/client/cart/adapters/brink.mjs +154 -0
- package/dist/client/cart/adapters/brink.mjs.map +1 -0
- package/dist/client/cart/adapters/index.d.ts +3 -0
- package/dist/client/cart/adapters/index.d.ts.map +1 -0
- package/dist/client/cart/adapters/index.mjs +5 -0
- package/dist/client/cart/adapters/index.mjs.map +1 -0
- package/dist/client/cart/adapters/mock.d.ts +20 -0
- package/dist/client/cart/adapters/mock.d.ts.map +1 -0
- package/dist/client/cart/adapters/mock.mjs +76 -0
- package/dist/client/cart/adapters/mock.mjs.map +1 -0
- package/dist/client/cart/components/{cart-drawer.d.mts → cart-drawer.d.ts} +4 -6
- package/dist/client/cart/components/cart-drawer.d.ts.map +1 -0
- package/dist/client/cart/components/cart-drawer.mjs +269 -138
- package/dist/client/cart/components/cart-drawer.mjs.map +1 -1
- package/dist/client/cart/components/cart-trigger.d.ts +10 -0
- package/dist/client/cart/components/cart-trigger.d.ts.map +1 -0
- package/dist/client/cart/components/cart-trigger.mjs +26 -10
- package/dist/client/cart/components/cart-trigger.mjs.map +1 -1
- package/dist/client/cart/components/promo-code-input.d.ts +16 -0
- package/dist/client/cart/components/promo-code-input.d.ts.map +1 -0
- package/dist/client/cart/components/promo-code-input.mjs +92 -0
- package/dist/client/cart/components/promo-code-input.mjs.map +1 -0
- package/dist/client/cart/constants/session.d.ts +2 -0
- package/dist/client/cart/constants/session.d.ts.map +1 -0
- package/dist/client/cart/contexts/cart.d.ts +36 -0
- package/dist/client/cart/contexts/cart.d.ts.map +1 -0
- package/dist/client/cart/contexts/cart.mjs +14 -16
- package/dist/client/cart/contexts/cart.mjs.map +1 -1
- package/dist/client/cart/hooks/useCart.d.ts +26 -0
- package/dist/client/cart/hooks/useCart.d.ts.map +1 -0
- package/dist/client/cart/hooks/useCart.mjs +5 -6
- package/dist/client/cart/hooks/useCart.mjs.map +1 -1
- package/dist/client/cart/hooks/useCartActions.d.ts +25 -0
- package/dist/client/cart/hooks/useCartActions.d.ts.map +1 -0
- package/dist/client/cart/hooks/useCartActions.mjs +7 -16
- package/dist/client/cart/hooks/useCartActions.mjs.map +1 -1
- package/dist/client/cart/index.d.ts +12 -0
- package/dist/client/cart/index.d.ts.map +1 -0
- package/dist/client/cart/index.mjs +16 -0
- package/dist/client/cart/index.mjs.map +1 -0
- package/dist/client/cart/queries/addToCartQueryFn.d.ts +7 -0
- package/dist/client/cart/queries/addToCartQueryFn.d.ts.map +1 -0
- package/dist/client/cart/queries/addToCartQueryFn.mjs.map +1 -1
- package/dist/client/cart/queries/getCartQueryFn.d.ts +4 -0
- package/dist/client/cart/queries/getCartQueryFn.d.ts.map +1 -0
- package/dist/client/cart/queries/getCartQueryFn.mjs.map +1 -1
- package/dist/client/cart/queries/removeCartItemQueryFn.d.ts +6 -0
- package/dist/client/cart/queries/removeCartItemQueryFn.d.ts.map +1 -0
- package/dist/client/cart/queries/removeCartItemQueryFn.mjs.map +1 -1
- package/dist/client/cart/queries/updateCartItemQueryFn.d.ts +7 -0
- package/dist/client/cart/queries/updateCartItemQueryFn.d.ts.map +1 -0
- package/dist/client/cart/queries/updateCartItemQueryFn.mjs.map +1 -1
- package/dist/client/cart/types/adapter.d.ts +110 -0
- package/dist/client/cart/types/adapter.d.ts.map +1 -0
- package/dist/client/cart/types/adapter.mjs +12 -0
- package/dist/client/cart/types/adapter.mjs.map +1 -0
- package/dist/client/cart/types/{cart.d.mts → cart.d.ts} +21 -5
- package/dist/client/cart/types/cart.d.ts.map +1 -0
- package/dist/client/cart/utils/session.d.ts +5 -0
- package/dist/client/cart/utils/session.d.ts.map +1 -0
- package/dist/client/cart/utils/session.mjs +1 -1
- package/dist/client/cart/utils/session.mjs.map +1 -1
- package/dist/client/cms/storyblok/preview/registerStoryblokBridge.d.ts +7 -0
- package/dist/client/cms/storyblok/preview/registerStoryblokBridge.d.ts.map +1 -0
- package/dist/client/cms/storyblok/preview/registerStoryblokBridge.mjs +3 -2
- package/dist/client/cms/storyblok/preview/registerStoryblokBridge.mjs.map +1 -1
- package/dist/client/cms/storyblok/preview/{storyblok-preview-syncer.d.mts → storyblok-preview-syncer.d.ts} +4 -6
- package/dist/client/cms/storyblok/preview/storyblok-preview-syncer.d.ts.map +1 -0
- package/dist/client/cms/storyblok/preview/storyblok-preview-syncer.mjs.map +1 -1
- package/dist/client/global/auth/withAuth.d.ts +5 -0
- package/dist/client/global/auth/withAuth.d.ts.map +1 -0
- package/dist/client/global/components/error-boundary.d.ts +18 -0
- package/dist/client/global/components/error-boundary.d.ts.map +1 -0
- package/dist/client/global/components/error-boundary.mjs +41 -0
- package/dist/client/global/components/error-boundary.mjs.map +1 -0
- package/dist/client/global/config/{index.d.mts → index.d.ts} +3 -3
- package/dist/client/global/config/index.d.ts.map +1 -0
- package/dist/client/global/constants/{tags.d.mts → tags.d.ts} +2 -3
- package/dist/client/global/constants/tags.d.ts.map +1 -0
- package/dist/client/global/index.d.ts +6 -0
- package/dist/client/global/index.d.ts.map +1 -0
- package/dist/client/global/index.mjs +7 -0
- package/dist/client/global/index.mjs.map +1 -0
- package/dist/client/global/providers/enad-provider.d.ts +48 -0
- package/dist/client/global/providers/enad-provider.d.ts.map +1 -0
- package/dist/client/global/providers/enad-provider.mjs +32 -3
- package/dist/client/global/providers/enad-provider.mjs.map +1 -1
- package/dist/client/icons/adapters/hugeicons.d.ts +9 -0
- package/dist/client/icons/adapters/hugeicons.d.ts.map +1 -0
- package/dist/client/icons/adapters/hugeicons.mjs +117 -0
- package/dist/client/icons/adapters/hugeicons.mjs.map +1 -0
- package/dist/client/icons/adapters/lucide.d.ts +8 -0
- package/dist/client/icons/adapters/lucide.d.ts.map +1 -0
- package/dist/client/icons/adapters/lucide.mjs +108 -0
- package/dist/client/icons/adapters/lucide.mjs.map +1 -0
- package/dist/client/icons/adapters/phosphor.d.ts +11 -0
- package/dist/client/icons/adapters/phosphor.d.ts.map +1 -0
- package/dist/client/icons/adapters/phosphor.mjs +108 -0
- package/dist/client/icons/adapters/phosphor.mjs.map +1 -0
- package/dist/client/icons/icon-context.d.ts +13 -0
- package/dist/client/icons/icon-context.d.ts.map +1 -0
- package/dist/client/icons/icon-context.mjs +27 -0
- package/dist/client/icons/icon-context.mjs.map +1 -0
- package/dist/client/icons/index.d.ts +9 -0
- package/dist/client/icons/index.d.ts.map +1 -0
- package/dist/client/icons/index.mjs +16 -0
- package/dist/client/icons/index.mjs.map +1 -0
- package/dist/client/icons/types.d.ts +60 -0
- package/dist/client/icons/types.d.ts.map +1 -0
- package/dist/client/icons/types.mjs +1 -0
- package/dist/client/icons/types.mjs.map +1 -0
- package/dist/client/motion/config.d.ts +42 -0
- package/dist/client/motion/config.d.ts.map +1 -0
- package/dist/client/motion/config.mjs +44 -0
- package/dist/client/motion/config.mjs.map +1 -0
- package/dist/client/motion/hover.d.ts +36 -0
- package/dist/client/motion/hover.d.ts.map +1 -0
- package/dist/client/motion/hover.mjs +19 -0
- package/dist/client/motion/hover.mjs.map +1 -0
- package/dist/client/motion/index.d.ts +4 -0
- package/dist/client/motion/index.d.ts.map +1 -0
- package/dist/client/motion/index.mjs +13 -0
- package/dist/client/motion/index.mjs.map +1 -0
- package/dist/client/motion/stagger.d.ts +36 -0
- package/dist/client/motion/stagger.d.ts.map +1 -0
- package/dist/client/motion/stagger.mjs +17 -0
- package/dist/client/motion/stagger.mjs.map +1 -0
- package/dist/client/search/actions/searchAction.d.ts +2 -0
- package/dist/client/search/actions/searchAction.d.ts.map +1 -0
- package/dist/client/search/actions/searchAction.mjs.map +1 -1
- package/dist/client/search/components/search-bar.d.ts +8 -0
- package/dist/client/search/components/search-bar.d.ts.map +1 -0
- package/dist/client/search/components/search-bar.mjs +33 -0
- package/dist/client/search/components/search-bar.mjs.map +1 -1
- package/dist/client/search/hooks/useSearch.d.ts +14 -0
- package/dist/client/search/hooks/useSearch.d.ts.map +1 -0
- package/dist/client/search/hooks/useSearch.mjs +1 -1
- package/dist/client/search/hooks/useSearch.mjs.map +1 -1
- package/dist/client/search/index.d.ts +2 -0
- package/dist/client/search/index.d.ts.map +1 -0
- package/dist/client/search/index.mjs +5 -0
- package/dist/client/search/index.mjs.map +1 -0
- package/dist/client/storefront/blocks/accordion-block.d.ts +4 -0
- package/dist/client/storefront/blocks/accordion-block.d.ts.map +1 -0
- package/dist/client/storefront/blocks/accordion-block.mjs +43 -0
- package/dist/client/storefront/blocks/accordion-block.mjs.map +1 -0
- package/dist/client/storefront/blocks/card-image-with-caption.d.ts +4 -0
- package/dist/client/storefront/blocks/card-image-with-caption.d.ts.map +1 -0
- package/dist/client/storefront/blocks/card-image-with-caption.mjs +27 -0
- package/dist/client/storefront/blocks/card-image-with-caption.mjs.map +1 -0
- package/dist/client/storefront/blocks/card-video.d.ts +4 -0
- package/dist/client/storefront/blocks/card-video.d.ts.map +1 -0
- package/dist/client/storefront/blocks/card-video.mjs +43 -0
- package/dist/client/storefront/blocks/card-video.mjs.map +1 -0
- package/dist/client/storefront/blocks/content-with-gallery.d.ts +4 -0
- package/dist/client/storefront/blocks/content-with-gallery.d.ts.map +1 -0
- package/dist/client/storefront/blocks/content-with-gallery.mjs +48 -0
- package/dist/client/storefront/blocks/content-with-gallery.mjs.map +1 -0
- package/dist/client/storefront/blocks/content-with-image-product-data.d.ts +4 -0
- package/dist/client/storefront/blocks/content-with-image-product-data.d.ts.map +1 -0
- package/dist/client/storefront/blocks/content-with-image-product-data.mjs +45 -0
- package/dist/client/storefront/blocks/content-with-image-product-data.mjs.map +1 -0
- package/dist/client/storefront/blocks/gallery-with-caption.d.ts +4 -0
- package/dist/client/storefront/blocks/gallery-with-caption.d.ts.map +1 -0
- package/dist/client/storefront/blocks/gallery-with-caption.mjs +36 -0
- package/dist/client/storefront/blocks/gallery-with-caption.mjs.map +1 -0
- package/dist/client/storefront/blocks/gallery-with-link-blocks.d.ts +4 -0
- package/dist/client/storefront/blocks/gallery-with-link-blocks.d.ts.map +1 -0
- package/dist/client/storefront/blocks/gallery-with-link-blocks.mjs +24 -0
- package/dist/client/storefront/blocks/gallery-with-link-blocks.mjs.map +1 -0
- package/dist/client/storefront/blocks/gallery.d.ts +4 -0
- package/dist/client/storefront/blocks/gallery.d.ts.map +1 -0
- package/dist/client/storefront/blocks/gallery.mjs +47 -0
- package/dist/client/storefront/blocks/gallery.mjs.map +1 -0
- package/dist/client/storefront/blocks/hero.d.ts +4 -0
- package/dist/client/storefront/blocks/hero.d.ts.map +1 -0
- package/dist/client/storefront/blocks/hero.mjs +357 -0
- package/dist/client/storefront/blocks/hero.mjs.map +1 -0
- package/dist/client/storefront/blocks/image-block.d.ts +4 -0
- package/dist/client/storefront/blocks/image-block.d.ts.map +1 -0
- package/dist/client/storefront/blocks/image-block.mjs +29 -0
- package/dist/client/storefront/blocks/image-block.mjs.map +1 -0
- package/dist/client/storefront/blocks/index.d.ts +20 -0
- package/dist/client/storefront/blocks/index.d.ts.map +1 -0
- package/dist/client/storefront/blocks/index.mjs +41 -0
- package/dist/client/storefront/blocks/index.mjs.map +1 -0
- package/dist/client/storefront/blocks/link-block-small.d.ts +4 -0
- package/dist/client/storefront/blocks/link-block-small.d.ts.map +1 -0
- package/dist/client/storefront/blocks/link-block-small.mjs +35 -0
- package/dist/client/storefront/blocks/link-block-small.mjs.map +1 -0
- package/dist/client/storefront/blocks/link-block.d.ts +4 -0
- package/dist/client/storefront/blocks/link-block.d.ts.map +1 -0
- package/dist/client/storefront/blocks/link-block.mjs +150 -0
- package/dist/client/storefront/blocks/link-block.mjs.map +1 -0
- package/dist/client/storefront/blocks/product-card.d.ts +4 -0
- package/dist/client/storefront/blocks/product-card.d.ts.map +1 -0
- package/dist/client/storefront/blocks/product-card.mjs +228 -0
- package/dist/client/storefront/blocks/product-card.mjs.map +1 -0
- package/dist/client/storefront/blocks/product-image.d.ts +4 -0
- package/dist/client/storefront/blocks/product-image.d.ts.map +1 -0
- package/dist/client/storefront/blocks/product-image.mjs +109 -0
- package/dist/client/storefront/blocks/product-image.mjs.map +1 -0
- package/dist/client/storefront/blocks/spacer.d.ts +4 -0
- package/dist/client/storefront/blocks/spacer.d.ts.map +1 -0
- package/dist/client/storefront/blocks/spacer.mjs +14 -0
- package/dist/client/storefront/blocks/spacer.mjs.map +1 -0
- package/dist/client/storefront/blocks/text-content-with-image.d.ts +4 -0
- package/dist/client/storefront/blocks/text-content-with-image.d.ts.map +1 -0
- package/dist/client/storefront/blocks/text-content-with-image.mjs +225 -0
- package/dist/client/storefront/blocks/text-content-with-image.mjs.map +1 -0
- package/dist/client/storefront/blocks/text-content.d.ts +4 -0
- package/dist/client/storefront/blocks/text-content.d.ts.map +1 -0
- package/dist/client/storefront/blocks/text-content.mjs +150 -0
- package/dist/client/storefront/blocks/text-content.mjs.map +1 -0
- package/dist/client/storefront/blocks/truncated-text.d.ts +4 -0
- package/dist/client/storefront/blocks/truncated-text.d.ts.map +1 -0
- package/dist/client/storefront/blocks/truncated-text.mjs +36 -0
- package/dist/client/storefront/blocks/truncated-text.mjs.map +1 -0
- package/dist/client/storefront/blocks/variable-text-content.d.ts +4 -0
- package/dist/client/storefront/blocks/variable-text-content.d.ts.map +1 -0
- package/dist/client/storefront/blocks/variable-text-content.mjs +15 -0
- package/dist/client/storefront/blocks/variable-text-content.mjs.map +1 -0
- package/dist/client/storefront/carousel/index.d.ts +2 -0
- package/dist/client/storefront/carousel/index.d.ts.map +1 -0
- package/dist/client/storefront/carousel/index.mjs +5 -0
- package/dist/client/storefront/carousel/index.mjs.map +1 -0
- package/dist/client/storefront/carousel/swipeable-carousel.d.ts +14 -0
- package/dist/client/storefront/carousel/swipeable-carousel.d.ts.map +1 -0
- package/dist/client/storefront/carousel/swipeable-carousel.mjs +80 -0
- package/dist/client/storefront/carousel/swipeable-carousel.mjs.map +1 -0
- package/dist/client/storefront/checkout/address-form.d.ts +31 -0
- package/dist/client/storefront/checkout/address-form.d.ts.map +1 -0
- package/dist/client/storefront/checkout/address-form.mjs +124 -0
- package/dist/client/storefront/checkout/address-form.mjs.map +1 -0
- package/dist/client/storefront/checkout/cart-summary.d.ts +40 -0
- package/dist/client/storefront/checkout/cart-summary.d.ts.map +1 -0
- package/dist/client/storefront/checkout/cart-summary.mjs +150 -0
- package/dist/client/storefront/checkout/cart-summary.mjs.map +1 -0
- package/dist/client/storefront/checkout/checkout-stepper.d.ts +13 -0
- package/dist/client/storefront/checkout/checkout-stepper.d.ts.map +1 -0
- package/dist/client/storefront/checkout/checkout-stepper.mjs +58 -0
- package/dist/client/storefront/checkout/checkout-stepper.mjs.map +1 -0
- package/dist/client/storefront/checkout/index.d.ts +15 -0
- package/dist/client/storefront/checkout/index.d.ts.map +1 -0
- package/dist/client/storefront/checkout/index.mjs +17 -0
- package/dist/client/storefront/checkout/index.mjs.map +1 -0
- package/dist/client/storefront/checkout/order-confirmation.d.ts +10 -0
- package/dist/client/storefront/checkout/order-confirmation.d.ts.map +1 -0
- package/dist/client/storefront/checkout/order-confirmation.mjs +27 -0
- package/dist/client/storefront/checkout/order-confirmation.mjs.map +1 -0
- package/dist/client/storefront/checkout/order-summary.d.ts +29 -0
- package/dist/client/storefront/checkout/order-summary.d.ts.map +1 -0
- package/dist/client/storefront/checkout/order-summary.mjs +106 -0
- package/dist/client/storefront/checkout/order-summary.mjs.map +1 -0
- package/dist/client/storefront/checkout/payment-method-selector.d.ts +18 -0
- package/dist/client/storefront/checkout/payment-method-selector.d.ts.map +1 -0
- package/dist/client/storefront/checkout/payment-method-selector.mjs +61 -0
- package/dist/client/storefront/checkout/payment-method-selector.mjs.map +1 -0
- package/dist/client/storefront/checkout/shipping-method-selector.d.ts +23 -0
- package/dist/client/storefront/checkout/shipping-method-selector.d.ts.map +1 -0
- package/dist/client/storefront/checkout/shipping-method-selector.mjs +77 -0
- package/dist/client/storefront/checkout/shipping-method-selector.mjs.map +1 -0
- package/dist/client/storefront/components/badge.d.ts +8 -0
- package/dist/client/storefront/components/badge.d.ts.map +1 -0
- package/dist/client/storefront/components/badge.mjs +28 -0
- package/dist/client/storefront/components/badge.mjs.map +1 -0
- package/dist/client/storefront/components/country-redirect.d.ts +30 -0
- package/dist/client/storefront/components/country-redirect.d.ts.map +1 -0
- package/dist/client/storefront/components/country-redirect.mjs +121 -0
- package/dist/client/storefront/components/country-redirect.mjs.map +1 -0
- package/dist/client/storefront/components/empty-state.d.ts +38 -0
- package/dist/client/storefront/components/empty-state.d.ts.map +1 -0
- package/dist/client/storefront/components/empty-state.mjs +55 -0
- package/dist/client/storefront/components/empty-state.mjs.map +1 -0
- package/dist/client/storefront/components/image-lightbox.d.ts +13 -0
- package/dist/client/storefront/components/image-lightbox.d.ts.map +1 -0
- package/dist/client/storefront/components/image-lightbox.mjs +275 -0
- package/dist/client/storefront/components/image-lightbox.mjs.map +1 -0
- package/dist/client/storefront/components/infinite-scroll.d.ts +37 -0
- package/dist/client/storefront/components/infinite-scroll.d.ts.map +1 -0
- package/dist/client/storefront/components/infinite-scroll.mjs +83 -0
- package/dist/client/storefront/components/infinite-scroll.mjs.map +1 -0
- package/dist/client/storefront/components/language-selector.d.ts +5 -0
- package/dist/client/storefront/components/language-selector.d.ts.map +1 -0
- package/dist/client/storefront/components/language-selector.mjs +58 -0
- package/dist/client/storefront/components/language-selector.mjs.map +1 -0
- package/dist/client/storefront/components/newsletter-signup.d.ts +14 -0
- package/dist/client/storefront/components/newsletter-signup.d.ts.map +1 -0
- package/dist/client/storefront/components/newsletter-signup.mjs +81 -0
- package/dist/client/storefront/components/newsletter-signup.mjs.map +1 -0
- package/dist/client/storefront/components/price.d.ts +14 -0
- package/dist/client/storefront/components/price.d.ts.map +1 -0
- package/dist/client/storefront/components/price.mjs +46 -0
- package/dist/client/storefront/components/price.mjs.map +1 -0
- package/dist/client/storefront/components/product-recommendations.d.ts +18 -0
- package/dist/client/storefront/components/product-recommendations.d.ts.map +1 -0
- package/dist/client/storefront/components/product-recommendations.mjs +108 -0
- package/dist/client/storefront/components/product-recommendations.mjs.map +1 -0
- package/dist/client/storefront/components/product-tabs.d.ts +12 -0
- package/dist/client/storefront/components/product-tabs.d.ts.map +1 -0
- package/dist/client/storefront/components/product-tabs.mjs +64 -0
- package/dist/client/storefront/components/product-tabs.mjs.map +1 -0
- package/dist/client/storefront/components/quick-view.d.ts +25 -0
- package/dist/client/storefront/components/quick-view.d.ts.map +1 -0
- package/dist/client/storefront/components/quick-view.mjs +149 -0
- package/dist/client/storefront/components/quick-view.mjs.map +1 -0
- package/dist/client/storefront/components/review-summary.d.ts +17 -0
- package/dist/client/storefront/components/review-summary.d.ts.map +1 -0
- package/dist/client/storefront/components/review-summary.mjs +66 -0
- package/dist/client/storefront/components/review-summary.mjs.map +1 -0
- package/dist/client/storefront/components/search-autocomplete.d.ts +25 -0
- package/dist/client/storefront/components/search-autocomplete.d.ts.map +1 -0
- package/dist/client/storefront/components/search-autocomplete.mjs +183 -0
- package/dist/client/storefront/components/search-autocomplete.mjs.map +1 -0
- package/dist/client/storefront/components/section-nav.d.ts +20 -0
- package/dist/client/storefront/components/section-nav.d.ts.map +1 -0
- package/dist/client/storefront/components/section-nav.mjs +175 -0
- package/dist/client/storefront/components/section-nav.mjs.map +1 -0
- package/dist/client/storefront/components/share-button.d.ts +19 -0
- package/dist/client/storefront/components/share-button.d.ts.map +1 -0
- package/dist/client/storefront/components/share-button.mjs +95 -0
- package/dist/client/storefront/components/share-button.mjs.map +1 -0
- package/dist/client/storefront/components/skeleton.d.ts +12 -0
- package/dist/client/storefront/components/skeleton.d.ts.map +1 -0
- package/dist/client/storefront/components/skeleton.mjs +70 -0
- package/dist/client/storefront/components/skeleton.mjs.map +1 -0
- package/dist/client/storefront/components/star-rating.d.ts +13 -0
- package/dist/client/storefront/components/star-rating.d.ts.map +1 -0
- package/dist/client/storefront/components/star-rating.mjs +240 -0
- package/dist/client/storefront/components/star-rating.mjs.map +1 -0
- package/dist/client/storefront/components/testimonial.d.ts +20 -0
- package/dist/client/storefront/components/testimonial.d.ts.map +1 -0
- package/dist/client/storefront/components/testimonial.mjs +53 -0
- package/dist/client/storefront/components/testimonial.mjs.map +1 -0
- package/dist/client/storefront/components/trust-badges.d.ts +14 -0
- package/dist/client/storefront/components/trust-badges.d.ts.map +1 -0
- package/dist/client/storefront/components/trust-badges.mjs +25 -0
- package/dist/client/storefront/components/trust-badges.mjs.map +1 -0
- package/dist/client/storefront/components/variant-selector.d.ts +21 -0
- package/dist/client/storefront/components/variant-selector.d.ts.map +1 -0
- package/dist/client/storefront/components/variant-selector.mjs +41 -0
- package/dist/client/storefront/components/variant-selector.mjs.map +1 -0
- package/dist/client/storefront/components/wishlist-toggle.d.ts +12 -0
- package/dist/client/storefront/components/wishlist-toggle.d.ts.map +1 -0
- package/dist/client/storefront/components/wishlist-toggle.mjs +58 -0
- package/dist/client/storefront/components/wishlist-toggle.mjs.map +1 -0
- package/dist/client/storefront/filters/filter-chip.d.ts +10 -0
- package/dist/client/storefront/filters/filter-chip.d.ts.map +1 -0
- package/dist/client/storefront/filters/filter-chip.mjs +30 -0
- package/dist/client/storefront/filters/filter-chip.mjs.map +1 -0
- package/dist/client/storefront/filters/filter-group.d.ts +22 -0
- package/dist/client/storefront/filters/filter-group.d.ts.map +1 -0
- package/dist/client/storefront/filters/filter-group.mjs +102 -0
- package/dist/client/storefront/filters/filter-group.mjs.map +1 -0
- package/dist/client/storefront/filters/filter-panel.d.ts +25 -0
- package/dist/client/storefront/filters/filter-panel.d.ts.map +1 -0
- package/dist/client/storefront/filters/filter-panel.mjs +110 -0
- package/dist/client/storefront/filters/filter-panel.mjs.map +1 -0
- package/dist/client/storefront/filters/index.d.ts +6 -0
- package/dist/client/storefront/filters/index.d.ts.map +1 -0
- package/dist/client/storefront/filters/index.mjs +13 -0
- package/dist/client/storefront/filters/index.mjs.map +1 -0
- package/dist/client/storefront/filters/sort-select.d.ts +12 -0
- package/dist/client/storefront/filters/sort-select.d.ts.map +1 -0
- package/dist/client/storefront/filters/sort-select.mjs +34 -0
- package/dist/client/storefront/filters/sort-select.mjs.map +1 -0
- package/dist/client/storefront/filters/toggle-list-view.d.ts +8 -0
- package/dist/client/storefront/filters/toggle-list-view.d.ts.map +1 -0
- package/dist/client/storefront/filters/toggle-list-view.mjs +30 -0
- package/dist/client/storefront/filters/toggle-list-view.mjs.map +1 -0
- package/dist/client/storefront/hooks/use-section-observer.d.ts +12 -0
- package/dist/client/storefront/hooks/use-section-observer.d.ts.map +1 -0
- package/dist/client/storefront/hooks/use-section-observer.mjs +46 -0
- package/dist/client/storefront/hooks/use-section-observer.mjs.map +1 -0
- package/dist/client/storefront/index.d.ts +24 -0
- package/dist/client/storefront/index.d.ts.map +1 -0
- package/dist/client/storefront/index.mjs +26 -0
- package/dist/client/storefront/index.mjs.map +1 -0
- package/dist/client/storefront/layout/footer.d.ts +4 -0
- package/dist/client/storefront/layout/footer.d.ts.map +1 -0
- package/dist/client/storefront/layout/footer.mjs +56 -0
- package/dist/client/storefront/layout/footer.mjs.map +1 -0
- package/dist/client/storefront/layout/header.d.ts +4 -0
- package/dist/client/storefront/layout/header.d.ts.map +1 -0
- package/dist/client/storefront/layout/header.mjs +367 -0
- package/dist/client/storefront/layout/header.mjs.map +1 -0
- package/dist/client/storefront/layout/index.d.ts +5 -0
- package/dist/client/storefront/layout/index.d.ts.map +1 -0
- package/dist/client/storefront/layout/index.mjs +11 -0
- package/dist/client/storefront/layout/index.mjs.map +1 -0
- package/dist/client/storefront/layout/mobile-menu-drawer.d.ts +4 -0
- package/dist/client/storefront/layout/mobile-menu-drawer.d.ts.map +1 -0
- package/dist/client/storefront/layout/mobile-menu-drawer.mjs +93 -0
- package/dist/client/storefront/layout/mobile-menu-drawer.mjs.map +1 -0
- package/dist/client/storefront/layout/promotion-bar.d.ts +4 -0
- package/dist/client/storefront/layout/promotion-bar.d.ts.map +1 -0
- package/dist/client/storefront/layout/promotion-bar.mjs +79 -0
- package/dist/client/storefront/layout/promotion-bar.mjs.map +1 -0
- package/dist/client/storefront/primitives/breadcrumbs.d.ts +12 -0
- package/dist/client/storefront/primitives/breadcrumbs.d.ts.map +1 -0
- package/dist/client/storefront/primitives/breadcrumbs.mjs +37 -0
- package/dist/client/storefront/primitives/breadcrumbs.mjs.map +1 -0
- package/dist/client/storefront/primitives/button.d.ts +12 -0
- package/dist/client/storefront/primitives/button.d.ts.map +1 -0
- package/dist/client/storefront/primitives/button.mjs +51 -0
- package/dist/client/storefront/primitives/button.mjs.map +1 -0
- package/dist/client/storefront/primitives/checkbox.d.ts +10 -0
- package/dist/client/storefront/primitives/checkbox.d.ts.map +1 -0
- package/dist/client/storefront/primitives/checkbox.mjs +23 -0
- package/dist/client/storefront/primitives/checkbox.mjs.map +1 -0
- package/dist/client/storefront/primitives/download-item.d.ts +9 -0
- package/dist/client/storefront/primitives/download-item.d.ts.map +1 -0
- package/dist/client/storefront/primitives/download-item.mjs +28 -0
- package/dist/client/storefront/primitives/download-item.mjs.map +1 -0
- package/dist/client/storefront/primitives/index.d.ts +10 -0
- package/dist/client/storefront/primitives/index.d.ts.map +1 -0
- package/dist/client/storefront/primitives/index.mjs +21 -0
- package/dist/client/storefront/primitives/index.mjs.map +1 -0
- package/dist/client/storefront/primitives/input.d.ts +18 -0
- package/dist/client/storefront/primitives/input.d.ts.map +1 -0
- package/dist/client/storefront/primitives/input.mjs +118 -0
- package/dist/client/storefront/primitives/input.mjs.map +1 -0
- package/dist/client/storefront/primitives/pagination.d.ts +9 -0
- package/dist/client/storefront/primitives/pagination.d.ts.map +1 -0
- package/dist/client/storefront/primitives/pagination.mjs +86 -0
- package/dist/client/storefront/primitives/pagination.mjs.map +1 -0
- package/dist/client/storefront/primitives/quick-links.d.ts +11 -0
- package/dist/client/storefront/primitives/quick-links.d.ts.map +1 -0
- package/dist/client/storefront/primitives/quick-links.mjs +17 -0
- package/dist/client/storefront/primitives/quick-links.mjs.map +1 -0
- package/dist/client/storefront/primitives/select.d.ts +16 -0
- package/dist/client/storefront/primitives/select.d.ts.map +1 -0
- package/dist/client/storefront/primitives/select.mjs +35 -0
- package/dist/client/storefront/primitives/select.mjs.map +1 -0
- package/dist/client/storefront/primitives/text-link.d.ts +7 -0
- package/dist/client/storefront/primitives/text-link.d.ts.map +1 -0
- package/dist/client/storefront/primitives/text-link.mjs +10 -0
- package/dist/client/storefront/primitives/text-link.mjs.map +1 -0
- package/dist/client/storefront/product/color-swatch.d.ts +10 -0
- package/dist/client/storefront/product/color-swatch.d.ts.map +1 -0
- package/dist/client/storefront/product/color-swatch.mjs +32 -0
- package/dist/client/storefront/product/color-swatch.mjs.map +1 -0
- package/dist/client/storefront/product/index.d.ts +5 -0
- package/dist/client/storefront/product/index.d.ts.map +1 -0
- package/dist/client/storefront/product/index.mjs +11 -0
- package/dist/client/storefront/product/index.mjs.map +1 -0
- package/dist/client/storefront/product/material-selector.d.ts +15 -0
- package/dist/client/storefront/product/material-selector.d.ts.map +1 -0
- package/dist/client/storefront/product/material-selector.mjs +35 -0
- package/dist/client/storefront/product/material-selector.mjs.map +1 -0
- package/dist/client/storefront/product/product-usp.d.ts +7 -0
- package/dist/client/storefront/product/product-usp.d.ts.map +1 -0
- package/dist/client/storefront/product/product-usp.mjs +14 -0
- package/dist/client/storefront/product/product-usp.mjs.map +1 -0
- package/dist/client/storefront/product/quantity-picker.d.ts +10 -0
- package/dist/client/storefront/product/quantity-picker.d.ts.map +1 -0
- package/dist/client/storefront/product/quantity-picker.mjs +56 -0
- package/dist/client/storefront/product/quantity-picker.mjs.map +1 -0
- package/dist/client/storefront/types.d.ts +284 -0
- package/dist/client/storefront/types.d.ts.map +1 -0
- package/dist/client/storefront/types.mjs +20 -0
- package/dist/client/storefront/types.mjs.map +1 -0
- package/dist/client/theme/apply.d.ts +17 -0
- package/dist/client/theme/apply.d.ts.map +1 -0
- package/dist/client/theme/apply.mjs +133 -0
- package/dist/client/theme/apply.mjs.map +1 -0
- package/dist/client/theme/cli.d.ts +2 -0
- package/dist/client/theme/cli.d.ts.map +1 -0
- package/dist/client/theme/cli.mjs +453 -0
- package/dist/client/theme/cli.mjs.map +1 -0
- package/dist/client/theme/codec.d.ts +28 -0
- package/dist/client/theme/codec.d.ts.map +1 -0
- package/dist/client/theme/codec.mjs +88 -0
- package/dist/client/theme/codec.mjs.map +1 -0
- package/dist/client/theme/defaults.d.ts +64 -0
- package/dist/client/theme/defaults.d.ts.map +1 -0
- package/dist/client/theme/defaults.mjs +158 -0
- package/dist/client/theme/defaults.mjs.map +1 -0
- package/dist/client/theme/index.d.ts +8 -0
- package/dist/client/theme/index.d.ts.map +1 -0
- package/dist/client/theme/index.mjs +20 -0
- package/dist/client/theme/index.mjs.map +1 -0
- package/dist/client/theme/scan.d.ts +16 -0
- package/dist/client/theme/scan.d.ts.map +1 -0
- package/dist/client/theme/scan.mjs +25 -0
- package/dist/client/theme/scan.mjs.map +1 -0
- package/dist/client/ui/accordion.d.ts +8 -0
- package/dist/client/ui/accordion.d.ts.map +1 -0
- package/dist/client/ui/accordion.mjs +66 -0
- package/dist/client/ui/accordion.mjs.map +1 -0
- package/dist/client/ui/breadcrumb.d.ts +12 -0
- package/dist/client/ui/breadcrumb.d.ts.map +1 -0
- package/dist/client/ui/breadcrumb.mjs +104 -0
- package/dist/client/ui/breadcrumb.mjs.map +1 -0
- package/dist/client/ui/button.d.ts +11 -0
- package/dist/client/ui/button.d.ts.map +1 -0
- package/dist/client/ui/button.mjs +57 -0
- package/dist/client/ui/button.mjs.map +1 -0
- package/dist/client/ui/card.d.ts +10 -0
- package/dist/client/ui/card.d.ts.map +1 -0
- package/dist/client/ui/card.mjs +91 -0
- package/dist/client/ui/card.mjs.map +1 -0
- package/dist/client/ui/carousel.d.ts +20 -0
- package/dist/client/ui/carousel.d.ts.map +1 -0
- package/dist/client/ui/carousel.mjs +202 -0
- package/dist/client/ui/carousel.mjs.map +1 -0
- package/dist/client/ui/checkbox.d.ts +5 -0
- package/dist/client/ui/checkbox.d.ts.map +1 -0
- package/dist/client/ui/checkbox.mjs +34 -0
- package/dist/client/ui/checkbox.mjs.map +1 -0
- package/dist/client/ui/collapsible.d.ts +6 -0
- package/dist/client/ui/collapsible.d.ts.map +1 -0
- package/dist/client/ui/collapsible.mjs +36 -0
- package/dist/client/ui/collapsible.mjs.map +1 -0
- package/dist/client/ui/input.d.ts +4 -0
- package/dist/client/ui/input.d.ts.map +1 -0
- package/dist/client/ui/input.mjs +22 -0
- package/dist/client/ui/input.mjs.map +1 -0
- package/dist/client/ui/label.d.ts +5 -0
- package/dist/client/ui/label.d.ts.map +1 -0
- package/dist/client/ui/label.mjs +23 -0
- package/dist/client/ui/label.mjs.map +1 -0
- package/dist/client/ui/mid-truncate.d.ts +27 -0
- package/dist/client/ui/mid-truncate.d.ts.map +1 -0
- package/dist/client/ui/mid-truncate.mjs +25 -0
- package/dist/client/ui/mid-truncate.mjs.map +1 -0
- package/dist/client/ui/navigation-menu.d.ts +15 -0
- package/dist/client/ui/navigation-menu.d.ts.map +1 -0
- package/dist/client/ui/navigation-menu.mjs +172 -0
- package/dist/client/ui/navigation-menu.mjs.map +1 -0
- package/dist/client/ui/pagination.d.ts +14 -0
- package/dist/client/ui/pagination.d.ts.map +1 -0
- package/dist/client/ui/pagination.mjs +124 -0
- package/dist/client/ui/pagination.mjs.map +1 -0
- package/dist/client/ui/popover.d.ts +11 -0
- package/dist/client/ui/popover.d.ts.map +1 -0
- package/dist/client/ui/popover.mjs +82 -0
- package/dist/client/ui/popover.mjs.map +1 -0
- package/dist/client/ui/select.d.ts +16 -0
- package/dist/client/ui/select.d.ts.map +1 -0
- package/dist/client/ui/select.mjs +183 -0
- package/dist/client/ui/select.mjs.map +1 -0
- package/dist/client/ui/separator.d.ts +5 -0
- package/dist/client/ui/separator.d.ts.map +1 -0
- package/dist/client/ui/separator.mjs +27 -0
- package/dist/client/ui/separator.mjs.map +1 -0
- package/dist/client/ui/sheet.d.ts +15 -0
- package/dist/client/ui/sheet.d.ts.map +1 -0
- package/dist/client/ui/sheet.mjs +130 -0
- package/dist/client/ui/sheet.mjs.map +1 -0
- package/dist/client/ui/toggle-group.d.ts +10 -0
- package/dist/client/ui/toggle-group.d.ts.map +1 -0
- package/dist/client/ui/toggle-group.mjs +69 -0
- package/dist/client/ui/toggle-group.mjs.map +1 -0
- package/dist/client/ui/toggle.d.ts +10 -0
- package/dist/client/ui/toggle.d.ts.map +1 -0
- package/dist/client/ui/toggle.mjs +44 -0
- package/dist/client/ui/toggle.mjs.map +1 -0
- package/dist/client/ui/utils.d.ts +3 -0
- package/dist/client/ui/utils.d.ts.map +1 -0
- package/dist/client/ui/utils.mjs +9 -0
- package/dist/client/ui/utils.mjs.map +1 -0
- package/dist/client/ui-interfaces/accordion.d.ts +8 -0
- package/dist/client/ui-interfaces/accordion.d.ts.map +1 -0
- package/dist/client/ui-interfaces/accordion.mjs +72 -0
- package/dist/client/ui-interfaces/accordion.mjs.map +1 -0
- package/dist/client/ui-interfaces/breadcrumb.d.ts +12 -0
- package/dist/client/ui-interfaces/breadcrumb.d.ts.map +1 -0
- package/dist/client/ui-interfaces/breadcrumb.mjs +97 -0
- package/dist/client/ui-interfaces/breadcrumb.mjs.map +1 -0
- package/dist/client/ui-interfaces/button.d.ts +11 -0
- package/dist/client/ui-interfaces/button.d.ts.map +1 -0
- package/dist/client/ui-interfaces/button.mjs +57 -0
- package/dist/client/ui-interfaces/button.mjs.map +1 -0
- package/dist/client/ui-interfaces/card.d.ts +10 -0
- package/dist/client/ui-interfaces/card.d.ts.map +1 -0
- package/dist/client/ui-interfaces/card.mjs +78 -0
- package/dist/client/ui-interfaces/card.mjs.map +1 -0
- package/dist/client/ui-interfaces/carousel.d.ts +20 -0
- package/dist/client/ui-interfaces/carousel.d.ts.map +1 -0
- package/dist/client/ui-interfaces/carousel.mjs +188 -0
- package/dist/client/ui-interfaces/carousel.mjs.map +1 -0
- package/dist/client/ui-interfaces/checkbox.d.ts +5 -0
- package/dist/client/ui-interfaces/checkbox.d.ts.map +1 -0
- package/dist/client/ui-interfaces/checkbox.mjs +30 -0
- package/dist/client/ui-interfaces/checkbox.mjs.map +1 -0
- package/dist/client/ui-interfaces/collapsible.d.ts +7 -0
- package/dist/client/ui-interfaces/collapsible.d.ts.map +1 -0
- package/dist/client/ui-interfaces/collapsible.mjs +42 -0
- package/dist/client/ui-interfaces/collapsible.mjs.map +1 -0
- package/dist/client/ui-interfaces/index.d.ts +18 -0
- package/dist/client/ui-interfaces/index.d.ts.map +1 -0
- package/dist/client/ui-interfaces/index.mjs +18 -0
- package/dist/client/ui-interfaces/index.mjs.map +1 -0
- package/dist/client/ui-interfaces/input.d.ts +7 -0
- package/dist/client/ui-interfaces/input.d.ts.map +1 -0
- package/dist/client/ui-interfaces/input.mjs +39 -0
- package/dist/client/ui-interfaces/input.mjs.map +1 -0
- package/dist/client/ui-interfaces/label.d.ts +5 -0
- package/dist/client/ui-interfaces/label.d.ts.map +1 -0
- package/dist/client/ui-interfaces/label.mjs +23 -0
- package/dist/client/ui-interfaces/label.mjs.map +1 -0
- package/dist/client/ui-interfaces/navigation-menu.d.ts +15 -0
- package/dist/client/ui-interfaces/navigation-menu.d.ts.map +1 -0
- package/dist/client/ui-interfaces/navigation-menu.mjs +163 -0
- package/dist/client/ui-interfaces/navigation-menu.mjs.map +1 -0
- package/dist/client/ui-interfaces/pagination.d.ts +14 -0
- package/dist/client/ui-interfaces/pagination.d.ts.map +1 -0
- package/dist/client/ui-interfaces/pagination.mjs +103 -0
- package/dist/client/ui-interfaces/pagination.mjs.map +1 -0
- package/dist/client/ui-interfaces/popover.d.ts +8 -0
- package/dist/client/ui-interfaces/popover.d.ts.map +1 -0
- package/dist/client/ui-interfaces/popover.mjs +50 -0
- package/dist/client/ui-interfaces/popover.mjs.map +1 -0
- package/dist/client/ui-interfaces/select.d.ts +16 -0
- package/dist/client/ui-interfaces/select.d.ts.map +1 -0
- package/dist/client/ui-interfaces/select.mjs +159 -0
- package/dist/client/ui-interfaces/select.mjs.map +1 -0
- package/dist/client/ui-interfaces/separator.d.ts +5 -0
- package/dist/client/ui-interfaces/separator.d.ts.map +1 -0
- package/dist/client/ui-interfaces/separator.mjs +28 -0
- package/dist/client/ui-interfaces/separator.mjs.map +1 -0
- package/dist/client/ui-interfaces/sheet.d.ts +14 -0
- package/dist/client/ui-interfaces/sheet.d.ts.map +1 -0
- package/dist/client/ui-interfaces/sheet.mjs +140 -0
- package/dist/client/ui-interfaces/sheet.mjs.map +1 -0
- package/dist/client/ui-interfaces/toggle-group.d.ts +10 -0
- package/dist/client/ui-interfaces/toggle-group.d.ts.map +1 -0
- package/dist/client/ui-interfaces/toggle-group.mjs +67 -0
- package/dist/client/ui-interfaces/toggle-group.mjs.map +1 -0
- package/dist/client/ui-interfaces/toggle.d.ts +10 -0
- package/dist/client/ui-interfaces/toggle.d.ts.map +1 -0
- package/dist/client/ui-interfaces/toggle.mjs +45 -0
- package/dist/client/ui-interfaces/toggle.mjs.map +1 -0
- package/dist/client/ui-resolver/accordion.d.ts +11 -0
- package/dist/client/ui-resolver/accordion.d.ts.map +1 -0
- package/dist/client/ui-resolver/accordion.mjs +35 -0
- package/dist/client/ui-resolver/accordion.mjs.map +1 -0
- package/dist/client/ui-resolver/breadcrumb.d.ts +14 -0
- package/dist/client/ui-resolver/breadcrumb.d.ts.map +1 -0
- package/dist/client/ui-resolver/breadcrumb.mjs +53 -0
- package/dist/client/ui-resolver/breadcrumb.mjs.map +1 -0
- package/dist/client/ui-resolver/button.d.ts +12 -0
- package/dist/client/ui-resolver/button.d.ts.map +1 -0
- package/dist/client/ui-resolver/button.mjs +25 -0
- package/dist/client/ui-resolver/button.mjs.map +1 -0
- package/dist/client/ui-resolver/card.d.ts +14 -0
- package/dist/client/ui-resolver/card.d.ts.map +1 -0
- package/dist/client/ui-resolver/card.mjs +53 -0
- package/dist/client/ui-resolver/card.mjs.map +1 -0
- package/dist/client/ui-resolver/carousel.d.ts +13 -0
- package/dist/client/ui-resolver/carousel.d.ts.map +1 -0
- package/dist/client/ui-resolver/carousel.mjs +41 -0
- package/dist/client/ui-resolver/carousel.mjs.map +1 -0
- package/dist/client/ui-resolver/checkbox.d.ts +8 -0
- package/dist/client/ui-resolver/checkbox.d.ts.map +1 -0
- package/dist/client/ui-resolver/checkbox.mjs +17 -0
- package/dist/client/ui-resolver/checkbox.mjs.map +1 -0
- package/dist/client/ui-resolver/collapsible.d.ts +10 -0
- package/dist/client/ui-resolver/collapsible.d.ts.map +1 -0
- package/dist/client/ui-resolver/collapsible.mjs +29 -0
- package/dist/client/ui-resolver/collapsible.mjs.map +1 -0
- package/dist/client/ui-resolver/context.d.ts +10 -0
- package/dist/client/ui-resolver/context.d.ts.map +1 -0
- package/dist/client/ui-resolver/context.mjs +28 -0
- package/dist/client/ui-resolver/context.mjs.map +1 -0
- package/dist/client/ui-resolver/index.d.ts +19 -0
- package/dist/client/ui-resolver/index.d.ts.map +1 -0
- package/dist/client/ui-resolver/index.mjs +156 -0
- package/dist/client/ui-resolver/index.mjs.map +1 -0
- package/dist/client/ui-resolver/input.d.ts +8 -0
- package/dist/client/ui-resolver/input.d.ts.map +1 -0
- package/dist/client/ui-resolver/input.mjs +17 -0
- package/dist/client/ui-resolver/input.mjs.map +1 -0
- package/dist/client/ui-resolver/label.d.ts +8 -0
- package/dist/client/ui-resolver/label.d.ts.map +1 -0
- package/dist/client/ui-resolver/label.mjs +17 -0
- package/dist/client/ui-resolver/label.mjs.map +1 -0
- package/dist/client/ui-resolver/navigation-menu.d.ts +16 -0
- package/dist/client/ui-resolver/navigation-menu.d.ts.map +1 -0
- package/dist/client/ui-resolver/navigation-menu.mjs +64 -0
- package/dist/client/ui-resolver/navigation-menu.mjs.map +1 -0
- package/dist/client/ui-resolver/pagination.d.ts +14 -0
- package/dist/client/ui-resolver/pagination.d.ts.map +1 -0
- package/dist/client/ui-resolver/pagination.mjs +53 -0
- package/dist/client/ui-resolver/pagination.mjs.map +1 -0
- package/dist/client/ui-resolver/popover.d.ts +11 -0
- package/dist/client/ui-resolver/popover.d.ts.map +1 -0
- package/dist/client/ui-resolver/popover.mjs +35 -0
- package/dist/client/ui-resolver/popover.mjs.map +1 -0
- package/dist/client/ui-resolver/select.d.ts +15 -0
- package/dist/client/ui-resolver/select.d.ts.map +1 -0
- package/dist/client/ui-resolver/select.mjs +59 -0
- package/dist/client/ui-resolver/select.mjs.map +1 -0
- package/dist/client/ui-resolver/separator.d.ts +8 -0
- package/dist/client/ui-resolver/separator.d.ts.map +1 -0
- package/dist/client/ui-resolver/separator.mjs +17 -0
- package/dist/client/ui-resolver/separator.mjs.map +1 -0
- package/dist/client/ui-resolver/sheet.d.ts +15 -0
- package/dist/client/ui-resolver/sheet.d.ts.map +1 -0
- package/dist/client/ui-resolver/sheet.mjs +59 -0
- package/dist/client/ui-resolver/sheet.mjs.map +1 -0
- package/dist/client/ui-resolver/toggle-group.d.ts +9 -0
- package/dist/client/ui-resolver/toggle-group.d.ts.map +1 -0
- package/dist/client/ui-resolver/toggle-group.mjs +23 -0
- package/dist/client/ui-resolver/toggle-group.mjs.map +1 -0
- package/dist/client/ui-resolver/toggle.d.ts +12 -0
- package/dist/client/ui-resolver/toggle.d.ts.map +1 -0
- package/dist/client/ui-resolver/toggle.mjs +25 -0
- package/dist/client/ui-resolver/toggle.mjs.map +1 -0
- package/dist/client/user/actions/createResetPasswordLinkAction.d.ts +14 -0
- package/dist/client/user/actions/createResetPasswordLinkAction.d.ts.map +1 -0
- package/dist/client/user/actions/createResetPasswordLinkAction.mjs +1 -1
- package/dist/client/user/actions/createResetPasswordLinkAction.mjs.map +1 -1
- package/dist/client/user/actions/getUserAction.d.ts +3 -0
- package/dist/client/user/actions/getUserAction.d.ts.map +1 -0
- package/dist/client/user/actions/getUserAction.mjs.map +1 -1
- package/dist/client/user/actions/{logInUserAction.d.mts → logInUserAction.d.ts} +3 -3
- package/dist/client/user/actions/logInUserAction.d.ts.map +1 -0
- package/dist/client/user/actions/logoutUserAction.d.ts +2 -0
- package/dist/client/user/actions/logoutUserAction.d.ts.map +1 -0
- package/dist/client/user/actions/registerOrganisationAction.d.ts +9 -0
- package/dist/client/user/actions/registerOrganisationAction.d.ts.map +1 -0
- package/dist/client/user/actions/registerOrganisationAction.mjs.map +1 -1
- package/dist/client/user/actions/{registerUserAction.d.mts → registerUserAction.d.ts} +3 -3
- package/dist/client/user/actions/registerUserAction.d.ts.map +1 -0
- package/dist/client/user/actions/registerUserAction.mjs +1 -1
- package/dist/client/user/actions/registerUserAction.mjs.map +1 -1
- package/dist/client/user/actions/{registerUserWithoutRedirectAction.d.mts → registerUserWithoutRedirectAction.d.ts} +3 -6
- package/dist/client/user/actions/registerUserWithoutRedirectAction.d.ts.map +1 -0
- package/dist/client/user/actions/{updatePasswordAction.d.mts → updatePasswordAction.d.ts} +3 -3
- package/dist/client/user/actions/updatePasswordAction.d.ts.map +1 -0
- package/dist/client/user/actions/updatePasswordAction.mjs +1 -1
- package/dist/client/user/actions/updatePasswordAction.mjs.map +1 -1
- package/dist/client/user/api/userRoute.d.ts +7 -0
- package/dist/client/user/api/userRoute.d.ts.map +1 -0
- package/dist/client/user/clients/enad.d.ts +4 -0
- package/dist/client/user/clients/enad.d.ts.map +1 -0
- package/dist/client/user/components/login-form.d.ts +23 -0
- package/dist/client/user/components/login-form.d.ts.map +1 -0
- package/dist/client/user/components/login-form.mjs +77 -73
- package/dist/client/user/components/login-form.mjs.map +1 -1
- package/dist/client/user/components/reset-password-form.d.ts +20 -0
- package/dist/client/user/components/reset-password-form.d.ts.map +1 -0
- package/dist/client/user/components/reset-password-form.mjs +57 -50
- package/dist/client/user/components/reset-password-form.mjs.map +1 -1
- package/dist/client/user/components/sign-out.d.ts +8 -0
- package/dist/client/user/components/sign-out.d.ts.map +1 -0
- package/dist/client/user/components/sign-out.mjs +6 -3
- package/dist/client/user/components/sign-out.mjs.map +1 -1
- package/dist/client/user/components/signup-form.d.ts +27 -0
- package/dist/client/user/components/signup-form.d.ts.map +1 -0
- package/dist/client/user/components/signup-form.mjs +153 -120
- package/dist/client/user/components/signup-form.mjs.map +1 -1
- package/dist/client/user/components/signup-organisation-form.d.ts +55 -0
- package/dist/client/user/components/signup-organisation-form.d.ts.map +1 -0
- package/dist/client/user/components/signup-organisation-form.mjs +713 -662
- package/dist/client/user/components/signup-organisation-form.mjs.map +1 -1
- package/dist/client/user/components/update-password-form.d.ts +17 -0
- package/dist/client/user/components/update-password-form.d.ts.map +1 -0
- package/dist/client/user/components/update-password-form.mjs +26 -35
- package/dist/client/user/components/update-password-form.mjs.map +1 -1
- package/dist/client/user/hooks/index.d.ts +2 -0
- package/dist/client/user/hooks/index.d.ts.map +1 -0
- package/dist/client/user/hooks/useUser.d.ts +12 -0
- package/dist/client/user/hooks/useUser.d.ts.map +1 -0
- package/dist/client/user/hooks/useUser.mjs +1 -1
- package/dist/client/user/hooks/useUser.mjs.map +1 -1
- package/dist/client/user/index.d.ts +9 -0
- package/dist/client/user/index.d.ts.map +1 -0
- package/dist/client/user/index.mjs +17 -0
- package/dist/client/user/index.mjs.map +1 -0
- package/dist/client/user/types/{user.d.mts → user.d.ts} +25 -26
- package/dist/client/user/types/user.d.ts.map +1 -0
- package/dist/client/user/utils/{userCookieService.d.mts → userCookieService.d.ts} +2 -3
- package/dist/client/user/utils/userCookieService.d.ts.map +1 -0
- package/dist/client/wishlist/actions/addItemsToWishlistAction.d.ts +5 -0
- package/dist/client/wishlist/actions/addItemsToWishlistAction.d.ts.map +1 -0
- package/dist/client/wishlist/actions/addItemsToWishlistAction.mjs.map +1 -1
- package/dist/client/wishlist/actions/createOrGetShareTokenAction.d.ts +3 -0
- package/dist/client/wishlist/actions/createOrGetShareTokenAction.d.ts.map +1 -0
- package/dist/client/wishlist/actions/createOrGetShareTokenAction.mjs.map +1 -1
- package/dist/client/wishlist/actions/createWishlistAction.d.ts +3 -0
- package/dist/client/wishlist/actions/createWishlistAction.d.ts.map +1 -0
- package/dist/client/wishlist/actions/createWishlistAction.mjs.map +1 -1
- package/dist/client/wishlist/actions/deleteItemsFromWishlistAction.d.ts +5 -0
- package/dist/client/wishlist/actions/deleteItemsFromWishlistAction.d.ts.map +1 -0
- package/dist/client/wishlist/actions/deleteItemsFromWishlistAction.mjs.map +1 -1
- package/dist/client/wishlist/actions/deleteWishlistAction.d.ts +4 -0
- package/dist/client/wishlist/actions/deleteWishlistAction.d.ts.map +1 -0
- package/dist/client/wishlist/actions/getSharedWishlistAction.d.ts +3 -0
- package/dist/client/wishlist/actions/getSharedWishlistAction.d.ts.map +1 -0
- package/dist/client/wishlist/actions/getSharedWishlistAction.mjs.map +1 -1
- package/dist/client/wishlist/actions/getSpecificWishlistAction.d.ts +3 -0
- package/dist/client/wishlist/actions/getSpecificWishlistAction.d.ts.map +1 -0
- package/dist/client/wishlist/actions/getSpecificWishlistAction.mjs.map +1 -1
- package/dist/client/wishlist/actions/getUserWishlists.d.ts +4 -0
- package/dist/client/wishlist/actions/getUserWishlists.d.ts.map +1 -0
- package/dist/client/wishlist/actions/getUserWishlists.mjs.map +1 -1
- package/dist/client/wishlist/actions/revokeShareTokenAction.d.ts +4 -0
- package/dist/client/wishlist/actions/revokeShareTokenAction.d.ts.map +1 -0
- package/dist/client/wishlist/actions/updateWishlistAction.d.ts +3 -0
- package/dist/client/wishlist/actions/updateWishlistAction.d.ts.map +1 -0
- package/dist/client/wishlist/actions/updateWishlistAction.mjs.map +1 -1
- package/dist/client/wishlist/hooks/index.d.ts +2 -0
- package/dist/client/wishlist/hooks/index.d.ts.map +1 -0
- package/dist/client/wishlist/hooks/useWishlist.d.ts +95 -0
- package/dist/client/wishlist/hooks/useWishlist.d.ts.map +1 -0
- package/dist/client/wishlist/hooks/useWishlist.mjs +14 -4
- package/dist/client/wishlist/hooks/useWishlist.mjs.map +1 -1
- package/dist/client/wishlist/hooks/useWishlistActions.d.ts +44 -0
- package/dist/client/wishlist/hooks/useWishlistActions.d.ts.map +1 -0
- package/dist/client/wishlist/hooks/useWishlistActions.mjs.map +1 -1
- package/dist/client/wishlist/index.d.ts +5 -0
- package/dist/client/wishlist/index.d.ts.map +1 -0
- package/dist/client/wishlist/index.mjs +9 -0
- package/dist/client/wishlist/index.mjs.map +1 -0
- package/dist/client/wishlist/wishlist-drawer.d.ts +17 -0
- package/dist/client/wishlist/wishlist-drawer.d.ts.map +1 -0
- package/dist/client/wishlist/wishlist-drawer.mjs +189 -170
- package/dist/client/wishlist/wishlist-drawer.mjs.map +1 -1
- package/dist/styles.css +1 -958
- package/package.json +107 -33
- package/dist/client/cart/components/cart-trigger.d.mts +0 -5
- package/dist/client/cart/constants/session.d.mts +0 -3
- package/dist/client/cart/contexts/cart.d.mts +0 -27
- package/dist/client/cart/hooks/useCart.d.mts +0 -29
- package/dist/client/cart/hooks/useCartActions.d.mts +0 -26
- package/dist/client/cart/queries/addToCartQueryFn.d.mts +0 -10
- package/dist/client/cart/queries/getCartQueryFn.d.mts +0 -7
- package/dist/client/cart/queries/removeCartItemQueryFn.d.mts +0 -9
- package/dist/client/cart/queries/updateCartItemQueryFn.d.mts +0 -10
- package/dist/client/cart/utils/session.d.mts +0 -6
- package/dist/client/cms/storyblok/preview/registerStoryblokBridge.d.mts +0 -6
- package/dist/client/global/auth/withAuth.d.mts +0 -6
- package/dist/client/global/providers/enad-provider.d.mts +0 -23
- package/dist/client/search/actions/searchAction.d.mts +0 -5
- package/dist/client/search/components/search-bar.d.mts +0 -2
- package/dist/client/search/hooks/useSearch.d.mts +0 -18
- package/dist/client/user/actions/createResetPasswordLinkAction.d.mts +0 -14
- package/dist/client/user/actions/getUserAction.d.mts +0 -5
- package/dist/client/user/actions/logoutUserAction.d.mts +0 -3
- package/dist/client/user/actions/registerOrganisationAction.d.mts +0 -12
- package/dist/client/user/api/userRoute.d.mts +0 -9
- package/dist/client/user/clients/enad.d.mts +0 -6
- package/dist/client/user/components/login-form.d.mts +0 -20
- package/dist/client/user/components/reset-password-form.d.mts +0 -15
- package/dist/client/user/components/sign-out.d.mts +0 -5
- package/dist/client/user/components/signup-form.d.mts +0 -15
- package/dist/client/user/components/signup-organisation-form.d.mts +0 -20
- package/dist/client/user/components/update-password-form.d.mts +0 -11
- package/dist/client/user/hooks/index.d.mts +0 -3
- package/dist/client/user/hooks/useUser.d.mts +0 -16
- package/dist/client/wishlist/actions/addItemsToWishlistAction.d.mts +0 -7
- package/dist/client/wishlist/actions/createOrGetShareTokenAction.d.mts +0 -6
- package/dist/client/wishlist/actions/createWishlistAction.d.mts +0 -6
- package/dist/client/wishlist/actions/deleteItemsFromWishlistAction.d.mts +0 -7
- package/dist/client/wishlist/actions/deleteWishlistAction.d.mts +0 -5
- package/dist/client/wishlist/actions/getSharedWishlistAction.d.mts +0 -6
- package/dist/client/wishlist/actions/getSpecificWishlistAction.d.mts +0 -6
- package/dist/client/wishlist/actions/getUserWishlists.d.mts +0 -7
- package/dist/client/wishlist/actions/revokeShareTokenAction.d.mts +0 -5
- package/dist/client/wishlist/actions/updateWishlistAction.d.mts +0 -6
- package/dist/client/wishlist/hooks/index.d.mts +0 -3
- package/dist/client/wishlist/hooks/useWishlist.d.mts +0 -98
- package/dist/client/wishlist/hooks/useWishlistActions.d.mts +0 -48
- package/dist/client/wishlist/wishlist-drawer.d.mts +0 -19
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { useIcon } from "../../icons/icon-context";
|
|
5
|
+
import { Input } from "../../ui/input";
|
|
6
|
+
import { StorefrontButton } from "../../storefront/primitives/button";
|
|
7
|
+
function PromoCodeInput({
|
|
8
|
+
onApply,
|
|
9
|
+
onRemove,
|
|
10
|
+
appliedCodes = [],
|
|
11
|
+
isApplying = false,
|
|
12
|
+
error,
|
|
13
|
+
labels = {},
|
|
14
|
+
className = ""
|
|
15
|
+
}) {
|
|
16
|
+
const CloseIcon = useIcon("close");
|
|
17
|
+
const LoaderIcon = useIcon("loader");
|
|
18
|
+
const TagIcon = useIcon("tag");
|
|
19
|
+
const {
|
|
20
|
+
placeholder = "Enter promo code",
|
|
21
|
+
applyButton = "Apply",
|
|
22
|
+
removeLabel = "Remove",
|
|
23
|
+
title = "Promo Code"
|
|
24
|
+
} = labels;
|
|
25
|
+
const [code, setCode] = useState("");
|
|
26
|
+
const errorId = "promo-code-error";
|
|
27
|
+
const handleApply = () => {
|
|
28
|
+
const trimmed = code.trim();
|
|
29
|
+
if (!trimmed) return;
|
|
30
|
+
onApply(trimmed);
|
|
31
|
+
setCode("");
|
|
32
|
+
};
|
|
33
|
+
const handleKeyDown = (e) => {
|
|
34
|
+
if (e.key === "Enter") {
|
|
35
|
+
e.preventDefault();
|
|
36
|
+
handleApply();
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
return /* @__PURE__ */ jsxs("div", { className: `font-enad space-y-3 ${className}`, children: [
|
|
40
|
+
title && /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-(--enad-text-primary-color)", children: title }),
|
|
41
|
+
/* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
|
|
42
|
+
/* @__PURE__ */ jsx(
|
|
43
|
+
Input,
|
|
44
|
+
{
|
|
45
|
+
type: "text",
|
|
46
|
+
value: code,
|
|
47
|
+
onChange: (e) => setCode(e.target.value),
|
|
48
|
+
onKeyDown: handleKeyDown,
|
|
49
|
+
placeholder,
|
|
50
|
+
disabled: isApplying,
|
|
51
|
+
"aria-describedby": error ? errorId : void 0,
|
|
52
|
+
className: "flex-1"
|
|
53
|
+
}
|
|
54
|
+
),
|
|
55
|
+
/* @__PURE__ */ jsx(
|
|
56
|
+
StorefrontButton,
|
|
57
|
+
{
|
|
58
|
+
type: "button",
|
|
59
|
+
onClick: handleApply,
|
|
60
|
+
disabled: isApplying || !code.trim(),
|
|
61
|
+
children: isApplying ? /* @__PURE__ */ jsx(LoaderIcon, { className: "h-4 w-4 animate-spin" }) : applyButton
|
|
62
|
+
}
|
|
63
|
+
)
|
|
64
|
+
] }),
|
|
65
|
+
error && /* @__PURE__ */ jsx("p", { id: errorId, className: "text-sm text-(--enad-error-color)", role: "alert", children: error }),
|
|
66
|
+
appliedCodes.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2", children: appliedCodes.map((appliedCode) => /* @__PURE__ */ jsxs(
|
|
67
|
+
"span",
|
|
68
|
+
{
|
|
69
|
+
className: "inline-flex items-center gap-1.5 px-3 py-1.5 text-sm bg-(--enad-border-color) text-(--enad-text-primary-color) rounded-(--enad-border-radius)",
|
|
70
|
+
children: [
|
|
71
|
+
/* @__PURE__ */ jsx(TagIcon, { className: "h-3.5 w-3.5" }),
|
|
72
|
+
appliedCode,
|
|
73
|
+
onRemove && /* @__PURE__ */ jsx(
|
|
74
|
+
"button",
|
|
75
|
+
{
|
|
76
|
+
type: "button",
|
|
77
|
+
onClick: () => onRemove(appliedCode),
|
|
78
|
+
"aria-label": `${removeLabel} ${appliedCode}`,
|
|
79
|
+
className: "ml-0.5 p-0.5 rounded-full hover:bg-(--enad-surface) transition",
|
|
80
|
+
children: /* @__PURE__ */ jsx(CloseIcon, { className: "h-3 w-3" })
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
appliedCode
|
|
86
|
+
)) })
|
|
87
|
+
] });
|
|
88
|
+
}
|
|
89
|
+
export {
|
|
90
|
+
PromoCodeInput
|
|
91
|
+
};
|
|
92
|
+
//# sourceMappingURL=promo-code-input.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/client/cart/components/promo-code-input.tsx"],"sourcesContent":["\"use client\"\n\nimport { useState } from \"react\"\nimport { useIcon } from \"../../icons/icon-context\"\nimport { Input } from \"../../ui/input\"\nimport { StorefrontButton } from \"../../storefront/primitives/button\"\n\nexport interface PromoCodeInputProps {\n onApply: (code: string) => void\n onRemove?: (code: string) => void\n appliedCodes?: string[]\n isApplying?: boolean\n error?: string\n labels?: {\n placeholder?: string\n applyButton?: string\n removeLabel?: string\n title?: string\n }\n className?: string\n}\n\nexport function PromoCodeInput({\n onApply,\n onRemove,\n appliedCodes = [],\n isApplying = false,\n error,\n labels = {},\n className = \"\",\n}: PromoCodeInputProps) {\n const CloseIcon = useIcon(\"close\")\n const LoaderIcon = useIcon(\"loader\")\n const TagIcon = useIcon(\"tag\")\n const {\n placeholder = \"Enter promo code\",\n applyButton = \"Apply\",\n removeLabel = \"Remove\",\n title = \"Promo Code\",\n } = labels\n\n const [code, setCode] = useState(\"\")\n const errorId = \"promo-code-error\"\n\n const handleApply = () => {\n const trimmed = code.trim()\n if (!trimmed) return\n onApply(trimmed)\n setCode(\"\")\n }\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === \"Enter\") {\n e.preventDefault()\n handleApply()\n }\n }\n\n return (\n <div className={`font-enad space-y-3 ${className}`}>\n {title && (\n <label className=\"block text-sm font-medium text-(--enad-text-primary-color)\">\n {title}\n </label>\n )}\n\n {/* Input + Apply button */}\n <div className=\"flex gap-2\">\n <Input\n type=\"text\"\n value={code}\n onChange={(e) => setCode(e.target.value)}\n onKeyDown={handleKeyDown}\n placeholder={placeholder}\n disabled={isApplying}\n aria-describedby={error ? errorId : undefined}\n className=\"flex-1\"\n />\n <StorefrontButton\n type=\"button\"\n onClick={handleApply}\n disabled={isApplying || !code.trim()}\n >\n {isApplying ? (\n <LoaderIcon className=\"h-4 w-4 animate-spin\" />\n ) : (\n applyButton\n )}\n </StorefrontButton>\n </div>\n\n {/* Error message */}\n {error && (\n <p id={errorId} className=\"text-sm text-(--enad-error-color)\" role=\"alert\">\n {error}\n </p>\n )}\n\n {/* Applied codes */}\n {appliedCodes.length > 0 && (\n <div className=\"flex flex-wrap gap-2\">\n {appliedCodes.map((appliedCode) => (\n <span\n key={appliedCode}\n className=\"inline-flex items-center gap-1.5 px-3 py-1.5 text-sm bg-(--enad-border-color) text-(--enad-text-primary-color) rounded-(--enad-border-radius)\"\n >\n <TagIcon className=\"h-3.5 w-3.5\" />\n {appliedCode}\n {onRemove && (\n <button\n type=\"button\"\n onClick={() => onRemove(appliedCode)}\n aria-label={`${removeLabel} ${appliedCode}`}\n className=\"ml-0.5 p-0.5 rounded-full hover:bg-(--enad-surface) transition\"\n >\n <CloseIcon className=\"h-3 w-3\" />\n </button>\n )}\n </span>\n ))}\n </div>\n )}\n </div>\n )\n}\n"],"mappings":";AA6DQ,cAMF,YANE;AA3DR,SAAS,gBAAgB;AACzB,SAAS,eAAe;AACxB,SAAS,aAAa;AACtB,SAAS,wBAAwB;AAiB1B,SAAS,eAAe;AAAA,EAC7B;AAAA,EACA;AAAA,EACA,eAAe,CAAC;AAAA,EAChB,aAAa;AAAA,EACb;AAAA,EACA,SAAS,CAAC;AAAA,EACV,YAAY;AACd,GAAwB;AACtB,QAAM,YAAY,QAAQ,OAAO;AACjC,QAAM,aAAa,QAAQ,QAAQ;AACnC,QAAM,UAAU,QAAQ,KAAK;AAC7B,QAAM;AAAA,IACJ,cAAc;AAAA,IACd,cAAc;AAAA,IACd,cAAc;AAAA,IACd,QAAQ;AAAA,EACV,IAAI;AAEJ,QAAM,CAAC,MAAM,OAAO,IAAI,SAAS,EAAE;AACnC,QAAM,UAAU;AAEhB,QAAM,cAAc,MAAM;AACxB,UAAM,UAAU,KAAK,KAAK;AAC1B,QAAI,CAAC,QAAS;AACd,YAAQ,OAAO;AACf,YAAQ,EAAE;AAAA,EACZ;AAEA,QAAM,gBAAgB,CAAC,MAA6C;AAClE,QAAI,EAAE,QAAQ,SAAS;AACrB,QAAE,eAAe;AACjB,kBAAY;AAAA,IACd;AAAA,EACF;AAEA,SACE,qBAAC,SAAI,WAAW,uBAAuB,SAAS,IAC7C;AAAA,aACC,oBAAC,WAAM,WAAU,8DACd,iBACH;AAAA,IAIF,qBAAC,SAAI,WAAU,cACb;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL,OAAO;AAAA,UACP,UAAU,CAAC,MAAM,QAAQ,EAAE,OAAO,KAAK;AAAA,UACvC,WAAW;AAAA,UACX;AAAA,UACA,UAAU;AAAA,UACV,oBAAkB,QAAQ,UAAU;AAAA,UACpC,WAAU;AAAA;AAAA,MACZ;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL,SAAS;AAAA,UACT,UAAU,cAAc,CAAC,KAAK,KAAK;AAAA,UAElC,uBACC,oBAAC,cAAW,WAAU,wBAAuB,IAE7C;AAAA;AAAA,MAEJ;AAAA,OACF;AAAA,IAGC,SACC,oBAAC,OAAE,IAAI,SAAS,WAAU,qCAAoC,MAAK,SAChE,iBACH;AAAA,IAID,aAAa,SAAS,KACrB,oBAAC,SAAI,WAAU,wBACZ,uBAAa,IAAI,CAAC,gBACjB;AAAA,MAAC;AAAA;AAAA,QAEC,WAAU;AAAA,QAEV;AAAA,8BAAC,WAAQ,WAAU,eAAc;AAAA,UAChC;AAAA,UACA,YACC;AAAA,YAAC;AAAA;AAAA,cACC,MAAK;AAAA,cACL,SAAS,MAAM,SAAS,WAAW;AAAA,cACnC,cAAY,GAAG,WAAW,IAAI,WAAW;AAAA,cACzC,WAAU;AAAA,cAEV,8BAAC,aAAU,WAAU,WAAU;AAAA;AAAA,UACjC;AAAA;AAAA;AAAA,MAbG;AAAA,IAeP,CACD,GACH;AAAA,KAEJ;AAEJ;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../../src/client/cart/constants/session.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,uBAAuB,CAAA"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { CartAdapter } from "../types/adapter";
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated Use `createBrinkCartAdapter` from `client/cart/brink-adapter` instead.
|
|
5
|
+
*/
|
|
6
|
+
export interface BrinkConfig {
|
|
7
|
+
env: string;
|
|
8
|
+
storeGroupId: string;
|
|
9
|
+
countryCode: string;
|
|
10
|
+
languageCode: string;
|
|
11
|
+
}
|
|
12
|
+
export interface CartProviderProps {
|
|
13
|
+
adapter: CartAdapter;
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Provides a cart adapter to all child components via React context.
|
|
18
|
+
*
|
|
19
|
+
* ```tsx
|
|
20
|
+
* import { CartProvider } from "@enadhq/enad-react-sdk/client/cart"
|
|
21
|
+
* import { createBrinkCartAdapter } from "@enadhq/enad-react-sdk/client/cart/brink-adapter"
|
|
22
|
+
*
|
|
23
|
+
* const adapter = createBrinkCartAdapter({ env: "production", ... })
|
|
24
|
+
*
|
|
25
|
+
* <CartProvider adapter={adapter}>
|
|
26
|
+
* {children}
|
|
27
|
+
* </CartProvider>
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare function CartProvider({ adapter, children }: CartProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
/**
|
|
32
|
+
* Read the cart adapter from context.
|
|
33
|
+
* Throws if called outside a CartProvider.
|
|
34
|
+
*/
|
|
35
|
+
export declare function useCartAdapter(): CartAdapter;
|
|
36
|
+
//# sourceMappingURL=cart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cart.d.ts","sourceRoot":"","sources":["../../../../src/client/cart/contexts/cart.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAMpD;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACtB;AAQD,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,WAAW,CAAC;IACrB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,iBAAiB,2CAEpE;AAED;;;GAGG;AACH,wBAAgB,cAAc,IAAI,WAAW,CAQ5C"}
|
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { createContext, useContext } from "react";
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
children
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return context;
|
|
17
|
-
};
|
|
3
|
+
const CartAdapterContext = createContext(void 0);
|
|
4
|
+
function CartProvider({ adapter, children }) {
|
|
5
|
+
return /* @__PURE__ */ jsx(CartAdapterContext.Provider, { value: adapter, children });
|
|
6
|
+
}
|
|
7
|
+
function useCartAdapter() {
|
|
8
|
+
const adapter = useContext(CartAdapterContext);
|
|
9
|
+
if (!adapter) {
|
|
10
|
+
throw new Error(
|
|
11
|
+
"useCartAdapter must be used inside a <CartProvider>. Did you forget to pass a cart adapter to <EnadProvider>?"
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
return adapter;
|
|
15
|
+
}
|
|
18
16
|
export {
|
|
19
17
|
CartProvider,
|
|
20
|
-
|
|
18
|
+
useCartAdapter
|
|
21
19
|
};
|
|
22
20
|
//# sourceMappingURL=cart.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/client/cart/contexts/cart.tsx"],"sourcesContent":["import React, { createContext, useContext } from \"react\"\n\n
|
|
1
|
+
{"version":3,"sources":["../../../../src/client/cart/contexts/cart.tsx"],"sourcesContent":["import React, { createContext, useContext } from \"react\";\nimport type { CartAdapter } from \"../types/adapter\";\n\n// ---------------------------------------------------------------------------\n// Legacy BrinkConfig type — kept for backward compatibility with EnadProvider\n// ---------------------------------------------------------------------------\n\n/**\n * @deprecated Use `createBrinkCartAdapter` from `client/cart/brink-adapter` instead.\n */\nexport interface BrinkConfig {\n env: string;\n storeGroupId: string;\n countryCode: string;\n languageCode: string;\n}\n\n// ---------------------------------------------------------------------------\n// Cart adapter context\n// ---------------------------------------------------------------------------\n\nconst CartAdapterContext = createContext<CartAdapter | undefined>(undefined);\n\nexport interface CartProviderProps {\n adapter: CartAdapter;\n children: React.ReactNode;\n}\n\n/**\n * Provides a cart adapter to all child components via React context.\n *\n * ```tsx\n * import { CartProvider } from \"@enadhq/enad-react-sdk/client/cart\"\n * import { createBrinkCartAdapter } from \"@enadhq/enad-react-sdk/client/cart/brink-adapter\"\n *\n * const adapter = createBrinkCartAdapter({ env: \"production\", ... })\n *\n * <CartProvider adapter={adapter}>\n * {children}\n * </CartProvider>\n * ```\n */\nexport function CartProvider({ adapter, children }: CartProviderProps) {\n return <CartAdapterContext.Provider value={adapter}>{children}</CartAdapterContext.Provider>;\n}\n\n/**\n * Read the cart adapter from context.\n * Throws if called outside a CartProvider.\n */\nexport function useCartAdapter(): CartAdapter {\n const adapter = useContext(CartAdapterContext);\n if (!adapter) {\n throw new Error(\n \"useCartAdapter must be used inside a <CartProvider>. Did you forget to pass a cart adapter to <EnadProvider>?\",\n );\n }\n return adapter;\n}\n"],"mappings":"AA2CS;AA3CT,SAAgB,eAAe,kBAAkB;AAqBjD,MAAM,qBAAqB,cAAuC,MAAS;AAqBpE,SAAS,aAAa,EAAE,SAAS,SAAS,GAAsB;AACrE,SAAO,oBAAC,mBAAmB,UAAnB,EAA4B,OAAO,SAAU,UAAS;AAChE;AAMO,SAAS,iBAA8B;AAC5C,QAAM,UAAU,WAAW,kBAAkB;AAC7C,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;","names":[]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook to manage cart state and actions.
|
|
3
|
+
* Reads the cart adapter from CartProvider context,
|
|
4
|
+
* provides the current cart, loading states, and mutation functions.
|
|
5
|
+
*/
|
|
6
|
+
export declare const useCart: () => {
|
|
7
|
+
addItem: import("@tanstack/react-query").UseMutateAsyncFunction<import("..").Cart, Error, {
|
|
8
|
+
productVariantId: string;
|
|
9
|
+
quantity?: number;
|
|
10
|
+
}, unknown>;
|
|
11
|
+
updateItem: import("@tanstack/react-query").UseMutateAsyncFunction<import("..").Cart, Error, {
|
|
12
|
+
itemId: string;
|
|
13
|
+
quantity: number;
|
|
14
|
+
}, unknown>;
|
|
15
|
+
removeItem: import("@tanstack/react-query").UseMutateAsyncFunction<import("..").Cart, Error, {
|
|
16
|
+
itemId: string;
|
|
17
|
+
}, unknown>;
|
|
18
|
+
isAdding: boolean;
|
|
19
|
+
isUpdating: boolean;
|
|
20
|
+
isRemoving: boolean;
|
|
21
|
+
cart: import("..").Cart | undefined;
|
|
22
|
+
isLoading: boolean;
|
|
23
|
+
isFetching: boolean;
|
|
24
|
+
refreshCart: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("..").Cart, Error>>;
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=useCart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCart.d.ts","sourceRoot":"","sources":["../../../../src/client/cart/hooks/useCart.tsx"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;CAoBnB,CAAC"}
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import { useQuery } from "@tanstack/react-query";
|
|
2
2
|
import { CACHE_TAGS } from "../../global/constants/tags";
|
|
3
|
-
import {
|
|
4
|
-
import { getCartQueryFn } from "../queries/getCartQueryFn";
|
|
3
|
+
import { useCartAdapter } from "../contexts/cart";
|
|
5
4
|
import { useCartActions } from "./useCartActions";
|
|
6
5
|
const useCart = () => {
|
|
7
|
-
const
|
|
6
|
+
const adapter = useCartAdapter();
|
|
8
7
|
const getCartQuery = useQuery({
|
|
9
8
|
queryKey: [CACHE_TAGS.cart],
|
|
10
|
-
queryFn:
|
|
9
|
+
queryFn: () => adapter.getCart(),
|
|
11
10
|
refetchOnMount: false
|
|
12
11
|
});
|
|
13
12
|
const currentCart = getCartQuery.data;
|
|
14
|
-
const cartActions = useCartActions(
|
|
13
|
+
const cartActions = useCartActions(adapter, currentCart);
|
|
15
14
|
return {
|
|
16
|
-
cart: currentCart
|
|
15
|
+
cart: currentCart,
|
|
17
16
|
isLoading: getCartQuery.isLoading,
|
|
18
17
|
isFetching: getCartQuery.isFetching,
|
|
19
18
|
refreshCart: getCartQuery.refetch,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/client/cart/hooks/useCart.tsx"],"sourcesContent":["import { useQuery } from \"@tanstack/react-query\"
|
|
1
|
+
{"version":3,"sources":["../../../../src/client/cart/hooks/useCart.tsx"],"sourcesContent":["import { useQuery } from \"@tanstack/react-query\";\nimport { CACHE_TAGS } from \"../../global/constants/tags\";\nimport { useCartAdapter } from \"../contexts/cart\";\nimport { useCartActions } from \"./useCartActions\";\n\n/**\n * Hook to manage cart state and actions.\n * Reads the cart adapter from CartProvider context,\n * provides the current cart, loading states, and mutation functions.\n */\nexport const useCart = () => {\n const adapter = useCartAdapter();\n\n const getCartQuery = useQuery({\n queryKey: [CACHE_TAGS.cart],\n queryFn: () => adapter.getCart(),\n refetchOnMount: false,\n });\n\n const currentCart = getCartQuery.data;\n\n const cartActions = useCartActions(adapter, currentCart);\n\n return {\n cart: currentCart,\n isLoading: getCartQuery.isLoading,\n isFetching: getCartQuery.isFetching,\n refreshCart: getCartQuery.refetch,\n ...cartActions,\n };\n};\n"],"mappings":"AAAA,SAAS,gBAAgB;AACzB,SAAS,kBAAkB;AAC3B,SAAS,sBAAsB;AAC/B,SAAS,sBAAsB;AAOxB,MAAM,UAAU,MAAM;AAC3B,QAAM,UAAU,eAAe;AAE/B,QAAM,eAAe,SAAS;AAAA,IAC5B,UAAU,CAAC,WAAW,IAAI;AAAA,IAC1B,SAAS,MAAM,QAAQ,QAAQ;AAAA,IAC/B,gBAAgB;AAAA,EAClB,CAAC;AAED,QAAM,cAAc,aAAa;AAEjC,QAAM,cAAc,eAAe,SAAS,WAAW;AAEvD,SAAO;AAAA,IACL,MAAM;AAAA,IACN,WAAW,aAAa;AAAA,IACxB,YAAY,aAAa;AAAA,IACzB,aAAa,aAAa;AAAA,IAC1B,GAAG;AAAA,EACL;AACF;","names":[]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { CartAdapter, Cart } from "../types/adapter";
|
|
2
|
+
/**
|
|
3
|
+
* Hook providing cart mutation actions: add, update, and remove items.
|
|
4
|
+
*
|
|
5
|
+
* Smart logic lives here (not in the adapter):
|
|
6
|
+
* - addItem checks for existing items and increments quantity instead of duplicating
|
|
7
|
+
* - updateItem removes the item if quantity drops to zero or below
|
|
8
|
+
*/
|
|
9
|
+
export declare const useCartActions: (adapter: CartAdapter, currentCart: Cart | undefined) => {
|
|
10
|
+
addItem: import("@tanstack/react-query").UseMutateAsyncFunction<Cart, Error, {
|
|
11
|
+
productVariantId: string;
|
|
12
|
+
quantity?: number;
|
|
13
|
+
}, unknown>;
|
|
14
|
+
updateItem: import("@tanstack/react-query").UseMutateAsyncFunction<Cart, Error, {
|
|
15
|
+
itemId: string;
|
|
16
|
+
quantity: number;
|
|
17
|
+
}, unknown>;
|
|
18
|
+
removeItem: import("@tanstack/react-query").UseMutateAsyncFunction<Cart, Error, {
|
|
19
|
+
itemId: string;
|
|
20
|
+
}, unknown>;
|
|
21
|
+
isAdding: boolean;
|
|
22
|
+
isUpdating: boolean;
|
|
23
|
+
isRemoving: boolean;
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=useCartActions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCartActions.d.ts","sourceRoot":"","sources":["../../../../src/client/cart/hooks/useCartActions.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAE1D;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,GAAI,SAAS,WAAW,EAAE,aAAa,IAAI,GAAG,SAAS;;0BAQ1D,MAAM;mBACb,MAAM;;;gBAgBgC,MAAM;kBAAY,MAAM;;;gBAalC,MAAM;;;;;CAclD,CAAC"}
|
|
@@ -1,26 +1,17 @@
|
|
|
1
1
|
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|
2
2
|
import { CACHE_TAGS } from "../../global/constants/tags";
|
|
3
|
-
|
|
4
|
-
import { removeCartItemQueryFn } from "../queries/removeCartItemQueryFn";
|
|
5
|
-
import { updateCartItemFn } from "../queries/updateCartItemQueryFn";
|
|
6
|
-
const useCartActions = (brinkConfig, currentCart) => {
|
|
3
|
+
const useCartActions = (adapter, currentCart) => {
|
|
7
4
|
const queryClient = useQueryClient();
|
|
8
5
|
const addItemMutation = useMutation({
|
|
9
6
|
mutationFn: async ({
|
|
10
7
|
productVariantId,
|
|
11
8
|
quantity = 1
|
|
12
9
|
}) => {
|
|
13
|
-
const existingItem = currentCart?.
|
|
14
|
-
(i) => i.productVariantId === productVariantId
|
|
15
|
-
);
|
|
10
|
+
const existingItem = currentCart?.items.find((i) => i.productVariantId === productVariantId);
|
|
16
11
|
if (existingItem) {
|
|
17
|
-
return
|
|
18
|
-
itemId: existingItem.id,
|
|
19
|
-
quantity: existingItem.quantity + quantity
|
|
20
|
-
});
|
|
21
|
-
} else {
|
|
22
|
-
return addToCartQueryFn(brinkConfig)({ productVariantId, quantity });
|
|
12
|
+
return adapter.updateItem(existingItem.id, existingItem.quantity + quantity);
|
|
23
13
|
}
|
|
14
|
+
return adapter.addItem(productVariantId, quantity);
|
|
24
15
|
},
|
|
25
16
|
onSuccess: (data) => {
|
|
26
17
|
queryClient.setQueryData([CACHE_TAGS.cart], data);
|
|
@@ -29,16 +20,16 @@ const useCartActions = (brinkConfig, currentCart) => {
|
|
|
29
20
|
const updateItemMutation = useMutation({
|
|
30
21
|
mutationFn: async ({ itemId, quantity }) => {
|
|
31
22
|
if (quantity <= 0) {
|
|
32
|
-
return
|
|
23
|
+
return adapter.removeItem(itemId);
|
|
33
24
|
}
|
|
34
|
-
return
|
|
25
|
+
return adapter.updateItem(itemId, quantity);
|
|
35
26
|
},
|
|
36
27
|
onSuccess: (data) => {
|
|
37
28
|
queryClient.setQueryData([CACHE_TAGS.cart], data);
|
|
38
29
|
}
|
|
39
30
|
});
|
|
40
31
|
const removeItemMutation = useMutation({
|
|
41
|
-
mutationFn: async ({ itemId }) =>
|
|
32
|
+
mutationFn: async ({ itemId }) => adapter.removeItem(itemId),
|
|
42
33
|
onSuccess: (data) => {
|
|
43
34
|
queryClient.setQueryData([CACHE_TAGS.cart], data);
|
|
44
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/client/cart/hooks/useCartActions.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../../../../src/client/cart/hooks/useCartActions.tsx"],"sourcesContent":["import { useMutation, useQueryClient } from \"@tanstack/react-query\";\nimport { CACHE_TAGS } from \"../../global/constants/tags\";\nimport type { CartAdapter, Cart } from \"../types/adapter\";\n\n/**\n * Hook providing cart mutation actions: add, update, and remove items.\n *\n * Smart logic lives here (not in the adapter):\n * - addItem checks for existing items and increments quantity instead of duplicating\n * - updateItem removes the item if quantity drops to zero or below\n */\nexport const useCartActions = (adapter: CartAdapter, currentCart: Cart | undefined) => {\n const queryClient = useQueryClient();\n\n const addItemMutation = useMutation({\n mutationFn: async ({\n productVariantId,\n quantity = 1,\n }: {\n productVariantId: string;\n quantity?: number;\n }) => {\n const existingItem = currentCart?.items.find((i) => i.productVariantId === productVariantId);\n\n // If we already have the item, increment quantity instead of adding a new one.\n if (existingItem) {\n return adapter.updateItem(existingItem.id, existingItem.quantity + quantity);\n }\n return adapter.addItem(productVariantId, quantity);\n },\n onSuccess: (data) => {\n queryClient.setQueryData([CACHE_TAGS.cart], data);\n },\n });\n\n const updateItemMutation = useMutation({\n mutationFn: async ({ itemId, quantity }: { itemId: string; quantity: number }) => {\n // If quantity is zero or less, remove the item\n if (quantity <= 0) {\n return adapter.removeItem(itemId);\n }\n return adapter.updateItem(itemId, quantity);\n },\n onSuccess: (data) => {\n queryClient.setQueryData([CACHE_TAGS.cart], data);\n },\n });\n\n const removeItemMutation = useMutation({\n mutationFn: async ({ itemId }: { itemId: string }) => adapter.removeItem(itemId),\n onSuccess: (data) => {\n queryClient.setQueryData([CACHE_TAGS.cart], data);\n },\n });\n\n return {\n addItem: addItemMutation.mutateAsync,\n updateItem: updateItemMutation.mutateAsync,\n removeItem: removeItemMutation.mutateAsync,\n isAdding: addItemMutation.isPending,\n isUpdating: updateItemMutation.isPending,\n isRemoving: removeItemMutation.isPending,\n };\n};\n"],"mappings":"AAAA,SAAS,aAAa,sBAAsB;AAC5C,SAAS,kBAAkB;AAUpB,MAAM,iBAAiB,CAAC,SAAsB,gBAAkC;AACrF,QAAM,cAAc,eAAe;AAEnC,QAAM,kBAAkB,YAAY;AAAA,IAClC,YAAY,OAAO;AAAA,MACjB;AAAA,MACA,WAAW;AAAA,IACb,MAGM;AACJ,YAAM,eAAe,aAAa,MAAM,KAAK,CAAC,MAAM,EAAE,qBAAqB,gBAAgB;AAG3F,UAAI,cAAc;AAChB,eAAO,QAAQ,WAAW,aAAa,IAAI,aAAa,WAAW,QAAQ;AAAA,MAC7E;AACA,aAAO,QAAQ,QAAQ,kBAAkB,QAAQ;AAAA,IACnD;AAAA,IACA,WAAW,CAAC,SAAS;AACnB,kBAAY,aAAa,CAAC,WAAW,IAAI,GAAG,IAAI;AAAA,IAClD;AAAA,EACF,CAAC;AAED,QAAM,qBAAqB,YAAY;AAAA,IACrC,YAAY,OAAO,EAAE,QAAQ,SAAS,MAA4C;AAEhF,UAAI,YAAY,GAAG;AACjB,eAAO,QAAQ,WAAW,MAAM;AAAA,MAClC;AACA,aAAO,QAAQ,WAAW,QAAQ,QAAQ;AAAA,IAC5C;AAAA,IACA,WAAW,CAAC,SAAS;AACnB,kBAAY,aAAa,CAAC,WAAW,IAAI,GAAG,IAAI;AAAA,IAClD;AAAA,EACF,CAAC;AAED,QAAM,qBAAqB,YAAY;AAAA,IACrC,YAAY,OAAO,EAAE,OAAO,MAA0B,QAAQ,WAAW,MAAM;AAAA,IAC/E,WAAW,CAAC,SAAS;AACnB,kBAAY,aAAa,CAAC,WAAW,IAAI,GAAG,IAAI;AAAA,IAClD;AAAA,EACF,CAAC;AAED,SAAO;AAAA,IACL,SAAS,gBAAgB;AAAA,IACzB,YAAY,mBAAmB;AAAA,IAC/B,YAAY,mBAAmB;AAAA,IAC/B,UAAU,gBAAgB;AAAA,IAC1B,YAAY,mBAAmB;AAAA,IAC/B,YAAY,mBAAmB;AAAA,EACjC;AACF;","names":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type { CartAdapter, Cart, CartItem, CartTotals, Money, CartErrorCode, } from "./types/adapter";
|
|
2
|
+
export { CartAdapterError } from "./types/adapter";
|
|
3
|
+
export { CartProvider, useCartAdapter } from "./contexts/cart";
|
|
4
|
+
export type { CartProviderProps } from "./contexts/cart";
|
|
5
|
+
export { useCart } from "./hooks/useCart";
|
|
6
|
+
export { CartDrawer } from "./components/cart-drawer";
|
|
7
|
+
export type { CartDrawerProps } from "./components/cart-drawer";
|
|
8
|
+
export { CartTrigger } from "./components/cart-trigger";
|
|
9
|
+
export { PromoCodeInput } from "./components/promo-code-input";
|
|
10
|
+
export type { PromoCodeInputProps } from "./components/promo-code-input";
|
|
11
|
+
export type { Cart as BrinkCart, CartItem as BrinkCartItem, CartResponse } from "./types/cart";
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/cart/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,WAAW,EACX,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,KAAK,EACL,aAAa,GACd,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAGnD,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC/D,YAAY,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAGzD,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAG1C,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,YAAY,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,YAAY,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAGzE,YAAY,EAAE,IAAI,IAAI,SAAS,EAAE,QAAQ,IAAI,aAAa,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CartAdapterError } from "./types/adapter";
|
|
2
|
+
import { CartProvider, useCartAdapter } from "./contexts/cart";
|
|
3
|
+
import { useCart } from "./hooks/useCart";
|
|
4
|
+
import { CartDrawer } from "./components/cart-drawer";
|
|
5
|
+
import { CartTrigger } from "./components/cart-trigger";
|
|
6
|
+
import { PromoCodeInput } from "./components/promo-code-input";
|
|
7
|
+
export {
|
|
8
|
+
CartAdapterError,
|
|
9
|
+
CartDrawer,
|
|
10
|
+
CartProvider,
|
|
11
|
+
CartTrigger,
|
|
12
|
+
PromoCodeInput,
|
|
13
|
+
useCart,
|
|
14
|
+
useCartAdapter
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/client/cart/index.ts"],"sourcesContent":["// Adapter interface and normalized types\nexport type {\n CartAdapter,\n Cart,\n CartItem,\n CartTotals,\n Money,\n CartErrorCode,\n} from \"./types/adapter\";\nexport { CartAdapterError } from \"./types/adapter\";\n\n// Provider\nexport { CartProvider, useCartAdapter } from \"./contexts/cart\";\nexport type { CartProviderProps } from \"./contexts/cart\";\n\n// Hooks\nexport { useCart } from \"./hooks/useCart\";\n\n// Components\nexport { CartDrawer } from \"./components/cart-drawer\";\nexport type { CartDrawerProps } from \"./components/cart-drawer\";\nexport { CartTrigger } from \"./components/cart-trigger\";\nexport { PromoCodeInput } from \"./components/promo-code-input\";\nexport type { PromoCodeInputProps } from \"./components/promo-code-input\";\n\n// Legacy types (deprecated — use normalized types above)\nexport type { Cart as BrinkCart, CartItem as BrinkCartItem, CartResponse } from \"./types/cart\";\n"],"mappings":"AASA,SAAS,wBAAwB;AAGjC,SAAS,cAAc,sBAAsB;AAI7C,SAAS,eAAe;AAGxB,SAAS,kBAAkB;AAE3B,SAAS,mBAAmB;AAC5B,SAAS,sBAAsB;","names":[]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type BrinkConfig } from "../contexts/cart";
|
|
2
|
+
import { type CartResponse } from "../types/cart";
|
|
3
|
+
export declare const addToCartQueryFn: (brinkConfig: BrinkConfig) => ({ productVariantId, quantity, }: {
|
|
4
|
+
productVariantId: string;
|
|
5
|
+
quantity?: number;
|
|
6
|
+
}) => Promise<CartResponse>;
|
|
7
|
+
//# sourceMappingURL=addToCartQueryFn.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addToCartQueryFn.d.ts","sourceRoot":"","sources":["../../../../src/client/cart/queries/addToCartQueryFn.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAGnD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAEjD,eAAO,MAAM,gBAAgB,GAAI,aAAa,WAAW,MAGzC,iCAGX;IACD,gBAAgB,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,KAAG,OAAO,CAAC,YAAY,CAmBzB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/client/cart/queries/addToCartQueryFn.tsx"],"sourcesContent":["import { BrinkConfig } from \"../contexts/cart\"\nimport { CART_SESSION_KEY } from \"../constants/session\"\nimport { getCartSession } from \"../utils/session\"\nimport { CartResponse } from \"../types/cart\"\n\nexport const addToCartQueryFn = (brinkConfig: BrinkConfig) => {\n const { env } = brinkConfig\n\n return async ({\n productVariantId,\n quantity = 1,\n }: {\n productVariantId: string\n quantity?: number\n }): Promise<CartResponse> => {\n const baseUrl = `https://shopper.eu-west-1.${env}.brinkcommerce.io`\n\n const res = await fetch(`${baseUrl}/shopper/sessions/items`, {\n method: \"POST\",\n headers: {\n Authorization: `Bearer ${getCartSession()}`,\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ productVariantId, quantity }),\n })\n\n if (!res.ok) throw new Error(\"Failed to add item to cart\")\n\n const data = (await res.json()) as CartResponse\n localStorage.setItem(CART_SESSION_KEY, data.token)\n\n return data\n }\n}\n"],"mappings":"AACA,SAAS,wBAAwB;AACjC,SAAS,sBAAsB;AAGxB,MAAM,mBAAmB,CAAC,gBAA6B;AAC5D,QAAM,EAAE,IAAI,IAAI;AAEhB,SAAO,OAAO;AAAA,IACZ;AAAA,IACA,WAAW;AAAA,EACb,MAG6B;AAC3B,UAAM,UAAU,6BAA6B,GAAG;AAEhD,UAAM,MAAM,MAAM,MAAM,GAAG,OAAO,2BAA2B;AAAA,MAC3D,QAAQ;AAAA,MACR,SAAS;AAAA,QACP,eAAe,UAAU,eAAe,CAAC;AAAA,QACzC,gBAAgB;AAAA,MAClB;AAAA,MACA,MAAM,KAAK,UAAU,EAAE,kBAAkB,SAAS,CAAC;AAAA,IACrD,CAAC;AAED,QAAI,CAAC,IAAI,GAAI,OAAM,IAAI,MAAM,4BAA4B;AAEzD,UAAM,OAAQ,MAAM,IAAI,KAAK;AAC7B,iBAAa,QAAQ,kBAAkB,KAAK,KAAK;AAEjD,WAAO;AAAA,EACT;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/client/cart/queries/addToCartQueryFn.tsx"],"sourcesContent":["import { type BrinkConfig } from \"../contexts/cart\"\nimport { CART_SESSION_KEY } from \"../constants/session\"\nimport { getCartSession } from \"../utils/session\"\nimport { type CartResponse } from \"../types/cart\"\n\nexport const addToCartQueryFn = (brinkConfig: BrinkConfig) => {\n const { env } = brinkConfig\n\n return async ({\n productVariantId,\n quantity = 1,\n }: {\n productVariantId: string\n quantity?: number\n }): Promise<CartResponse> => {\n const baseUrl = `https://shopper.eu-west-1.${env}.brinkcommerce.io`\n\n const res = await fetch(`${baseUrl}/shopper/sessions/items`, {\n method: \"POST\",\n headers: {\n Authorization: `Bearer ${getCartSession()}`,\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ productVariantId, quantity }),\n })\n\n if (!res.ok) throw new Error(\"Failed to add item to cart\")\n\n const data = (await res.json()) as CartResponse\n localStorage.setItem(CART_SESSION_KEY, data.token)\n\n return data\n }\n}\n"],"mappings":"AACA,SAAS,wBAAwB;AACjC,SAAS,sBAAsB;AAGxB,MAAM,mBAAmB,CAAC,gBAA6B;AAC5D,QAAM,EAAE,IAAI,IAAI;AAEhB,SAAO,OAAO;AAAA,IACZ;AAAA,IACA,WAAW;AAAA,EACb,MAG6B;AAC3B,UAAM,UAAU,6BAA6B,GAAG;AAEhD,UAAM,MAAM,MAAM,MAAM,GAAG,OAAO,2BAA2B;AAAA,MAC3D,QAAQ;AAAA,MACR,SAAS;AAAA,QACP,eAAe,UAAU,eAAe,CAAC;AAAA,QACzC,gBAAgB;AAAA,MAClB;AAAA,MACA,MAAM,KAAK,UAAU,EAAE,kBAAkB,SAAS,CAAC;AAAA,IACrD,CAAC;AAED,QAAI,CAAC,IAAI,GAAI,OAAM,IAAI,MAAM,4BAA4B;AAEzD,UAAM,OAAQ,MAAM,IAAI,KAAK;AAC7B,iBAAa,QAAQ,kBAAkB,KAAK,KAAK;AAEjD,WAAO;AAAA,EACT;AACF;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCartQueryFn.d.ts","sourceRoot":"","sources":["../../../../src/client/cart/queries/getCartQueryFn.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAGjD,eAAO,MAAM,cAAc,GAAI,aAAa,WAAW,WAGpC,OAAO,CAAC,YAAY,CAmCtC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/client/cart/queries/getCartQueryFn.tsx"],"sourcesContent":["import { BrinkConfig } from \"../contexts/cart\"\nimport { CartResponse } from \"../types/cart\"\nimport { clearCartSession, getCartSession, hasCartSession, setCartSession } from \"../utils/session\"\n\nexport const getCartQueryFn = (brinkConfig: BrinkConfig) => {\n const { env, storeGroupId, countryCode, languageCode } = brinkConfig\n\n return async (): Promise<CartResponse> => {\n const baseUrl = `https://shopper.eu-west-1.${env}.brinkcommerce.io`\n\n const existingToken = hasCartSession() ? getCartSession() : null\n\n if (existingToken) {\n const res = await fetch(`${baseUrl}/shopper/sessions`, {\n headers: {\n Authorization: `Bearer ${existingToken}`,\n \"Content-Type\": \"application/json\",\n },\n cache: \"no-store\",\n })\n\n if (res.ok) {\n return (await res.json()) as CartResponse\n }\n\n clearCartSession()\n }\n\n const res = await fetch(`${baseUrl}/shopper/sessions/start`, {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ storeGroupId, countryCode, languageCode }),\n })\n\n if (!res.ok) throw new Error(\"Failed to start shopper session\")\n\n const data = (await res.json()) as CartResponse\n\n setCartSession(data.token)\n\n return data\n }\n}\n"],"mappings":"AAEA,SAAS,kBAAkB,gBAAgB,gBAAgB,sBAAsB;AAE1E,MAAM,iBAAiB,CAAC,gBAA6B;AAC1D,QAAM,EAAE,KAAK,cAAc,aAAa,aAAa,IAAI;AAEzD,SAAO,YAAmC;AACxC,UAAM,UAAU,6BAA6B,GAAG;AAEhD,UAAM,gBAAgB,eAAe,IAAI,eAAe,IAAI;AAE5D,QAAI,eAAe;AACjB,YAAMA,OAAM,MAAM,MAAM,GAAG,OAAO,qBAAqB;AAAA,QACrD,SAAS;AAAA,UACP,eAAe,UAAU,aAAa;AAAA,UACtC,gBAAgB;AAAA,QAClB;AAAA,QACA,OAAO;AAAA,MACT,CAAC;AAED,UAAIA,KAAI,IAAI;AACV,eAAQ,MAAMA,KAAI,KAAK;AAAA,MACzB;AAEA,uBAAiB;AAAA,IACnB;AAEA,UAAM,MAAM,MAAM,MAAM,GAAG,OAAO,2BAA2B;AAAA,MAC3D,QAAQ;AAAA,MACR,SAAS,EAAE,gBAAgB,mBAAmB;AAAA,MAC9C,MAAM,KAAK,UAAU,EAAE,cAAc,aAAa,aAAa,CAAC;AAAA,IAClE,CAAC;AAED,QAAI,CAAC,IAAI,GAAI,OAAM,IAAI,MAAM,iCAAiC;AAE9D,UAAM,OAAQ,MAAM,IAAI,KAAK;AAE7B,mBAAe,KAAK,KAAK;AAEzB,WAAO;AAAA,EACT;AACF;","names":["res"]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/client/cart/queries/getCartQueryFn.tsx"],"sourcesContent":["import { type BrinkConfig } from \"../contexts/cart\"\nimport { type CartResponse } from \"../types/cart\"\nimport { clearCartSession, getCartSession, hasCartSession, setCartSession } from \"../utils/session\"\n\nexport const getCartQueryFn = (brinkConfig: BrinkConfig) => {\n const { env, storeGroupId, countryCode, languageCode } = brinkConfig\n\n return async (): Promise<CartResponse> => {\n const baseUrl = `https://shopper.eu-west-1.${env}.brinkcommerce.io`\n\n const existingToken = hasCartSession() ? getCartSession() : null\n\n if (existingToken) {\n const res = await fetch(`${baseUrl}/shopper/sessions`, {\n headers: {\n Authorization: `Bearer ${existingToken}`,\n \"Content-Type\": \"application/json\",\n },\n cache: \"no-store\",\n })\n\n if (res.ok) {\n return (await res.json()) as CartResponse\n }\n\n clearCartSession()\n }\n\n const res = await fetch(`${baseUrl}/shopper/sessions/start`, {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ storeGroupId, countryCode, languageCode }),\n })\n\n if (!res.ok) throw new Error(\"Failed to start shopper session\")\n\n const data = (await res.json()) as CartResponse\n\n setCartSession(data.token)\n\n return data\n }\n}\n"],"mappings":"AAEA,SAAS,kBAAkB,gBAAgB,gBAAgB,sBAAsB;AAE1E,MAAM,iBAAiB,CAAC,gBAA6B;AAC1D,QAAM,EAAE,KAAK,cAAc,aAAa,aAAa,IAAI;AAEzD,SAAO,YAAmC;AACxC,UAAM,UAAU,6BAA6B,GAAG;AAEhD,UAAM,gBAAgB,eAAe,IAAI,eAAe,IAAI;AAE5D,QAAI,eAAe;AACjB,YAAMA,OAAM,MAAM,MAAM,GAAG,OAAO,qBAAqB;AAAA,QACrD,SAAS;AAAA,UACP,eAAe,UAAU,aAAa;AAAA,UACtC,gBAAgB;AAAA,QAClB;AAAA,QACA,OAAO;AAAA,MACT,CAAC;AAED,UAAIA,KAAI,IAAI;AACV,eAAQ,MAAMA,KAAI,KAAK;AAAA,MACzB;AAEA,uBAAiB;AAAA,IACnB;AAEA,UAAM,MAAM,MAAM,MAAM,GAAG,OAAO,2BAA2B;AAAA,MAC3D,QAAQ;AAAA,MACR,SAAS,EAAE,gBAAgB,mBAAmB;AAAA,MAC9C,MAAM,KAAK,UAAU,EAAE,cAAc,aAAa,aAAa,CAAC;AAAA,IAClE,CAAC;AAED,QAAI,CAAC,IAAI,GAAI,OAAM,IAAI,MAAM,iCAAiC;AAE9D,UAAM,OAAQ,MAAM,IAAI,KAAK;AAE7B,mBAAe,KAAK,KAAK;AAEzB,WAAO;AAAA,EACT;AACF;","names":["res"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type BrinkConfig } from "../contexts/cart";
|
|
2
|
+
import { type CartResponse } from "../types/cart";
|
|
3
|
+
export declare const removeCartItemQueryFn: (brinkConfig: BrinkConfig) => ({ itemId }: {
|
|
4
|
+
itemId: string;
|
|
5
|
+
}) => Promise<CartResponse>;
|
|
6
|
+
//# sourceMappingURL=removeCartItemQueryFn.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"removeCartItemQueryFn.d.ts","sourceRoot":"","sources":["../../../../src/client/cart/queries/removeCartItemQueryFn.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAGjD,eAAO,MAAM,qBAAqB,GAAI,aAAa,WAAW,MAG9C,YAAY;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,KAAG,OAAO,CAAC,YAAY,CAsBpE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/client/cart/queries/removeCartItemQueryFn.tsx"],"sourcesContent":["import { BrinkConfig } from \"../contexts/cart\"\nimport { CartResponse } from \"../types/cart\"\nimport { getCartSession, setCartSession } from \"../utils/session\"\n\nexport const removeCartItemQueryFn = (brinkConfig: BrinkConfig) => {\n const { env } = brinkConfig\n\n return async ({ itemId }: { itemId: string }): Promise<CartResponse> => {\n const baseUrl = `https://shopper.eu-west-1.${env}.brinkcommerce.io`\n\n const res = await fetch(`${baseUrl}/shopper/sessions/items/${itemId}`, {\n method: \"DELETE\",\n headers: {\n Authorization: `Bearer ${getCartSession()}`,\n },\n })\n\n if (!res.ok) {\n const errorText = await res.text()\n throw new Error(`Failed to remove cart item: ${errorText}`)\n }\n\n const data = (await res.json()) as CartResponse\n\n // Update token in localStorage if it changed\n setCartSession(data.token)\n\n return data\n }\n}\n"],"mappings":"AAEA,SAAS,gBAAgB,sBAAsB;AAExC,MAAM,wBAAwB,CAAC,gBAA6B;AACjE,QAAM,EAAE,IAAI,IAAI;AAEhB,SAAO,OAAO,EAAE,OAAO,MAAiD;AACtE,UAAM,UAAU,6BAA6B,GAAG;AAEhD,UAAM,MAAM,MAAM,MAAM,GAAG,OAAO,2BAA2B,MAAM,IAAI;AAAA,MACrE,QAAQ;AAAA,MACR,SAAS;AAAA,QACP,eAAe,UAAU,eAAe,CAAC;AAAA,MAC3C;AAAA,IACF,CAAC;AAED,QAAI,CAAC,IAAI,IAAI;AACX,YAAM,YAAY,MAAM,IAAI,KAAK;AACjC,YAAM,IAAI,MAAM,+BAA+B,SAAS,EAAE;AAAA,IAC5D;AAEA,UAAM,OAAQ,MAAM,IAAI,KAAK;AAG7B,mBAAe,KAAK,KAAK;AAEzB,WAAO;AAAA,EACT;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/client/cart/queries/removeCartItemQueryFn.tsx"],"sourcesContent":["import { type BrinkConfig } from \"../contexts/cart\"\nimport { type CartResponse } from \"../types/cart\"\nimport { getCartSession, setCartSession } from \"../utils/session\"\n\nexport const removeCartItemQueryFn = (brinkConfig: BrinkConfig) => {\n const { env } = brinkConfig\n\n return async ({ itemId }: { itemId: string }): Promise<CartResponse> => {\n const baseUrl = `https://shopper.eu-west-1.${env}.brinkcommerce.io`\n\n const res = await fetch(`${baseUrl}/shopper/sessions/items/${itemId}`, {\n method: \"DELETE\",\n headers: {\n Authorization: `Bearer ${getCartSession()}`,\n },\n })\n\n if (!res.ok) {\n const errorText = await res.text()\n throw new Error(`Failed to remove cart item: ${errorText}`)\n }\n\n const data = (await res.json()) as CartResponse\n\n // Update token in localStorage if it changed\n setCartSession(data.token)\n\n return data\n }\n}\n"],"mappings":"AAEA,SAAS,gBAAgB,sBAAsB;AAExC,MAAM,wBAAwB,CAAC,gBAA6B;AACjE,QAAM,EAAE,IAAI,IAAI;AAEhB,SAAO,OAAO,EAAE,OAAO,MAAiD;AACtE,UAAM,UAAU,6BAA6B,GAAG;AAEhD,UAAM,MAAM,MAAM,MAAM,GAAG,OAAO,2BAA2B,MAAM,IAAI;AAAA,MACrE,QAAQ;AAAA,MACR,SAAS;AAAA,QACP,eAAe,UAAU,eAAe,CAAC;AAAA,MAC3C;AAAA,IACF,CAAC;AAED,QAAI,CAAC,IAAI,IAAI;AACX,YAAM,YAAY,MAAM,IAAI,KAAK;AACjC,YAAM,IAAI,MAAM,+BAA+B,SAAS,EAAE;AAAA,IAC5D;AAEA,UAAM,OAAQ,MAAM,IAAI,KAAK;AAG7B,mBAAe,KAAK,KAAK;AAEzB,WAAO;AAAA,EACT;AACF;","names":[]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type BrinkConfig } from "../contexts/cart";
|
|
2
|
+
import { type CartResponse } from "../types/cart";
|
|
3
|
+
export declare const updateCartItemFn: (brinkConfig: BrinkConfig) => ({ itemId, quantity, }: {
|
|
4
|
+
itemId: string;
|
|
5
|
+
quantity: number;
|
|
6
|
+
}) => Promise<CartResponse>;
|
|
7
|
+
//# sourceMappingURL=updateCartItemQueryFn.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"updateCartItemQueryFn.d.ts","sourceRoot":"","sources":["../../../../src/client/cart/queries/updateCartItemQueryFn.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAGnD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAEjD,eAAO,MAAM,gBAAgB,GAAI,aAAa,WAAW,MAGzC,uBAGX;IACD,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;CACjB,KAAG,OAAO,CAAC,YAAY,CAmBzB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/client/cart/queries/updateCartItemQueryFn.tsx"],"sourcesContent":["import { BrinkConfig } from \"../contexts/cart\"\nimport { CART_SESSION_KEY } from \"../constants/session\"\nimport { getCartSession } from \"../utils/session\"\nimport { CartResponse } from \"../types/cart\"\n\nexport const updateCartItemFn = (brinkConfig: BrinkConfig) => {\n const { env } = brinkConfig\n\n return async ({\n itemId,\n quantity,\n }: {\n itemId: string\n quantity: number\n }): Promise<CartResponse> => {\n const baseUrl = `https://shopper.eu-west-1.${env}.brinkcommerce.io`\n\n const res = await fetch(`${baseUrl}/shopper/sessions/items/${itemId}`, {\n method: \"PUT\",\n headers: {\n Authorization: `Bearer ${getCartSession()}`,\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ quantity }),\n })\n\n if (!res.ok) throw new Error(\"Failed to update cart item\")\n\n const data = (await res.json()) as CartResponse\n localStorage.setItem(CART_SESSION_KEY, data.token)\n\n return data\n }\n}\n"],"mappings":"AACA,SAAS,wBAAwB;AACjC,SAAS,sBAAsB;AAGxB,MAAM,mBAAmB,CAAC,gBAA6B;AAC5D,QAAM,EAAE,IAAI,IAAI;AAEhB,SAAO,OAAO;AAAA,IACZ;AAAA,IACA;AAAA,EACF,MAG6B;AAC3B,UAAM,UAAU,6BAA6B,GAAG;AAEhD,UAAM,MAAM,MAAM,MAAM,GAAG,OAAO,2BAA2B,MAAM,IAAI;AAAA,MACrE,QAAQ;AAAA,MACR,SAAS;AAAA,QACP,eAAe,UAAU,eAAe,CAAC;AAAA,QACzC,gBAAgB;AAAA,MAClB;AAAA,MACA,MAAM,KAAK,UAAU,EAAE,SAAS,CAAC;AAAA,IACnC,CAAC;AAED,QAAI,CAAC,IAAI,GAAI,OAAM,IAAI,MAAM,4BAA4B;AAEzD,UAAM,OAAQ,MAAM,IAAI,KAAK;AAC7B,iBAAa,QAAQ,kBAAkB,KAAK,KAAK;AAEjD,WAAO;AAAA,EACT;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/client/cart/queries/updateCartItemQueryFn.tsx"],"sourcesContent":["import { type BrinkConfig } from \"../contexts/cart\"\nimport { CART_SESSION_KEY } from \"../constants/session\"\nimport { getCartSession } from \"../utils/session\"\nimport { type CartResponse } from \"../types/cart\"\n\nexport const updateCartItemFn = (brinkConfig: BrinkConfig) => {\n const { env } = brinkConfig\n\n return async ({\n itemId,\n quantity,\n }: {\n itemId: string\n quantity: number\n }): Promise<CartResponse> => {\n const baseUrl = `https://shopper.eu-west-1.${env}.brinkcommerce.io`\n\n const res = await fetch(`${baseUrl}/shopper/sessions/items/${itemId}`, {\n method: \"PUT\",\n headers: {\n Authorization: `Bearer ${getCartSession()}`,\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ quantity }),\n })\n\n if (!res.ok) throw new Error(\"Failed to update cart item\")\n\n const data = (await res.json()) as CartResponse\n localStorage.setItem(CART_SESSION_KEY, data.token)\n\n return data\n }\n}\n"],"mappings":"AACA,SAAS,wBAAwB;AACjC,SAAS,sBAAsB;AAGxB,MAAM,mBAAmB,CAAC,gBAA6B;AAC5D,QAAM,EAAE,IAAI,IAAI;AAEhB,SAAO,OAAO;AAAA,IACZ;AAAA,IACA;AAAA,EACF,MAG6B;AAC3B,UAAM,UAAU,6BAA6B,GAAG;AAEhD,UAAM,MAAM,MAAM,MAAM,GAAG,OAAO,2BAA2B,MAAM,IAAI;AAAA,MACrE,QAAQ;AAAA,MACR,SAAS;AAAA,QACP,eAAe,UAAU,eAAe,CAAC;AAAA,QACzC,gBAAgB;AAAA,MAClB;AAAA,MACA,MAAM,KAAK,UAAU,EAAE,SAAS,CAAC;AAAA,IACnC,CAAC;AAED,QAAI,CAAC,IAAI,GAAI,OAAM,IAAI,MAAM,4BAA4B;AAEzD,UAAM,OAAQ,MAAM,IAAI,KAAK;AAC7B,iBAAa,QAAQ,kBAAkB,KAAK,KAAK;AAEjD,WAAO;AAAA,EACT;AACF;","names":[]}
|