@enadhq/enad-react-sdk 1.0.0 → 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.ts +17 -0
- package/dist/client/cart/components/cart-drawer.d.ts.map +1 -0
- package/dist/client/cart/components/cart-drawer.mjs +311 -0
- package/dist/client/cart/components/cart-drawer.mjs.map +1 -0
- 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 +34 -0
- package/dist/client/cart/components/cart-trigger.mjs.map +1 -0
- 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/constants/session.mjs +5 -0
- package/dist/client/cart/constants/session.mjs.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 +20 -0
- package/dist/client/cart/contexts/cart.mjs.map +1 -0
- 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 +25 -0
- package/dist/client/cart/hooks/useCart.mjs.map +1 -0
- 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 +49 -0
- package/dist/client/cart/hooks/useCartActions.mjs.map +1 -0
- 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 +27 -0
- package/dist/client/cart/queries/addToCartQueryFn.mjs.map +1 -0
- 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 +34 -0
- package/dist/client/cart/queries/getCartQueryFn.mjs.map +1 -0
- 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 +24 -0
- package/dist/client/cart/queries/removeCartItemQueryFn.mjs.map +1 -0
- 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 +27 -0
- package/dist/client/cart/queries/updateCartItemQueryFn.mjs.map +1 -0
- 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.ts +52 -0
- package/dist/client/cart/types/cart.d.ts.map +1 -0
- package/dist/client/cart/types/cart.mjs +1 -0
- package/dist/client/cart/types/cart.mjs.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 +21 -0
- package/dist/client/cart/utils/session.mjs.map +1 -0
- 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 +25 -0
- package/dist/client/cms/storyblok/preview/registerStoryblokBridge.mjs.map +1 -0
- package/dist/client/cms/storyblok/preview/storyblok-preview-syncer.d.ts +20 -0
- package/dist/client/cms/storyblok/preview/storyblok-preview-syncer.d.ts.map +1 -0
- package/dist/client/cms/storyblok/preview/storyblok-preview-syncer.mjs +79 -0
- package/dist/client/cms/storyblok/preview/storyblok-preview-syncer.mjs.map +1 -0
- 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/auth/withAuth.mjs +25 -0
- package/dist/client/global/auth/withAuth.mjs.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.ts +17 -0
- package/dist/client/global/config/index.d.ts.map +1 -0
- package/dist/client/global/config/index.mjs +34 -0
- package/dist/client/global/config/index.mjs.map +1 -0
- package/dist/client/global/constants/tags.d.ts +15 -0
- package/dist/client/global/constants/tags.d.ts.map +1 -0
- package/dist/client/global/constants/tags.mjs +18 -0
- package/dist/client/global/constants/tags.mjs.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 +40 -0
- package/dist/client/global/providers/enad-provider.mjs.map +1 -0
- 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 +18 -0
- package/dist/client/search/actions/searchAction.mjs.map +1 -0
- 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 +34 -0
- package/dist/client/search/components/search-bar.mjs.map +1 -0
- 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 +37 -0
- package/dist/client/search/hooks/useSearch.mjs.map +1 -0
- 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 +30 -0
- package/dist/client/user/actions/createResetPasswordLinkAction.mjs.map +1 -0
- 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 +19 -0
- package/dist/client/user/actions/getUserAction.mjs.map +1 -0
- package/dist/client/user/actions/logInUserAction.d.ts +15 -0
- package/dist/client/user/actions/logInUserAction.d.ts.map +1 -0
- package/dist/client/user/actions/logInUserAction.mjs +34 -0
- package/dist/client/user/actions/logInUserAction.mjs.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/logoutUserAction.mjs +10 -0
- package/dist/client/user/actions/logoutUserAction.mjs.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 +18 -0
- package/dist/client/user/actions/registerOrganisationAction.mjs.map +1 -0
- package/dist/client/user/actions/registerUserAction.d.ts +18 -0
- package/dist/client/user/actions/registerUserAction.d.ts.map +1 -0
- package/dist/client/user/actions/registerUserAction.mjs +42 -0
- package/dist/client/user/actions/registerUserAction.mjs.map +1 -0
- package/dist/client/user/actions/registerUserWithoutRedirectAction.d.ts +41 -0
- package/dist/client/user/actions/registerUserWithoutRedirectAction.d.ts.map +1 -0
- package/dist/client/user/actions/registerUserWithoutRedirectAction.mjs +58 -0
- package/dist/client/user/actions/registerUserWithoutRedirectAction.mjs.map +1 -0
- package/dist/client/user/actions/updatePasswordAction.d.ts +21 -0
- package/dist/client/user/actions/updatePasswordAction.d.ts.map +1 -0
- package/dist/client/user/actions/updatePasswordAction.mjs +37 -0
- package/dist/client/user/actions/updatePasswordAction.mjs.map +1 -0
- 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/api/userRoute.mjs +65 -0
- package/dist/client/user/api/userRoute.mjs.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/clients/enad.mjs +19 -0
- package/dist/client/user/clients/enad.mjs.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 +117 -0
- package/dist/client/user/components/login-form.mjs.map +1 -0
- 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 +93 -0
- package/dist/client/user/components/reset-password-form.mjs.map +1 -0
- 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 +26 -0
- package/dist/client/user/components/sign-out.mjs.map +1 -0
- 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 +188 -0
- package/dist/client/user/components/signup-form.mjs.map +1 -0
- 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 +864 -0
- package/dist/client/user/components/signup-organisation-form.mjs.map +1 -0
- 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 +60 -0
- package/dist/client/user/components/update-password-form.mjs.map +1 -0
- 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/index.mjs +2 -0
- package/dist/client/user/hooks/index.mjs.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 +32 -0
- package/dist/client/user/hooks/useUser.mjs.map +1 -0
- 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.ts +201 -0
- package/dist/client/user/types/user.d.ts.map +1 -0
- package/dist/client/user/types/user.mjs +1 -0
- package/dist/client/user/types/user.mjs.map +1 -0
- package/dist/client/user/utils/userCookieService.d.ts +19 -0
- package/dist/client/user/utils/userCookieService.d.ts.map +1 -0
- package/dist/client/user/utils/userCookieService.mjs +51 -0
- package/dist/client/user/utils/userCookieService.mjs.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 +20 -0
- package/dist/client/wishlist/actions/addItemsToWishlistAction.mjs.map +1 -0
- 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 +20 -0
- package/dist/client/wishlist/actions/createOrGetShareTokenAction.mjs.map +1 -0
- 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 +16 -0
- package/dist/client/wishlist/actions/createWishlistAction.mjs.map +1 -0
- 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 +20 -0
- package/dist/client/wishlist/actions/deleteItemsFromWishlistAction.mjs.map +1 -0
- 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/deleteWishlistAction.mjs +16 -0
- package/dist/client/wishlist/actions/deleteWishlistAction.mjs.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 +20 -0
- package/dist/client/wishlist/actions/getSharedWishlistAction.mjs.map +1 -0
- 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 +20 -0
- package/dist/client/wishlist/actions/getSpecificWishlistAction.mjs.map +1 -0
- 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 +25 -0
- package/dist/client/wishlist/actions/getUserWishlists.mjs.map +1 -0
- 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/revokeShareTokenAction.mjs +20 -0
- package/dist/client/wishlist/actions/revokeShareTokenAction.mjs.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 +20 -0
- package/dist/client/wishlist/actions/updateWishlistAction.mjs.map +1 -0
- 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/index.mjs +2 -0
- package/dist/client/wishlist/hooks/index.mjs.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 +76 -0
- package/dist/client/wishlist/hooks/useWishlist.mjs.map +1 -0
- 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 +101 -0
- package/dist/client/wishlist/hooks/useWishlistActions.mjs.map +1 -0
- 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 +199 -0
- package/dist/client/wishlist/wishlist-drawer.mjs.map +1 -0
- package/dist/styles.css +2 -0
- package/package.json +54 -32
package/README.md
ADDED
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
# @enadhq/enad-react-sdk
|
|
2
|
+
|
|
3
|
+
Composable storefront UI components for building e-commerce experiences with React 19 and Next.js 16. Part of the [Enad](https://enad.io) unified commerce platform.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @enadhq/enad-react-sdk
|
|
9
|
+
# or
|
|
10
|
+
pnpm add @enadhq/enad-react-sdk
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### Peer dependencies
|
|
14
|
+
|
|
15
|
+
You need these in your project:
|
|
16
|
+
|
|
17
|
+
- `react` >= 19
|
|
18
|
+
- `react-dom` >= 19
|
|
19
|
+
- `next` >= 16
|
|
20
|
+
- `@tanstack/react-query` >= 5
|
|
21
|
+
|
|
22
|
+
## Setup
|
|
23
|
+
|
|
24
|
+
### 1. Import the stylesheet
|
|
25
|
+
|
|
26
|
+
Add the SDK stylesheet to your app's root layout:
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
import "@enadhq/enad-react-sdk/styles.css";
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### 2. Wrap your app with `EnadProvider`
|
|
33
|
+
|
|
34
|
+
`EnadProvider` sets up React Query, the icon system, and the component resolver. Place it at the root of your component tree.
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
import { EnadProvider } from "@enadhq/enad-react-sdk/client/global";
|
|
38
|
+
|
|
39
|
+
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
|
40
|
+
return (
|
|
41
|
+
<EnadProvider>
|
|
42
|
+
{children}
|
|
43
|
+
</EnadProvider>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
#### Provider options
|
|
49
|
+
|
|
50
|
+
| Prop | Type | Default | Description |
|
|
51
|
+
|------|------|---------|-------------|
|
|
52
|
+
| `cartAdapter` | `CartAdapter` | — | Cart backend adapter (see [Cart adapters](#cart-adapters) below) |
|
|
53
|
+
| `brink` | `BrinkConfig` | — | **Deprecated.** Use `cartAdapter` with `createBrinkCartAdapter()` instead |
|
|
54
|
+
| `icons` | `IconSlotMap` | `phosphorIcons` | Icon set to use. Ships with `phosphorIcons`, `lucideIcons`, and `hugeIcons` adapters |
|
|
55
|
+
| `componentSet` | `"default" \| "mono"` | `"default"` | Base UI component set. `"mono"` uses the monochromatic variant |
|
|
56
|
+
| `componentOverrides` | `ComponentOverrides` | — | Override the component set for specific components |
|
|
57
|
+
|
|
58
|
+
#### Cart adapters
|
|
59
|
+
|
|
60
|
+
The SDK uses a pluggable adapter pattern for the cart backend. Pass any object that implements the `CartAdapter` interface. The Brink Commerce adapter ships as a separate entry point:
|
|
61
|
+
|
|
62
|
+
```tsx
|
|
63
|
+
import { EnadProvider } from "@enadhq/enad-react-sdk/client/global";
|
|
64
|
+
import { createBrinkCartAdapter } from "@enadhq/enad-react-sdk/client/cart/brink-adapter";
|
|
65
|
+
|
|
66
|
+
const cartAdapter = createBrinkCartAdapter({
|
|
67
|
+
env: "production",
|
|
68
|
+
storeGroupId: "sg-123",
|
|
69
|
+
countryCode: "SE",
|
|
70
|
+
languageCode: "sv",
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
<EnadProvider cartAdapter={cartAdapter}>
|
|
74
|
+
{children}
|
|
75
|
+
</EnadProvider>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
A mock adapter is also available for development and testing:
|
|
79
|
+
|
|
80
|
+
```tsx
|
|
81
|
+
import { createMockCartAdapter } from "@enadhq/enad-react-sdk/client/cart/mock-adapter";
|
|
82
|
+
|
|
83
|
+
const cartAdapter = createMockCartAdapter({ delay: 200 });
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
To write your own adapter for a different backend (Centra, Shopify, a custom API), implement the `CartAdapter` interface from `client/cart`:
|
|
87
|
+
|
|
88
|
+
```ts
|
|
89
|
+
import type { CartAdapter } from "@enadhq/enad-react-sdk/client/cart";
|
|
90
|
+
|
|
91
|
+
const myAdapter: CartAdapter = {
|
|
92
|
+
getCart: () => { /* ... */ },
|
|
93
|
+
addItem: (productVariantId, quantity) => { /* ... */ },
|
|
94
|
+
updateItem: (itemId, quantity) => { /* ... */ },
|
|
95
|
+
removeItem: (itemId) => { /* ... */ },
|
|
96
|
+
};
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
All adapter methods return a normalized `Cart` object. The adapter owns session management internally.
|
|
100
|
+
|
|
101
|
+
#### Switching icon sets
|
|
102
|
+
|
|
103
|
+
```tsx
|
|
104
|
+
import { EnadProvider } from "@enadhq/enad-react-sdk/client/global";
|
|
105
|
+
import { lucideIcons } from "@enadhq/enad-react-sdk/client/icons";
|
|
106
|
+
|
|
107
|
+
<EnadProvider icons={lucideIcons}>
|
|
108
|
+
{children}
|
|
109
|
+
</EnadProvider>
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Package exports
|
|
113
|
+
|
|
114
|
+
The SDK is split into focused entry points for tree-shaking. Import from the specific module you need.
|
|
115
|
+
|
|
116
|
+
### `client/global`
|
|
117
|
+
|
|
118
|
+
Provider setup and top-level utilities.
|
|
119
|
+
|
|
120
|
+
```tsx
|
|
121
|
+
import { EnadProvider, ErrorBoundary } from "@enadhq/enad-react-sdk/client/global";
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### `client/storefront`
|
|
125
|
+
|
|
126
|
+
Storefront UI components: prices, badges, ratings, variant selectors, product tabs, navigation, newsletter signup, language/country selectors, and more.
|
|
127
|
+
|
|
128
|
+
```tsx
|
|
129
|
+
import { Price, Badge, StarRating, VariantSelector, ProductTabs } from "@enadhq/enad-react-sdk/client/storefront";
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### `client/cart`
|
|
133
|
+
|
|
134
|
+
Cart components, hooks, adapter interface, and normalized types.
|
|
135
|
+
|
|
136
|
+
```tsx
|
|
137
|
+
import { CartDrawer, CartTrigger, useCart } from "@enadhq/enad-react-sdk/client/cart";
|
|
138
|
+
import type { CartAdapter, Cart, CartItem, Money } from "@enadhq/enad-react-sdk/client/cart";
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### `client/cart/brink-adapter`
|
|
142
|
+
|
|
143
|
+
Brink Commerce adapter. Separate entry point for tree-shaking.
|
|
144
|
+
|
|
145
|
+
```tsx
|
|
146
|
+
import { createBrinkCartAdapter } from "@enadhq/enad-react-sdk/client/cart/brink-adapter";
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### `client/cart/mock-adapter`
|
|
150
|
+
|
|
151
|
+
In-memory mock adapter for development and testing.
|
|
152
|
+
|
|
153
|
+
```tsx
|
|
154
|
+
import { createMockCartAdapter } from "@enadhq/enad-react-sdk/client/cart/mock-adapter";
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### `client/search`
|
|
158
|
+
|
|
159
|
+
Search functionality with the `useSearch` hook.
|
|
160
|
+
|
|
161
|
+
```tsx
|
|
162
|
+
import { useSearch } from "@enadhq/enad-react-sdk/client/search";
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### `client/icons`
|
|
166
|
+
|
|
167
|
+
Pluggable icon system with adapters for Phosphor, Lucide, and Hugeicons.
|
|
168
|
+
|
|
169
|
+
```tsx
|
|
170
|
+
import { Icon, useIcon, phosphorIcons, lucideIcons, hugeIcons } from "@enadhq/enad-react-sdk/client/icons";
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### `client/theme`
|
|
174
|
+
|
|
175
|
+
Theme codec for encoding/decoding theme hashes, CSS generation, conflict scanning, and default token values.
|
|
176
|
+
|
|
177
|
+
```tsx
|
|
178
|
+
import { encodeThemeHash, decodeThemeHash, generateThemeCSS, SDK_DEFAULTS } from "@enadhq/enad-react-sdk/client/theme";
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
The package also ships an `enad-theme` CLI for theme operations:
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
npx enad-theme --help
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### `client/user`
|
|
188
|
+
|
|
189
|
+
User account context and hooks.
|
|
190
|
+
|
|
191
|
+
### `client/wishlist`
|
|
192
|
+
|
|
193
|
+
Wishlist state management.
|
|
194
|
+
|
|
195
|
+
### `client/ui-interfaces`
|
|
196
|
+
|
|
197
|
+
TypeScript interfaces for the component system.
|
|
198
|
+
|
|
199
|
+
### `client/ui-resolver`
|
|
200
|
+
|
|
201
|
+
Component resolver that maps abstract component names to concrete implementations.
|
|
202
|
+
|
|
203
|
+
## Component overview
|
|
204
|
+
|
|
205
|
+
### Blocks
|
|
206
|
+
|
|
207
|
+
Content blocks for building storefront pages:
|
|
208
|
+
|
|
209
|
+
- `Hero`, `Gallery`, `GalleryWithCaption`, `GalleryWithLinkBlocks`
|
|
210
|
+
- `TextContent`, `VariableTextContent`, `TextContentWithImage`, `ContentWithImageProductData`
|
|
211
|
+
- `ProductCard`, `ProductImage`, `LinkBlock`, `LinkBlockSmall`
|
|
212
|
+
- `ImageBlock`, `CardImageWithCaption`, `CardVideo`
|
|
213
|
+
- `AccordionBlock`, `Spacer`, `TruncatedText`
|
|
214
|
+
|
|
215
|
+
### Primitives
|
|
216
|
+
|
|
217
|
+
Low-level UI elements that other components build on:
|
|
218
|
+
|
|
219
|
+
- `Button`, `Input`, `Select`, `Checkbox`
|
|
220
|
+
- `Breadcrumbs`, `Pagination`, `TextLink`
|
|
221
|
+
- `QuickLinks`, `DownloadItem`
|
|
222
|
+
|
|
223
|
+
### Product
|
|
224
|
+
|
|
225
|
+
Product-specific components:
|
|
226
|
+
|
|
227
|
+
- `ColorSwatch`, `MaterialSelector`, `QuantityPicker`, `ProductUSP`
|
|
228
|
+
|
|
229
|
+
### Carousel
|
|
230
|
+
|
|
231
|
+
- `SwipeableCarousel` — touch-friendly carousel built on Embla
|
|
232
|
+
|
|
233
|
+
### Layout
|
|
234
|
+
|
|
235
|
+
- `Header`, `Footer`, `PromotionBar`, `MobileMenuDrawer`
|
|
236
|
+
|
|
237
|
+
### Filters
|
|
238
|
+
|
|
239
|
+
- `FilterPanel`, `FilterGroup`, `FilterChip`, `SortSelect`, `ToggleListView`
|
|
240
|
+
|
|
241
|
+
### Checkout
|
|
242
|
+
|
|
243
|
+
Checkout flow components (in development).
|
|
244
|
+
|
|
245
|
+
## Theming
|
|
246
|
+
|
|
247
|
+
The SDK uses CSS custom properties for all visual tokens (colors, radii, spacing). You own your brand palette — the SDK owns the interaction quality and structural patterns.
|
|
248
|
+
|
|
249
|
+
Themes are applied through CSS variables. Use the `enad-theme` CLI or the `generateThemeCSS` function to produce a theme stylesheet from a configuration object.
|
|
250
|
+
|
|
251
|
+
Light and dark modes are both first-class. The SDK respects `prefers-color-scheme` and supports explicit mode toggling.
|
|
252
|
+
|
|
253
|
+
## Built with
|
|
254
|
+
|
|
255
|
+
- [Tailwind CSS v4](https://tailwindcss.com) — utility-first styling
|
|
256
|
+
- [Radix UI](https://radix-ui.com) — accessible primitives (dialogs, popovers, accordions)
|
|
257
|
+
- [Embla Carousel](https://www.embla-carousel.com) — lightweight carousel engine
|
|
258
|
+
- [React Query](https://tanstack.com/query) — data fetching and cache management
|
|
259
|
+
- [react-hook-form](https://react-hook-form.com) + [Zod](https://zod.dev) — form handling and validation
|
|
260
|
+
- [class-variance-authority](https://cva.style) — variant-driven component styles
|
|
261
|
+
|
|
262
|
+
## Development
|
|
263
|
+
|
|
264
|
+
From the monorepo root:
|
|
265
|
+
|
|
266
|
+
```bash
|
|
267
|
+
# Build the SDK (ESM via tsup, types via tsc, styles via tailwindcss)
|
|
268
|
+
pnpm build --filter=@enadhq/enad-react-sdk
|
|
269
|
+
|
|
270
|
+
# Watch mode — rebuilds on file changes
|
|
271
|
+
pnpm dev --filter=@enadhq/enad-react-sdk
|
|
272
|
+
|
|
273
|
+
# Type check
|
|
274
|
+
pnpm check-types --filter=@enadhq/enad-react-sdk
|
|
275
|
+
|
|
276
|
+
# Lint
|
|
277
|
+
pnpm lint --filter=@enadhq/enad-react-sdk
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
The build has three stages:
|
|
281
|
+
|
|
282
|
+
1. **tsup** — bundles TypeScript to ESM (`dist/*.mjs`)
|
|
283
|
+
2. **tsc** — generates declaration files (`dist/*.d.ts`)
|
|
284
|
+
3. **tailwindcss** — compiles `src/styles.css` to `dist/styles.css`
|
|
285
|
+
|
|
286
|
+
## License
|
|
287
|
+
|
|
288
|
+
MIT
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { CartAdapter } from "../types/adapter";
|
|
2
|
+
export interface BrinkCartAdapterConfig {
|
|
3
|
+
/** Brink environment identifier (used to build the API base URL). */
|
|
4
|
+
env: string;
|
|
5
|
+
/** Store group identifier. */
|
|
6
|
+
storeGroupId: string;
|
|
7
|
+
/** ISO 3166-1 alpha-2 country code. */
|
|
8
|
+
countryCode: string;
|
|
9
|
+
/** BCP 47 language code. */
|
|
10
|
+
languageCode: string;
|
|
11
|
+
/** Storage key for the session token. Defaults to "brink_cart_session". */
|
|
12
|
+
sessionKey?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Create a cart adapter for Brink Commerce.
|
|
16
|
+
*
|
|
17
|
+
* ```ts
|
|
18
|
+
* import { createBrinkCartAdapter } from "@enadhq/enad-react-sdk/client/cart/brink-adapter"
|
|
19
|
+
*
|
|
20
|
+
* const adapter = createBrinkCartAdapter({
|
|
21
|
+
* env: "production",
|
|
22
|
+
* storeGroupId: "sg-123",
|
|
23
|
+
* countryCode: "SE",
|
|
24
|
+
* languageCode: "sv",
|
|
25
|
+
* })
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare function createBrinkCartAdapter(config: BrinkCartAdapterConfig): CartAdapter;
|
|
29
|
+
//# sourceMappingURL=brink.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brink.d.ts","sourceRoot":"","sources":["../../../../src/client/cart/adapters/brink.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAyB,MAAM,kBAAkB,CAAC;AAO3E,MAAM,WAAW,sBAAsB;IACrC,qEAAqE;IACrE,GAAG,EAAE,MAAM,CAAC;IACZ,8BAA8B;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,uCAAuC;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,4BAA4B;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,2EAA2E;IAC3E,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AA6ID;;;;;;;;;;;;;GAaG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,sBAAsB,GAAG,WAAW,CA+FlF"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { CartAdapterError } from "../types/adapter";
|
|
2
|
+
function money(amount, currencyCode) {
|
|
3
|
+
return { amount, currencyCode };
|
|
4
|
+
}
|
|
5
|
+
function mapItem(item, currencyCode) {
|
|
6
|
+
return {
|
|
7
|
+
id: item.id,
|
|
8
|
+
productVariantId: item.productVariantId,
|
|
9
|
+
sku: item.sku,
|
|
10
|
+
displayName: item.displayName,
|
|
11
|
+
unitPrice: money(item.salePriceAmount, currencyCode),
|
|
12
|
+
listPrice: item.originalPriceAmount != null ? money(item.originalPriceAmount, currencyCode) : void 0,
|
|
13
|
+
discount: item.discountAmount != null ? money(item.discountAmount, currencyCode) : void 0,
|
|
14
|
+
tax: item.taxAmount != null ? money(item.taxAmount, currencyCode) : void 0,
|
|
15
|
+
quantity: item.quantity,
|
|
16
|
+
imageUrl: item.imageUrl,
|
|
17
|
+
variantLabel: item.variantLabel,
|
|
18
|
+
productSlug: item.customAttributes?.productSlug,
|
|
19
|
+
backendMeta: item.customAttributes
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function mapCart(response) {
|
|
23
|
+
const { cart } = response;
|
|
24
|
+
const cc = cart.currencyCode;
|
|
25
|
+
return {
|
|
26
|
+
id: cart.id,
|
|
27
|
+
countryCode: cart.countryCode,
|
|
28
|
+
currencyCode: cc,
|
|
29
|
+
languageCode: cart.languageCode,
|
|
30
|
+
taxIncludedInPrice: cart.isTaxIncludedInPrice,
|
|
31
|
+
discountCodes: cart.discountCodes,
|
|
32
|
+
items: cart.items.map((item) => mapItem(item, cc)),
|
|
33
|
+
totals: {
|
|
34
|
+
subtotal: money(cart.totals.subTotal, cc),
|
|
35
|
+
tax: money(cart.totals.taxTotal, cc),
|
|
36
|
+
discount: money(cart.totals.discountTotal, cc),
|
|
37
|
+
total: money(cart.totals.grandTotal, cc)
|
|
38
|
+
},
|
|
39
|
+
createdAt: cart.created,
|
|
40
|
+
updatedAt: cart.updated,
|
|
41
|
+
backendMeta: {
|
|
42
|
+
revision: cart.revision,
|
|
43
|
+
storeGroupId: cart.storeGroupId,
|
|
44
|
+
sessionToken: response.token,
|
|
45
|
+
capabilities: response.capabilities
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function createSessionStore(key) {
|
|
50
|
+
return {
|
|
51
|
+
get() {
|
|
52
|
+
try {
|
|
53
|
+
return localStorage.getItem(key);
|
|
54
|
+
} catch {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
set(token) {
|
|
59
|
+
try {
|
|
60
|
+
localStorage.setItem(key, token);
|
|
61
|
+
} catch {
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
clear() {
|
|
65
|
+
try {
|
|
66
|
+
localStorage.removeItem(key);
|
|
67
|
+
} catch {
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
function createBrinkCartAdapter(config) {
|
|
73
|
+
const { env, storeGroupId, countryCode, languageCode } = config;
|
|
74
|
+
const baseUrl = `https://shopper.eu-west-1.${env}.brinkcommerce.io`;
|
|
75
|
+
const session = createSessionStore(config.sessionKey ?? "brink_cart_session");
|
|
76
|
+
async function handleResponse(res) {
|
|
77
|
+
if (res.status === 401) {
|
|
78
|
+
session.clear();
|
|
79
|
+
throw new CartAdapterError("SESSION_EXPIRED", "Cart session has expired");
|
|
80
|
+
}
|
|
81
|
+
if (!res.ok) {
|
|
82
|
+
const text = await res.text().catch(() => "Unknown error");
|
|
83
|
+
throw new CartAdapterError("UNKNOWN", `Brink API error (${res.status}): ${text}`);
|
|
84
|
+
}
|
|
85
|
+
return res.json();
|
|
86
|
+
}
|
|
87
|
+
function authHeaders() {
|
|
88
|
+
const token = session.get();
|
|
89
|
+
if (!token) return { "Content-Type": "application/json" };
|
|
90
|
+
return {
|
|
91
|
+
Authorization: `Bearer ${token}`,
|
|
92
|
+
"Content-Type": "application/json"
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
const adapter = {
|
|
96
|
+
async getCart() {
|
|
97
|
+
const existingToken = session.get();
|
|
98
|
+
if (existingToken) {
|
|
99
|
+
const res2 = await fetch(`${baseUrl}/shopper/sessions`, {
|
|
100
|
+
headers: authHeaders(),
|
|
101
|
+
cache: "no-store"
|
|
102
|
+
});
|
|
103
|
+
if (res2.ok) {
|
|
104
|
+
const data2 = await res2.json();
|
|
105
|
+
session.set(data2.token);
|
|
106
|
+
return mapCart(data2);
|
|
107
|
+
}
|
|
108
|
+
session.clear();
|
|
109
|
+
}
|
|
110
|
+
const res = await fetch(`${baseUrl}/shopper/sessions/start`, {
|
|
111
|
+
method: "POST",
|
|
112
|
+
headers: { "Content-Type": "application/json" },
|
|
113
|
+
body: JSON.stringify({ storeGroupId, countryCode, languageCode })
|
|
114
|
+
});
|
|
115
|
+
const data = await handleResponse(res);
|
|
116
|
+
session.set(data.token);
|
|
117
|
+
return mapCart(data);
|
|
118
|
+
},
|
|
119
|
+
async addItem(productVariantId, quantity) {
|
|
120
|
+
const res = await fetch(`${baseUrl}/shopper/sessions/items`, {
|
|
121
|
+
method: "POST",
|
|
122
|
+
headers: authHeaders(),
|
|
123
|
+
body: JSON.stringify({ productVariantId, quantity })
|
|
124
|
+
});
|
|
125
|
+
const data = await handleResponse(res);
|
|
126
|
+
session.set(data.token);
|
|
127
|
+
return mapCart(data);
|
|
128
|
+
},
|
|
129
|
+
async updateItem(itemId, quantity) {
|
|
130
|
+
const res = await fetch(`${baseUrl}/shopper/sessions/items/${itemId}`, {
|
|
131
|
+
method: "PUT",
|
|
132
|
+
headers: authHeaders(),
|
|
133
|
+
body: JSON.stringify({ quantity })
|
|
134
|
+
});
|
|
135
|
+
const data = await handleResponse(res);
|
|
136
|
+
session.set(data.token);
|
|
137
|
+
return mapCart(data);
|
|
138
|
+
},
|
|
139
|
+
async removeItem(itemId) {
|
|
140
|
+
const res = await fetch(`${baseUrl}/shopper/sessions/items/${itemId}`, {
|
|
141
|
+
method: "DELETE",
|
|
142
|
+
headers: authHeaders()
|
|
143
|
+
});
|
|
144
|
+
const data = await handleResponse(res);
|
|
145
|
+
session.set(data.token);
|
|
146
|
+
return mapCart(data);
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
return adapter;
|
|
150
|
+
}
|
|
151
|
+
export {
|
|
152
|
+
createBrinkCartAdapter
|
|
153
|
+
};
|
|
154
|
+
//# sourceMappingURL=brink.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/client/cart/adapters/brink.ts"],"sourcesContent":["import type { CartAdapter, Cart, CartItem, Money } from \"../types/adapter\";\nimport { CartAdapterError } from \"../types/adapter\";\n\n// ---------------------------------------------------------------------------\n// Config\n// ---------------------------------------------------------------------------\n\nexport interface BrinkCartAdapterConfig {\n /** Brink environment identifier (used to build the API base URL). */\n env: string;\n /** Store group identifier. */\n storeGroupId: string;\n /** ISO 3166-1 alpha-2 country code. */\n countryCode: string;\n /** BCP 47 language code. */\n languageCode: string;\n /** Storage key for the session token. Defaults to \"brink_cart_session\". */\n sessionKey?: string;\n}\n\n// ---------------------------------------------------------------------------\n// Brink API response types (internal)\n// ---------------------------------------------------------------------------\n\ninterface BrinkCartItem {\n id: string;\n productVariantId: string;\n quantity: number;\n salePriceAmount: number;\n displayName: string;\n imageUrl?: string;\n customAttributes?: { productSlug?: string; [key: string]: unknown };\n originalPriceAmount?: number;\n discountAmount?: number;\n taxAmount?: number;\n variantLabel?: string;\n sku?: string;\n}\n\ninterface BrinkCart {\n id: string;\n storeGroupId: string;\n countryCode: string;\n currencyCode: string;\n languageCode: string;\n isTaxIncludedInPrice: boolean;\n discountCodes: string[];\n created: string;\n updated: string;\n discountAmount: number;\n revision: number;\n items: BrinkCartItem[];\n totals: {\n subTotal: number;\n taxTotal: number;\n discountTotal: number;\n grandTotal: number;\n };\n}\n\ninterface BrinkCartResponse {\n token: string;\n cart: BrinkCart;\n capabilities: {\n paymentProviders: { id: string; name: string }[];\n shippingProviders: { id: string; name: string }[];\n };\n}\n\n// ---------------------------------------------------------------------------\n// Mapping\n// ---------------------------------------------------------------------------\n\nfunction money(amount: number, currencyCode: string): Money {\n return { amount, currencyCode };\n}\n\nfunction mapItem(item: BrinkCartItem, currencyCode: string): CartItem {\n return {\n id: item.id,\n productVariantId: item.productVariantId,\n sku: item.sku,\n displayName: item.displayName,\n unitPrice: money(item.salePriceAmount, currencyCode),\n listPrice:\n item.originalPriceAmount != null ? money(item.originalPriceAmount, currencyCode) : undefined,\n discount: item.discountAmount != null ? money(item.discountAmount, currencyCode) : undefined,\n tax: item.taxAmount != null ? money(item.taxAmount, currencyCode) : undefined,\n quantity: item.quantity,\n imageUrl: item.imageUrl,\n variantLabel: item.variantLabel,\n productSlug: item.customAttributes?.productSlug,\n backendMeta: item.customAttributes,\n };\n}\n\nfunction mapCart(response: BrinkCartResponse): Cart {\n const { cart } = response;\n const cc = cart.currencyCode;\n\n return {\n id: cart.id,\n countryCode: cart.countryCode,\n currencyCode: cc,\n languageCode: cart.languageCode,\n taxIncludedInPrice: cart.isTaxIncludedInPrice,\n discountCodes: cart.discountCodes,\n items: cart.items.map((item) => mapItem(item, cc)),\n totals: {\n subtotal: money(cart.totals.subTotal, cc),\n tax: money(cart.totals.taxTotal, cc),\n discount: money(cart.totals.discountTotal, cc),\n total: money(cart.totals.grandTotal, cc),\n },\n createdAt: cart.created,\n updatedAt: cart.updated,\n backendMeta: {\n revision: cart.revision,\n storeGroupId: cart.storeGroupId,\n sessionToken: response.token,\n capabilities: response.capabilities,\n },\n };\n}\n\n// ---------------------------------------------------------------------------\n// Session helpers\n// ---------------------------------------------------------------------------\n\nfunction createSessionStore(key: string) {\n return {\n get(): string | null {\n try {\n return localStorage.getItem(key);\n } catch {\n return null;\n }\n },\n set(token: string) {\n try {\n localStorage.setItem(key, token);\n } catch {\n // localStorage unavailable (SSR, private browsing) — silently skip\n }\n },\n clear() {\n try {\n localStorage.removeItem(key);\n } catch {\n // noop\n }\n },\n };\n}\n\n// ---------------------------------------------------------------------------\n// Adapter factory\n// ---------------------------------------------------------------------------\n\n/**\n * Create a cart adapter for Brink Commerce.\n *\n * ```ts\n * import { createBrinkCartAdapter } from \"@enadhq/enad-react-sdk/client/cart/brink-adapter\"\n *\n * const adapter = createBrinkCartAdapter({\n * env: \"production\",\n * storeGroupId: \"sg-123\",\n * countryCode: \"SE\",\n * languageCode: \"sv\",\n * })\n * ```\n */\nexport function createBrinkCartAdapter(config: BrinkCartAdapterConfig): CartAdapter {\n const { env, storeGroupId, countryCode, languageCode } = config;\n const baseUrl = `https://shopper.eu-west-1.${env}.brinkcommerce.io`;\n const session = createSessionStore(config.sessionKey ?? \"brink_cart_session\");\n\n async function handleResponse(res: Response): Promise<BrinkCartResponse> {\n if (res.status === 401) {\n session.clear();\n throw new CartAdapterError(\"SESSION_EXPIRED\", \"Cart session has expired\");\n }\n if (!res.ok) {\n const text = await res.text().catch(() => \"Unknown error\");\n throw new CartAdapterError(\"UNKNOWN\", `Brink API error (${res.status}): ${text}`);\n }\n return res.json() as Promise<BrinkCartResponse>;\n }\n\n function authHeaders(): Record<string, string> {\n const token = session.get();\n if (!token) return { \"Content-Type\": \"application/json\" };\n return {\n Authorization: `Bearer ${token}`,\n \"Content-Type\": \"application/json\",\n };\n }\n\n const adapter: CartAdapter = {\n async getCart(): Promise<Cart> {\n const existingToken = session.get();\n\n if (existingToken) {\n const res = await fetch(`${baseUrl}/shopper/sessions`, {\n headers: authHeaders(),\n cache: \"no-store\",\n });\n\n if (res.ok) {\n const data = (await res.json()) as BrinkCartResponse;\n session.set(data.token);\n return mapCart(data);\n }\n\n // Token expired or invalid — start fresh\n session.clear();\n }\n\n // No session — create one\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 const data = await handleResponse(res);\n session.set(data.token);\n return mapCart(data);\n },\n\n async addItem(productVariantId: string, quantity: number): Promise<Cart> {\n const res = await fetch(`${baseUrl}/shopper/sessions/items`, {\n method: \"POST\",\n headers: authHeaders(),\n body: JSON.stringify({ productVariantId, quantity }),\n });\n\n const data = await handleResponse(res);\n session.set(data.token);\n return mapCart(data);\n },\n\n async updateItem(itemId: string, quantity: number): Promise<Cart> {\n const res = await fetch(`${baseUrl}/shopper/sessions/items/${itemId}`, {\n method: \"PUT\",\n headers: authHeaders(),\n body: JSON.stringify({ quantity }),\n });\n\n const data = await handleResponse(res);\n session.set(data.token);\n return mapCart(data);\n },\n\n async removeItem(itemId: string): Promise<Cart> {\n const res = await fetch(`${baseUrl}/shopper/sessions/items/${itemId}`, {\n method: \"DELETE\",\n headers: authHeaders(),\n });\n\n const data = await handleResponse(res);\n session.set(data.token);\n return mapCart(data);\n },\n };\n\n return adapter;\n}\n"],"mappings":"AACA,SAAS,wBAAwB;AAwEjC,SAAS,MAAM,QAAgB,cAA6B;AAC1D,SAAO,EAAE,QAAQ,aAAa;AAChC;AAEA,SAAS,QAAQ,MAAqB,cAAgC;AACpE,SAAO;AAAA,IACL,IAAI,KAAK;AAAA,IACT,kBAAkB,KAAK;AAAA,IACvB,KAAK,KAAK;AAAA,IACV,aAAa,KAAK;AAAA,IAClB,WAAW,MAAM,KAAK,iBAAiB,YAAY;AAAA,IACnD,WACE,KAAK,uBAAuB,OAAO,MAAM,KAAK,qBAAqB,YAAY,IAAI;AAAA,IACrF,UAAU,KAAK,kBAAkB,OAAO,MAAM,KAAK,gBAAgB,YAAY,IAAI;AAAA,IACnF,KAAK,KAAK,aAAa,OAAO,MAAM,KAAK,WAAW,YAAY,IAAI;AAAA,IACpE,UAAU,KAAK;AAAA,IACf,UAAU,KAAK;AAAA,IACf,cAAc,KAAK;AAAA,IACnB,aAAa,KAAK,kBAAkB;AAAA,IACpC,aAAa,KAAK;AAAA,EACpB;AACF;AAEA,SAAS,QAAQ,UAAmC;AAClD,QAAM,EAAE,KAAK,IAAI;AACjB,QAAM,KAAK,KAAK;AAEhB,SAAO;AAAA,IACL,IAAI,KAAK;AAAA,IACT,aAAa,KAAK;AAAA,IAClB,cAAc;AAAA,IACd,cAAc,KAAK;AAAA,IACnB,oBAAoB,KAAK;AAAA,IACzB,eAAe,KAAK;AAAA,IACpB,OAAO,KAAK,MAAM,IAAI,CAAC,SAAS,QAAQ,MAAM,EAAE,CAAC;AAAA,IACjD,QAAQ;AAAA,MACN,UAAU,MAAM,KAAK,OAAO,UAAU,EAAE;AAAA,MACxC,KAAK,MAAM,KAAK,OAAO,UAAU,EAAE;AAAA,MACnC,UAAU,MAAM,KAAK,OAAO,eAAe,EAAE;AAAA,MAC7C,OAAO,MAAM,KAAK,OAAO,YAAY,EAAE;AAAA,IACzC;AAAA,IACA,WAAW,KAAK;AAAA,IAChB,WAAW,KAAK;AAAA,IAChB,aAAa;AAAA,MACX,UAAU,KAAK;AAAA,MACf,cAAc,KAAK;AAAA,MACnB,cAAc,SAAS;AAAA,MACvB,cAAc,SAAS;AAAA,IACzB;AAAA,EACF;AACF;AAMA,SAAS,mBAAmB,KAAa;AACvC,SAAO;AAAA,IACL,MAAqB;AACnB,UAAI;AACF,eAAO,aAAa,QAAQ,GAAG;AAAA,MACjC,QAAQ;AACN,eAAO;AAAA,MACT;AAAA,IACF;AAAA,IACA,IAAI,OAAe;AACjB,UAAI;AACF,qBAAa,QAAQ,KAAK,KAAK;AAAA,MACjC,QAAQ;AAAA,MAER;AAAA,IACF;AAAA,IACA,QAAQ;AACN,UAAI;AACF,qBAAa,WAAW,GAAG;AAAA,MAC7B,QAAQ;AAAA,MAER;AAAA,IACF;AAAA,EACF;AACF;AAoBO,SAAS,uBAAuB,QAA6C;AAClF,QAAM,EAAE,KAAK,cAAc,aAAa,aAAa,IAAI;AACzD,QAAM,UAAU,6BAA6B,GAAG;AAChD,QAAM,UAAU,mBAAmB,OAAO,cAAc,oBAAoB;AAE5E,iBAAe,eAAe,KAA2C;AACvE,QAAI,IAAI,WAAW,KAAK;AACtB,cAAQ,MAAM;AACd,YAAM,IAAI,iBAAiB,mBAAmB,0BAA0B;AAAA,IAC1E;AACA,QAAI,CAAC,IAAI,IAAI;AACX,YAAM,OAAO,MAAM,IAAI,KAAK,EAAE,MAAM,MAAM,eAAe;AACzD,YAAM,IAAI,iBAAiB,WAAW,oBAAoB,IAAI,MAAM,MAAM,IAAI,EAAE;AAAA,IAClF;AACA,WAAO,IAAI,KAAK;AAAA,EAClB;AAEA,WAAS,cAAsC;AAC7C,UAAM,QAAQ,QAAQ,IAAI;AAC1B,QAAI,CAAC,MAAO,QAAO,EAAE,gBAAgB,mBAAmB;AACxD,WAAO;AAAA,MACL,eAAe,UAAU,KAAK;AAAA,MAC9B,gBAAgB;AAAA,IAClB;AAAA,EACF;AAEA,QAAM,UAAuB;AAAA,IAC3B,MAAM,UAAyB;AAC7B,YAAM,gBAAgB,QAAQ,IAAI;AAElC,UAAI,eAAe;AACjB,cAAMA,OAAM,MAAM,MAAM,GAAG,OAAO,qBAAqB;AAAA,UACrD,SAAS,YAAY;AAAA,UACrB,OAAO;AAAA,QACT,CAAC;AAED,YAAIA,KAAI,IAAI;AACV,gBAAMC,QAAQ,MAAMD,KAAI,KAAK;AAC7B,kBAAQ,IAAIC,MAAK,KAAK;AACtB,iBAAO,QAAQA,KAAI;AAAA,QACrB;AAGA,gBAAQ,MAAM;AAAA,MAChB;AAGA,YAAM,MAAM,MAAM,MAAM,GAAG,OAAO,2BAA2B;AAAA,QAC3D,QAAQ;AAAA,QACR,SAAS,EAAE,gBAAgB,mBAAmB;AAAA,QAC9C,MAAM,KAAK,UAAU,EAAE,cAAc,aAAa,aAAa,CAAC;AAAA,MAClE,CAAC;AAED,YAAM,OAAO,MAAM,eAAe,GAAG;AACrC,cAAQ,IAAI,KAAK,KAAK;AACtB,aAAO,QAAQ,IAAI;AAAA,IACrB;AAAA,IAEA,MAAM,QAAQ,kBAA0B,UAAiC;AACvE,YAAM,MAAM,MAAM,MAAM,GAAG,OAAO,2BAA2B;AAAA,QAC3D,QAAQ;AAAA,QACR,SAAS,YAAY;AAAA,QACrB,MAAM,KAAK,UAAU,EAAE,kBAAkB,SAAS,CAAC;AAAA,MACrD,CAAC;AAED,YAAM,OAAO,MAAM,eAAe,GAAG;AACrC,cAAQ,IAAI,KAAK,KAAK;AACtB,aAAO,QAAQ,IAAI;AAAA,IACrB;AAAA,IAEA,MAAM,WAAW,QAAgB,UAAiC;AAChE,YAAM,MAAM,MAAM,MAAM,GAAG,OAAO,2BAA2B,MAAM,IAAI;AAAA,QACrE,QAAQ;AAAA,QACR,SAAS,YAAY;AAAA,QACrB,MAAM,KAAK,UAAU,EAAE,SAAS,CAAC;AAAA,MACnC,CAAC;AAED,YAAM,OAAO,MAAM,eAAe,GAAG;AACrC,cAAQ,IAAI,KAAK,KAAK;AACtB,aAAO,QAAQ,IAAI;AAAA,IACrB;AAAA,IAEA,MAAM,WAAW,QAA+B;AAC9C,YAAM,MAAM,MAAM,MAAM,GAAG,OAAO,2BAA2B,MAAM,IAAI;AAAA,QACrE,QAAQ;AAAA,QACR,SAAS,YAAY;AAAA,MACvB,CAAC;AAED,YAAM,OAAO,MAAM,eAAe,GAAG;AACrC,cAAQ,IAAI,KAAK,KAAK;AACtB,aAAO,QAAQ,IAAI;AAAA,IACrB;AAAA,EACF;AAEA,SAAO;AACT;","names":["res","data"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/client/cart/adapters/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AACjD,YAAY,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/client/cart/adapters/index.ts"],"sourcesContent":["export { createBrinkCartAdapter } from \"./brink\";\nexport type { BrinkCartAdapterConfig } from \"./brink\";\n"],"mappings":"AAAA,SAAS,8BAA8B;","names":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { CartAdapter, CartItem } from "../types/adapter";
|
|
2
|
+
export interface MockCartAdapterOptions {
|
|
3
|
+
/** Initial items to populate the cart with. */
|
|
4
|
+
initialItems?: CartItem[];
|
|
5
|
+
/** Currency code. Defaults to "USD". */
|
|
6
|
+
currencyCode?: string;
|
|
7
|
+
/** Simulated network delay in ms. Defaults to 0. */
|
|
8
|
+
delay?: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* In-memory cart adapter for testing and development.
|
|
12
|
+
*
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { createMockCartAdapter } from "@enadhq/enad-react-sdk/client/cart/mock-adapter"
|
|
15
|
+
*
|
|
16
|
+
* const adapter = createMockCartAdapter({ delay: 200 })
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare function createMockCartAdapter(options?: MockCartAdapterOptions): CartAdapter;
|
|
20
|
+
//# sourceMappingURL=mock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mock.d.ts","sourceRoot":"","sources":["../../../../src/client/cart/adapters/mock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAQ,QAAQ,EAAS,MAAM,kBAAkB,CAAC;AAoC3E,MAAM,WAAW,sBAAsB;IACrC,+CAA+C;IAC/C,YAAY,CAAC,EAAE,QAAQ,EAAE,CAAC;IAC1B,wCAAwC;IACxC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oDAAoD;IACpD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,GAAE,sBAA2B,GAAG,WAAW,CA+CvF"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
function money(amount, currencyCode = "USD") {
|
|
2
|
+
return { amount, currencyCode };
|
|
3
|
+
}
|
|
4
|
+
let nextItemId = 1;
|
|
5
|
+
function createEmptyCart(currencyCode = "USD") {
|
|
6
|
+
return {
|
|
7
|
+
id: "mock-cart",
|
|
8
|
+
countryCode: "US",
|
|
9
|
+
currencyCode,
|
|
10
|
+
languageCode: "en",
|
|
11
|
+
taxIncludedInPrice: false,
|
|
12
|
+
discountCodes: [],
|
|
13
|
+
items: [],
|
|
14
|
+
totals: {
|
|
15
|
+
subtotal: money(0, currencyCode),
|
|
16
|
+
tax: money(0, currencyCode),
|
|
17
|
+
discount: money(0, currencyCode),
|
|
18
|
+
total: money(0, currencyCode)
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function recalculateTotals(items, currencyCode) {
|
|
23
|
+
const subtotal = items.reduce((sum, item) => sum + item.unitPrice.amount * item.quantity, 0);
|
|
24
|
+
return {
|
|
25
|
+
subtotal: money(subtotal, currencyCode),
|
|
26
|
+
tax: money(0, currencyCode),
|
|
27
|
+
discount: money(0, currencyCode),
|
|
28
|
+
total: money(subtotal, currencyCode)
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function createMockCartAdapter(options = {}) {
|
|
32
|
+
const { currencyCode = "USD", delay = 0 } = options;
|
|
33
|
+
let cart = createEmptyCart(currencyCode);
|
|
34
|
+
if (options.initialItems) {
|
|
35
|
+
cart.items = [...options.initialItems];
|
|
36
|
+
cart.totals = recalculateTotals(cart.items, currencyCode);
|
|
37
|
+
}
|
|
38
|
+
async function wait() {
|
|
39
|
+
if (delay > 0) await new Promise((r) => setTimeout(r, delay));
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
async getCart() {
|
|
43
|
+
await wait();
|
|
44
|
+
return { ...cart };
|
|
45
|
+
},
|
|
46
|
+
async addItem(productVariantId, quantity) {
|
|
47
|
+
await wait();
|
|
48
|
+
const newItem = {
|
|
49
|
+
id: `mock-item-${nextItemId++}`,
|
|
50
|
+
productVariantId,
|
|
51
|
+
displayName: `Product ${productVariantId}`,
|
|
52
|
+
unitPrice: money(1e3, currencyCode),
|
|
53
|
+
quantity
|
|
54
|
+
};
|
|
55
|
+
cart.items = [...cart.items, newItem];
|
|
56
|
+
cart.totals = recalculateTotals(cart.items, currencyCode);
|
|
57
|
+
return { ...cart };
|
|
58
|
+
},
|
|
59
|
+
async updateItem(itemId, quantity) {
|
|
60
|
+
await wait();
|
|
61
|
+
cart.items = cart.items.map((item) => item.id === itemId ? { ...item, quantity } : item);
|
|
62
|
+
cart.totals = recalculateTotals(cart.items, currencyCode);
|
|
63
|
+
return { ...cart };
|
|
64
|
+
},
|
|
65
|
+
async removeItem(itemId) {
|
|
66
|
+
await wait();
|
|
67
|
+
cart.items = cart.items.filter((item) => item.id !== itemId);
|
|
68
|
+
cart.totals = recalculateTotals(cart.items, currencyCode);
|
|
69
|
+
return { ...cart };
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
export {
|
|
74
|
+
createMockCartAdapter
|
|
75
|
+
};
|
|
76
|
+
//# sourceMappingURL=mock.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/client/cart/adapters/mock.ts"],"sourcesContent":["import type { CartAdapter, Cart, CartItem, Money } from \"../types/adapter\";\n\nfunction money(amount: number, currencyCode = \"USD\"): Money {\n return { amount, currencyCode };\n}\n\nlet nextItemId = 1;\n\nfunction createEmptyCart(currencyCode = \"USD\"): Cart {\n return {\n id: \"mock-cart\",\n countryCode: \"US\",\n currencyCode,\n languageCode: \"en\",\n taxIncludedInPrice: false,\n discountCodes: [],\n items: [],\n totals: {\n subtotal: money(0, currencyCode),\n tax: money(0, currencyCode),\n discount: money(0, currencyCode),\n total: money(0, currencyCode),\n },\n };\n}\n\nfunction recalculateTotals(items: CartItem[], currencyCode: string): Cart[\"totals\"] {\n const subtotal = items.reduce((sum, item) => sum + item.unitPrice.amount * item.quantity, 0);\n return {\n subtotal: money(subtotal, currencyCode),\n tax: money(0, currencyCode),\n discount: money(0, currencyCode),\n total: money(subtotal, currencyCode),\n };\n}\n\nexport interface MockCartAdapterOptions {\n /** Initial items to populate the cart with. */\n initialItems?: CartItem[];\n /** Currency code. Defaults to \"USD\". */\n currencyCode?: string;\n /** Simulated network delay in ms. Defaults to 0. */\n delay?: number;\n}\n\n/**\n * In-memory cart adapter for testing and development.\n *\n * ```ts\n * import { createMockCartAdapter } from \"@enadhq/enad-react-sdk/client/cart/mock-adapter\"\n *\n * const adapter = createMockCartAdapter({ delay: 200 })\n * ```\n */\nexport function createMockCartAdapter(options: MockCartAdapterOptions = {}): CartAdapter {\n const { currencyCode = \"USD\", delay = 0 } = options;\n let cart = createEmptyCart(currencyCode);\n\n if (options.initialItems) {\n cart.items = [...options.initialItems];\n cart.totals = recalculateTotals(cart.items, currencyCode);\n }\n\n async function wait() {\n if (delay > 0) await new Promise((r) => setTimeout(r, delay));\n }\n\n return {\n async getCart(): Promise<Cart> {\n await wait();\n return { ...cart };\n },\n\n async addItem(productVariantId: string, quantity: number): Promise<Cart> {\n await wait();\n const newItem: CartItem = {\n id: `mock-item-${nextItemId++}`,\n productVariantId,\n displayName: `Product ${productVariantId}`,\n unitPrice: money(1000, currencyCode),\n quantity,\n };\n cart.items = [...cart.items, newItem];\n cart.totals = recalculateTotals(cart.items, currencyCode);\n return { ...cart };\n },\n\n async updateItem(itemId: string, quantity: number): Promise<Cart> {\n await wait();\n cart.items = cart.items.map((item) => (item.id === itemId ? { ...item, quantity } : item));\n cart.totals = recalculateTotals(cart.items, currencyCode);\n return { ...cart };\n },\n\n async removeItem(itemId: string): Promise<Cart> {\n await wait();\n cart.items = cart.items.filter((item) => item.id !== itemId);\n cart.totals = recalculateTotals(cart.items, currencyCode);\n return { ...cart };\n },\n };\n}\n"],"mappings":"AAEA,SAAS,MAAM,QAAgB,eAAe,OAAc;AAC1D,SAAO,EAAE,QAAQ,aAAa;AAChC;AAEA,IAAI,aAAa;AAEjB,SAAS,gBAAgB,eAAe,OAAa;AACnD,SAAO;AAAA,IACL,IAAI;AAAA,IACJ,aAAa;AAAA,IACb;AAAA,IACA,cAAc;AAAA,IACd,oBAAoB;AAAA,IACpB,eAAe,CAAC;AAAA,IAChB,OAAO,CAAC;AAAA,IACR,QAAQ;AAAA,MACN,UAAU,MAAM,GAAG,YAAY;AAAA,MAC/B,KAAK,MAAM,GAAG,YAAY;AAAA,MAC1B,UAAU,MAAM,GAAG,YAAY;AAAA,MAC/B,OAAO,MAAM,GAAG,YAAY;AAAA,IAC9B;AAAA,EACF;AACF;AAEA,SAAS,kBAAkB,OAAmB,cAAsC;AAClF,QAAM,WAAW,MAAM,OAAO,CAAC,KAAK,SAAS,MAAM,KAAK,UAAU,SAAS,KAAK,UAAU,CAAC;AAC3F,SAAO;AAAA,IACL,UAAU,MAAM,UAAU,YAAY;AAAA,IACtC,KAAK,MAAM,GAAG,YAAY;AAAA,IAC1B,UAAU,MAAM,GAAG,YAAY;AAAA,IAC/B,OAAO,MAAM,UAAU,YAAY;AAAA,EACrC;AACF;AAoBO,SAAS,sBAAsB,UAAkC,CAAC,GAAgB;AACvF,QAAM,EAAE,eAAe,OAAO,QAAQ,EAAE,IAAI;AAC5C,MAAI,OAAO,gBAAgB,YAAY;AAEvC,MAAI,QAAQ,cAAc;AACxB,SAAK,QAAQ,CAAC,GAAG,QAAQ,YAAY;AACrC,SAAK,SAAS,kBAAkB,KAAK,OAAO,YAAY;AAAA,EAC1D;AAEA,iBAAe,OAAO;AACpB,QAAI,QAAQ,EAAG,OAAM,IAAI,QAAQ,CAAC,MAAM,WAAW,GAAG,KAAK,CAAC;AAAA,EAC9D;AAEA,SAAO;AAAA,IACL,MAAM,UAAyB;AAC7B,YAAM,KAAK;AACX,aAAO,EAAE,GAAG,KAAK;AAAA,IACnB;AAAA,IAEA,MAAM,QAAQ,kBAA0B,UAAiC;AACvE,YAAM,KAAK;AACX,YAAM,UAAoB;AAAA,QACxB,IAAI,aAAa,YAAY;AAAA,QAC7B;AAAA,QACA,aAAa,WAAW,gBAAgB;AAAA,QACxC,WAAW,MAAM,KAAM,YAAY;AAAA,QACnC;AAAA,MACF;AACA,WAAK,QAAQ,CAAC,GAAG,KAAK,OAAO,OAAO;AACpC,WAAK,SAAS,kBAAkB,KAAK,OAAO,YAAY;AACxD,aAAO,EAAE,GAAG,KAAK;AAAA,IACnB;AAAA,IAEA,MAAM,WAAW,QAAgB,UAAiC;AAChE,YAAM,KAAK;AACX,WAAK,QAAQ,KAAK,MAAM,IAAI,CAAC,SAAU,KAAK,OAAO,SAAS,EAAE,GAAG,MAAM,SAAS,IAAI,IAAK;AACzF,WAAK,SAAS,kBAAkB,KAAK,OAAO,YAAY;AACxD,aAAO,EAAE,GAAG,KAAK;AAAA,IACnB;AAAA,IAEA,MAAM,WAAW,QAA+B;AAC9C,YAAM,KAAK;AACX,WAAK,QAAQ,KAAK,MAAM,OAAO,CAAC,SAAS,KAAK,OAAO,MAAM;AAC3D,WAAK,SAAS,kBAAkB,KAAK,OAAO,YAAY;AACxD,aAAO,EAAE,GAAG,KAAK;AAAA,IACnB;AAAA,EACF;AACF;","names":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface CartDrawerProps {
|
|
2
|
+
isOpen: boolean;
|
|
3
|
+
onClose: () => void;
|
|
4
|
+
className?: string;
|
|
5
|
+
labels?: {
|
|
6
|
+
title?: string;
|
|
7
|
+
emptyCartMessage?: string;
|
|
8
|
+
continueShopping?: string;
|
|
9
|
+
subtotal?: string;
|
|
10
|
+
discount?: string;
|
|
11
|
+
tax?: string;
|
|
12
|
+
total?: string;
|
|
13
|
+
proceedToCheckout?: string;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export declare function CartDrawer({ isOpen, onClose, className, labels }: CartDrawerProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
//# sourceMappingURL=cart-drawer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cart-drawer.d.ts","sourceRoot":"","sources":["../../../../src/client/cart/components/cart-drawer.tsx"],"names":[],"mappings":"AASA,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE;QACP,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,iBAAiB,CAAC,EAAE,MAAM,CAAC;KAC5B,CAAC;CACH;AAySD,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAW,EAAE,EAAE,eAAe,2CAsFtF"}
|