@enadhq/enad-react-sdk 0.0.6 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +288 -0
- package/dist/client/cart/adapters/brink.d.ts +29 -0
- package/dist/client/cart/adapters/brink.d.ts.map +1 -0
- package/dist/client/cart/adapters/brink.mjs +154 -0
- package/dist/client/cart/adapters/brink.mjs.map +1 -0
- package/dist/client/cart/adapters/index.d.ts +3 -0
- package/dist/client/cart/adapters/index.d.ts.map +1 -0
- package/dist/client/cart/adapters/index.mjs +5 -0
- package/dist/client/cart/adapters/index.mjs.map +1 -0
- package/dist/client/cart/adapters/mock.d.ts +20 -0
- package/dist/client/cart/adapters/mock.d.ts.map +1 -0
- package/dist/client/cart/adapters/mock.mjs +76 -0
- package/dist/client/cart/adapters/mock.mjs.map +1 -0
- package/dist/client/cart/components/{cart-drawer.d.mts → cart-drawer.d.ts} +4 -6
- package/dist/client/cart/components/cart-drawer.d.ts.map +1 -0
- package/dist/client/cart/components/cart-drawer.mjs +269 -138
- package/dist/client/cart/components/cart-drawer.mjs.map +1 -1
- package/dist/client/cart/components/cart-trigger.d.ts +10 -0
- package/dist/client/cart/components/cart-trigger.d.ts.map +1 -0
- package/dist/client/cart/components/cart-trigger.mjs +26 -10
- package/dist/client/cart/components/cart-trigger.mjs.map +1 -1
- package/dist/client/cart/components/promo-code-input.d.ts +16 -0
- package/dist/client/cart/components/promo-code-input.d.ts.map +1 -0
- package/dist/client/cart/components/promo-code-input.mjs +92 -0
- package/dist/client/cart/components/promo-code-input.mjs.map +1 -0
- package/dist/client/cart/constants/session.d.ts +2 -0
- package/dist/client/cart/constants/session.d.ts.map +1 -0
- package/dist/client/cart/contexts/cart.d.ts +36 -0
- package/dist/client/cart/contexts/cart.d.ts.map +1 -0
- package/dist/client/cart/contexts/cart.mjs +14 -16
- package/dist/client/cart/contexts/cart.mjs.map +1 -1
- package/dist/client/cart/hooks/useCart.d.ts +26 -0
- package/dist/client/cart/hooks/useCart.d.ts.map +1 -0
- package/dist/client/cart/hooks/useCart.mjs +5 -6
- package/dist/client/cart/hooks/useCart.mjs.map +1 -1
- package/dist/client/cart/hooks/useCartActions.d.ts +25 -0
- package/dist/client/cart/hooks/useCartActions.d.ts.map +1 -0
- package/dist/client/cart/hooks/useCartActions.mjs +7 -16
- package/dist/client/cart/hooks/useCartActions.mjs.map +1 -1
- package/dist/client/cart/index.d.ts +12 -0
- package/dist/client/cart/index.d.ts.map +1 -0
- package/dist/client/cart/index.mjs +16 -0
- package/dist/client/cart/index.mjs.map +1 -0
- package/dist/client/cart/queries/addToCartQueryFn.d.ts +7 -0
- package/dist/client/cart/queries/addToCartQueryFn.d.ts.map +1 -0
- package/dist/client/cart/queries/addToCartQueryFn.mjs.map +1 -1
- package/dist/client/cart/queries/getCartQueryFn.d.ts +4 -0
- package/dist/client/cart/queries/getCartQueryFn.d.ts.map +1 -0
- package/dist/client/cart/queries/getCartQueryFn.mjs.map +1 -1
- package/dist/client/cart/queries/removeCartItemQueryFn.d.ts +6 -0
- package/dist/client/cart/queries/removeCartItemQueryFn.d.ts.map +1 -0
- package/dist/client/cart/queries/removeCartItemQueryFn.mjs.map +1 -1
- package/dist/client/cart/queries/updateCartItemQueryFn.d.ts +7 -0
- package/dist/client/cart/queries/updateCartItemQueryFn.d.ts.map +1 -0
- package/dist/client/cart/queries/updateCartItemQueryFn.mjs.map +1 -1
- package/dist/client/cart/types/adapter.d.ts +110 -0
- package/dist/client/cart/types/adapter.d.ts.map +1 -0
- package/dist/client/cart/types/adapter.mjs +12 -0
- package/dist/client/cart/types/adapter.mjs.map +1 -0
- package/dist/client/cart/types/{cart.d.mts → cart.d.ts} +21 -5
- package/dist/client/cart/types/cart.d.ts.map +1 -0
- package/dist/client/cart/utils/session.d.ts +5 -0
- package/dist/client/cart/utils/session.d.ts.map +1 -0
- package/dist/client/cart/utils/session.mjs +1 -1
- package/dist/client/cart/utils/session.mjs.map +1 -1
- package/dist/client/cms/storyblok/preview/registerStoryblokBridge.d.ts +7 -0
- package/dist/client/cms/storyblok/preview/registerStoryblokBridge.d.ts.map +1 -0
- package/dist/client/cms/storyblok/preview/registerStoryblokBridge.mjs +3 -2
- package/dist/client/cms/storyblok/preview/registerStoryblokBridge.mjs.map +1 -1
- package/dist/client/cms/storyblok/preview/{storyblok-preview-syncer.d.mts → storyblok-preview-syncer.d.ts} +4 -6
- package/dist/client/cms/storyblok/preview/storyblok-preview-syncer.d.ts.map +1 -0
- package/dist/client/cms/storyblok/preview/storyblok-preview-syncer.mjs.map +1 -1
- package/dist/client/global/auth/withAuth.d.ts +5 -0
- package/dist/client/global/auth/withAuth.d.ts.map +1 -0
- package/dist/client/global/components/error-boundary.d.ts +18 -0
- package/dist/client/global/components/error-boundary.d.ts.map +1 -0
- package/dist/client/global/components/error-boundary.mjs +41 -0
- package/dist/client/global/components/error-boundary.mjs.map +1 -0
- package/dist/client/global/config/{index.d.mts → index.d.ts} +3 -3
- package/dist/client/global/config/index.d.ts.map +1 -0
- package/dist/client/global/constants/{tags.d.mts → tags.d.ts} +2 -3
- package/dist/client/global/constants/tags.d.ts.map +1 -0
- package/dist/client/global/index.d.ts +6 -0
- package/dist/client/global/index.d.ts.map +1 -0
- package/dist/client/global/index.mjs +7 -0
- package/dist/client/global/index.mjs.map +1 -0
- package/dist/client/global/providers/enad-provider.d.ts +48 -0
- package/dist/client/global/providers/enad-provider.d.ts.map +1 -0
- package/dist/client/global/providers/enad-provider.mjs +32 -3
- package/dist/client/global/providers/enad-provider.mjs.map +1 -1
- package/dist/client/icons/adapters/hugeicons.d.ts +9 -0
- package/dist/client/icons/adapters/hugeicons.d.ts.map +1 -0
- package/dist/client/icons/adapters/hugeicons.mjs +117 -0
- package/dist/client/icons/adapters/hugeicons.mjs.map +1 -0
- package/dist/client/icons/adapters/lucide.d.ts +8 -0
- package/dist/client/icons/adapters/lucide.d.ts.map +1 -0
- package/dist/client/icons/adapters/lucide.mjs +108 -0
- package/dist/client/icons/adapters/lucide.mjs.map +1 -0
- package/dist/client/icons/adapters/phosphor.d.ts +11 -0
- package/dist/client/icons/adapters/phosphor.d.ts.map +1 -0
- package/dist/client/icons/adapters/phosphor.mjs +108 -0
- package/dist/client/icons/adapters/phosphor.mjs.map +1 -0
- package/dist/client/icons/icon-context.d.ts +13 -0
- package/dist/client/icons/icon-context.d.ts.map +1 -0
- package/dist/client/icons/icon-context.mjs +27 -0
- package/dist/client/icons/icon-context.mjs.map +1 -0
- package/dist/client/icons/index.d.ts +9 -0
- package/dist/client/icons/index.d.ts.map +1 -0
- package/dist/client/icons/index.mjs +16 -0
- package/dist/client/icons/index.mjs.map +1 -0
- package/dist/client/icons/types.d.ts +60 -0
- package/dist/client/icons/types.d.ts.map +1 -0
- package/dist/client/icons/types.mjs +1 -0
- package/dist/client/icons/types.mjs.map +1 -0
- package/dist/client/motion/config.d.ts +42 -0
- package/dist/client/motion/config.d.ts.map +1 -0
- package/dist/client/motion/config.mjs +44 -0
- package/dist/client/motion/config.mjs.map +1 -0
- package/dist/client/motion/hover.d.ts +36 -0
- package/dist/client/motion/hover.d.ts.map +1 -0
- package/dist/client/motion/hover.mjs +19 -0
- package/dist/client/motion/hover.mjs.map +1 -0
- package/dist/client/motion/index.d.ts +4 -0
- package/dist/client/motion/index.d.ts.map +1 -0
- package/dist/client/motion/index.mjs +13 -0
- package/dist/client/motion/index.mjs.map +1 -0
- package/dist/client/motion/stagger.d.ts +36 -0
- package/dist/client/motion/stagger.d.ts.map +1 -0
- package/dist/client/motion/stagger.mjs +17 -0
- package/dist/client/motion/stagger.mjs.map +1 -0
- package/dist/client/search/actions/searchAction.d.ts +2 -0
- package/dist/client/search/actions/searchAction.d.ts.map +1 -0
- package/dist/client/search/actions/searchAction.mjs.map +1 -1
- package/dist/client/search/components/search-bar.d.ts +8 -0
- package/dist/client/search/components/search-bar.d.ts.map +1 -0
- package/dist/client/search/components/search-bar.mjs +33 -0
- package/dist/client/search/components/search-bar.mjs.map +1 -1
- package/dist/client/search/hooks/useSearch.d.ts +14 -0
- package/dist/client/search/hooks/useSearch.d.ts.map +1 -0
- package/dist/client/search/hooks/useSearch.mjs +1 -1
- package/dist/client/search/hooks/useSearch.mjs.map +1 -1
- package/dist/client/search/index.d.ts +2 -0
- package/dist/client/search/index.d.ts.map +1 -0
- package/dist/client/search/index.mjs +5 -0
- package/dist/client/search/index.mjs.map +1 -0
- package/dist/client/storefront/blocks/accordion-block.d.ts +4 -0
- package/dist/client/storefront/blocks/accordion-block.d.ts.map +1 -0
- package/dist/client/storefront/blocks/accordion-block.mjs +43 -0
- package/dist/client/storefront/blocks/accordion-block.mjs.map +1 -0
- package/dist/client/storefront/blocks/card-image-with-caption.d.ts +4 -0
- package/dist/client/storefront/blocks/card-image-with-caption.d.ts.map +1 -0
- package/dist/client/storefront/blocks/card-image-with-caption.mjs +27 -0
- package/dist/client/storefront/blocks/card-image-with-caption.mjs.map +1 -0
- package/dist/client/storefront/blocks/card-video.d.ts +4 -0
- package/dist/client/storefront/blocks/card-video.d.ts.map +1 -0
- package/dist/client/storefront/blocks/card-video.mjs +43 -0
- package/dist/client/storefront/blocks/card-video.mjs.map +1 -0
- package/dist/client/storefront/blocks/content-with-gallery.d.ts +4 -0
- package/dist/client/storefront/blocks/content-with-gallery.d.ts.map +1 -0
- package/dist/client/storefront/blocks/content-with-gallery.mjs +48 -0
- package/dist/client/storefront/blocks/content-with-gallery.mjs.map +1 -0
- package/dist/client/storefront/blocks/content-with-image-product-data.d.ts +4 -0
- package/dist/client/storefront/blocks/content-with-image-product-data.d.ts.map +1 -0
- package/dist/client/storefront/blocks/content-with-image-product-data.mjs +45 -0
- package/dist/client/storefront/blocks/content-with-image-product-data.mjs.map +1 -0
- package/dist/client/storefront/blocks/gallery-with-caption.d.ts +4 -0
- package/dist/client/storefront/blocks/gallery-with-caption.d.ts.map +1 -0
- package/dist/client/storefront/blocks/gallery-with-caption.mjs +36 -0
- package/dist/client/storefront/blocks/gallery-with-caption.mjs.map +1 -0
- package/dist/client/storefront/blocks/gallery-with-link-blocks.d.ts +4 -0
- package/dist/client/storefront/blocks/gallery-with-link-blocks.d.ts.map +1 -0
- package/dist/client/storefront/blocks/gallery-with-link-blocks.mjs +24 -0
- package/dist/client/storefront/blocks/gallery-with-link-blocks.mjs.map +1 -0
- package/dist/client/storefront/blocks/gallery.d.ts +4 -0
- package/dist/client/storefront/blocks/gallery.d.ts.map +1 -0
- package/dist/client/storefront/blocks/gallery.mjs +47 -0
- package/dist/client/storefront/blocks/gallery.mjs.map +1 -0
- package/dist/client/storefront/blocks/hero.d.ts +4 -0
- package/dist/client/storefront/blocks/hero.d.ts.map +1 -0
- package/dist/client/storefront/blocks/hero.mjs +357 -0
- package/dist/client/storefront/blocks/hero.mjs.map +1 -0
- package/dist/client/storefront/blocks/image-block.d.ts +4 -0
- package/dist/client/storefront/blocks/image-block.d.ts.map +1 -0
- package/dist/client/storefront/blocks/image-block.mjs +29 -0
- package/dist/client/storefront/blocks/image-block.mjs.map +1 -0
- package/dist/client/storefront/blocks/index.d.ts +20 -0
- package/dist/client/storefront/blocks/index.d.ts.map +1 -0
- package/dist/client/storefront/blocks/index.mjs +41 -0
- package/dist/client/storefront/blocks/index.mjs.map +1 -0
- package/dist/client/storefront/blocks/link-block-small.d.ts +4 -0
- package/dist/client/storefront/blocks/link-block-small.d.ts.map +1 -0
- package/dist/client/storefront/blocks/link-block-small.mjs +35 -0
- package/dist/client/storefront/blocks/link-block-small.mjs.map +1 -0
- package/dist/client/storefront/blocks/link-block.d.ts +4 -0
- package/dist/client/storefront/blocks/link-block.d.ts.map +1 -0
- package/dist/client/storefront/blocks/link-block.mjs +150 -0
- package/dist/client/storefront/blocks/link-block.mjs.map +1 -0
- package/dist/client/storefront/blocks/product-card.d.ts +4 -0
- package/dist/client/storefront/blocks/product-card.d.ts.map +1 -0
- package/dist/client/storefront/blocks/product-card.mjs +228 -0
- package/dist/client/storefront/blocks/product-card.mjs.map +1 -0
- package/dist/client/storefront/blocks/product-image.d.ts +4 -0
- package/dist/client/storefront/blocks/product-image.d.ts.map +1 -0
- package/dist/client/storefront/blocks/product-image.mjs +109 -0
- package/dist/client/storefront/blocks/product-image.mjs.map +1 -0
- package/dist/client/storefront/blocks/spacer.d.ts +4 -0
- package/dist/client/storefront/blocks/spacer.d.ts.map +1 -0
- package/dist/client/storefront/blocks/spacer.mjs +14 -0
- package/dist/client/storefront/blocks/spacer.mjs.map +1 -0
- package/dist/client/storefront/blocks/text-content-with-image.d.ts +4 -0
- package/dist/client/storefront/blocks/text-content-with-image.d.ts.map +1 -0
- package/dist/client/storefront/blocks/text-content-with-image.mjs +225 -0
- package/dist/client/storefront/blocks/text-content-with-image.mjs.map +1 -0
- package/dist/client/storefront/blocks/text-content.d.ts +4 -0
- package/dist/client/storefront/blocks/text-content.d.ts.map +1 -0
- package/dist/client/storefront/blocks/text-content.mjs +150 -0
- package/dist/client/storefront/blocks/text-content.mjs.map +1 -0
- package/dist/client/storefront/blocks/truncated-text.d.ts +4 -0
- package/dist/client/storefront/blocks/truncated-text.d.ts.map +1 -0
- package/dist/client/storefront/blocks/truncated-text.mjs +36 -0
- package/dist/client/storefront/blocks/truncated-text.mjs.map +1 -0
- package/dist/client/storefront/blocks/variable-text-content.d.ts +4 -0
- package/dist/client/storefront/blocks/variable-text-content.d.ts.map +1 -0
- package/dist/client/storefront/blocks/variable-text-content.mjs +15 -0
- package/dist/client/storefront/blocks/variable-text-content.mjs.map +1 -0
- package/dist/client/storefront/carousel/index.d.ts +2 -0
- package/dist/client/storefront/carousel/index.d.ts.map +1 -0
- package/dist/client/storefront/carousel/index.mjs +5 -0
- package/dist/client/storefront/carousel/index.mjs.map +1 -0
- package/dist/client/storefront/carousel/swipeable-carousel.d.ts +14 -0
- package/dist/client/storefront/carousel/swipeable-carousel.d.ts.map +1 -0
- package/dist/client/storefront/carousel/swipeable-carousel.mjs +80 -0
- package/dist/client/storefront/carousel/swipeable-carousel.mjs.map +1 -0
- package/dist/client/storefront/checkout/address-form.d.ts +31 -0
- package/dist/client/storefront/checkout/address-form.d.ts.map +1 -0
- package/dist/client/storefront/checkout/address-form.mjs +124 -0
- package/dist/client/storefront/checkout/address-form.mjs.map +1 -0
- package/dist/client/storefront/checkout/cart-summary.d.ts +40 -0
- package/dist/client/storefront/checkout/cart-summary.d.ts.map +1 -0
- package/dist/client/storefront/checkout/cart-summary.mjs +150 -0
- package/dist/client/storefront/checkout/cart-summary.mjs.map +1 -0
- package/dist/client/storefront/checkout/checkout-stepper.d.ts +13 -0
- package/dist/client/storefront/checkout/checkout-stepper.d.ts.map +1 -0
- package/dist/client/storefront/checkout/checkout-stepper.mjs +58 -0
- package/dist/client/storefront/checkout/checkout-stepper.mjs.map +1 -0
- package/dist/client/storefront/checkout/index.d.ts +15 -0
- package/dist/client/storefront/checkout/index.d.ts.map +1 -0
- package/dist/client/storefront/checkout/index.mjs +17 -0
- package/dist/client/storefront/checkout/index.mjs.map +1 -0
- package/dist/client/storefront/checkout/order-confirmation.d.ts +10 -0
- package/dist/client/storefront/checkout/order-confirmation.d.ts.map +1 -0
- package/dist/client/storefront/checkout/order-confirmation.mjs +27 -0
- package/dist/client/storefront/checkout/order-confirmation.mjs.map +1 -0
- package/dist/client/storefront/checkout/order-summary.d.ts +29 -0
- package/dist/client/storefront/checkout/order-summary.d.ts.map +1 -0
- package/dist/client/storefront/checkout/order-summary.mjs +106 -0
- package/dist/client/storefront/checkout/order-summary.mjs.map +1 -0
- package/dist/client/storefront/checkout/payment-method-selector.d.ts +18 -0
- package/dist/client/storefront/checkout/payment-method-selector.d.ts.map +1 -0
- package/dist/client/storefront/checkout/payment-method-selector.mjs +61 -0
- package/dist/client/storefront/checkout/payment-method-selector.mjs.map +1 -0
- package/dist/client/storefront/checkout/shipping-method-selector.d.ts +23 -0
- package/dist/client/storefront/checkout/shipping-method-selector.d.ts.map +1 -0
- package/dist/client/storefront/checkout/shipping-method-selector.mjs +77 -0
- package/dist/client/storefront/checkout/shipping-method-selector.mjs.map +1 -0
- package/dist/client/storefront/components/badge.d.ts +8 -0
- package/dist/client/storefront/components/badge.d.ts.map +1 -0
- package/dist/client/storefront/components/badge.mjs +28 -0
- package/dist/client/storefront/components/badge.mjs.map +1 -0
- package/dist/client/storefront/components/country-redirect.d.ts +30 -0
- package/dist/client/storefront/components/country-redirect.d.ts.map +1 -0
- package/dist/client/storefront/components/country-redirect.mjs +121 -0
- package/dist/client/storefront/components/country-redirect.mjs.map +1 -0
- package/dist/client/storefront/components/empty-state.d.ts +38 -0
- package/dist/client/storefront/components/empty-state.d.ts.map +1 -0
- package/dist/client/storefront/components/empty-state.mjs +55 -0
- package/dist/client/storefront/components/empty-state.mjs.map +1 -0
- package/dist/client/storefront/components/image-lightbox.d.ts +13 -0
- package/dist/client/storefront/components/image-lightbox.d.ts.map +1 -0
- package/dist/client/storefront/components/image-lightbox.mjs +275 -0
- package/dist/client/storefront/components/image-lightbox.mjs.map +1 -0
- package/dist/client/storefront/components/infinite-scroll.d.ts +37 -0
- package/dist/client/storefront/components/infinite-scroll.d.ts.map +1 -0
- package/dist/client/storefront/components/infinite-scroll.mjs +83 -0
- package/dist/client/storefront/components/infinite-scroll.mjs.map +1 -0
- package/dist/client/storefront/components/language-selector.d.ts +5 -0
- package/dist/client/storefront/components/language-selector.d.ts.map +1 -0
- package/dist/client/storefront/components/language-selector.mjs +58 -0
- package/dist/client/storefront/components/language-selector.mjs.map +1 -0
- package/dist/client/storefront/components/newsletter-signup.d.ts +14 -0
- package/dist/client/storefront/components/newsletter-signup.d.ts.map +1 -0
- package/dist/client/storefront/components/newsletter-signup.mjs +81 -0
- package/dist/client/storefront/components/newsletter-signup.mjs.map +1 -0
- package/dist/client/storefront/components/price.d.ts +14 -0
- package/dist/client/storefront/components/price.d.ts.map +1 -0
- package/dist/client/storefront/components/price.mjs +46 -0
- package/dist/client/storefront/components/price.mjs.map +1 -0
- package/dist/client/storefront/components/product-recommendations.d.ts +18 -0
- package/dist/client/storefront/components/product-recommendations.d.ts.map +1 -0
- package/dist/client/storefront/components/product-recommendations.mjs +108 -0
- package/dist/client/storefront/components/product-recommendations.mjs.map +1 -0
- package/dist/client/storefront/components/product-tabs.d.ts +12 -0
- package/dist/client/storefront/components/product-tabs.d.ts.map +1 -0
- package/dist/client/storefront/components/product-tabs.mjs +64 -0
- package/dist/client/storefront/components/product-tabs.mjs.map +1 -0
- package/dist/client/storefront/components/quick-view.d.ts +25 -0
- package/dist/client/storefront/components/quick-view.d.ts.map +1 -0
- package/dist/client/storefront/components/quick-view.mjs +149 -0
- package/dist/client/storefront/components/quick-view.mjs.map +1 -0
- package/dist/client/storefront/components/review-summary.d.ts +17 -0
- package/dist/client/storefront/components/review-summary.d.ts.map +1 -0
- package/dist/client/storefront/components/review-summary.mjs +66 -0
- package/dist/client/storefront/components/review-summary.mjs.map +1 -0
- package/dist/client/storefront/components/search-autocomplete.d.ts +25 -0
- package/dist/client/storefront/components/search-autocomplete.d.ts.map +1 -0
- package/dist/client/storefront/components/search-autocomplete.mjs +183 -0
- package/dist/client/storefront/components/search-autocomplete.mjs.map +1 -0
- package/dist/client/storefront/components/section-nav.d.ts +20 -0
- package/dist/client/storefront/components/section-nav.d.ts.map +1 -0
- package/dist/client/storefront/components/section-nav.mjs +175 -0
- package/dist/client/storefront/components/section-nav.mjs.map +1 -0
- package/dist/client/storefront/components/share-button.d.ts +19 -0
- package/dist/client/storefront/components/share-button.d.ts.map +1 -0
- package/dist/client/storefront/components/share-button.mjs +95 -0
- package/dist/client/storefront/components/share-button.mjs.map +1 -0
- package/dist/client/storefront/components/skeleton.d.ts +12 -0
- package/dist/client/storefront/components/skeleton.d.ts.map +1 -0
- package/dist/client/storefront/components/skeleton.mjs +70 -0
- package/dist/client/storefront/components/skeleton.mjs.map +1 -0
- package/dist/client/storefront/components/star-rating.d.ts +13 -0
- package/dist/client/storefront/components/star-rating.d.ts.map +1 -0
- package/dist/client/storefront/components/star-rating.mjs +240 -0
- package/dist/client/storefront/components/star-rating.mjs.map +1 -0
- package/dist/client/storefront/components/testimonial.d.ts +20 -0
- package/dist/client/storefront/components/testimonial.d.ts.map +1 -0
- package/dist/client/storefront/components/testimonial.mjs +53 -0
- package/dist/client/storefront/components/testimonial.mjs.map +1 -0
- package/dist/client/storefront/components/trust-badges.d.ts +14 -0
- package/dist/client/storefront/components/trust-badges.d.ts.map +1 -0
- package/dist/client/storefront/components/trust-badges.mjs +25 -0
- package/dist/client/storefront/components/trust-badges.mjs.map +1 -0
- package/dist/client/storefront/components/variant-selector.d.ts +21 -0
- package/dist/client/storefront/components/variant-selector.d.ts.map +1 -0
- package/dist/client/storefront/components/variant-selector.mjs +41 -0
- package/dist/client/storefront/components/variant-selector.mjs.map +1 -0
- package/dist/client/storefront/components/wishlist-toggle.d.ts +12 -0
- package/dist/client/storefront/components/wishlist-toggle.d.ts.map +1 -0
- package/dist/client/storefront/components/wishlist-toggle.mjs +58 -0
- package/dist/client/storefront/components/wishlist-toggle.mjs.map +1 -0
- package/dist/client/storefront/filters/filter-chip.d.ts +10 -0
- package/dist/client/storefront/filters/filter-chip.d.ts.map +1 -0
- package/dist/client/storefront/filters/filter-chip.mjs +30 -0
- package/dist/client/storefront/filters/filter-chip.mjs.map +1 -0
- package/dist/client/storefront/filters/filter-group.d.ts +22 -0
- package/dist/client/storefront/filters/filter-group.d.ts.map +1 -0
- package/dist/client/storefront/filters/filter-group.mjs +102 -0
- package/dist/client/storefront/filters/filter-group.mjs.map +1 -0
- package/dist/client/storefront/filters/filter-panel.d.ts +25 -0
- package/dist/client/storefront/filters/filter-panel.d.ts.map +1 -0
- package/dist/client/storefront/filters/filter-panel.mjs +110 -0
- package/dist/client/storefront/filters/filter-panel.mjs.map +1 -0
- package/dist/client/storefront/filters/index.d.ts +6 -0
- package/dist/client/storefront/filters/index.d.ts.map +1 -0
- package/dist/client/storefront/filters/index.mjs +13 -0
- package/dist/client/storefront/filters/index.mjs.map +1 -0
- package/dist/client/storefront/filters/sort-select.d.ts +12 -0
- package/dist/client/storefront/filters/sort-select.d.ts.map +1 -0
- package/dist/client/storefront/filters/sort-select.mjs +34 -0
- package/dist/client/storefront/filters/sort-select.mjs.map +1 -0
- package/dist/client/storefront/filters/toggle-list-view.d.ts +8 -0
- package/dist/client/storefront/filters/toggle-list-view.d.ts.map +1 -0
- package/dist/client/storefront/filters/toggle-list-view.mjs +30 -0
- package/dist/client/storefront/filters/toggle-list-view.mjs.map +1 -0
- package/dist/client/storefront/hooks/use-section-observer.d.ts +12 -0
- package/dist/client/storefront/hooks/use-section-observer.d.ts.map +1 -0
- package/dist/client/storefront/hooks/use-section-observer.mjs +46 -0
- package/dist/client/storefront/hooks/use-section-observer.mjs.map +1 -0
- package/dist/client/storefront/index.d.ts +24 -0
- package/dist/client/storefront/index.d.ts.map +1 -0
- package/dist/client/storefront/index.mjs +26 -0
- package/dist/client/storefront/index.mjs.map +1 -0
- package/dist/client/storefront/layout/footer.d.ts +4 -0
- package/dist/client/storefront/layout/footer.d.ts.map +1 -0
- package/dist/client/storefront/layout/footer.mjs +56 -0
- package/dist/client/storefront/layout/footer.mjs.map +1 -0
- package/dist/client/storefront/layout/header.d.ts +4 -0
- package/dist/client/storefront/layout/header.d.ts.map +1 -0
- package/dist/client/storefront/layout/header.mjs +367 -0
- package/dist/client/storefront/layout/header.mjs.map +1 -0
- package/dist/client/storefront/layout/index.d.ts +5 -0
- package/dist/client/storefront/layout/index.d.ts.map +1 -0
- package/dist/client/storefront/layout/index.mjs +11 -0
- package/dist/client/storefront/layout/index.mjs.map +1 -0
- package/dist/client/storefront/layout/mobile-menu-drawer.d.ts +4 -0
- package/dist/client/storefront/layout/mobile-menu-drawer.d.ts.map +1 -0
- package/dist/client/storefront/layout/mobile-menu-drawer.mjs +93 -0
- package/dist/client/storefront/layout/mobile-menu-drawer.mjs.map +1 -0
- package/dist/client/storefront/layout/promotion-bar.d.ts +4 -0
- package/dist/client/storefront/layout/promotion-bar.d.ts.map +1 -0
- package/dist/client/storefront/layout/promotion-bar.mjs +79 -0
- package/dist/client/storefront/layout/promotion-bar.mjs.map +1 -0
- package/dist/client/storefront/primitives/breadcrumbs.d.ts +12 -0
- package/dist/client/storefront/primitives/breadcrumbs.d.ts.map +1 -0
- package/dist/client/storefront/primitives/breadcrumbs.mjs +37 -0
- package/dist/client/storefront/primitives/breadcrumbs.mjs.map +1 -0
- package/dist/client/storefront/primitives/button.d.ts +12 -0
- package/dist/client/storefront/primitives/button.d.ts.map +1 -0
- package/dist/client/storefront/primitives/button.mjs +51 -0
- package/dist/client/storefront/primitives/button.mjs.map +1 -0
- package/dist/client/storefront/primitives/checkbox.d.ts +10 -0
- package/dist/client/storefront/primitives/checkbox.d.ts.map +1 -0
- package/dist/client/storefront/primitives/checkbox.mjs +23 -0
- package/dist/client/storefront/primitives/checkbox.mjs.map +1 -0
- package/dist/client/storefront/primitives/download-item.d.ts +9 -0
- package/dist/client/storefront/primitives/download-item.d.ts.map +1 -0
- package/dist/client/storefront/primitives/download-item.mjs +28 -0
- package/dist/client/storefront/primitives/download-item.mjs.map +1 -0
- package/dist/client/storefront/primitives/index.d.ts +10 -0
- package/dist/client/storefront/primitives/index.d.ts.map +1 -0
- package/dist/client/storefront/primitives/index.mjs +21 -0
- package/dist/client/storefront/primitives/index.mjs.map +1 -0
- package/dist/client/storefront/primitives/input.d.ts +18 -0
- package/dist/client/storefront/primitives/input.d.ts.map +1 -0
- package/dist/client/storefront/primitives/input.mjs +118 -0
- package/dist/client/storefront/primitives/input.mjs.map +1 -0
- package/dist/client/storefront/primitives/pagination.d.ts +9 -0
- package/dist/client/storefront/primitives/pagination.d.ts.map +1 -0
- package/dist/client/storefront/primitives/pagination.mjs +86 -0
- package/dist/client/storefront/primitives/pagination.mjs.map +1 -0
- package/dist/client/storefront/primitives/quick-links.d.ts +11 -0
- package/dist/client/storefront/primitives/quick-links.d.ts.map +1 -0
- package/dist/client/storefront/primitives/quick-links.mjs +17 -0
- package/dist/client/storefront/primitives/quick-links.mjs.map +1 -0
- package/dist/client/storefront/primitives/select.d.ts +16 -0
- package/dist/client/storefront/primitives/select.d.ts.map +1 -0
- package/dist/client/storefront/primitives/select.mjs +35 -0
- package/dist/client/storefront/primitives/select.mjs.map +1 -0
- package/dist/client/storefront/primitives/text-link.d.ts +7 -0
- package/dist/client/storefront/primitives/text-link.d.ts.map +1 -0
- package/dist/client/storefront/primitives/text-link.mjs +10 -0
- package/dist/client/storefront/primitives/text-link.mjs.map +1 -0
- package/dist/client/storefront/product/color-swatch.d.ts +10 -0
- package/dist/client/storefront/product/color-swatch.d.ts.map +1 -0
- package/dist/client/storefront/product/color-swatch.mjs +32 -0
- package/dist/client/storefront/product/color-swatch.mjs.map +1 -0
- package/dist/client/storefront/product/index.d.ts +5 -0
- package/dist/client/storefront/product/index.d.ts.map +1 -0
- package/dist/client/storefront/product/index.mjs +11 -0
- package/dist/client/storefront/product/index.mjs.map +1 -0
- package/dist/client/storefront/product/material-selector.d.ts +15 -0
- package/dist/client/storefront/product/material-selector.d.ts.map +1 -0
- package/dist/client/storefront/product/material-selector.mjs +35 -0
- package/dist/client/storefront/product/material-selector.mjs.map +1 -0
- package/dist/client/storefront/product/product-usp.d.ts +7 -0
- package/dist/client/storefront/product/product-usp.d.ts.map +1 -0
- package/dist/client/storefront/product/product-usp.mjs +14 -0
- package/dist/client/storefront/product/product-usp.mjs.map +1 -0
- package/dist/client/storefront/product/quantity-picker.d.ts +10 -0
- package/dist/client/storefront/product/quantity-picker.d.ts.map +1 -0
- package/dist/client/storefront/product/quantity-picker.mjs +56 -0
- package/dist/client/storefront/product/quantity-picker.mjs.map +1 -0
- package/dist/client/storefront/types.d.ts +284 -0
- package/dist/client/storefront/types.d.ts.map +1 -0
- package/dist/client/storefront/types.mjs +20 -0
- package/dist/client/storefront/types.mjs.map +1 -0
- package/dist/client/theme/apply.d.ts +17 -0
- package/dist/client/theme/apply.d.ts.map +1 -0
- package/dist/client/theme/apply.mjs +133 -0
- package/dist/client/theme/apply.mjs.map +1 -0
- package/dist/client/theme/cli.d.ts +2 -0
- package/dist/client/theme/cli.d.ts.map +1 -0
- package/dist/client/theme/cli.mjs +453 -0
- package/dist/client/theme/cli.mjs.map +1 -0
- package/dist/client/theme/codec.d.ts +28 -0
- package/dist/client/theme/codec.d.ts.map +1 -0
- package/dist/client/theme/codec.mjs +88 -0
- package/dist/client/theme/codec.mjs.map +1 -0
- package/dist/client/theme/defaults.d.ts +64 -0
- package/dist/client/theme/defaults.d.ts.map +1 -0
- package/dist/client/theme/defaults.mjs +158 -0
- package/dist/client/theme/defaults.mjs.map +1 -0
- package/dist/client/theme/index.d.ts +8 -0
- package/dist/client/theme/index.d.ts.map +1 -0
- package/dist/client/theme/index.mjs +20 -0
- package/dist/client/theme/index.mjs.map +1 -0
- package/dist/client/theme/scan.d.ts +16 -0
- package/dist/client/theme/scan.d.ts.map +1 -0
- package/dist/client/theme/scan.mjs +25 -0
- package/dist/client/theme/scan.mjs.map +1 -0
- package/dist/client/ui/accordion.d.ts +8 -0
- package/dist/client/ui/accordion.d.ts.map +1 -0
- package/dist/client/ui/accordion.mjs +66 -0
- package/dist/client/ui/accordion.mjs.map +1 -0
- package/dist/client/ui/breadcrumb.d.ts +12 -0
- package/dist/client/ui/breadcrumb.d.ts.map +1 -0
- package/dist/client/ui/breadcrumb.mjs +104 -0
- package/dist/client/ui/breadcrumb.mjs.map +1 -0
- package/dist/client/ui/button.d.ts +11 -0
- package/dist/client/ui/button.d.ts.map +1 -0
- package/dist/client/ui/button.mjs +57 -0
- package/dist/client/ui/button.mjs.map +1 -0
- package/dist/client/ui/card.d.ts +10 -0
- package/dist/client/ui/card.d.ts.map +1 -0
- package/dist/client/ui/card.mjs +91 -0
- package/dist/client/ui/card.mjs.map +1 -0
- package/dist/client/ui/carousel.d.ts +20 -0
- package/dist/client/ui/carousel.d.ts.map +1 -0
- package/dist/client/ui/carousel.mjs +202 -0
- package/dist/client/ui/carousel.mjs.map +1 -0
- package/dist/client/ui/checkbox.d.ts +5 -0
- package/dist/client/ui/checkbox.d.ts.map +1 -0
- package/dist/client/ui/checkbox.mjs +34 -0
- package/dist/client/ui/checkbox.mjs.map +1 -0
- package/dist/client/ui/collapsible.d.ts +6 -0
- package/dist/client/ui/collapsible.d.ts.map +1 -0
- package/dist/client/ui/collapsible.mjs +36 -0
- package/dist/client/ui/collapsible.mjs.map +1 -0
- package/dist/client/ui/input.d.ts +4 -0
- package/dist/client/ui/input.d.ts.map +1 -0
- package/dist/client/ui/input.mjs +22 -0
- package/dist/client/ui/input.mjs.map +1 -0
- package/dist/client/ui/label.d.ts +5 -0
- package/dist/client/ui/label.d.ts.map +1 -0
- package/dist/client/ui/label.mjs +23 -0
- package/dist/client/ui/label.mjs.map +1 -0
- package/dist/client/ui/mid-truncate.d.ts +27 -0
- package/dist/client/ui/mid-truncate.d.ts.map +1 -0
- package/dist/client/ui/mid-truncate.mjs +25 -0
- package/dist/client/ui/mid-truncate.mjs.map +1 -0
- package/dist/client/ui/navigation-menu.d.ts +15 -0
- package/dist/client/ui/navigation-menu.d.ts.map +1 -0
- package/dist/client/ui/navigation-menu.mjs +172 -0
- package/dist/client/ui/navigation-menu.mjs.map +1 -0
- package/dist/client/ui/pagination.d.ts +14 -0
- package/dist/client/ui/pagination.d.ts.map +1 -0
- package/dist/client/ui/pagination.mjs +124 -0
- package/dist/client/ui/pagination.mjs.map +1 -0
- package/dist/client/ui/popover.d.ts +11 -0
- package/dist/client/ui/popover.d.ts.map +1 -0
- package/dist/client/ui/popover.mjs +82 -0
- package/dist/client/ui/popover.mjs.map +1 -0
- package/dist/client/ui/select.d.ts +16 -0
- package/dist/client/ui/select.d.ts.map +1 -0
- package/dist/client/ui/select.mjs +183 -0
- package/dist/client/ui/select.mjs.map +1 -0
- package/dist/client/ui/separator.d.ts +5 -0
- package/dist/client/ui/separator.d.ts.map +1 -0
- package/dist/client/ui/separator.mjs +27 -0
- package/dist/client/ui/separator.mjs.map +1 -0
- package/dist/client/ui/sheet.d.ts +15 -0
- package/dist/client/ui/sheet.d.ts.map +1 -0
- package/dist/client/ui/sheet.mjs +130 -0
- package/dist/client/ui/sheet.mjs.map +1 -0
- package/dist/client/ui/toggle-group.d.ts +10 -0
- package/dist/client/ui/toggle-group.d.ts.map +1 -0
- package/dist/client/ui/toggle-group.mjs +69 -0
- package/dist/client/ui/toggle-group.mjs.map +1 -0
- package/dist/client/ui/toggle.d.ts +10 -0
- package/dist/client/ui/toggle.d.ts.map +1 -0
- package/dist/client/ui/toggle.mjs +44 -0
- package/dist/client/ui/toggle.mjs.map +1 -0
- package/dist/client/ui/utils.d.ts +3 -0
- package/dist/client/ui/utils.d.ts.map +1 -0
- package/dist/client/ui/utils.mjs +9 -0
- package/dist/client/ui/utils.mjs.map +1 -0
- package/dist/client/ui-interfaces/accordion.d.ts +8 -0
- package/dist/client/ui-interfaces/accordion.d.ts.map +1 -0
- package/dist/client/ui-interfaces/accordion.mjs +72 -0
- package/dist/client/ui-interfaces/accordion.mjs.map +1 -0
- package/dist/client/ui-interfaces/breadcrumb.d.ts +12 -0
- package/dist/client/ui-interfaces/breadcrumb.d.ts.map +1 -0
- package/dist/client/ui-interfaces/breadcrumb.mjs +97 -0
- package/dist/client/ui-interfaces/breadcrumb.mjs.map +1 -0
- package/dist/client/ui-interfaces/button.d.ts +11 -0
- package/dist/client/ui-interfaces/button.d.ts.map +1 -0
- package/dist/client/ui-interfaces/button.mjs +57 -0
- package/dist/client/ui-interfaces/button.mjs.map +1 -0
- package/dist/client/ui-interfaces/card.d.ts +10 -0
- package/dist/client/ui-interfaces/card.d.ts.map +1 -0
- package/dist/client/ui-interfaces/card.mjs +78 -0
- package/dist/client/ui-interfaces/card.mjs.map +1 -0
- package/dist/client/ui-interfaces/carousel.d.ts +20 -0
- package/dist/client/ui-interfaces/carousel.d.ts.map +1 -0
- package/dist/client/ui-interfaces/carousel.mjs +188 -0
- package/dist/client/ui-interfaces/carousel.mjs.map +1 -0
- package/dist/client/ui-interfaces/checkbox.d.ts +5 -0
- package/dist/client/ui-interfaces/checkbox.d.ts.map +1 -0
- package/dist/client/ui-interfaces/checkbox.mjs +30 -0
- package/dist/client/ui-interfaces/checkbox.mjs.map +1 -0
- package/dist/client/ui-interfaces/collapsible.d.ts +7 -0
- package/dist/client/ui-interfaces/collapsible.d.ts.map +1 -0
- package/dist/client/ui-interfaces/collapsible.mjs +42 -0
- package/dist/client/ui-interfaces/collapsible.mjs.map +1 -0
- package/dist/client/ui-interfaces/index.d.ts +18 -0
- package/dist/client/ui-interfaces/index.d.ts.map +1 -0
- package/dist/client/ui-interfaces/index.mjs +18 -0
- package/dist/client/ui-interfaces/index.mjs.map +1 -0
- package/dist/client/ui-interfaces/input.d.ts +7 -0
- package/dist/client/ui-interfaces/input.d.ts.map +1 -0
- package/dist/client/ui-interfaces/input.mjs +39 -0
- package/dist/client/ui-interfaces/input.mjs.map +1 -0
- package/dist/client/ui-interfaces/label.d.ts +5 -0
- package/dist/client/ui-interfaces/label.d.ts.map +1 -0
- package/dist/client/ui-interfaces/label.mjs +23 -0
- package/dist/client/ui-interfaces/label.mjs.map +1 -0
- package/dist/client/ui-interfaces/navigation-menu.d.ts +15 -0
- package/dist/client/ui-interfaces/navigation-menu.d.ts.map +1 -0
- package/dist/client/ui-interfaces/navigation-menu.mjs +163 -0
- package/dist/client/ui-interfaces/navigation-menu.mjs.map +1 -0
- package/dist/client/ui-interfaces/pagination.d.ts +14 -0
- package/dist/client/ui-interfaces/pagination.d.ts.map +1 -0
- package/dist/client/ui-interfaces/pagination.mjs +103 -0
- package/dist/client/ui-interfaces/pagination.mjs.map +1 -0
- package/dist/client/ui-interfaces/popover.d.ts +8 -0
- package/dist/client/ui-interfaces/popover.d.ts.map +1 -0
- package/dist/client/ui-interfaces/popover.mjs +50 -0
- package/dist/client/ui-interfaces/popover.mjs.map +1 -0
- package/dist/client/ui-interfaces/select.d.ts +16 -0
- package/dist/client/ui-interfaces/select.d.ts.map +1 -0
- package/dist/client/ui-interfaces/select.mjs +159 -0
- package/dist/client/ui-interfaces/select.mjs.map +1 -0
- package/dist/client/ui-interfaces/separator.d.ts +5 -0
- package/dist/client/ui-interfaces/separator.d.ts.map +1 -0
- package/dist/client/ui-interfaces/separator.mjs +28 -0
- package/dist/client/ui-interfaces/separator.mjs.map +1 -0
- package/dist/client/ui-interfaces/sheet.d.ts +14 -0
- package/dist/client/ui-interfaces/sheet.d.ts.map +1 -0
- package/dist/client/ui-interfaces/sheet.mjs +140 -0
- package/dist/client/ui-interfaces/sheet.mjs.map +1 -0
- package/dist/client/ui-interfaces/toggle-group.d.ts +10 -0
- package/dist/client/ui-interfaces/toggle-group.d.ts.map +1 -0
- package/dist/client/ui-interfaces/toggle-group.mjs +67 -0
- package/dist/client/ui-interfaces/toggle-group.mjs.map +1 -0
- package/dist/client/ui-interfaces/toggle.d.ts +10 -0
- package/dist/client/ui-interfaces/toggle.d.ts.map +1 -0
- package/dist/client/ui-interfaces/toggle.mjs +45 -0
- package/dist/client/ui-interfaces/toggle.mjs.map +1 -0
- package/dist/client/ui-resolver/accordion.d.ts +11 -0
- package/dist/client/ui-resolver/accordion.d.ts.map +1 -0
- package/dist/client/ui-resolver/accordion.mjs +35 -0
- package/dist/client/ui-resolver/accordion.mjs.map +1 -0
- package/dist/client/ui-resolver/breadcrumb.d.ts +14 -0
- package/dist/client/ui-resolver/breadcrumb.d.ts.map +1 -0
- package/dist/client/ui-resolver/breadcrumb.mjs +53 -0
- package/dist/client/ui-resolver/breadcrumb.mjs.map +1 -0
- package/dist/client/ui-resolver/button.d.ts +12 -0
- package/dist/client/ui-resolver/button.d.ts.map +1 -0
- package/dist/client/ui-resolver/button.mjs +25 -0
- package/dist/client/ui-resolver/button.mjs.map +1 -0
- package/dist/client/ui-resolver/card.d.ts +14 -0
- package/dist/client/ui-resolver/card.d.ts.map +1 -0
- package/dist/client/ui-resolver/card.mjs +53 -0
- package/dist/client/ui-resolver/card.mjs.map +1 -0
- package/dist/client/ui-resolver/carousel.d.ts +13 -0
- package/dist/client/ui-resolver/carousel.d.ts.map +1 -0
- package/dist/client/ui-resolver/carousel.mjs +41 -0
- package/dist/client/ui-resolver/carousel.mjs.map +1 -0
- package/dist/client/ui-resolver/checkbox.d.ts +8 -0
- package/dist/client/ui-resolver/checkbox.d.ts.map +1 -0
- package/dist/client/ui-resolver/checkbox.mjs +17 -0
- package/dist/client/ui-resolver/checkbox.mjs.map +1 -0
- package/dist/client/ui-resolver/collapsible.d.ts +10 -0
- package/dist/client/ui-resolver/collapsible.d.ts.map +1 -0
- package/dist/client/ui-resolver/collapsible.mjs +29 -0
- package/dist/client/ui-resolver/collapsible.mjs.map +1 -0
- package/dist/client/ui-resolver/context.d.ts +10 -0
- package/dist/client/ui-resolver/context.d.ts.map +1 -0
- package/dist/client/ui-resolver/context.mjs +28 -0
- package/dist/client/ui-resolver/context.mjs.map +1 -0
- package/dist/client/ui-resolver/index.d.ts +19 -0
- package/dist/client/ui-resolver/index.d.ts.map +1 -0
- package/dist/client/ui-resolver/index.mjs +156 -0
- package/dist/client/ui-resolver/index.mjs.map +1 -0
- package/dist/client/ui-resolver/input.d.ts +8 -0
- package/dist/client/ui-resolver/input.d.ts.map +1 -0
- package/dist/client/ui-resolver/input.mjs +17 -0
- package/dist/client/ui-resolver/input.mjs.map +1 -0
- package/dist/client/ui-resolver/label.d.ts +8 -0
- package/dist/client/ui-resolver/label.d.ts.map +1 -0
- package/dist/client/ui-resolver/label.mjs +17 -0
- package/dist/client/ui-resolver/label.mjs.map +1 -0
- package/dist/client/ui-resolver/navigation-menu.d.ts +16 -0
- package/dist/client/ui-resolver/navigation-menu.d.ts.map +1 -0
- package/dist/client/ui-resolver/navigation-menu.mjs +64 -0
- package/dist/client/ui-resolver/navigation-menu.mjs.map +1 -0
- package/dist/client/ui-resolver/pagination.d.ts +14 -0
- package/dist/client/ui-resolver/pagination.d.ts.map +1 -0
- package/dist/client/ui-resolver/pagination.mjs +53 -0
- package/dist/client/ui-resolver/pagination.mjs.map +1 -0
- package/dist/client/ui-resolver/popover.d.ts +11 -0
- package/dist/client/ui-resolver/popover.d.ts.map +1 -0
- package/dist/client/ui-resolver/popover.mjs +35 -0
- package/dist/client/ui-resolver/popover.mjs.map +1 -0
- package/dist/client/ui-resolver/select.d.ts +15 -0
- package/dist/client/ui-resolver/select.d.ts.map +1 -0
- package/dist/client/ui-resolver/select.mjs +59 -0
- package/dist/client/ui-resolver/select.mjs.map +1 -0
- package/dist/client/ui-resolver/separator.d.ts +8 -0
- package/dist/client/ui-resolver/separator.d.ts.map +1 -0
- package/dist/client/ui-resolver/separator.mjs +17 -0
- package/dist/client/ui-resolver/separator.mjs.map +1 -0
- package/dist/client/ui-resolver/sheet.d.ts +15 -0
- package/dist/client/ui-resolver/sheet.d.ts.map +1 -0
- package/dist/client/ui-resolver/sheet.mjs +59 -0
- package/dist/client/ui-resolver/sheet.mjs.map +1 -0
- package/dist/client/ui-resolver/toggle-group.d.ts +9 -0
- package/dist/client/ui-resolver/toggle-group.d.ts.map +1 -0
- package/dist/client/ui-resolver/toggle-group.mjs +23 -0
- package/dist/client/ui-resolver/toggle-group.mjs.map +1 -0
- package/dist/client/ui-resolver/toggle.d.ts +12 -0
- package/dist/client/ui-resolver/toggle.d.ts.map +1 -0
- package/dist/client/ui-resolver/toggle.mjs +25 -0
- package/dist/client/ui-resolver/toggle.mjs.map +1 -0
- package/dist/client/user/actions/createResetPasswordLinkAction.d.ts +14 -0
- package/dist/client/user/actions/createResetPasswordLinkAction.d.ts.map +1 -0
- package/dist/client/user/actions/createResetPasswordLinkAction.mjs +1 -1
- package/dist/client/user/actions/createResetPasswordLinkAction.mjs.map +1 -1
- package/dist/client/user/actions/getUserAction.d.ts +3 -0
- package/dist/client/user/actions/getUserAction.d.ts.map +1 -0
- package/dist/client/user/actions/getUserAction.mjs.map +1 -1
- package/dist/client/user/actions/{logInUserAction.d.mts → logInUserAction.d.ts} +3 -3
- package/dist/client/user/actions/logInUserAction.d.ts.map +1 -0
- package/dist/client/user/actions/logoutUserAction.d.ts +2 -0
- package/dist/client/user/actions/logoutUserAction.d.ts.map +1 -0
- package/dist/client/user/actions/registerOrganisationAction.d.ts +9 -0
- package/dist/client/user/actions/registerOrganisationAction.d.ts.map +1 -0
- package/dist/client/user/actions/registerOrganisationAction.mjs.map +1 -1
- package/dist/client/user/actions/{registerUserAction.d.mts → registerUserAction.d.ts} +3 -3
- package/dist/client/user/actions/registerUserAction.d.ts.map +1 -0
- package/dist/client/user/actions/registerUserAction.mjs +1 -1
- package/dist/client/user/actions/registerUserAction.mjs.map +1 -1
- package/dist/client/user/actions/{registerUserWithoutRedirectAction.d.mts → registerUserWithoutRedirectAction.d.ts} +3 -6
- package/dist/client/user/actions/registerUserWithoutRedirectAction.d.ts.map +1 -0
- package/dist/client/user/actions/{updatePasswordAction.d.mts → updatePasswordAction.d.ts} +3 -3
- package/dist/client/user/actions/updatePasswordAction.d.ts.map +1 -0
- package/dist/client/user/actions/updatePasswordAction.mjs +1 -1
- package/dist/client/user/actions/updatePasswordAction.mjs.map +1 -1
- package/dist/client/user/api/userRoute.d.ts +7 -0
- package/dist/client/user/api/userRoute.d.ts.map +1 -0
- package/dist/client/user/clients/enad.d.ts +4 -0
- package/dist/client/user/clients/enad.d.ts.map +1 -0
- package/dist/client/user/components/login-form.d.ts +23 -0
- package/dist/client/user/components/login-form.d.ts.map +1 -0
- package/dist/client/user/components/login-form.mjs +77 -73
- package/dist/client/user/components/login-form.mjs.map +1 -1
- package/dist/client/user/components/reset-password-form.d.ts +20 -0
- package/dist/client/user/components/reset-password-form.d.ts.map +1 -0
- package/dist/client/user/components/reset-password-form.mjs +57 -50
- package/dist/client/user/components/reset-password-form.mjs.map +1 -1
- package/dist/client/user/components/sign-out.d.ts +8 -0
- package/dist/client/user/components/sign-out.d.ts.map +1 -0
- package/dist/client/user/components/sign-out.mjs +6 -3
- package/dist/client/user/components/sign-out.mjs.map +1 -1
- package/dist/client/user/components/signup-form.d.ts +27 -0
- package/dist/client/user/components/signup-form.d.ts.map +1 -0
- package/dist/client/user/components/signup-form.mjs +153 -120
- package/dist/client/user/components/signup-form.mjs.map +1 -1
- package/dist/client/user/components/signup-organisation-form.d.ts +55 -0
- package/dist/client/user/components/signup-organisation-form.d.ts.map +1 -0
- package/dist/client/user/components/signup-organisation-form.mjs +713 -662
- package/dist/client/user/components/signup-organisation-form.mjs.map +1 -1
- package/dist/client/user/components/update-password-form.d.ts +17 -0
- package/dist/client/user/components/update-password-form.d.ts.map +1 -0
- package/dist/client/user/components/update-password-form.mjs +26 -35
- package/dist/client/user/components/update-password-form.mjs.map +1 -1
- package/dist/client/user/hooks/index.d.ts +2 -0
- package/dist/client/user/hooks/index.d.ts.map +1 -0
- package/dist/client/user/hooks/useUser.d.ts +12 -0
- package/dist/client/user/hooks/useUser.d.ts.map +1 -0
- package/dist/client/user/hooks/useUser.mjs +1 -1
- package/dist/client/user/hooks/useUser.mjs.map +1 -1
- package/dist/client/user/index.d.ts +9 -0
- package/dist/client/user/index.d.ts.map +1 -0
- package/dist/client/user/index.mjs +17 -0
- package/dist/client/user/index.mjs.map +1 -0
- package/dist/client/user/types/{user.d.mts → user.d.ts} +25 -26
- package/dist/client/user/types/user.d.ts.map +1 -0
- package/dist/client/user/utils/{userCookieService.d.mts → userCookieService.d.ts} +2 -3
- package/dist/client/user/utils/userCookieService.d.ts.map +1 -0
- package/dist/client/wishlist/actions/addItemsToWishlistAction.d.ts +5 -0
- package/dist/client/wishlist/actions/addItemsToWishlistAction.d.ts.map +1 -0
- package/dist/client/wishlist/actions/addItemsToWishlistAction.mjs.map +1 -1
- package/dist/client/wishlist/actions/createOrGetShareTokenAction.d.ts +3 -0
- package/dist/client/wishlist/actions/createOrGetShareTokenAction.d.ts.map +1 -0
- package/dist/client/wishlist/actions/createOrGetShareTokenAction.mjs.map +1 -1
- package/dist/client/wishlist/actions/createWishlistAction.d.ts +3 -0
- package/dist/client/wishlist/actions/createWishlistAction.d.ts.map +1 -0
- package/dist/client/wishlist/actions/createWishlistAction.mjs.map +1 -1
- package/dist/client/wishlist/actions/deleteItemsFromWishlistAction.d.ts +5 -0
- package/dist/client/wishlist/actions/deleteItemsFromWishlistAction.d.ts.map +1 -0
- package/dist/client/wishlist/actions/deleteItemsFromWishlistAction.mjs.map +1 -1
- package/dist/client/wishlist/actions/deleteWishlistAction.d.ts +4 -0
- package/dist/client/wishlist/actions/deleteWishlistAction.d.ts.map +1 -0
- package/dist/client/wishlist/actions/getSharedWishlistAction.d.ts +3 -0
- package/dist/client/wishlist/actions/getSharedWishlistAction.d.ts.map +1 -0
- package/dist/client/wishlist/actions/getSharedWishlistAction.mjs.map +1 -1
- package/dist/client/wishlist/actions/getSpecificWishlistAction.d.ts +3 -0
- package/dist/client/wishlist/actions/getSpecificWishlistAction.d.ts.map +1 -0
- package/dist/client/wishlist/actions/getSpecificWishlistAction.mjs.map +1 -1
- package/dist/client/wishlist/actions/getUserWishlists.d.ts +4 -0
- package/dist/client/wishlist/actions/getUserWishlists.d.ts.map +1 -0
- package/dist/client/wishlist/actions/getUserWishlists.mjs.map +1 -1
- package/dist/client/wishlist/actions/revokeShareTokenAction.d.ts +4 -0
- package/dist/client/wishlist/actions/revokeShareTokenAction.d.ts.map +1 -0
- package/dist/client/wishlist/actions/updateWishlistAction.d.ts +3 -0
- package/dist/client/wishlist/actions/updateWishlistAction.d.ts.map +1 -0
- package/dist/client/wishlist/actions/updateWishlistAction.mjs.map +1 -1
- package/dist/client/wishlist/hooks/index.d.ts +2 -0
- package/dist/client/wishlist/hooks/index.d.ts.map +1 -0
- package/dist/client/wishlist/hooks/useWishlist.d.ts +95 -0
- package/dist/client/wishlist/hooks/useWishlist.d.ts.map +1 -0
- package/dist/client/wishlist/hooks/useWishlist.mjs +14 -4
- package/dist/client/wishlist/hooks/useWishlist.mjs.map +1 -1
- package/dist/client/wishlist/hooks/useWishlistActions.d.ts +44 -0
- package/dist/client/wishlist/hooks/useWishlistActions.d.ts.map +1 -0
- package/dist/client/wishlist/hooks/useWishlistActions.mjs.map +1 -1
- package/dist/client/wishlist/index.d.ts +5 -0
- package/dist/client/wishlist/index.d.ts.map +1 -0
- package/dist/client/wishlist/index.mjs +9 -0
- package/dist/client/wishlist/index.mjs.map +1 -0
- package/dist/client/wishlist/wishlist-drawer.d.ts +17 -0
- package/dist/client/wishlist/wishlist-drawer.d.ts.map +1 -0
- package/dist/client/wishlist/wishlist-drawer.mjs +189 -170
- package/dist/client/wishlist/wishlist-drawer.mjs.map +1 -1
- package/dist/styles.css +1 -958
- package/package.json +107 -33
- package/dist/client/cart/components/cart-trigger.d.mts +0 -5
- package/dist/client/cart/constants/session.d.mts +0 -3
- package/dist/client/cart/contexts/cart.d.mts +0 -27
- package/dist/client/cart/hooks/useCart.d.mts +0 -29
- package/dist/client/cart/hooks/useCartActions.d.mts +0 -26
- package/dist/client/cart/queries/addToCartQueryFn.d.mts +0 -10
- package/dist/client/cart/queries/getCartQueryFn.d.mts +0 -7
- package/dist/client/cart/queries/removeCartItemQueryFn.d.mts +0 -9
- package/dist/client/cart/queries/updateCartItemQueryFn.d.mts +0 -10
- package/dist/client/cart/utils/session.d.mts +0 -6
- package/dist/client/cms/storyblok/preview/registerStoryblokBridge.d.mts +0 -6
- package/dist/client/global/auth/withAuth.d.mts +0 -6
- package/dist/client/global/providers/enad-provider.d.mts +0 -23
- package/dist/client/search/actions/searchAction.d.mts +0 -5
- package/dist/client/search/components/search-bar.d.mts +0 -2
- package/dist/client/search/hooks/useSearch.d.mts +0 -18
- package/dist/client/user/actions/createResetPasswordLinkAction.d.mts +0 -14
- package/dist/client/user/actions/getUserAction.d.mts +0 -5
- package/dist/client/user/actions/logoutUserAction.d.mts +0 -3
- package/dist/client/user/actions/registerOrganisationAction.d.mts +0 -12
- package/dist/client/user/api/userRoute.d.mts +0 -9
- package/dist/client/user/clients/enad.d.mts +0 -6
- package/dist/client/user/components/login-form.d.mts +0 -20
- package/dist/client/user/components/reset-password-form.d.mts +0 -15
- package/dist/client/user/components/sign-out.d.mts +0 -5
- package/dist/client/user/components/signup-form.d.mts +0 -15
- package/dist/client/user/components/signup-organisation-form.d.mts +0 -20
- package/dist/client/user/components/update-password-form.d.mts +0 -11
- package/dist/client/user/hooks/index.d.mts +0 -3
- package/dist/client/user/hooks/useUser.d.mts +0 -16
- package/dist/client/wishlist/actions/addItemsToWishlistAction.d.mts +0 -7
- package/dist/client/wishlist/actions/createOrGetShareTokenAction.d.mts +0 -6
- package/dist/client/wishlist/actions/createWishlistAction.d.mts +0 -6
- package/dist/client/wishlist/actions/deleteItemsFromWishlistAction.d.mts +0 -7
- package/dist/client/wishlist/actions/deleteWishlistAction.d.mts +0 -5
- package/dist/client/wishlist/actions/getSharedWishlistAction.d.mts +0 -6
- package/dist/client/wishlist/actions/getSpecificWishlistAction.d.mts +0 -6
- package/dist/client/wishlist/actions/getUserWishlists.d.mts +0 -7
- package/dist/client/wishlist/actions/revokeShareTokenAction.d.mts +0 -5
- package/dist/client/wishlist/actions/updateWishlistAction.d.mts +0 -6
- package/dist/client/wishlist/hooks/index.d.mts +0 -3
- package/dist/client/wishlist/hooks/useWishlist.d.mts +0 -98
- package/dist/client/wishlist/hooks/useWishlistActions.d.mts +0 -48
- package/dist/client/wishlist/wishlist-drawer.d.mts +0 -19
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/client/wishlist/hooks/useWishlistActions.tsx"],"sourcesContent":["\"use client\"\n\nimport {\n AddItemsToWishlistOptions,\n CreateOrGetShareTokenForWishlistOptions,\n CreateWishlistOptions,\n DeleteItemsFromWishlistOptions,\n UpdateWishlistOptions,\n} from \"@enadhq/enad-ts-sdk\"\nimport { useMutation, useQueryClient } from \"@tanstack/react-query\"\nimport { CACHE_TAGS } from \"../../global/constants/tags\"\nimport { addItemsToWishlistAction } from \"../actions/addItemsToWishlistAction\"\nimport { createOrGetShareTokenAction } from \"../actions/createOrGetShareTokenAction\"\nimport { createWishlistAction } from \"../actions/createWishlistAction\"\nimport { deleteItemsFromWishlistAction } from \"../actions/deleteItemsFromWishlistAction\"\nimport { deleteWishlistAction } from \"../actions/deleteWishlistAction\"\nimport { revokeShareTokenAction } from \"../actions/revokeShareTokenAction\"\nimport { updateWishlistAction } from \"../actions/updateWishlistAction\"\n\n/**\n * Hook to provide wishlist action mutations: create, update, delete wishlist, and add/remove items.\n */\nexport const useWishlistActions = () => {\n const queryClient = useQueryClient()\n\n // Create wishlist mutation\n const createWishlistMutation = useMutation({\n mutationFn: async (options?: CreateWishlistOptions) => {\n return createWishlistAction(options)\n },\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: [CACHE_TAGS.wishlist] })\n },\n })\n\n // Update wishlist mutation\n const updateWishlistMutation = useMutation({\n mutationFn: async ({\n wishlistId,\n options,\n }: {\n wishlistId: string\n options?: UpdateWishlistOptions\n }) => {\n return updateWishlistAction(wishlistId, options)\n },\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: [CACHE_TAGS.wishlist] })\n },\n })\n\n // Delete wishlist mutation\n const deleteWishlistMutation = useMutation({\n mutationFn: async (wishlistId: string) => {\n return deleteWishlistAction(wishlistId)\n },\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: [CACHE_TAGS.wishlist] })\n },\n })\n\n // Add items to wishlist mutation\n const addItemsMutation = useMutation({\n mutationFn: async ({\n wishlistId,\n options,\n }: {\n wishlistId: string\n options?: AddItemsToWishlistOptions\n }) => {\n return addItemsToWishlistAction(wishlistId, options)\n },\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: [CACHE_TAGS.wishlist] })\n },\n })\n\n // Remove items from wishlist mutation\n const deleteItemsMutation = useMutation({\n mutationFn: async ({\n wishlistId,\n options,\n }: {\n wishlistId: string\n options?: DeleteItemsFromWishlistOptions\n }) => {\n return deleteItemsFromWishlistAction(wishlistId, options)\n },\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: [CACHE_TAGS.wishlist] })\n },\n })\n\n // Create or get share token mutation\n const createOrGetShareTokenMutation = useMutation({\n mutationFn: async ({\n wishlistId,\n options,\n }: {\n wishlistId: string\n options?: CreateOrGetShareTokenForWishlistOptions\n }) => {\n return createOrGetShareTokenAction(wishlistId, options)\n },\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: [CACHE_TAGS.wishlist] })\n },\n })\n\n // Revoke share token mutation\n const revokeShareTokenMutation = useMutation({\n mutationFn: async ({ wishlistId, shareToken }: { wishlistId: string; shareToken: string }) => {\n return revokeShareTokenAction(wishlistId, shareToken)\n },\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: [CACHE_TAGS.wishlist] })\n },\n })\n\n return {\n createWishlist: createWishlistMutation.mutateAsync,\n updateWishlist: updateWishlistMutation.mutateAsync,\n deleteWishlist: deleteWishlistMutation.mutateAsync,\n addItems: addItemsMutation.mutateAsync,\n deleteItems: deleteItemsMutation.mutateAsync,\n createOrGetShareToken: createOrGetShareTokenMutation.mutateAsync,\n revokeShareToken: revokeShareTokenMutation.mutateAsync,\n isCreatingWishlist: createWishlistMutation.isPending,\n isUpdatingWishlist: updateWishlistMutation.isPending,\n isDeletingWishlist: deleteWishlistMutation.isPending,\n isAddingItemsToWishlist: addItemsMutation.isPending,\n isDeletingItemsFromWishlist: deleteItemsMutation.isPending,\n isCreatingShareToken: createOrGetShareTokenMutation.isPending,\n isRevokingShareToken: revokeShareTokenMutation.isPending,\n }\n}\n"],"mappings":";AASA,SAAS,aAAa,sBAAsB;AAC5C,SAAS,kBAAkB;AAC3B,SAAS,gCAAgC;AACzC,SAAS,mCAAmC;AAC5C,SAAS,4BAA4B;AACrC,SAAS,qCAAqC;AAC9C,SAAS,4BAA4B;AACrC,SAAS,8BAA8B;AACvC,SAAS,4BAA4B;AAK9B,MAAM,qBAAqB,MAAM;AACtC,QAAM,cAAc,eAAe;AAGnC,QAAM,yBAAyB,YAAY;AAAA,IACzC,YAAY,OAAO,YAAoC;AACrD,aAAO,qBAAqB,OAAO;AAAA,IACrC;AAAA,IACA,WAAW,MAAM;AACf,kBAAY,kBAAkB,EAAE,UAAU,CAAC,WAAW,QAAQ,EAAE,CAAC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,EACF,CAAC;AAGD,QAAM,2BAA2B,YAAY;AAAA,IAC3C,YAAY,OAAO,EAAE,YAAY,WAAW,MAAkD;AAC5F,aAAO,uBAAuB,YAAY,UAAU;AAAA,IACtD;AAAA,IACA,WAAW,MAAM;AACf,kBAAY,kBAAkB,EAAE,UAAU,CAAC,WAAW,QAAQ,EAAE,CAAC;AAAA,IACnE;AAAA,EACF,CAAC;AAED,SAAO;AAAA,IACL,gBAAgB,uBAAuB;AAAA,IACvC,gBAAgB,uBAAuB;AAAA,IACvC,gBAAgB,uBAAuB;AAAA,IACvC,UAAU,iBAAiB;AAAA,IAC3B,aAAa,oBAAoB;AAAA,IACjC,uBAAuB,8BAA8B;AAAA,IACrD,kBAAkB,yBAAyB;AAAA,IAC3C,oBAAoB,uBAAuB;AAAA,IAC3C,oBAAoB,uBAAuB;AAAA,IAC3C,oBAAoB,uBAAuB;AAAA,IAC3C,yBAAyB,iBAAiB;AAAA,IAC1C,6BAA6B,oBAAoB;AAAA,IACjD,sBAAsB,8BAA8B;AAAA,IACpD,sBAAsB,yBAAyB;AAAA,EACjD;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/client/wishlist/hooks/useWishlistActions.tsx"],"sourcesContent":["\"use client\"\n\nimport {\n type AddItemsToWishlistOptions,\n type CreateOrGetShareTokenForWishlistOptions,\n type CreateWishlistOptions,\n type DeleteItemsFromWishlistOptions,\n type UpdateWishlistOptions,\n} from \"@enadhq/enad-ts-sdk\"\nimport { useMutation, useQueryClient } from \"@tanstack/react-query\"\nimport { CACHE_TAGS } from \"../../global/constants/tags\"\nimport { addItemsToWishlistAction } from \"../actions/addItemsToWishlistAction\"\nimport { createOrGetShareTokenAction } from \"../actions/createOrGetShareTokenAction\"\nimport { createWishlistAction } from \"../actions/createWishlistAction\"\nimport { deleteItemsFromWishlistAction } from \"../actions/deleteItemsFromWishlistAction\"\nimport { deleteWishlistAction } from \"../actions/deleteWishlistAction\"\nimport { revokeShareTokenAction } from \"../actions/revokeShareTokenAction\"\nimport { updateWishlistAction } from \"../actions/updateWishlistAction\"\n\n/**\n * Hook to provide wishlist action mutations: create, update, delete wishlist, and add/remove items.\n */\nexport const useWishlistActions = () => {\n const queryClient = useQueryClient()\n\n // Create wishlist mutation\n const createWishlistMutation = useMutation({\n mutationFn: async (options?: CreateWishlistOptions) => {\n return createWishlistAction(options)\n },\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: [CACHE_TAGS.wishlist] })\n },\n })\n\n // Update wishlist mutation\n const updateWishlistMutation = useMutation({\n mutationFn: async ({\n wishlistId,\n options,\n }: {\n wishlistId: string\n options?: UpdateWishlistOptions\n }) => {\n return updateWishlistAction(wishlistId, options)\n },\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: [CACHE_TAGS.wishlist] })\n },\n })\n\n // Delete wishlist mutation\n const deleteWishlistMutation = useMutation({\n mutationFn: async (wishlistId: string) => {\n return deleteWishlistAction(wishlistId)\n },\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: [CACHE_TAGS.wishlist] })\n },\n })\n\n // Add items to wishlist mutation\n const addItemsMutation = useMutation({\n mutationFn: async ({\n wishlistId,\n options,\n }: {\n wishlistId: string\n options?: AddItemsToWishlistOptions\n }) => {\n return addItemsToWishlistAction(wishlistId, options)\n },\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: [CACHE_TAGS.wishlist] })\n },\n })\n\n // Remove items from wishlist mutation\n const deleteItemsMutation = useMutation({\n mutationFn: async ({\n wishlistId,\n options,\n }: {\n wishlistId: string\n options?: DeleteItemsFromWishlistOptions\n }) => {\n return deleteItemsFromWishlistAction(wishlistId, options)\n },\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: [CACHE_TAGS.wishlist] })\n },\n })\n\n // Create or get share token mutation\n const createOrGetShareTokenMutation = useMutation({\n mutationFn: async ({\n wishlistId,\n options,\n }: {\n wishlistId: string\n options?: CreateOrGetShareTokenForWishlistOptions\n }) => {\n return createOrGetShareTokenAction(wishlistId, options)\n },\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: [CACHE_TAGS.wishlist] })\n },\n })\n\n // Revoke share token mutation\n const revokeShareTokenMutation = useMutation({\n mutationFn: async ({ wishlistId, shareToken }: { wishlistId: string; shareToken: string }) => {\n return revokeShareTokenAction(wishlistId, shareToken)\n },\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: [CACHE_TAGS.wishlist] })\n },\n })\n\n return {\n createWishlist: createWishlistMutation.mutateAsync,\n updateWishlist: updateWishlistMutation.mutateAsync,\n deleteWishlist: deleteWishlistMutation.mutateAsync,\n addItems: addItemsMutation.mutateAsync,\n deleteItems: deleteItemsMutation.mutateAsync,\n createOrGetShareToken: createOrGetShareTokenMutation.mutateAsync,\n revokeShareToken: revokeShareTokenMutation.mutateAsync,\n isCreatingWishlist: createWishlistMutation.isPending,\n isUpdatingWishlist: updateWishlistMutation.isPending,\n isDeletingWishlist: deleteWishlistMutation.isPending,\n isAddingItemsToWishlist: addItemsMutation.isPending,\n isDeletingItemsFromWishlist: deleteItemsMutation.isPending,\n isCreatingShareToken: createOrGetShareTokenMutation.isPending,\n isRevokingShareToken: revokeShareTokenMutation.isPending,\n }\n}\n"],"mappings":";AASA,SAAS,aAAa,sBAAsB;AAC5C,SAAS,kBAAkB;AAC3B,SAAS,gCAAgC;AACzC,SAAS,mCAAmC;AAC5C,SAAS,4BAA4B;AACrC,SAAS,qCAAqC;AAC9C,SAAS,4BAA4B;AACrC,SAAS,8BAA8B;AACvC,SAAS,4BAA4B;AAK9B,MAAM,qBAAqB,MAAM;AACtC,QAAM,cAAc,eAAe;AAGnC,QAAM,yBAAyB,YAAY;AAAA,IACzC,YAAY,OAAO,YAAoC;AACrD,aAAO,qBAAqB,OAAO;AAAA,IACrC;AAAA,IACA,WAAW,MAAM;AACf,kBAAY,kBAAkB,EAAE,UAAU,CAAC,WAAW,QAAQ,EAAE,CAAC;AAAA,IACnE;AAAA,EACF,CAAC;AAGD,QAAM,yBA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AC3C,YAAY,OAAO,EAAE,YAAY,WAAW,MAAkD;AAC5F,aAAO,uBAAuB,YAAY,UAAU;AAAA,IACtD;AAAA,IACA,WAAW,MAAM;AACf,kBAAY,kBAAkB,EAAE,UAAU,CAAC,WAAW,QAAQ,EAAE,CAAC;AAAA,IACnE;AAAA,EACF,CAAC;AAED,SAAO;AAAA,IACL,gBAAgB,uBAAuB;AAAA,IACvC,gBAAgB,uBAAuB;AAAA,IACvC,gBAAgB,uBAAuB;AAAA,IACvC,UAAU,iBAAiB;AAAA,IAC3B,aAAa,oBAAoB;AAAA,IACjC,uBAAuB,8BAA8B;AAAA,IACrD,kBAAkB,yBAAyB;AAAA,IAC3C,oBAAoB,uBAAuB;AAAA,IAC3C,oBAAoB,uBAAuB;AAAA,IAC3C,oBAAoB,uBAAuB;AAAA,IAC3C,yBAAyB,iBAAiB;AAAA,IAC1C,6BAA6B,oBAAoB;AAAA,IACjD,sBAAsB,8BAA8B;AAAA,IACpD,sBAAsB,yBAAyB;AAAA,EACjD;AACF;","names":[]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { WishlistDrawer } from "./wishlist-drawer";
|
|
2
|
+
export type { WishlistDrawerProps } from "./wishlist-drawer";
|
|
3
|
+
export { useWishlist } from "./hooks/useWishlist";
|
|
4
|
+
export { useWishlistActions } from "./hooks/useWishlistActions";
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/wishlist/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClD,YAAY,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { WishlistDrawer } from "./wishlist-drawer";
|
|
2
|
+
import { useWishlist } from "./hooks/useWishlist";
|
|
3
|
+
import { useWishlistActions } from "./hooks/useWishlistActions";
|
|
4
|
+
export {
|
|
5
|
+
WishlistDrawer,
|
|
6
|
+
useWishlist,
|
|
7
|
+
useWishlistActions
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/client/wishlist/index.ts"],"sourcesContent":["export { WishlistDrawer } from \"./wishlist-drawer\"\nexport type { WishlistDrawerProps } from \"./wishlist-drawer\"\nexport { useWishlist } from \"./hooks/useWishlist\"\nexport { useWishlistActions } from \"./hooks/useWishlistActions\"\n"],"mappings":"AAAA,SAAS,sBAAsB;AAE/B,SAAS,mBAAmB;AAC5B,SAAS,0BAA0B;","names":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface WishlistDrawerProps {
|
|
2
|
+
isOpen: boolean;
|
|
3
|
+
onClose: () => void;
|
|
4
|
+
wishlistId?: string;
|
|
5
|
+
onMoveToCart?: (productId: string) => void;
|
|
6
|
+
className?: string;
|
|
7
|
+
labels?: {
|
|
8
|
+
title?: string;
|
|
9
|
+
emptyTitle?: string;
|
|
10
|
+
emptyDescription?: string;
|
|
11
|
+
removeLabel?: string;
|
|
12
|
+
moveToCartLabel?: string;
|
|
13
|
+
continueShoppingLabel?: string;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export declare function WishlistDrawer({ isOpen, onClose, wishlistId, onMoveToCart, className, labels, }: WishlistDrawerProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
//# sourceMappingURL=wishlist-drawer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wishlist-drawer.d.ts","sourceRoot":"","sources":["../../../src/client/wishlist/wishlist-drawer.tsx"],"names":[],"mappings":"AA0BA,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,OAAO,CAAA;IACf,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,YAAY,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAA;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE;QACP,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,gBAAgB,CAAC,EAAE,MAAM,CAAA;QACzB,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,eAAe,CAAC,EAAE,MAAM,CAAA;QACxB,qBAAqB,CAAC,EAAE,MAAM,CAAA;KAC/B,CAAA;CACF;AA8LD,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,OAAO,EACP,UAAU,EACV,YAAY,EACZ,SAAS,EACT,MAAW,GACZ,EAAE,mBAAmB,2CAkErB"}
|
|
@@ -1,180 +1,199 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
className
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
};
|
|
24
|
-
return /* @__PURE__ */ jsx(
|
|
25
|
-
"button",
|
|
26
|
-
{
|
|
27
|
-
className: `${baseClasses} ${variantClasses[variant]} ${sizeClasses[size]} ${className}`,
|
|
28
|
-
...props,
|
|
29
|
-
children
|
|
30
|
-
}
|
|
31
|
-
);
|
|
32
|
-
};
|
|
33
|
-
function CartDrawer({ isOpen, onClose, labels = {} }) {
|
|
34
|
-
const {
|
|
35
|
-
title = "Shopping Cart",
|
|
36
|
-
emptyCartMessage = "Your cart is empty",
|
|
37
|
-
continueShopping = "Continue Shopping",
|
|
38
|
-
subtotal = "Subtotal",
|
|
39
|
-
discount = "Discount",
|
|
40
|
-
tax = "Tax",
|
|
41
|
-
total = "Total",
|
|
42
|
-
proceedToCheckout = "Proceed to Checkout"
|
|
43
|
-
} = labels;
|
|
44
|
-
const { cart, removeItem, updateItem } = useCart();
|
|
45
|
-
const items = cart?.items || [];
|
|
46
|
-
const totals = cart?.totals;
|
|
47
|
-
const handleUpdateQuantity = (itemId, newQuantity) => {
|
|
48
|
-
updateItem({ itemId, quantity: newQuantity });
|
|
49
|
-
};
|
|
50
|
-
const handleRemoveItem = (itemId) => {
|
|
51
|
-
removeItem({ itemId });
|
|
52
|
-
};
|
|
53
|
-
const formatPrice = (amount) => {
|
|
54
|
-
return `${(amount / 100).toFixed(2)} ${cart?.currencyCode || "USD"}`;
|
|
55
|
-
};
|
|
56
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
57
|
-
/* @__PURE__ */ jsx(
|
|
58
|
-
"div",
|
|
59
|
-
{
|
|
60
|
-
className: `fixed font-enad inset-0 bg-black/60 backdrop-blur-sm z-50 transition-opacity duration-300 ${isOpen ? "opacity-100" : "opacity-0 pointer-events-none"}`,
|
|
61
|
-
onClick: onClose
|
|
62
|
-
}
|
|
63
|
-
),
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useIcon } from "../icons/icon-context";
|
|
4
|
+
import { Button } from "../ui/button";
|
|
5
|
+
import { Sheet, SheetContent, SheetHeader, SheetTitle } from "../ui/sheet";
|
|
6
|
+
import { useWishlist } from "./hooks/useWishlist";
|
|
7
|
+
import { useWishlistActions } from "./hooks/useWishlistActions";
|
|
8
|
+
function WishlistItemImage({ imageUrl, imageAlt }) {
|
|
9
|
+
return /* @__PURE__ */ jsx("div", { className: "relative size-24 flex-shrink-0 overflow-hidden rounded-(--enad-border-radius) bg-(--enad-border-color)", children: imageUrl ? /* @__PURE__ */ jsx("img", { src: imageUrl, alt: imageAlt, loading: "lazy", className: "size-full object-cover" }) : /* @__PURE__ */ jsx("div", { className: "size-full bg-(--enad-border-color)" }) });
|
|
10
|
+
}
|
|
11
|
+
function WishlistItemActions({
|
|
12
|
+
productId,
|
|
13
|
+
productName,
|
|
14
|
+
onMoveToCart,
|
|
15
|
+
onRemove,
|
|
16
|
+
isDeleting,
|
|
17
|
+
removeLabel,
|
|
18
|
+
moveToCartLabel
|
|
19
|
+
}) {
|
|
20
|
+
const TrashIcon = useIcon("trash");
|
|
21
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mt-2", children: [
|
|
22
|
+
onMoveToCart && productId && /* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", onClick: () => onMoveToCart(productId), children: moveToCartLabel }),
|
|
64
23
|
/* @__PURE__ */ jsx(
|
|
65
|
-
|
|
24
|
+
Button,
|
|
66
25
|
{
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
style: { fontFamily: "var(--font-oswald)" },
|
|
75
|
-
children: title
|
|
76
|
-
}
|
|
77
|
-
),
|
|
78
|
-
/* @__PURE__ */ jsx(Button, { variant: "ghost", size: "icon", onClick: onClose, children: /* @__PURE__ */ jsx(X, { className: "h-5 w-5" }) })
|
|
79
|
-
] }),
|
|
80
|
-
/* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto p-6", children: items.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center h-full text-center", children: [
|
|
81
|
-
/* @__PURE__ */ jsx("p", { className: "text-(--enad-text-muted-color) mb-4", children: emptyCartMessage }),
|
|
82
|
-
/* @__PURE__ */ jsx(Button, { onClick: onClose, variant: "outline", children: continueShopping })
|
|
83
|
-
] }) : /* @__PURE__ */ jsx("div", { className: "space-y-6", children: items.map((item) => /* @__PURE__ */ jsxs("div", { className: "flex gap-4", children: [
|
|
84
|
-
/* @__PURE__ */ jsx("div", { className: "relative w-24 h-24 flex-shrink-0 bg-(--enad-border-color) rounded-(--enad-border-radius) overflow-hidden", children: item.imageUrl ? /* @__PURE__ */ jsx(
|
|
85
|
-
"img",
|
|
86
|
-
{
|
|
87
|
-
src: item.imageUrl || "/placeholder.svg",
|
|
88
|
-
alt: item.displayName,
|
|
89
|
-
className: "object-cover"
|
|
90
|
-
}
|
|
91
|
-
) : /* @__PURE__ */ jsx("div", { className: "w-full h-full bg-(--enad-border-color)" }) }),
|
|
92
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-1 min-w-0 justify-between flex-col", children: [
|
|
93
|
-
/* @__PURE__ */ jsxs("div", { className: "flex justify-between gap-2 mb-2", children: [
|
|
94
|
-
/* @__PURE__ */ jsx(
|
|
95
|
-
Link,
|
|
96
|
-
{
|
|
97
|
-
href: `/products/${item.customAttributes?.productSlug || item.productVariantId}`,
|
|
98
|
-
className: "font-medium text-sm text-(--enad-link-color) hover:text-(--enad-link-hover-color) transition-colors",
|
|
99
|
-
onClick: onClose,
|
|
100
|
-
children: item.displayName
|
|
101
|
-
}
|
|
102
|
-
),
|
|
103
|
-
/* @__PURE__ */ jsx(
|
|
104
|
-
Button,
|
|
105
|
-
{
|
|
106
|
-
variant: "ghost",
|
|
107
|
-
size: "icon",
|
|
108
|
-
className: "h-5 w-5 flex-shrink-0",
|
|
109
|
-
onClick: () => handleRemoveItem(item.id),
|
|
110
|
-
children: /* @__PURE__ */ jsx(Trash2, { className: "h-4 w-4" })
|
|
111
|
-
}
|
|
112
|
-
)
|
|
113
|
-
] }),
|
|
114
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
115
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm text-(--enad-text-muted-color) mb-1", children: formatPrice(item.salePriceAmount) }),
|
|
116
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
117
|
-
/* @__PURE__ */ jsx(
|
|
118
|
-
Button,
|
|
119
|
-
{
|
|
120
|
-
variant: "outline",
|
|
121
|
-
size: "icon",
|
|
122
|
-
className: "h-5 w-5 bg-transparent",
|
|
123
|
-
onClick: () => handleUpdateQuantity(item.id, item.quantity - 1),
|
|
124
|
-
disabled: item.quantity <= 1,
|
|
125
|
-
children: /* @__PURE__ */ jsx(Minus, { className: "h-3 w-3" })
|
|
126
|
-
}
|
|
127
|
-
),
|
|
128
|
-
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium w-8 text-center text-(--enad-text-primary-color)", children: item.quantity }),
|
|
129
|
-
/* @__PURE__ */ jsx(
|
|
130
|
-
Button,
|
|
131
|
-
{
|
|
132
|
-
variant: "outline",
|
|
133
|
-
size: "icon",
|
|
134
|
-
className: "h-5 w-5 bg-transparent",
|
|
135
|
-
onClick: () => handleUpdateQuantity(item.id, item.quantity + 1),
|
|
136
|
-
children: /* @__PURE__ */ jsx(Plus, { className: "h-3 w-3" })
|
|
137
|
-
}
|
|
138
|
-
)
|
|
139
|
-
] })
|
|
140
|
-
] })
|
|
141
|
-
] })
|
|
142
|
-
] }, item.id)) }) }),
|
|
143
|
-
items.length > 0 && totals && /* @__PURE__ */ jsxs("div", { className: " p-6 space-y-4", children: [
|
|
144
|
-
/* @__PURE__ */ jsxs("div", { className: "flex justify-between text-sm", children: [
|
|
145
|
-
/* @__PURE__ */ jsx("span", { className: "text-(--enad-text-muted-color)", children: subtotal }),
|
|
146
|
-
/* @__PURE__ */ jsx("span", { className: "text-(--enad-text-primary-color)", children: formatPrice(totals.subTotal) })
|
|
147
|
-
] }),
|
|
148
|
-
totals.discountTotal > 0 && /* @__PURE__ */ jsxs("div", { className: "flex justify-between text-sm", children: [
|
|
149
|
-
/* @__PURE__ */ jsx("span", { className: "text-(--enad-text-muted-color)", children: discount }),
|
|
150
|
-
/* @__PURE__ */ jsxs("span", { className: "text-(--enad-success-color)", children: [
|
|
151
|
-
"-",
|
|
152
|
-
formatPrice(totals.discountTotal)
|
|
153
|
-
] })
|
|
154
|
-
] }),
|
|
155
|
-
totals.taxTotal > 0 && /* @__PURE__ */ jsxs("div", { className: "flex justify-between text-sm", children: [
|
|
156
|
-
/* @__PURE__ */ jsx("span", { className: "text-(--enad-text-muted-color)", children: tax }),
|
|
157
|
-
/* @__PURE__ */ jsx("span", { className: "text-(--enad-text-primary-color)", children: formatPrice(totals.taxTotal) })
|
|
158
|
-
] }),
|
|
159
|
-
/* @__PURE__ */ jsxs("div", { className: "flex justify-between text-lg font-bold pt-4 border-t border-(--enad-border-color)", children: [
|
|
160
|
-
/* @__PURE__ */ jsx("span", { className: "text-(--enad-text-primary-color)", children: total }),
|
|
161
|
-
/* @__PURE__ */ jsx("span", { className: "text-(--enad-text-primary-color)", children: formatPrice(totals.grandTotal) })
|
|
162
|
-
] }),
|
|
163
|
-
/* @__PURE__ */ jsx(
|
|
164
|
-
Button,
|
|
165
|
-
{
|
|
166
|
-
className: "w-full py-6 text-sm font-medium uppercase tracking-wider",
|
|
167
|
-
size: "lg",
|
|
168
|
-
children: proceedToCheckout
|
|
169
|
-
}
|
|
170
|
-
)
|
|
171
|
-
] })
|
|
172
|
-
] })
|
|
26
|
+
variant: "ghost",
|
|
27
|
+
size: "icon",
|
|
28
|
+
className: "flex-shrink-0",
|
|
29
|
+
onClick: () => productId && onRemove(productId),
|
|
30
|
+
disabled: isDeleting || !productId,
|
|
31
|
+
"aria-label": `${removeLabel} ${productName}`,
|
|
32
|
+
children: /* @__PURE__ */ jsx(TrashIcon, { className: "size-4" })
|
|
173
33
|
}
|
|
174
34
|
)
|
|
175
35
|
] });
|
|
176
36
|
}
|
|
37
|
+
function WishlistItemRow({
|
|
38
|
+
item,
|
|
39
|
+
onMoveToCart,
|
|
40
|
+
onRemove,
|
|
41
|
+
isDeleting,
|
|
42
|
+
removeLabel,
|
|
43
|
+
moveToCartLabel
|
|
44
|
+
}) {
|
|
45
|
+
const product = item.product;
|
|
46
|
+
const productName = product?.product_name ?? "Unknown Product";
|
|
47
|
+
const imageUrl = product?.images?.[0]?.image_url;
|
|
48
|
+
const imageAlt = product?.images?.[0]?.alt_text ?? productName;
|
|
49
|
+
const productId = item.product_id ?? product?.id;
|
|
50
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex gap-4", role: "listitem", children: [
|
|
51
|
+
/* @__PURE__ */ jsx(WishlistItemImage, { imageUrl, imageAlt }),
|
|
52
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-1 min-w-0 flex-col justify-between", children: [
|
|
53
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-(--enad-text-primary-color)", children: productName }),
|
|
54
|
+
/* @__PURE__ */ jsx(
|
|
55
|
+
WishlistItemActions,
|
|
56
|
+
{
|
|
57
|
+
productId,
|
|
58
|
+
productName,
|
|
59
|
+
onMoveToCart,
|
|
60
|
+
onRemove,
|
|
61
|
+
isDeleting,
|
|
62
|
+
removeLabel,
|
|
63
|
+
moveToCartLabel
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
] })
|
|
67
|
+
] });
|
|
68
|
+
}
|
|
69
|
+
function WishlistLoadingSkeleton() {
|
|
70
|
+
return /* @__PURE__ */ jsx("div", { className: "space-y-6", "aria-busy": "true", "aria-label": "Loading wishlist items", children: [1, 2, 3].map((i) => /* @__PURE__ */ jsxs("div", { className: "flex gap-4 animate-pulse", children: [
|
|
71
|
+
/* @__PURE__ */ jsx("div", { className: "size-24 flex-shrink-0 bg-(--enad-border-color) rounded-(--enad-border-radius)" }),
|
|
72
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-1 flex-col gap-2", children: [
|
|
73
|
+
/* @__PURE__ */ jsx("div", { className: "h-4 w-3/4 bg-(--enad-border-color) rounded-(--enad-border-radius)" }),
|
|
74
|
+
/* @__PURE__ */ jsx("div", { className: "h-4 w-1/3 bg-(--enad-border-color) rounded-(--enad-border-radius)" })
|
|
75
|
+
] })
|
|
76
|
+
] }, i)) });
|
|
77
|
+
}
|
|
78
|
+
function WishlistEmptyState({
|
|
79
|
+
emptyTitle,
|
|
80
|
+
emptyDescription,
|
|
81
|
+
continueShoppingLabel,
|
|
82
|
+
onClose
|
|
83
|
+
}) {
|
|
84
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex h-full flex-col items-center justify-center text-center", children: [
|
|
85
|
+
/* @__PURE__ */ jsx("p", { className: "font-medium text-(--enad-text-primary-color) mb-2", children: emptyTitle }),
|
|
86
|
+
/* @__PURE__ */ jsx("p", { className: "text-(--enad-text-muted-color) mb-4", children: emptyDescription }),
|
|
87
|
+
/* @__PURE__ */ jsx(Button, { onClick: onClose, variant: "outline", children: continueShoppingLabel })
|
|
88
|
+
] });
|
|
89
|
+
}
|
|
90
|
+
function WishlistContent({
|
|
91
|
+
isLoading,
|
|
92
|
+
items,
|
|
93
|
+
onMoveToCart,
|
|
94
|
+
handleMoveToCart,
|
|
95
|
+
handleRemoveItem,
|
|
96
|
+
isDeletingItemsFromWishlist,
|
|
97
|
+
removeLabel,
|
|
98
|
+
moveToCartLabel,
|
|
99
|
+
emptyTitle,
|
|
100
|
+
emptyDescription,
|
|
101
|
+
continueShoppingLabel,
|
|
102
|
+
onClose
|
|
103
|
+
}) {
|
|
104
|
+
if (isLoading) return /* @__PURE__ */ jsx(WishlistLoadingSkeleton, {});
|
|
105
|
+
if (items.length === 0) {
|
|
106
|
+
return /* @__PURE__ */ jsx(
|
|
107
|
+
WishlistEmptyState,
|
|
108
|
+
{
|
|
109
|
+
emptyTitle,
|
|
110
|
+
emptyDescription,
|
|
111
|
+
continueShoppingLabel,
|
|
112
|
+
onClose
|
|
113
|
+
}
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
return /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-6", role: "list", "aria-label": "Wishlist items", children: items.map((item) => /* @__PURE__ */ jsx(
|
|
117
|
+
WishlistItemRow,
|
|
118
|
+
{
|
|
119
|
+
item,
|
|
120
|
+
onMoveToCart: onMoveToCart ? handleMoveToCart : void 0,
|
|
121
|
+
onRemove: handleRemoveItem,
|
|
122
|
+
isDeleting: isDeletingItemsFromWishlist,
|
|
123
|
+
removeLabel,
|
|
124
|
+
moveToCartLabel
|
|
125
|
+
},
|
|
126
|
+
item.id
|
|
127
|
+
)) });
|
|
128
|
+
}
|
|
129
|
+
function WishlistDrawer({
|
|
130
|
+
isOpen,
|
|
131
|
+
onClose,
|
|
132
|
+
wishlistId,
|
|
133
|
+
onMoveToCart,
|
|
134
|
+
className,
|
|
135
|
+
labels = {}
|
|
136
|
+
}) {
|
|
137
|
+
const CloseIcon = useIcon("close");
|
|
138
|
+
const {
|
|
139
|
+
title = "Your Wishlist",
|
|
140
|
+
emptyTitle = "Your wishlist is empty",
|
|
141
|
+
emptyDescription = "Save items you love to your wishlist.",
|
|
142
|
+
removeLabel = "Remove",
|
|
143
|
+
moveToCartLabel = "Move to Cart",
|
|
144
|
+
continueShoppingLabel = "Continue Shopping"
|
|
145
|
+
} = labels;
|
|
146
|
+
const { wishlist, isLoading } = useWishlist(wishlistId ? { wishlistId } : void 0);
|
|
147
|
+
const { deleteItems, isDeletingItemsFromWishlist } = useWishlistActions();
|
|
148
|
+
const items = wishlist?.items ?? [];
|
|
149
|
+
const handleRemoveItem = (productId) => {
|
|
150
|
+
if (!wishlistId || !productId) return;
|
|
151
|
+
deleteItems({ wishlistId, options: { product_ids: [productId] } });
|
|
152
|
+
};
|
|
153
|
+
const handleMoveToCart = (productId) => {
|
|
154
|
+
if (onMoveToCart && productId) {
|
|
155
|
+
onMoveToCart(productId);
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
return /* @__PURE__ */ jsx(Sheet, { open: isOpen, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ jsxs(
|
|
159
|
+
SheetContent,
|
|
160
|
+
{
|
|
161
|
+
side: "right",
|
|
162
|
+
className: `flex w-full flex-col p-0 sm:max-w-[480px] ${className ?? ""}`,
|
|
163
|
+
showCloseButton: false,
|
|
164
|
+
children: [
|
|
165
|
+
/* @__PURE__ */ jsxs(SheetHeader, { className: "flex flex-row items-center justify-between p-6 pb-0", children: [
|
|
166
|
+
/* @__PURE__ */ jsx(
|
|
167
|
+
SheetTitle,
|
|
168
|
+
{
|
|
169
|
+
className: "text-xl font-heading font-bold tracking-wider uppercase text-(--enad-text-primary-color)",
|
|
170
|
+
children: title
|
|
171
|
+
}
|
|
172
|
+
),
|
|
173
|
+
/* @__PURE__ */ jsx(Button, { variant: "ghost", size: "icon", onClick: onClose, "aria-label": "Close wishlist", children: /* @__PURE__ */ jsx(CloseIcon, { className: "size-5" }) })
|
|
174
|
+
] }),
|
|
175
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto px-6 py-6", children: /* @__PURE__ */ jsx(
|
|
176
|
+
WishlistContent,
|
|
177
|
+
{
|
|
178
|
+
isLoading,
|
|
179
|
+
items,
|
|
180
|
+
onMoveToCart,
|
|
181
|
+
handleMoveToCart,
|
|
182
|
+
handleRemoveItem,
|
|
183
|
+
isDeletingItemsFromWishlist,
|
|
184
|
+
removeLabel,
|
|
185
|
+
moveToCartLabel,
|
|
186
|
+
emptyTitle,
|
|
187
|
+
emptyDescription,
|
|
188
|
+
continueShoppingLabel,
|
|
189
|
+
onClose
|
|
190
|
+
}
|
|
191
|
+
) })
|
|
192
|
+
]
|
|
193
|
+
}
|
|
194
|
+
) });
|
|
195
|
+
}
|
|
177
196
|
export {
|
|
178
|
-
|
|
197
|
+
WishlistDrawer
|
|
179
198
|
};
|
|
180
199
|
//# sourceMappingURL=wishlist-drawer.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/client/wishlist/wishlist-drawer.tsx"],"sourcesContent":["\"use client\"\n\nimport { X, Minus, Plus, Trash2 } from \"lucide-react\"\nimport Link from \"next/link\"\nimport { useCart } from \"../cart/hooks/useCart\"\n\ninterface CartDrawerProps {\n isOpen: boolean\n onClose: () => void\n labels?: {\n title?: string\n emptyCartMessage?: string\n continueShopping?: string\n subtotal?: string\n discount?: string\n tax?: string\n total?: string\n proceedToCheckout?: string\n }\n}\n\n// Inline Button Component\ninterface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n variant?: \"ghost\" | \"outline\" | \"default\"\n size?: \"icon\" | \"lg\" | \"default\"\n children: React.ReactNode\n}\n\nconst Button = ({\n variant = \"default\",\n size = \"default\",\n className = \"\",\n children,\n ...props\n}: ButtonProps) => {\n const baseClasses =\n \"inline-flex items-center justify-center font-medium transition-colors disabled:opacity-50 disabled:pointer-events-none\"\n\n const variantClasses = {\n default: \"bg-(--enad-button-bg) text-(--enad-button-color) hover:bg-(--enad-button-hover-bg)\",\n ghost: \"bg-transparent hover:bg-(--enad-border-color)\",\n outline: \"border border-(--enad-border-color) bg-transparent hover:bg-(--enad-border-color)\",\n }\n\n const sizeClasses = {\n default: \"h-10 px-4 py-2 rounded-(--enad-border-radius)\",\n lg: \"h-12 px-6 py-3 rounded-(--enad-border-radius)\",\n icon: \"h-5 w-5 rounded-(--enad-border-radius)\",\n }\n\n return (\n <button\n className={`${baseClasses} ${variantClasses[variant]} ${sizeClasses[size]} ${className}`}\n {...props}\n >\n {children}\n </button>\n )\n}\n\nexport function CartDrawer({ isOpen, onClose, labels = {} }: CartDrawerProps) {\n const {\n title = \"Shopping Cart\",\n emptyCartMessage = \"Your cart is empty\",\n continueShopping = \"Continue Shopping\",\n subtotal = \"Subtotal\",\n discount = \"Discount\",\n tax = \"Tax\",\n total = \"Total\",\n proceedToCheckout = \"Proceed to Checkout\",\n } = labels\n const { cart, removeItem, updateItem } = useCart()\n\n const items = cart?.items || []\n const totals = cart?.totals\n\n const handleUpdateQuantity = (itemId: string, newQuantity: number) => {\n updateItem({ itemId, quantity: newQuantity })\n }\n\n const handleRemoveItem = (itemId: string) => {\n removeItem({ itemId })\n }\n\n const formatPrice = (amount: number) => {\n return `${(amount / 100).toFixed(2)} ${cart?.currencyCode || \"USD\"}`\n }\n\n return (\n <>\n {/* Backdrop */}\n <div\n className={`fixed font-enad inset-0 bg-black/60 backdrop-blur-sm z-50 transition-opacity duration-300 ${\n isOpen ? \"opacity-100\" : \"opacity-0 pointer-events-none\"\n }`}\n onClick={onClose}\n />\n\n {/* Drawer */}\n <div\n className={`fixed top-0 right-0 h-full w-full md:w-[480px] bg-(--enad-surface) z-50 transform transition-transform duration-300 ease-in-out ${\n isOpen ? \"translate-x-0\" : \"translate-x-full\"\n }`}\n >\n <div className=\"flex flex-col h-full\">\n {/* Header */}\n <div className=\"flex items-center justify-between p-6\">\n <h2\n className=\"text-xl font-bold tracking-wider uppercase text-(--enad-text-primary-color)\"\n style={{ fontFamily: \"var(--font-oswald)\" }}\n >\n {title}\n </h2>\n <Button variant=\"ghost\" size=\"icon\" onClick={onClose}>\n <X className=\"h-5 w-5\" />\n </Button>\n </div>\n\n {/* Cart Items */}\n <div className=\"flex-1 overflow-y-auto p-6\">\n {items.length === 0 ? (\n <div className=\"flex flex-col items-center justify-center h-full text-center\">\n <p className=\"text-(--enad-text-muted-color) mb-4\">{emptyCartMessage}</p>\n <Button onClick={onClose} variant=\"outline\">\n {continueShopping}\n </Button>\n </div>\n ) : (\n <div className=\"space-y-6\">\n {items.map((item) => (\n <div key={item.id} className=\"flex gap-4\">\n {/* Product Image */}\n <div className=\"relative w-24 h-24 flex-shrink-0 bg-(--enad-border-color) rounded-(--enad-border-radius) overflow-hidden\">\n {item.imageUrl ? (\n <img\n src={item.imageUrl || \"/placeholder.svg\"}\n alt={item.displayName}\n className=\"object-cover\"\n />\n ) : (\n <div className=\"w-full h-full bg-(--enad-border-color)\" />\n )}\n </div>\n\n {/* Product Info */}\n <div className=\"flex flex-1 min-w-0 justify-between flex-col\">\n <div className=\"flex justify-between gap-2 mb-2\">\n <Link\n href={`/products/${item.customAttributes?.productSlug || item.productVariantId}`}\n className=\"font-medium text-sm text-(--enad-link-color) hover:text-(--enad-link-hover-color) transition-colors\"\n onClick={onClose}\n >\n {item.displayName}\n </Link>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className=\"h-5 w-5 flex-shrink-0\"\n onClick={() => handleRemoveItem(item.id)}\n >\n <Trash2 className=\"h-4 w-4\" />\n </Button>\n </div>\n\n <div>\n <p className=\"text-sm text-(--enad-text-muted-color) mb-1\">\n {formatPrice(item.salePriceAmount)}\n </p>\n\n {/* Quantity Controls */}\n <div className=\"flex items-center gap-2\">\n <Button\n variant=\"outline\"\n size=\"icon\"\n className=\"h-5 w-5 bg-transparent\"\n onClick={() => handleUpdateQuantity(item.id, item.quantity - 1)}\n disabled={item.quantity <= 1}\n >\n <Minus className=\"h-3 w-3\" />\n </Button>\n <span className=\"text-sm font-medium w-8 text-center text-(--enad-text-primary-color)\">\n {item.quantity}\n </span>\n <Button\n variant=\"outline\"\n size=\"icon\"\n className=\"h-5 w-5 bg-transparent\"\n onClick={() => handleUpdateQuantity(item.id, item.quantity + 1)}\n >\n <Plus className=\"h-3 w-3\" />\n </Button>\n </div>\n </div>\n </div>\n </div>\n ))}\n </div>\n )}\n </div>\n\n {/* Footer with Totals */}\n {items.length > 0 && totals && (\n <div className=\" p-6 space-y-4\">\n {/* Subtotal */}\n <div className=\"flex justify-between text-sm\">\n <span className=\"text-(--enad-text-muted-color)\">{subtotal}</span>\n <span className=\"text-(--enad-text-primary-color)\">\n {formatPrice(totals.subTotal)}\n </span>\n </div>\n\n {/* Discount */}\n {totals.discountTotal > 0 && (\n <div className=\"flex justify-between text-sm\">\n <span className=\"text-(--enad-text-muted-color)\">{discount}</span>\n <span className=\"text-(--enad-success-color)\">\n -{formatPrice(totals.discountTotal)}\n </span>\n </div>\n )}\n\n {/* Tax */}\n {totals.taxTotal > 0 && (\n <div className=\"flex justify-between text-sm\">\n <span className=\"text-(--enad-text-muted-color)\">{tax}</span>\n <span className=\"text-(--enad-text-primary-color)\">\n {formatPrice(totals.taxTotal)}\n </span>\n </div>\n )}\n\n {/* Total */}\n <div className=\"flex justify-between text-lg font-bold pt-4 border-t border-(--enad-border-color)\">\n <span className=\"text-(--enad-text-primary-color)\">{total}</span>\n <span className=\"text-(--enad-text-primary-color)\">\n {formatPrice(totals.grandTotal)}\n </span>\n </div>\n\n {/* Checkout Button */}\n <Button\n className=\"w-full py-6 text-sm font-medium uppercase tracking-wider\"\n size=\"lg\"\n >\n {proceedToCheckout}\n </Button>\n </div>\n )}\n </div>\n </div>\n </>\n )\n}\n"],"mappings":";AAmDI,SAsCA,UAtCA,KAuDM,YAvDN;AAjDJ,SAAS,GAAG,OAAO,MAAM,cAAc;AACvC,OAAO,UAAU;AACjB,SAAS,eAAe;AAwBxB,MAAM,SAAS,CAAC;AAAA,EACd,UAAU;AAAA,EACV,OAAO;AAAA,EACP,YAAY;AAAA,EACZ;AAAA,EACA,GAAG;AACL,MAAmB;AACjB,QAAM,cACJ;AAEF,QAAM,iBAAiB;AAAA,IACrB,SAAS;AAAA,IACT,OAAO;AAAA,IACP,SAAS;AAAA,EACX;AAEA,QAAM,cAAc;AAAA,IAClB,SAAS;AAAA,IACT,IAAI;AAAA,IACJ,MAAM;AAAA,EACR;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,WAAW,IAAI,eAAe,OAAO,CAAC,IAAI,YAAY,IAAI,CAAC,IAAI,SAAS;AAAA,MACrF,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ;AAEO,SAAS,WAAW,EAAE,QAAQ,SAAS,SAAS,CAAC,EAAE,GAAoB;AAC5E,QAAM;AAAA,IACJ,QAAQ;AAAA,IACR,mBAAmB;AAAA,IACnB,mBAAmB;AAAA,IACnB,WAAW;AAAA,IACX,WAAW;AAAA,IACX,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,oBAAoB;AAAA,EACtB,IAAI;AACJ,QAAM,EAAE,MAAM,YAAY,WAAW,IAAI,QAAQ;AAEjD,QAAM,QAAQ,MAAM,SAAS,CAAC;AAC9B,QAAM,SAAS,MAAM;AAErB,QAAM,uBAAuB,CAAC,QAAgB,gBAAwB;AACpE,eAAW,EAAE,QAAQ,UAAU,YAAY,CAAC;AAAA,EA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O,QAAQ,GAC9B;AAAA,eACF;AAAA,YAGC,OAAO,gBAAgB,KACtB,qBAAC,SAAI,WAAU,gCACb;AAAA,kCAAC,UAAK,WAAU,kCAAkC,oBAAS;AAAA,cAC3D,qBAAC,UAAK,WAAU,+BAA8B;AAAA;AAAA,gBAC1C,YAAY,OAAO,aAAa;AAAA,iBACpC;AAAA,eACF;AAAA,YAID,OAAO,WAAW,KACjB,qBAAC,SAAI,WAAU,gCACb;AAAA,kCAAC,UAAK,WAAU,kCAAkC,eAAI;AAAA,cACtD,oBAAC,UAAK,WAAU,oCACb,sBAAY,OAAO,QAAQ,GAC9B;AAAA,eACF;AAAA,YAIF,qBAAC,SAAI,WAAU,qFACb;AAAA,kCAAC,UAAK,WAAU,oCAAoC,iBAAM;AAAA,cAC1D,oBAAC,UAAK,WAAU,oCACb,sBAAY,OAAO,UAAU,GAChC;AAAA,eACF;AAAA,YAGA;AAAA,cAAC;AAAA;AAAA,gBACC,WAAU;AAAA,gBACV,MAAK;AAAA,gBAEJ;AAAA;AAAA,YACH;AAAA,aACF;AAAA,WAEJ;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/client/wishlist/wishlist-drawer.tsx"],"sourcesContent":["\"use client\"\n\nimport { useIcon } from \"../icons/icon-context\"\nimport { Button } from \"../ui/button\"\nimport { Sheet, SheetContent, SheetHeader, SheetTitle } from \"../ui/sheet\"\nimport { useWishlist } from \"./hooks/useWishlist\"\nimport { useWishlistActions } from \"./hooks/useWishlistActions\"\n\ninterface WishlistItemImage {\n image_url?: string\n alt_text?: string\n}\n\ninterface WishlistItemProduct {\n id?: string\n product_name?: string\n images?: WishlistItemImage[]\n slug?: string\n}\n\ninterface WishlistDrawerItem {\n id?: string\n product_id?: string\n product?: WishlistItemProduct\n}\n\nexport interface WishlistDrawerProps {\n isOpen: boolean\n onClose: () => void\n wishlistId?: string\n onMoveToCart?: (productId: string) => void\n className?: string\n labels?: {\n title?: string\n emptyTitle?: string\n emptyDescription?: string\n removeLabel?: string\n moveToCartLabel?: string\n continueShoppingLabel?: string\n }\n}\n\nfunction WishlistItemImage({ imageUrl, imageAlt }: { imageUrl?: string; imageAlt: string }) {\n return (\n <div className=\"relative size-24 flex-shrink-0 overflow-hidden rounded-(--enad-border-radius) bg-(--enad-border-color)\">\n {imageUrl ? (\n <img src={imageUrl} alt={imageAlt} loading=\"lazy\" className=\"size-full object-cover\" />\n ) : (\n <div className=\"size-full bg-(--enad-border-color)\" />\n )}\n </div>\n )\n}\n\nfunction WishlistItemActions({\n productId,\n productName,\n onMoveToCart,\n onRemove,\n isDeleting,\n removeLabel,\n moveToCartLabel,\n}: {\n productId?: string\n productName: string\n onMoveToCart?: (productId: string) => void\n onRemove: (productId: string) => void\n isDeleting: boolean\n removeLabel: string\n moveToCartLabel: string\n}) {\n const TrashIcon = useIcon(\"trash\")\n\n return (\n <div className=\"flex items-center gap-2 mt-2\">\n {onMoveToCart && productId && (\n <Button variant=\"outline\" size=\"sm\" onClick={() => onMoveToCart(productId)}>\n {moveToCartLabel}\n </Button>\n )}\n\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className=\"flex-shrink-0\"\n onClick={() => productId && onRemove(productId)}\n disabled={isDeleting || !productId}\n aria-label={`${removeLabel} ${productName}`}\n >\n <TrashIcon className=\"size-4\" />\n </Button>\n </div>\n )\n}\n\nfunction WishlistItemRow({\n item,\n onMoveToCart,\n onRemove,\n isDeleting,\n removeLabel,\n moveToCartLabel,\n}: {\n item: WishlistDrawerItem\n onMoveToCart?: (productId: string) => void\n onRemove: (productId: string) => void\n isDeleting: boolean\n removeLabel: string\n moveToCartLabel: string\n}) {\n const product = item.product\n const productName = product?.product_name ?? \"Unknown Product\"\n const imageUrl = product?.images?.[0]?.image_url\n const imageAlt = product?.images?.[0]?.alt_text ?? productName\n const productId = item.product_id ?? product?.id\n\n return (\n <div className=\"flex gap-4\" role=\"listitem\">\n <WishlistItemImage imageUrl={imageUrl} imageAlt={imageAlt} />\n\n <div className=\"flex flex-1 min-w-0 flex-col justify-between\">\n <p className=\"text-sm font-medium text-(--enad-text-primary-color)\">{productName}</p>\n\n <WishlistItemActions\n productId={productId}\n productName={productName}\n onMoveToCart={onMoveToCart}\n onRemove={onRemove}\n isDeleting={isDeleting}\n removeLabel={removeLabel}\n moveToCartLabel={moveToCartLabel}\n />\n </div>\n </div>\n )\n}\n\nfunction WishlistLoadingSkeleton() {\n return (\n <div className=\"space-y-6\" aria-busy=\"true\" aria-label=\"Loading wishlist items\">\n {[1, 2, 3].map((i) => (\n <div key={i} className=\"flex gap-4 animate-pulse\">\n <div className=\"size-24 flex-shrink-0 bg-(--enad-border-color) rounded-(--enad-border-radius)\" />\n <div className=\"flex flex-1 flex-col gap-2\">\n <div className=\"h-4 w-3/4 bg-(--enad-border-color) rounded-(--enad-border-radius)\" />\n <div className=\"h-4 w-1/3 bg-(--enad-border-color) rounded-(--enad-border-radius)\" />\n </div>\n </div>\n ))}\n </div>\n )\n}\n\nfunction WishlistEmptyState({\n emptyTitle,\n emptyDescription,\n continueShoppingLabel,\n onClose,\n}: {\n emptyTitle: string\n emptyDescription: string\n continueShoppingLabel: string\n onClose: () => void\n}) {\n return (\n <div className=\"flex h-full flex-col items-center justify-center text-center\">\n <p className=\"font-medium text-(--enad-text-primary-color) mb-2\">{emptyTitle}</p>\n <p className=\"text-(--enad-text-muted-color) mb-4\">{emptyDescription}</p>\n <Button onClick={onClose} variant=\"outline\">\n {continueShoppingLabel}\n </Button>\n </div>\n )\n}\n\nfunction WishlistContent({\n isLoading,\n items,\n onMoveToCart,\n handleMoveToCart,\n handleRemoveItem,\n isDeletingItemsFromWishlist,\n removeLabel,\n moveToCartLabel,\n emptyTitle,\n emptyDescription,\n continueShoppingLabel,\n onClose,\n}: {\n isLoading: boolean\n items: WishlistDrawerItem[]\n onMoveToCart?: (productId: string) => void\n handleMoveToCart: (productId: string) => void\n handleRemoveItem: (productId: string) => void\n isDeletingItemsFromWishlist: boolean\n removeLabel: string\n moveToCartLabel: string\n emptyTitle: string\n emptyDescription: string\n continueShoppingLabel: string\n onClose: () => void\n}) {\n if (isLoading) return <WishlistLoadingSkeleton />\n if (items.length === 0) {\n return (\n <WishlistEmptyState\n emptyTitle={emptyTitle}\n emptyDescription={emptyDescription}\n continueShoppingLabel={continueShoppingLabel}\n onClose={onClose}\n />\n )\n }\n return (\n <div className=\"flex flex-col gap-6\" role=\"list\" aria-label=\"Wishlist items\">\n {items.map((item) => (\n <WishlistItemRow\n key={item.id}\n item={item}\n onMoveToCart={onMoveToCart ? handleMoveToCart : undefined}\n onRemove={handleRemoveItem}\n isDeleting={isDeletingItemsFromWishlist}\n removeLabel={removeLabel}\n moveToCartLabel={moveToCartLabel}\n />\n ))}\n </div>\n )\n}\n\nexport function WishlistDrawer({\n isOpen,\n onClose,\n wishlistId,\n onMoveToCart,\n className,\n labels = {},\n}: WishlistDrawerProps) {\n const CloseIcon = useIcon(\"close\")\n const {\n title = \"Your Wishlist\",\n emptyTitle = \"Your wishlist is empty\",\n emptyDescription = \"Save items you love to your wishlist.\",\n removeLabel = \"Remove\",\n moveToCartLabel = \"Move to Cart\",\n continueShoppingLabel = \"Continue Shopping\",\n } = labels\n\n const { wishlist, isLoading } = useWishlist(wishlistId ? { wishlistId } : undefined)\n const { deleteItems, isDeletingItemsFromWishlist } = useWishlistActions()\n\n const items = (wishlist?.items ?? []) as WishlistDrawerItem[]\n\n const handleRemoveItem = (productId: string) => {\n if (!wishlistId || !productId) return\n deleteItems({ wishlistId, options: { product_ids: [productId] } })\n }\n\n const handleMoveToCart = (productId: string) => {\n if (onMoveToCart && productId) {\n onMoveToCart(productId)\n }\n }\n\n return (\n <Sheet open={isOpen} onOpenChange={(open) => !open && onClose()}>\n <SheetContent\n side=\"right\"\n className={`flex w-full flex-col p-0 sm:max-w-[480px] ${className ?? \"\"}`}\n showCloseButton={false}\n >\n {/* Header */}\n <SheetHeader className=\"flex flex-row items-center justify-between p-6 pb-0\">\n <SheetTitle\n className=\"text-xl font-heading font-bold tracking-wider uppercase text-(--enad-text-primary-color)\"\n >\n {title}\n </SheetTitle>\n <Button variant=\"ghost\" size=\"icon\" onClick={onClose} aria-label=\"Close wishlist\">\n <CloseIcon className=\"size-5\" />\n </Button>\n </SheetHeader>\n\n {/* Wishlist Items */}\n <div className=\"flex-1 overflow-y-auto px-6 py-6\">\n <WishlistContent\n isLoading={isLoading}\n items={items}\n onMoveToCart={onMoveToCart}\n handleMoveToCart={handleMoveToCart}\n handleRemoveItem={handleRemoveItem}\n isDeletingItemsFromWishlist={isDeletingItemsFromWishlist}\n removeLabel={removeLabel}\n moveToCartLabel={moveToCartLabel}\n emptyTitle={emptyTitle}\n emptyDescription={emptyDescription}\n continueShoppingLabel={continueShoppingLabel}\n onClose={onClose}\n />\n </div>\n </SheetContent>\n </Sheet>\n )\n}\n"],"mappings":";AA8CQ,cA4BJ,YA5BI;AA5CR,SAAS,eAAe;AACxB,SAAS,cAAc;AACvB,SAAS,OAAO,cAAc,aAAa,kBAAkB;AAC7D,SAAS,mBAAmB;AAC5B,SAAS,0BAA0B;AAoCnC,SAAS,kBAAkB,EAAE,UAAU,SAAS,GAA4C;AAC1F,SACE,oBAAC,SAAI,WAAU,0GACZ,qBACC,oBAAC,SAAI,KAAK,UAAU,KAAK,UAAU,SAAQ,QAAO,WAAU,0BAAyB,IAErF,oBAAC,SAAI,WAAU,sCAAqC,GAExD;AAEJ;AAEA,SAAS,oBAAoB;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAQG;AACD,QAAM,YAAY,QAAQ,OAAO;AAEjC,SACE,qBAAC,SAAI,WAAU,gCACZ;AAAA,oBAAgB,aACf,oBAAC,UAAO,SAAQ,WAAU,MAAK,MAAK,SAAS,MAAM,aAAa,SAAS,GACtE,2BACH;AAAA,IAGF;AAAA,MAAC;AAAA;AAAA,QACC,SAAQ;AAAA,QACR,MAAK;AA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