@enadhq/enad-react-sdk 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +288 -0
- package/dist/client/cart/adapters/brink.d.ts +29 -0
- package/dist/client/cart/adapters/brink.d.ts.map +1 -0
- package/dist/client/cart/adapters/brink.mjs +154 -0
- package/dist/client/cart/adapters/brink.mjs.map +1 -0
- package/dist/client/cart/adapters/index.d.ts +3 -0
- package/dist/client/cart/adapters/index.d.ts.map +1 -0
- package/dist/client/cart/adapters/index.mjs +5 -0
- package/dist/client/cart/adapters/index.mjs.map +1 -0
- package/dist/client/cart/adapters/mock.d.ts +20 -0
- package/dist/client/cart/adapters/mock.d.ts.map +1 -0
- package/dist/client/cart/adapters/mock.mjs +76 -0
- package/dist/client/cart/adapters/mock.mjs.map +1 -0
- package/dist/client/cart/components/cart-drawer.d.ts +17 -0
- package/dist/client/cart/components/cart-drawer.d.ts.map +1 -0
- package/dist/client/cart/components/cart-drawer.mjs +311 -0
- package/dist/client/cart/components/cart-drawer.mjs.map +1 -0
- package/dist/client/cart/components/cart-trigger.d.ts +10 -0
- package/dist/client/cart/components/cart-trigger.d.ts.map +1 -0
- package/dist/client/cart/components/cart-trigger.mjs +34 -0
- package/dist/client/cart/components/cart-trigger.mjs.map +1 -0
- package/dist/client/cart/components/promo-code-input.d.ts +16 -0
- package/dist/client/cart/components/promo-code-input.d.ts.map +1 -0
- package/dist/client/cart/components/promo-code-input.mjs +92 -0
- package/dist/client/cart/components/promo-code-input.mjs.map +1 -0
- package/dist/client/cart/constants/session.d.ts +2 -0
- package/dist/client/cart/constants/session.d.ts.map +1 -0
- package/dist/client/cart/constants/session.mjs +5 -0
- package/dist/client/cart/constants/session.mjs.map +1 -0
- package/dist/client/cart/contexts/cart.d.ts +36 -0
- package/dist/client/cart/contexts/cart.d.ts.map +1 -0
- package/dist/client/cart/contexts/cart.mjs +20 -0
- package/dist/client/cart/contexts/cart.mjs.map +1 -0
- package/dist/client/cart/hooks/useCart.d.ts +26 -0
- package/dist/client/cart/hooks/useCart.d.ts.map +1 -0
- package/dist/client/cart/hooks/useCart.mjs +25 -0
- package/dist/client/cart/hooks/useCart.mjs.map +1 -0
- package/dist/client/cart/hooks/useCartActions.d.ts +25 -0
- package/dist/client/cart/hooks/useCartActions.d.ts.map +1 -0
- package/dist/client/cart/hooks/useCartActions.mjs +49 -0
- package/dist/client/cart/hooks/useCartActions.mjs.map +1 -0
- package/dist/client/cart/index.d.ts +12 -0
- package/dist/client/cart/index.d.ts.map +1 -0
- package/dist/client/cart/index.mjs +16 -0
- package/dist/client/cart/index.mjs.map +1 -0
- package/dist/client/cart/queries/addToCartQueryFn.d.ts +7 -0
- package/dist/client/cart/queries/addToCartQueryFn.d.ts.map +1 -0
- package/dist/client/cart/queries/addToCartQueryFn.mjs +27 -0
- package/dist/client/cart/queries/addToCartQueryFn.mjs.map +1 -0
- package/dist/client/cart/queries/getCartQueryFn.d.ts +4 -0
- package/dist/client/cart/queries/getCartQueryFn.d.ts.map +1 -0
- package/dist/client/cart/queries/getCartQueryFn.mjs +34 -0
- package/dist/client/cart/queries/getCartQueryFn.mjs.map +1 -0
- package/dist/client/cart/queries/removeCartItemQueryFn.d.ts +6 -0
- package/dist/client/cart/queries/removeCartItemQueryFn.d.ts.map +1 -0
- package/dist/client/cart/queries/removeCartItemQueryFn.mjs +24 -0
- package/dist/client/cart/queries/removeCartItemQueryFn.mjs.map +1 -0
- package/dist/client/cart/queries/updateCartItemQueryFn.d.ts +7 -0
- package/dist/client/cart/queries/updateCartItemQueryFn.d.ts.map +1 -0
- package/dist/client/cart/queries/updateCartItemQueryFn.mjs +27 -0
- package/dist/client/cart/queries/updateCartItemQueryFn.mjs.map +1 -0
- package/dist/client/cart/types/adapter.d.ts +110 -0
- package/dist/client/cart/types/adapter.d.ts.map +1 -0
- package/dist/client/cart/types/adapter.mjs +12 -0
- package/dist/client/cart/types/adapter.mjs.map +1 -0
- package/dist/client/cart/types/cart.d.ts +52 -0
- package/dist/client/cart/types/cart.d.ts.map +1 -0
- package/dist/client/cart/types/cart.mjs +1 -0
- package/dist/client/cart/types/cart.mjs.map +1 -0
- package/dist/client/cart/utils/session.d.ts +5 -0
- package/dist/client/cart/utils/session.d.ts.map +1 -0
- package/dist/client/cart/utils/session.mjs +21 -0
- package/dist/client/cart/utils/session.mjs.map +1 -0
- package/dist/client/cms/storyblok/preview/registerStoryblokBridge.d.ts +7 -0
- package/dist/client/cms/storyblok/preview/registerStoryblokBridge.d.ts.map +1 -0
- package/dist/client/cms/storyblok/preview/registerStoryblokBridge.mjs +25 -0
- package/dist/client/cms/storyblok/preview/registerStoryblokBridge.mjs.map +1 -0
- package/dist/client/cms/storyblok/preview/storyblok-preview-syncer.d.ts +20 -0
- package/dist/client/cms/storyblok/preview/storyblok-preview-syncer.d.ts.map +1 -0
- package/dist/client/cms/storyblok/preview/storyblok-preview-syncer.mjs +79 -0
- package/dist/client/cms/storyblok/preview/storyblok-preview-syncer.mjs.map +1 -0
- package/dist/client/global/auth/withAuth.d.ts +5 -0
- package/dist/client/global/auth/withAuth.d.ts.map +1 -0
- package/dist/client/global/auth/withAuth.mjs +25 -0
- package/dist/client/global/auth/withAuth.mjs.map +1 -0
- package/dist/client/global/components/error-boundary.d.ts +18 -0
- package/dist/client/global/components/error-boundary.d.ts.map +1 -0
- package/dist/client/global/components/error-boundary.mjs +41 -0
- package/dist/client/global/components/error-boundary.mjs.map +1 -0
- package/dist/client/global/config/index.d.ts +17 -0
- package/dist/client/global/config/index.d.ts.map +1 -0
- package/dist/client/global/config/index.mjs +34 -0
- package/dist/client/global/config/index.mjs.map +1 -0
- package/dist/client/global/constants/tags.d.ts +15 -0
- package/dist/client/global/constants/tags.d.ts.map +1 -0
- package/dist/client/global/constants/tags.mjs +18 -0
- package/dist/client/global/constants/tags.mjs.map +1 -0
- package/dist/client/global/index.d.ts +6 -0
- package/dist/client/global/index.d.ts.map +1 -0
- package/dist/client/global/index.mjs +7 -0
- package/dist/client/global/index.mjs.map +1 -0
- package/dist/client/global/providers/enad-provider.d.ts +48 -0
- package/dist/client/global/providers/enad-provider.d.ts.map +1 -0
- package/dist/client/global/providers/enad-provider.mjs +40 -0
- package/dist/client/global/providers/enad-provider.mjs.map +1 -0
- package/dist/client/icons/adapters/hugeicons.d.ts +9 -0
- package/dist/client/icons/adapters/hugeicons.d.ts.map +1 -0
- package/dist/client/icons/adapters/hugeicons.mjs +117 -0
- package/dist/client/icons/adapters/hugeicons.mjs.map +1 -0
- package/dist/client/icons/adapters/lucide.d.ts +8 -0
- package/dist/client/icons/adapters/lucide.d.ts.map +1 -0
- package/dist/client/icons/adapters/lucide.mjs +108 -0
- package/dist/client/icons/adapters/lucide.mjs.map +1 -0
- package/dist/client/icons/adapters/phosphor.d.ts +11 -0
- package/dist/client/icons/adapters/phosphor.d.ts.map +1 -0
- package/dist/client/icons/adapters/phosphor.mjs +108 -0
- package/dist/client/icons/adapters/phosphor.mjs.map +1 -0
- package/dist/client/icons/icon-context.d.ts +13 -0
- package/dist/client/icons/icon-context.d.ts.map +1 -0
- package/dist/client/icons/icon-context.mjs +27 -0
- package/dist/client/icons/icon-context.mjs.map +1 -0
- package/dist/client/icons/index.d.ts +9 -0
- package/dist/client/icons/index.d.ts.map +1 -0
- package/dist/client/icons/index.mjs +16 -0
- package/dist/client/icons/index.mjs.map +1 -0
- package/dist/client/icons/types.d.ts +60 -0
- package/dist/client/icons/types.d.ts.map +1 -0
- package/dist/client/icons/types.mjs +1 -0
- package/dist/client/icons/types.mjs.map +1 -0
- package/dist/client/motion/config.d.ts +42 -0
- package/dist/client/motion/config.d.ts.map +1 -0
- package/dist/client/motion/config.mjs +44 -0
- package/dist/client/motion/config.mjs.map +1 -0
- package/dist/client/motion/hover.d.ts +36 -0
- package/dist/client/motion/hover.d.ts.map +1 -0
- package/dist/client/motion/hover.mjs +19 -0
- package/dist/client/motion/hover.mjs.map +1 -0
- package/dist/client/motion/index.d.ts +4 -0
- package/dist/client/motion/index.d.ts.map +1 -0
- package/dist/client/motion/index.mjs +13 -0
- package/dist/client/motion/index.mjs.map +1 -0
- package/dist/client/motion/stagger.d.ts +36 -0
- package/dist/client/motion/stagger.d.ts.map +1 -0
- package/dist/client/motion/stagger.mjs +17 -0
- package/dist/client/motion/stagger.mjs.map +1 -0
- package/dist/client/search/actions/searchAction.d.ts +2 -0
- package/dist/client/search/actions/searchAction.d.ts.map +1 -0
- package/dist/client/search/actions/searchAction.mjs +18 -0
- package/dist/client/search/actions/searchAction.mjs.map +1 -0
- package/dist/client/search/components/search-bar.d.ts +8 -0
- package/dist/client/search/components/search-bar.d.ts.map +1 -0
- package/dist/client/search/components/search-bar.mjs +34 -0
- package/dist/client/search/components/search-bar.mjs.map +1 -0
- package/dist/client/search/hooks/useSearch.d.ts +14 -0
- package/dist/client/search/hooks/useSearch.d.ts.map +1 -0
- package/dist/client/search/hooks/useSearch.mjs +37 -0
- package/dist/client/search/hooks/useSearch.mjs.map +1 -0
- package/dist/client/search/index.d.ts +2 -0
- package/dist/client/search/index.d.ts.map +1 -0
- package/dist/client/search/index.mjs +5 -0
- package/dist/client/search/index.mjs.map +1 -0
- package/dist/client/storefront/blocks/accordion-block.d.ts +4 -0
- package/dist/client/storefront/blocks/accordion-block.d.ts.map +1 -0
- package/dist/client/storefront/blocks/accordion-block.mjs +43 -0
- package/dist/client/storefront/blocks/accordion-block.mjs.map +1 -0
- package/dist/client/storefront/blocks/card-image-with-caption.d.ts +4 -0
- package/dist/client/storefront/blocks/card-image-with-caption.d.ts.map +1 -0
- package/dist/client/storefront/blocks/card-image-with-caption.mjs +27 -0
- package/dist/client/storefront/blocks/card-image-with-caption.mjs.map +1 -0
- package/dist/client/storefront/blocks/card-video.d.ts +4 -0
- package/dist/client/storefront/blocks/card-video.d.ts.map +1 -0
- package/dist/client/storefront/blocks/card-video.mjs +43 -0
- package/dist/client/storefront/blocks/card-video.mjs.map +1 -0
- package/dist/client/storefront/blocks/content-with-gallery.d.ts +4 -0
- package/dist/client/storefront/blocks/content-with-gallery.d.ts.map +1 -0
- package/dist/client/storefront/blocks/content-with-gallery.mjs +48 -0
- package/dist/client/storefront/blocks/content-with-gallery.mjs.map +1 -0
- package/dist/client/storefront/blocks/content-with-image-product-data.d.ts +4 -0
- package/dist/client/storefront/blocks/content-with-image-product-data.d.ts.map +1 -0
- package/dist/client/storefront/blocks/content-with-image-product-data.mjs +45 -0
- package/dist/client/storefront/blocks/content-with-image-product-data.mjs.map +1 -0
- package/dist/client/storefront/blocks/gallery-with-caption.d.ts +4 -0
- package/dist/client/storefront/blocks/gallery-with-caption.d.ts.map +1 -0
- package/dist/client/storefront/blocks/gallery-with-caption.mjs +36 -0
- package/dist/client/storefront/blocks/gallery-with-caption.mjs.map +1 -0
- package/dist/client/storefront/blocks/gallery-with-link-blocks.d.ts +4 -0
- package/dist/client/storefront/blocks/gallery-with-link-blocks.d.ts.map +1 -0
- package/dist/client/storefront/blocks/gallery-with-link-blocks.mjs +24 -0
- package/dist/client/storefront/blocks/gallery-with-link-blocks.mjs.map +1 -0
- package/dist/client/storefront/blocks/gallery.d.ts +4 -0
- package/dist/client/storefront/blocks/gallery.d.ts.map +1 -0
- package/dist/client/storefront/blocks/gallery.mjs +47 -0
- package/dist/client/storefront/blocks/gallery.mjs.map +1 -0
- package/dist/client/storefront/blocks/hero.d.ts +4 -0
- package/dist/client/storefront/blocks/hero.d.ts.map +1 -0
- package/dist/client/storefront/blocks/hero.mjs +357 -0
- package/dist/client/storefront/blocks/hero.mjs.map +1 -0
- package/dist/client/storefront/blocks/image-block.d.ts +4 -0
- package/dist/client/storefront/blocks/image-block.d.ts.map +1 -0
- package/dist/client/storefront/blocks/image-block.mjs +29 -0
- package/dist/client/storefront/blocks/image-block.mjs.map +1 -0
- package/dist/client/storefront/blocks/index.d.ts +20 -0
- package/dist/client/storefront/blocks/index.d.ts.map +1 -0
- package/dist/client/storefront/blocks/index.mjs +41 -0
- package/dist/client/storefront/blocks/index.mjs.map +1 -0
- package/dist/client/storefront/blocks/link-block-small.d.ts +4 -0
- package/dist/client/storefront/blocks/link-block-small.d.ts.map +1 -0
- package/dist/client/storefront/blocks/link-block-small.mjs +35 -0
- package/dist/client/storefront/blocks/link-block-small.mjs.map +1 -0
- package/dist/client/storefront/blocks/link-block.d.ts +4 -0
- package/dist/client/storefront/blocks/link-block.d.ts.map +1 -0
- package/dist/client/storefront/blocks/link-block.mjs +150 -0
- package/dist/client/storefront/blocks/link-block.mjs.map +1 -0
- package/dist/client/storefront/blocks/product-card.d.ts +4 -0
- package/dist/client/storefront/blocks/product-card.d.ts.map +1 -0
- package/dist/client/storefront/blocks/product-card.mjs +228 -0
- package/dist/client/storefront/blocks/product-card.mjs.map +1 -0
- package/dist/client/storefront/blocks/product-image.d.ts +4 -0
- package/dist/client/storefront/blocks/product-image.d.ts.map +1 -0
- package/dist/client/storefront/blocks/product-image.mjs +109 -0
- package/dist/client/storefront/blocks/product-image.mjs.map +1 -0
- package/dist/client/storefront/blocks/spacer.d.ts +4 -0
- package/dist/client/storefront/blocks/spacer.d.ts.map +1 -0
- package/dist/client/storefront/blocks/spacer.mjs +14 -0
- package/dist/client/storefront/blocks/spacer.mjs.map +1 -0
- package/dist/client/storefront/blocks/text-content-with-image.d.ts +4 -0
- package/dist/client/storefront/blocks/text-content-with-image.d.ts.map +1 -0
- package/dist/client/storefront/blocks/text-content-with-image.mjs +225 -0
- package/dist/client/storefront/blocks/text-content-with-image.mjs.map +1 -0
- package/dist/client/storefront/blocks/text-content.d.ts +4 -0
- package/dist/client/storefront/blocks/text-content.d.ts.map +1 -0
- package/dist/client/storefront/blocks/text-content.mjs +150 -0
- package/dist/client/storefront/blocks/text-content.mjs.map +1 -0
- package/dist/client/storefront/blocks/truncated-text.d.ts +4 -0
- package/dist/client/storefront/blocks/truncated-text.d.ts.map +1 -0
- package/dist/client/storefront/blocks/truncated-text.mjs +36 -0
- package/dist/client/storefront/blocks/truncated-text.mjs.map +1 -0
- package/dist/client/storefront/blocks/variable-text-content.d.ts +4 -0
- package/dist/client/storefront/blocks/variable-text-content.d.ts.map +1 -0
- package/dist/client/storefront/blocks/variable-text-content.mjs +15 -0
- package/dist/client/storefront/blocks/variable-text-content.mjs.map +1 -0
- package/dist/client/storefront/carousel/index.d.ts +2 -0
- package/dist/client/storefront/carousel/index.d.ts.map +1 -0
- package/dist/client/storefront/carousel/index.mjs +5 -0
- package/dist/client/storefront/carousel/index.mjs.map +1 -0
- package/dist/client/storefront/carousel/swipeable-carousel.d.ts +14 -0
- package/dist/client/storefront/carousel/swipeable-carousel.d.ts.map +1 -0
- package/dist/client/storefront/carousel/swipeable-carousel.mjs +80 -0
- package/dist/client/storefront/carousel/swipeable-carousel.mjs.map +1 -0
- package/dist/client/storefront/checkout/address-form.d.ts +31 -0
- package/dist/client/storefront/checkout/address-form.d.ts.map +1 -0
- package/dist/client/storefront/checkout/address-form.mjs +124 -0
- package/dist/client/storefront/checkout/address-form.mjs.map +1 -0
- package/dist/client/storefront/checkout/cart-summary.d.ts +40 -0
- package/dist/client/storefront/checkout/cart-summary.d.ts.map +1 -0
- package/dist/client/storefront/checkout/cart-summary.mjs +150 -0
- package/dist/client/storefront/checkout/cart-summary.mjs.map +1 -0
- package/dist/client/storefront/checkout/checkout-stepper.d.ts +13 -0
- package/dist/client/storefront/checkout/checkout-stepper.d.ts.map +1 -0
- package/dist/client/storefront/checkout/checkout-stepper.mjs +58 -0
- package/dist/client/storefront/checkout/checkout-stepper.mjs.map +1 -0
- package/dist/client/storefront/checkout/index.d.ts +15 -0
- package/dist/client/storefront/checkout/index.d.ts.map +1 -0
- package/dist/client/storefront/checkout/index.mjs +17 -0
- package/dist/client/storefront/checkout/index.mjs.map +1 -0
- package/dist/client/storefront/checkout/order-confirmation.d.ts +10 -0
- package/dist/client/storefront/checkout/order-confirmation.d.ts.map +1 -0
- package/dist/client/storefront/checkout/order-confirmation.mjs +27 -0
- package/dist/client/storefront/checkout/order-confirmation.mjs.map +1 -0
- package/dist/client/storefront/checkout/order-summary.d.ts +29 -0
- package/dist/client/storefront/checkout/order-summary.d.ts.map +1 -0
- package/dist/client/storefront/checkout/order-summary.mjs +106 -0
- package/dist/client/storefront/checkout/order-summary.mjs.map +1 -0
- package/dist/client/storefront/checkout/payment-method-selector.d.ts +18 -0
- package/dist/client/storefront/checkout/payment-method-selector.d.ts.map +1 -0
- package/dist/client/storefront/checkout/payment-method-selector.mjs +61 -0
- package/dist/client/storefront/checkout/payment-method-selector.mjs.map +1 -0
- package/dist/client/storefront/checkout/shipping-method-selector.d.ts +23 -0
- package/dist/client/storefront/checkout/shipping-method-selector.d.ts.map +1 -0
- package/dist/client/storefront/checkout/shipping-method-selector.mjs +77 -0
- package/dist/client/storefront/checkout/shipping-method-selector.mjs.map +1 -0
- package/dist/client/storefront/components/badge.d.ts +8 -0
- package/dist/client/storefront/components/badge.d.ts.map +1 -0
- package/dist/client/storefront/components/badge.mjs +28 -0
- package/dist/client/storefront/components/badge.mjs.map +1 -0
- package/dist/client/storefront/components/country-redirect.d.ts +30 -0
- package/dist/client/storefront/components/country-redirect.d.ts.map +1 -0
- package/dist/client/storefront/components/country-redirect.mjs +121 -0
- package/dist/client/storefront/components/country-redirect.mjs.map +1 -0
- package/dist/client/storefront/components/empty-state.d.ts +38 -0
- package/dist/client/storefront/components/empty-state.d.ts.map +1 -0
- package/dist/client/storefront/components/empty-state.mjs +55 -0
- package/dist/client/storefront/components/empty-state.mjs.map +1 -0
- package/dist/client/storefront/components/image-lightbox.d.ts +13 -0
- package/dist/client/storefront/components/image-lightbox.d.ts.map +1 -0
- package/dist/client/storefront/components/image-lightbox.mjs +275 -0
- package/dist/client/storefront/components/image-lightbox.mjs.map +1 -0
- package/dist/client/storefront/components/infinite-scroll.d.ts +37 -0
- package/dist/client/storefront/components/infinite-scroll.d.ts.map +1 -0
- package/dist/client/storefront/components/infinite-scroll.mjs +83 -0
- package/dist/client/storefront/components/infinite-scroll.mjs.map +1 -0
- package/dist/client/storefront/components/language-selector.d.ts +5 -0
- package/dist/client/storefront/components/language-selector.d.ts.map +1 -0
- package/dist/client/storefront/components/language-selector.mjs +58 -0
- package/dist/client/storefront/components/language-selector.mjs.map +1 -0
- package/dist/client/storefront/components/newsletter-signup.d.ts +14 -0
- package/dist/client/storefront/components/newsletter-signup.d.ts.map +1 -0
- package/dist/client/storefront/components/newsletter-signup.mjs +81 -0
- package/dist/client/storefront/components/newsletter-signup.mjs.map +1 -0
- package/dist/client/storefront/components/price.d.ts +14 -0
- package/dist/client/storefront/components/price.d.ts.map +1 -0
- package/dist/client/storefront/components/price.mjs +46 -0
- package/dist/client/storefront/components/price.mjs.map +1 -0
- package/dist/client/storefront/components/product-recommendations.d.ts +18 -0
- package/dist/client/storefront/components/product-recommendations.d.ts.map +1 -0
- package/dist/client/storefront/components/product-recommendations.mjs +108 -0
- package/dist/client/storefront/components/product-recommendations.mjs.map +1 -0
- package/dist/client/storefront/components/product-tabs.d.ts +12 -0
- package/dist/client/storefront/components/product-tabs.d.ts.map +1 -0
- package/dist/client/storefront/components/product-tabs.mjs +64 -0
- package/dist/client/storefront/components/product-tabs.mjs.map +1 -0
- package/dist/client/storefront/components/quick-view.d.ts +25 -0
- package/dist/client/storefront/components/quick-view.d.ts.map +1 -0
- package/dist/client/storefront/components/quick-view.mjs +149 -0
- package/dist/client/storefront/components/quick-view.mjs.map +1 -0
- package/dist/client/storefront/components/review-summary.d.ts +17 -0
- package/dist/client/storefront/components/review-summary.d.ts.map +1 -0
- package/dist/client/storefront/components/review-summary.mjs +66 -0
- package/dist/client/storefront/components/review-summary.mjs.map +1 -0
- package/dist/client/storefront/components/search-autocomplete.d.ts +25 -0
- package/dist/client/storefront/components/search-autocomplete.d.ts.map +1 -0
- package/dist/client/storefront/components/search-autocomplete.mjs +183 -0
- package/dist/client/storefront/components/search-autocomplete.mjs.map +1 -0
- package/dist/client/storefront/components/section-nav.d.ts +20 -0
- package/dist/client/storefront/components/section-nav.d.ts.map +1 -0
- package/dist/client/storefront/components/section-nav.mjs +175 -0
- package/dist/client/storefront/components/section-nav.mjs.map +1 -0
- package/dist/client/storefront/components/share-button.d.ts +19 -0
- package/dist/client/storefront/components/share-button.d.ts.map +1 -0
- package/dist/client/storefront/components/share-button.mjs +95 -0
- package/dist/client/storefront/components/share-button.mjs.map +1 -0
- package/dist/client/storefront/components/skeleton.d.ts +12 -0
- package/dist/client/storefront/components/skeleton.d.ts.map +1 -0
- package/dist/client/storefront/components/skeleton.mjs +70 -0
- package/dist/client/storefront/components/skeleton.mjs.map +1 -0
- package/dist/client/storefront/components/star-rating.d.ts +13 -0
- package/dist/client/storefront/components/star-rating.d.ts.map +1 -0
- package/dist/client/storefront/components/star-rating.mjs +240 -0
- package/dist/client/storefront/components/star-rating.mjs.map +1 -0
- package/dist/client/storefront/components/testimonial.d.ts +20 -0
- package/dist/client/storefront/components/testimonial.d.ts.map +1 -0
- package/dist/client/storefront/components/testimonial.mjs +53 -0
- package/dist/client/storefront/components/testimonial.mjs.map +1 -0
- package/dist/client/storefront/components/trust-badges.d.ts +14 -0
- package/dist/client/storefront/components/trust-badges.d.ts.map +1 -0
- package/dist/client/storefront/components/trust-badges.mjs +25 -0
- package/dist/client/storefront/components/trust-badges.mjs.map +1 -0
- package/dist/client/storefront/components/variant-selector.d.ts +21 -0
- package/dist/client/storefront/components/variant-selector.d.ts.map +1 -0
- package/dist/client/storefront/components/variant-selector.mjs +41 -0
- package/dist/client/storefront/components/variant-selector.mjs.map +1 -0
- package/dist/client/storefront/components/wishlist-toggle.d.ts +12 -0
- package/dist/client/storefront/components/wishlist-toggle.d.ts.map +1 -0
- package/dist/client/storefront/components/wishlist-toggle.mjs +58 -0
- package/dist/client/storefront/components/wishlist-toggle.mjs.map +1 -0
- package/dist/client/storefront/filters/filter-chip.d.ts +10 -0
- package/dist/client/storefront/filters/filter-chip.d.ts.map +1 -0
- package/dist/client/storefront/filters/filter-chip.mjs +30 -0
- package/dist/client/storefront/filters/filter-chip.mjs.map +1 -0
- package/dist/client/storefront/filters/filter-group.d.ts +22 -0
- package/dist/client/storefront/filters/filter-group.d.ts.map +1 -0
- package/dist/client/storefront/filters/filter-group.mjs +102 -0
- package/dist/client/storefront/filters/filter-group.mjs.map +1 -0
- package/dist/client/storefront/filters/filter-panel.d.ts +25 -0
- package/dist/client/storefront/filters/filter-panel.d.ts.map +1 -0
- package/dist/client/storefront/filters/filter-panel.mjs +110 -0
- package/dist/client/storefront/filters/filter-panel.mjs.map +1 -0
- package/dist/client/storefront/filters/index.d.ts +6 -0
- package/dist/client/storefront/filters/index.d.ts.map +1 -0
- package/dist/client/storefront/filters/index.mjs +13 -0
- package/dist/client/storefront/filters/index.mjs.map +1 -0
- package/dist/client/storefront/filters/sort-select.d.ts +12 -0
- package/dist/client/storefront/filters/sort-select.d.ts.map +1 -0
- package/dist/client/storefront/filters/sort-select.mjs +34 -0
- package/dist/client/storefront/filters/sort-select.mjs.map +1 -0
- package/dist/client/storefront/filters/toggle-list-view.d.ts +8 -0
- package/dist/client/storefront/filters/toggle-list-view.d.ts.map +1 -0
- package/dist/client/storefront/filters/toggle-list-view.mjs +30 -0
- package/dist/client/storefront/filters/toggle-list-view.mjs.map +1 -0
- package/dist/client/storefront/hooks/use-section-observer.d.ts +12 -0
- package/dist/client/storefront/hooks/use-section-observer.d.ts.map +1 -0
- package/dist/client/storefront/hooks/use-section-observer.mjs +46 -0
- package/dist/client/storefront/hooks/use-section-observer.mjs.map +1 -0
- package/dist/client/storefront/index.d.ts +24 -0
- package/dist/client/storefront/index.d.ts.map +1 -0
- package/dist/client/storefront/index.mjs +26 -0
- package/dist/client/storefront/index.mjs.map +1 -0
- package/dist/client/storefront/layout/footer.d.ts +4 -0
- package/dist/client/storefront/layout/footer.d.ts.map +1 -0
- package/dist/client/storefront/layout/footer.mjs +56 -0
- package/dist/client/storefront/layout/footer.mjs.map +1 -0
- package/dist/client/storefront/layout/header.d.ts +4 -0
- package/dist/client/storefront/layout/header.d.ts.map +1 -0
- package/dist/client/storefront/layout/header.mjs +367 -0
- package/dist/client/storefront/layout/header.mjs.map +1 -0
- package/dist/client/storefront/layout/index.d.ts +5 -0
- package/dist/client/storefront/layout/index.d.ts.map +1 -0
- package/dist/client/storefront/layout/index.mjs +11 -0
- package/dist/client/storefront/layout/index.mjs.map +1 -0
- package/dist/client/storefront/layout/mobile-menu-drawer.d.ts +4 -0
- package/dist/client/storefront/layout/mobile-menu-drawer.d.ts.map +1 -0
- package/dist/client/storefront/layout/mobile-menu-drawer.mjs +93 -0
- package/dist/client/storefront/layout/mobile-menu-drawer.mjs.map +1 -0
- package/dist/client/storefront/layout/promotion-bar.d.ts +4 -0
- package/dist/client/storefront/layout/promotion-bar.d.ts.map +1 -0
- package/dist/client/storefront/layout/promotion-bar.mjs +79 -0
- package/dist/client/storefront/layout/promotion-bar.mjs.map +1 -0
- package/dist/client/storefront/primitives/breadcrumbs.d.ts +12 -0
- package/dist/client/storefront/primitives/breadcrumbs.d.ts.map +1 -0
- package/dist/client/storefront/primitives/breadcrumbs.mjs +37 -0
- package/dist/client/storefront/primitives/breadcrumbs.mjs.map +1 -0
- package/dist/client/storefront/primitives/button.d.ts +12 -0
- package/dist/client/storefront/primitives/button.d.ts.map +1 -0
- package/dist/client/storefront/primitives/button.mjs +51 -0
- package/dist/client/storefront/primitives/button.mjs.map +1 -0
- package/dist/client/storefront/primitives/checkbox.d.ts +10 -0
- package/dist/client/storefront/primitives/checkbox.d.ts.map +1 -0
- package/dist/client/storefront/primitives/checkbox.mjs +23 -0
- package/dist/client/storefront/primitives/checkbox.mjs.map +1 -0
- package/dist/client/storefront/primitives/download-item.d.ts +9 -0
- package/dist/client/storefront/primitives/download-item.d.ts.map +1 -0
- package/dist/client/storefront/primitives/download-item.mjs +28 -0
- package/dist/client/storefront/primitives/download-item.mjs.map +1 -0
- package/dist/client/storefront/primitives/index.d.ts +10 -0
- package/dist/client/storefront/primitives/index.d.ts.map +1 -0
- package/dist/client/storefront/primitives/index.mjs +21 -0
- package/dist/client/storefront/primitives/index.mjs.map +1 -0
- package/dist/client/storefront/primitives/input.d.ts +18 -0
- package/dist/client/storefront/primitives/input.d.ts.map +1 -0
- package/dist/client/storefront/primitives/input.mjs +118 -0
- package/dist/client/storefront/primitives/input.mjs.map +1 -0
- package/dist/client/storefront/primitives/pagination.d.ts +9 -0
- package/dist/client/storefront/primitives/pagination.d.ts.map +1 -0
- package/dist/client/storefront/primitives/pagination.mjs +86 -0
- package/dist/client/storefront/primitives/pagination.mjs.map +1 -0
- package/dist/client/storefront/primitives/quick-links.d.ts +11 -0
- package/dist/client/storefront/primitives/quick-links.d.ts.map +1 -0
- package/dist/client/storefront/primitives/quick-links.mjs +17 -0
- package/dist/client/storefront/primitives/quick-links.mjs.map +1 -0
- package/dist/client/storefront/primitives/select.d.ts +16 -0
- package/dist/client/storefront/primitives/select.d.ts.map +1 -0
- package/dist/client/storefront/primitives/select.mjs +35 -0
- package/dist/client/storefront/primitives/select.mjs.map +1 -0
- package/dist/client/storefront/primitives/text-link.d.ts +7 -0
- package/dist/client/storefront/primitives/text-link.d.ts.map +1 -0
- package/dist/client/storefront/primitives/text-link.mjs +10 -0
- package/dist/client/storefront/primitives/text-link.mjs.map +1 -0
- package/dist/client/storefront/product/color-swatch.d.ts +10 -0
- package/dist/client/storefront/product/color-swatch.d.ts.map +1 -0
- package/dist/client/storefront/product/color-swatch.mjs +32 -0
- package/dist/client/storefront/product/color-swatch.mjs.map +1 -0
- package/dist/client/storefront/product/index.d.ts +5 -0
- package/dist/client/storefront/product/index.d.ts.map +1 -0
- package/dist/client/storefront/product/index.mjs +11 -0
- package/dist/client/storefront/product/index.mjs.map +1 -0
- package/dist/client/storefront/product/material-selector.d.ts +15 -0
- package/dist/client/storefront/product/material-selector.d.ts.map +1 -0
- package/dist/client/storefront/product/material-selector.mjs +35 -0
- package/dist/client/storefront/product/material-selector.mjs.map +1 -0
- package/dist/client/storefront/product/product-usp.d.ts +7 -0
- package/dist/client/storefront/product/product-usp.d.ts.map +1 -0
- package/dist/client/storefront/product/product-usp.mjs +14 -0
- package/dist/client/storefront/product/product-usp.mjs.map +1 -0
- package/dist/client/storefront/product/quantity-picker.d.ts +10 -0
- package/dist/client/storefront/product/quantity-picker.d.ts.map +1 -0
- package/dist/client/storefront/product/quantity-picker.mjs +56 -0
- package/dist/client/storefront/product/quantity-picker.mjs.map +1 -0
- package/dist/client/storefront/types.d.ts +284 -0
- package/dist/client/storefront/types.d.ts.map +1 -0
- package/dist/client/storefront/types.mjs +20 -0
- package/dist/client/storefront/types.mjs.map +1 -0
- package/dist/client/theme/apply.d.ts +17 -0
- package/dist/client/theme/apply.d.ts.map +1 -0
- package/dist/client/theme/apply.mjs +133 -0
- package/dist/client/theme/apply.mjs.map +1 -0
- package/dist/client/theme/cli.d.ts +2 -0
- package/dist/client/theme/cli.d.ts.map +1 -0
- package/dist/client/theme/cli.mjs +453 -0
- package/dist/client/theme/cli.mjs.map +1 -0
- package/dist/client/theme/codec.d.ts +28 -0
- package/dist/client/theme/codec.d.ts.map +1 -0
- package/dist/client/theme/codec.mjs +88 -0
- package/dist/client/theme/codec.mjs.map +1 -0
- package/dist/client/theme/defaults.d.ts +64 -0
- package/dist/client/theme/defaults.d.ts.map +1 -0
- package/dist/client/theme/defaults.mjs +158 -0
- package/dist/client/theme/defaults.mjs.map +1 -0
- package/dist/client/theme/index.d.ts +8 -0
- package/dist/client/theme/index.d.ts.map +1 -0
- package/dist/client/theme/index.mjs +20 -0
- package/dist/client/theme/index.mjs.map +1 -0
- package/dist/client/theme/scan.d.ts +16 -0
- package/dist/client/theme/scan.d.ts.map +1 -0
- package/dist/client/theme/scan.mjs +25 -0
- package/dist/client/theme/scan.mjs.map +1 -0
- package/dist/client/ui/accordion.d.ts +8 -0
- package/dist/client/ui/accordion.d.ts.map +1 -0
- package/dist/client/ui/accordion.mjs +66 -0
- package/dist/client/ui/accordion.mjs.map +1 -0
- package/dist/client/ui/breadcrumb.d.ts +12 -0
- package/dist/client/ui/breadcrumb.d.ts.map +1 -0
- package/dist/client/ui/breadcrumb.mjs +104 -0
- package/dist/client/ui/breadcrumb.mjs.map +1 -0
- package/dist/client/ui/button.d.ts +11 -0
- package/dist/client/ui/button.d.ts.map +1 -0
- package/dist/client/ui/button.mjs +57 -0
- package/dist/client/ui/button.mjs.map +1 -0
- package/dist/client/ui/card.d.ts +10 -0
- package/dist/client/ui/card.d.ts.map +1 -0
- package/dist/client/ui/card.mjs +91 -0
- package/dist/client/ui/card.mjs.map +1 -0
- package/dist/client/ui/carousel.d.ts +20 -0
- package/dist/client/ui/carousel.d.ts.map +1 -0
- package/dist/client/ui/carousel.mjs +202 -0
- package/dist/client/ui/carousel.mjs.map +1 -0
- package/dist/client/ui/checkbox.d.ts +5 -0
- package/dist/client/ui/checkbox.d.ts.map +1 -0
- package/dist/client/ui/checkbox.mjs +34 -0
- package/dist/client/ui/checkbox.mjs.map +1 -0
- package/dist/client/ui/collapsible.d.ts +6 -0
- package/dist/client/ui/collapsible.d.ts.map +1 -0
- package/dist/client/ui/collapsible.mjs +36 -0
- package/dist/client/ui/collapsible.mjs.map +1 -0
- package/dist/client/ui/input.d.ts +4 -0
- package/dist/client/ui/input.d.ts.map +1 -0
- package/dist/client/ui/input.mjs +22 -0
- package/dist/client/ui/input.mjs.map +1 -0
- package/dist/client/ui/label.d.ts +5 -0
- package/dist/client/ui/label.d.ts.map +1 -0
- package/dist/client/ui/label.mjs +23 -0
- package/dist/client/ui/label.mjs.map +1 -0
- package/dist/client/ui/mid-truncate.d.ts +27 -0
- package/dist/client/ui/mid-truncate.d.ts.map +1 -0
- package/dist/client/ui/mid-truncate.mjs +25 -0
- package/dist/client/ui/mid-truncate.mjs.map +1 -0
- package/dist/client/ui/navigation-menu.d.ts +15 -0
- package/dist/client/ui/navigation-menu.d.ts.map +1 -0
- package/dist/client/ui/navigation-menu.mjs +172 -0
- package/dist/client/ui/navigation-menu.mjs.map +1 -0
- package/dist/client/ui/pagination.d.ts +14 -0
- package/dist/client/ui/pagination.d.ts.map +1 -0
- package/dist/client/ui/pagination.mjs +124 -0
- package/dist/client/ui/pagination.mjs.map +1 -0
- package/dist/client/ui/popover.d.ts +11 -0
- package/dist/client/ui/popover.d.ts.map +1 -0
- package/dist/client/ui/popover.mjs +82 -0
- package/dist/client/ui/popover.mjs.map +1 -0
- package/dist/client/ui/select.d.ts +16 -0
- package/dist/client/ui/select.d.ts.map +1 -0
- package/dist/client/ui/select.mjs +183 -0
- package/dist/client/ui/select.mjs.map +1 -0
- package/dist/client/ui/separator.d.ts +5 -0
- package/dist/client/ui/separator.d.ts.map +1 -0
- package/dist/client/ui/separator.mjs +27 -0
- package/dist/client/ui/separator.mjs.map +1 -0
- package/dist/client/ui/sheet.d.ts +15 -0
- package/dist/client/ui/sheet.d.ts.map +1 -0
- package/dist/client/ui/sheet.mjs +130 -0
- package/dist/client/ui/sheet.mjs.map +1 -0
- package/dist/client/ui/toggle-group.d.ts +10 -0
- package/dist/client/ui/toggle-group.d.ts.map +1 -0
- package/dist/client/ui/toggle-group.mjs +69 -0
- package/dist/client/ui/toggle-group.mjs.map +1 -0
- package/dist/client/ui/toggle.d.ts +10 -0
- package/dist/client/ui/toggle.d.ts.map +1 -0
- package/dist/client/ui/toggle.mjs +44 -0
- package/dist/client/ui/toggle.mjs.map +1 -0
- package/dist/client/ui/utils.d.ts +3 -0
- package/dist/client/ui/utils.d.ts.map +1 -0
- package/dist/client/ui/utils.mjs +9 -0
- package/dist/client/ui/utils.mjs.map +1 -0
- package/dist/client/ui-interfaces/accordion.d.ts +8 -0
- package/dist/client/ui-interfaces/accordion.d.ts.map +1 -0
- package/dist/client/ui-interfaces/accordion.mjs +72 -0
- package/dist/client/ui-interfaces/accordion.mjs.map +1 -0
- package/dist/client/ui-interfaces/breadcrumb.d.ts +12 -0
- package/dist/client/ui-interfaces/breadcrumb.d.ts.map +1 -0
- package/dist/client/ui-interfaces/breadcrumb.mjs +97 -0
- package/dist/client/ui-interfaces/breadcrumb.mjs.map +1 -0
- package/dist/client/ui-interfaces/button.d.ts +11 -0
- package/dist/client/ui-interfaces/button.d.ts.map +1 -0
- package/dist/client/ui-interfaces/button.mjs +57 -0
- package/dist/client/ui-interfaces/button.mjs.map +1 -0
- package/dist/client/ui-interfaces/card.d.ts +10 -0
- package/dist/client/ui-interfaces/card.d.ts.map +1 -0
- package/dist/client/ui-interfaces/card.mjs +78 -0
- package/dist/client/ui-interfaces/card.mjs.map +1 -0
- package/dist/client/ui-interfaces/carousel.d.ts +20 -0
- package/dist/client/ui-interfaces/carousel.d.ts.map +1 -0
- package/dist/client/ui-interfaces/carousel.mjs +188 -0
- package/dist/client/ui-interfaces/carousel.mjs.map +1 -0
- package/dist/client/ui-interfaces/checkbox.d.ts +5 -0
- package/dist/client/ui-interfaces/checkbox.d.ts.map +1 -0
- package/dist/client/ui-interfaces/checkbox.mjs +30 -0
- package/dist/client/ui-interfaces/checkbox.mjs.map +1 -0
- package/dist/client/ui-interfaces/collapsible.d.ts +7 -0
- package/dist/client/ui-interfaces/collapsible.d.ts.map +1 -0
- package/dist/client/ui-interfaces/collapsible.mjs +42 -0
- package/dist/client/ui-interfaces/collapsible.mjs.map +1 -0
- package/dist/client/ui-interfaces/index.d.ts +18 -0
- package/dist/client/ui-interfaces/index.d.ts.map +1 -0
- package/dist/client/ui-interfaces/index.mjs +18 -0
- package/dist/client/ui-interfaces/index.mjs.map +1 -0
- package/dist/client/ui-interfaces/input.d.ts +7 -0
- package/dist/client/ui-interfaces/input.d.ts.map +1 -0
- package/dist/client/ui-interfaces/input.mjs +39 -0
- package/dist/client/ui-interfaces/input.mjs.map +1 -0
- package/dist/client/ui-interfaces/label.d.ts +5 -0
- package/dist/client/ui-interfaces/label.d.ts.map +1 -0
- package/dist/client/ui-interfaces/label.mjs +23 -0
- package/dist/client/ui-interfaces/label.mjs.map +1 -0
- package/dist/client/ui-interfaces/navigation-menu.d.ts +15 -0
- package/dist/client/ui-interfaces/navigation-menu.d.ts.map +1 -0
- package/dist/client/ui-interfaces/navigation-menu.mjs +163 -0
- package/dist/client/ui-interfaces/navigation-menu.mjs.map +1 -0
- package/dist/client/ui-interfaces/pagination.d.ts +14 -0
- package/dist/client/ui-interfaces/pagination.d.ts.map +1 -0
- package/dist/client/ui-interfaces/pagination.mjs +103 -0
- package/dist/client/ui-interfaces/pagination.mjs.map +1 -0
- package/dist/client/ui-interfaces/popover.d.ts +8 -0
- package/dist/client/ui-interfaces/popover.d.ts.map +1 -0
- package/dist/client/ui-interfaces/popover.mjs +50 -0
- package/dist/client/ui-interfaces/popover.mjs.map +1 -0
- package/dist/client/ui-interfaces/select.d.ts +16 -0
- package/dist/client/ui-interfaces/select.d.ts.map +1 -0
- package/dist/client/ui-interfaces/select.mjs +159 -0
- package/dist/client/ui-interfaces/select.mjs.map +1 -0
- package/dist/client/ui-interfaces/separator.d.ts +5 -0
- package/dist/client/ui-interfaces/separator.d.ts.map +1 -0
- package/dist/client/ui-interfaces/separator.mjs +28 -0
- package/dist/client/ui-interfaces/separator.mjs.map +1 -0
- package/dist/client/ui-interfaces/sheet.d.ts +14 -0
- package/dist/client/ui-interfaces/sheet.d.ts.map +1 -0
- package/dist/client/ui-interfaces/sheet.mjs +140 -0
- package/dist/client/ui-interfaces/sheet.mjs.map +1 -0
- package/dist/client/ui-interfaces/toggle-group.d.ts +10 -0
- package/dist/client/ui-interfaces/toggle-group.d.ts.map +1 -0
- package/dist/client/ui-interfaces/toggle-group.mjs +67 -0
- package/dist/client/ui-interfaces/toggle-group.mjs.map +1 -0
- package/dist/client/ui-interfaces/toggle.d.ts +10 -0
- package/dist/client/ui-interfaces/toggle.d.ts.map +1 -0
- package/dist/client/ui-interfaces/toggle.mjs +45 -0
- package/dist/client/ui-interfaces/toggle.mjs.map +1 -0
- package/dist/client/ui-resolver/accordion.d.ts +11 -0
- package/dist/client/ui-resolver/accordion.d.ts.map +1 -0
- package/dist/client/ui-resolver/accordion.mjs +35 -0
- package/dist/client/ui-resolver/accordion.mjs.map +1 -0
- package/dist/client/ui-resolver/breadcrumb.d.ts +14 -0
- package/dist/client/ui-resolver/breadcrumb.d.ts.map +1 -0
- package/dist/client/ui-resolver/breadcrumb.mjs +53 -0
- package/dist/client/ui-resolver/breadcrumb.mjs.map +1 -0
- package/dist/client/ui-resolver/button.d.ts +12 -0
- package/dist/client/ui-resolver/button.d.ts.map +1 -0
- package/dist/client/ui-resolver/button.mjs +25 -0
- package/dist/client/ui-resolver/button.mjs.map +1 -0
- package/dist/client/ui-resolver/card.d.ts +14 -0
- package/dist/client/ui-resolver/card.d.ts.map +1 -0
- package/dist/client/ui-resolver/card.mjs +53 -0
- package/dist/client/ui-resolver/card.mjs.map +1 -0
- package/dist/client/ui-resolver/carousel.d.ts +13 -0
- package/dist/client/ui-resolver/carousel.d.ts.map +1 -0
- package/dist/client/ui-resolver/carousel.mjs +41 -0
- package/dist/client/ui-resolver/carousel.mjs.map +1 -0
- package/dist/client/ui-resolver/checkbox.d.ts +8 -0
- package/dist/client/ui-resolver/checkbox.d.ts.map +1 -0
- package/dist/client/ui-resolver/checkbox.mjs +17 -0
- package/dist/client/ui-resolver/checkbox.mjs.map +1 -0
- package/dist/client/ui-resolver/collapsible.d.ts +10 -0
- package/dist/client/ui-resolver/collapsible.d.ts.map +1 -0
- package/dist/client/ui-resolver/collapsible.mjs +29 -0
- package/dist/client/ui-resolver/collapsible.mjs.map +1 -0
- package/dist/client/ui-resolver/context.d.ts +10 -0
- package/dist/client/ui-resolver/context.d.ts.map +1 -0
- package/dist/client/ui-resolver/context.mjs +28 -0
- package/dist/client/ui-resolver/context.mjs.map +1 -0
- package/dist/client/ui-resolver/index.d.ts +19 -0
- package/dist/client/ui-resolver/index.d.ts.map +1 -0
- package/dist/client/ui-resolver/index.mjs +156 -0
- package/dist/client/ui-resolver/index.mjs.map +1 -0
- package/dist/client/ui-resolver/input.d.ts +8 -0
- package/dist/client/ui-resolver/input.d.ts.map +1 -0
- package/dist/client/ui-resolver/input.mjs +17 -0
- package/dist/client/ui-resolver/input.mjs.map +1 -0
- package/dist/client/ui-resolver/label.d.ts +8 -0
- package/dist/client/ui-resolver/label.d.ts.map +1 -0
- package/dist/client/ui-resolver/label.mjs +17 -0
- package/dist/client/ui-resolver/label.mjs.map +1 -0
- package/dist/client/ui-resolver/navigation-menu.d.ts +16 -0
- package/dist/client/ui-resolver/navigation-menu.d.ts.map +1 -0
- package/dist/client/ui-resolver/navigation-menu.mjs +64 -0
- package/dist/client/ui-resolver/navigation-menu.mjs.map +1 -0
- package/dist/client/ui-resolver/pagination.d.ts +14 -0
- package/dist/client/ui-resolver/pagination.d.ts.map +1 -0
- package/dist/client/ui-resolver/pagination.mjs +53 -0
- package/dist/client/ui-resolver/pagination.mjs.map +1 -0
- package/dist/client/ui-resolver/popover.d.ts +11 -0
- package/dist/client/ui-resolver/popover.d.ts.map +1 -0
- package/dist/client/ui-resolver/popover.mjs +35 -0
- package/dist/client/ui-resolver/popover.mjs.map +1 -0
- package/dist/client/ui-resolver/select.d.ts +15 -0
- package/dist/client/ui-resolver/select.d.ts.map +1 -0
- package/dist/client/ui-resolver/select.mjs +59 -0
- package/dist/client/ui-resolver/select.mjs.map +1 -0
- package/dist/client/ui-resolver/separator.d.ts +8 -0
- package/dist/client/ui-resolver/separator.d.ts.map +1 -0
- package/dist/client/ui-resolver/separator.mjs +17 -0
- package/dist/client/ui-resolver/separator.mjs.map +1 -0
- package/dist/client/ui-resolver/sheet.d.ts +15 -0
- package/dist/client/ui-resolver/sheet.d.ts.map +1 -0
- package/dist/client/ui-resolver/sheet.mjs +59 -0
- package/dist/client/ui-resolver/sheet.mjs.map +1 -0
- package/dist/client/ui-resolver/toggle-group.d.ts +9 -0
- package/dist/client/ui-resolver/toggle-group.d.ts.map +1 -0
- package/dist/client/ui-resolver/toggle-group.mjs +23 -0
- package/dist/client/ui-resolver/toggle-group.mjs.map +1 -0
- package/dist/client/ui-resolver/toggle.d.ts +12 -0
- package/dist/client/ui-resolver/toggle.d.ts.map +1 -0
- package/dist/client/ui-resolver/toggle.mjs +25 -0
- package/dist/client/ui-resolver/toggle.mjs.map +1 -0
- package/dist/client/user/actions/createResetPasswordLinkAction.d.ts +14 -0
- package/dist/client/user/actions/createResetPasswordLinkAction.d.ts.map +1 -0
- package/dist/client/user/actions/createResetPasswordLinkAction.mjs +30 -0
- package/dist/client/user/actions/createResetPasswordLinkAction.mjs.map +1 -0
- package/dist/client/user/actions/getUserAction.d.ts +3 -0
- package/dist/client/user/actions/getUserAction.d.ts.map +1 -0
- package/dist/client/user/actions/getUserAction.mjs +19 -0
- package/dist/client/user/actions/getUserAction.mjs.map +1 -0
- package/dist/client/user/actions/logInUserAction.d.ts +15 -0
- package/dist/client/user/actions/logInUserAction.d.ts.map +1 -0
- package/dist/client/user/actions/logInUserAction.mjs +34 -0
- package/dist/client/user/actions/logInUserAction.mjs.map +1 -0
- package/dist/client/user/actions/logoutUserAction.d.ts +2 -0
- package/dist/client/user/actions/logoutUserAction.d.ts.map +1 -0
- package/dist/client/user/actions/logoutUserAction.mjs +10 -0
- package/dist/client/user/actions/logoutUserAction.mjs.map +1 -0
- package/dist/client/user/actions/registerOrganisationAction.d.ts +9 -0
- package/dist/client/user/actions/registerOrganisationAction.d.ts.map +1 -0
- package/dist/client/user/actions/registerOrganisationAction.mjs +18 -0
- package/dist/client/user/actions/registerOrganisationAction.mjs.map +1 -0
- package/dist/client/user/actions/registerUserAction.d.ts +18 -0
- package/dist/client/user/actions/registerUserAction.d.ts.map +1 -0
- package/dist/client/user/actions/registerUserAction.mjs +42 -0
- package/dist/client/user/actions/registerUserAction.mjs.map +1 -0
- package/dist/client/user/actions/registerUserWithoutRedirectAction.d.ts +41 -0
- package/dist/client/user/actions/registerUserWithoutRedirectAction.d.ts.map +1 -0
- package/dist/client/user/actions/registerUserWithoutRedirectAction.mjs +58 -0
- package/dist/client/user/actions/registerUserWithoutRedirectAction.mjs.map +1 -0
- package/dist/client/user/actions/updatePasswordAction.d.ts +21 -0
- package/dist/client/user/actions/updatePasswordAction.d.ts.map +1 -0
- package/dist/client/user/actions/updatePasswordAction.mjs +37 -0
- package/dist/client/user/actions/updatePasswordAction.mjs.map +1 -0
- package/dist/client/user/api/userRoute.d.ts +7 -0
- package/dist/client/user/api/userRoute.d.ts.map +1 -0
- package/dist/client/user/api/userRoute.mjs +65 -0
- package/dist/client/user/api/userRoute.mjs.map +1 -0
- package/dist/client/user/clients/enad.d.ts +4 -0
- package/dist/client/user/clients/enad.d.ts.map +1 -0
- package/dist/client/user/clients/enad.mjs +19 -0
- package/dist/client/user/clients/enad.mjs.map +1 -0
- package/dist/client/user/components/login-form.d.ts +23 -0
- package/dist/client/user/components/login-form.d.ts.map +1 -0
- package/dist/client/user/components/login-form.mjs +117 -0
- package/dist/client/user/components/login-form.mjs.map +1 -0
- package/dist/client/user/components/reset-password-form.d.ts +20 -0
- package/dist/client/user/components/reset-password-form.d.ts.map +1 -0
- package/dist/client/user/components/reset-password-form.mjs +93 -0
- package/dist/client/user/components/reset-password-form.mjs.map +1 -0
- package/dist/client/user/components/sign-out.d.ts +8 -0
- package/dist/client/user/components/sign-out.d.ts.map +1 -0
- package/dist/client/user/components/sign-out.mjs +26 -0
- package/dist/client/user/components/sign-out.mjs.map +1 -0
- package/dist/client/user/components/signup-form.d.ts +27 -0
- package/dist/client/user/components/signup-form.d.ts.map +1 -0
- package/dist/client/user/components/signup-form.mjs +188 -0
- package/dist/client/user/components/signup-form.mjs.map +1 -0
- package/dist/client/user/components/signup-organisation-form.d.ts +55 -0
- package/dist/client/user/components/signup-organisation-form.d.ts.map +1 -0
- package/dist/client/user/components/signup-organisation-form.mjs +864 -0
- package/dist/client/user/components/signup-organisation-form.mjs.map +1 -0
- package/dist/client/user/components/update-password-form.d.ts +17 -0
- package/dist/client/user/components/update-password-form.d.ts.map +1 -0
- package/dist/client/user/components/update-password-form.mjs +60 -0
- package/dist/client/user/components/update-password-form.mjs.map +1 -0
- package/dist/client/user/hooks/index.d.ts +2 -0
- package/dist/client/user/hooks/index.d.ts.map +1 -0
- package/dist/client/user/hooks/index.mjs +2 -0
- package/dist/client/user/hooks/index.mjs.map +1 -0
- package/dist/client/user/hooks/useUser.d.ts +12 -0
- package/dist/client/user/hooks/useUser.d.ts.map +1 -0
- package/dist/client/user/hooks/useUser.mjs +32 -0
- package/dist/client/user/hooks/useUser.mjs.map +1 -0
- package/dist/client/user/index.d.ts +9 -0
- package/dist/client/user/index.d.ts.map +1 -0
- package/dist/client/user/index.mjs +17 -0
- package/dist/client/user/index.mjs.map +1 -0
- package/dist/client/user/types/user.d.ts +201 -0
- package/dist/client/user/types/user.d.ts.map +1 -0
- package/dist/client/user/types/user.mjs +1 -0
- package/dist/client/user/types/user.mjs.map +1 -0
- package/dist/client/user/utils/userCookieService.d.ts +19 -0
- package/dist/client/user/utils/userCookieService.d.ts.map +1 -0
- package/dist/client/user/utils/userCookieService.mjs +51 -0
- package/dist/client/user/utils/userCookieService.mjs.map +1 -0
- package/dist/client/wishlist/actions/addItemsToWishlistAction.d.ts +5 -0
- package/dist/client/wishlist/actions/addItemsToWishlistAction.d.ts.map +1 -0
- package/dist/client/wishlist/actions/addItemsToWishlistAction.mjs +20 -0
- package/dist/client/wishlist/actions/addItemsToWishlistAction.mjs.map +1 -0
- package/dist/client/wishlist/actions/createOrGetShareTokenAction.d.ts +3 -0
- package/dist/client/wishlist/actions/createOrGetShareTokenAction.d.ts.map +1 -0
- package/dist/client/wishlist/actions/createOrGetShareTokenAction.mjs +20 -0
- package/dist/client/wishlist/actions/createOrGetShareTokenAction.mjs.map +1 -0
- package/dist/client/wishlist/actions/createWishlistAction.d.ts +3 -0
- package/dist/client/wishlist/actions/createWishlistAction.d.ts.map +1 -0
- package/dist/client/wishlist/actions/createWishlistAction.mjs +16 -0
- package/dist/client/wishlist/actions/createWishlistAction.mjs.map +1 -0
- package/dist/client/wishlist/actions/deleteItemsFromWishlistAction.d.ts +5 -0
- package/dist/client/wishlist/actions/deleteItemsFromWishlistAction.d.ts.map +1 -0
- package/dist/client/wishlist/actions/deleteItemsFromWishlistAction.mjs +20 -0
- package/dist/client/wishlist/actions/deleteItemsFromWishlistAction.mjs.map +1 -0
- package/dist/client/wishlist/actions/deleteWishlistAction.d.ts +4 -0
- package/dist/client/wishlist/actions/deleteWishlistAction.d.ts.map +1 -0
- package/dist/client/wishlist/actions/deleteWishlistAction.mjs +16 -0
- package/dist/client/wishlist/actions/deleteWishlistAction.mjs.map +1 -0
- package/dist/client/wishlist/actions/getSharedWishlistAction.d.ts +3 -0
- package/dist/client/wishlist/actions/getSharedWishlistAction.d.ts.map +1 -0
- package/dist/client/wishlist/actions/getSharedWishlistAction.mjs +20 -0
- package/dist/client/wishlist/actions/getSharedWishlistAction.mjs.map +1 -0
- package/dist/client/wishlist/actions/getSpecificWishlistAction.d.ts +3 -0
- package/dist/client/wishlist/actions/getSpecificWishlistAction.d.ts.map +1 -0
- package/dist/client/wishlist/actions/getSpecificWishlistAction.mjs +20 -0
- package/dist/client/wishlist/actions/getSpecificWishlistAction.mjs.map +1 -0
- package/dist/client/wishlist/actions/getUserWishlists.d.ts +4 -0
- package/dist/client/wishlist/actions/getUserWishlists.d.ts.map +1 -0
- package/dist/client/wishlist/actions/getUserWishlists.mjs +25 -0
- package/dist/client/wishlist/actions/getUserWishlists.mjs.map +1 -0
- package/dist/client/wishlist/actions/revokeShareTokenAction.d.ts +4 -0
- package/dist/client/wishlist/actions/revokeShareTokenAction.d.ts.map +1 -0
- package/dist/client/wishlist/actions/revokeShareTokenAction.mjs +20 -0
- package/dist/client/wishlist/actions/revokeShareTokenAction.mjs.map +1 -0
- package/dist/client/wishlist/actions/updateWishlistAction.d.ts +3 -0
- package/dist/client/wishlist/actions/updateWishlistAction.d.ts.map +1 -0
- package/dist/client/wishlist/actions/updateWishlistAction.mjs +20 -0
- package/dist/client/wishlist/actions/updateWishlistAction.mjs.map +1 -0
- package/dist/client/wishlist/hooks/index.d.ts +2 -0
- package/dist/client/wishlist/hooks/index.d.ts.map +1 -0
- package/dist/client/wishlist/hooks/index.mjs +2 -0
- package/dist/client/wishlist/hooks/index.mjs.map +1 -0
- package/dist/client/wishlist/hooks/useWishlist.d.ts +95 -0
- package/dist/client/wishlist/hooks/useWishlist.d.ts.map +1 -0
- package/dist/client/wishlist/hooks/useWishlist.mjs +76 -0
- package/dist/client/wishlist/hooks/useWishlist.mjs.map +1 -0
- package/dist/client/wishlist/hooks/useWishlistActions.d.ts +44 -0
- package/dist/client/wishlist/hooks/useWishlistActions.d.ts.map +1 -0
- package/dist/client/wishlist/hooks/useWishlistActions.mjs +101 -0
- package/dist/client/wishlist/hooks/useWishlistActions.mjs.map +1 -0
- package/dist/client/wishlist/index.d.ts +5 -0
- package/dist/client/wishlist/index.d.ts.map +1 -0
- package/dist/client/wishlist/index.mjs +9 -0
- package/dist/client/wishlist/index.mjs.map +1 -0
- package/dist/client/wishlist/wishlist-drawer.d.ts +17 -0
- package/dist/client/wishlist/wishlist-drawer.d.ts.map +1 -0
- package/dist/client/wishlist/wishlist-drawer.mjs +199 -0
- package/dist/client/wishlist/wishlist-drawer.mjs.map +1 -0
- package/dist/styles.css +2 -0
- package/package.json +54 -32
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useCallback, useRef, useState } from "react";
|
|
4
|
+
import { useIcon } from "../../icons/icon-context";
|
|
5
|
+
const sizeMap = {
|
|
6
|
+
sm: "h-3.5 w-3.5",
|
|
7
|
+
md: "h-5 w-5",
|
|
8
|
+
lg: "h-6 w-6"
|
|
9
|
+
};
|
|
10
|
+
function getHoverRating(event, starIndex) {
|
|
11
|
+
const rect = event.currentTarget.getBoundingClientRect();
|
|
12
|
+
const x = event.clientX - rect.left;
|
|
13
|
+
const isLeftHalf = x < rect.width / 2;
|
|
14
|
+
return isLeftHalf ? starIndex + 0.5 : starIndex + 1;
|
|
15
|
+
}
|
|
16
|
+
function RatingMeta({ showValue, clampedRating, reviewCount }) {
|
|
17
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
18
|
+
showValue && /* @__PURE__ */ jsx("span", { className: "text-sm text-(--enad-text-primary-color) font-medium", children: clampedRating.toFixed(1) }),
|
|
19
|
+
reviewCount !== void 0 && /* @__PURE__ */ jsxs("span", { className: "text-sm text-(--enad-text-muted-color)", children: [
|
|
20
|
+
"(",
|
|
21
|
+
reviewCount,
|
|
22
|
+
" ",
|
|
23
|
+
reviewCount === 1 ? "review" : "reviews",
|
|
24
|
+
")"
|
|
25
|
+
] })
|
|
26
|
+
] });
|
|
27
|
+
}
|
|
28
|
+
function StarIcon_({
|
|
29
|
+
fillLevel,
|
|
30
|
+
iconSize,
|
|
31
|
+
filledColor,
|
|
32
|
+
StarIcon,
|
|
33
|
+
StarFilledIcon
|
|
34
|
+
}) {
|
|
35
|
+
if (fillLevel >= 1) {
|
|
36
|
+
return /* @__PURE__ */ jsx(
|
|
37
|
+
StarFilledIcon,
|
|
38
|
+
{
|
|
39
|
+
className: `${iconSize} fill-current ${filledColor}`
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
if (fillLevel > 0) {
|
|
44
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
45
|
+
/* @__PURE__ */ jsx(
|
|
46
|
+
StarIcon,
|
|
47
|
+
{
|
|
48
|
+
className: `absolute inset-0 ${iconSize} text-(--enad-text-muted-color)`
|
|
49
|
+
}
|
|
50
|
+
),
|
|
51
|
+
/* @__PURE__ */ jsx(
|
|
52
|
+
"span",
|
|
53
|
+
{
|
|
54
|
+
className: "absolute inset-0 overflow-hidden",
|
|
55
|
+
style: { clipPath: `inset(0 ${(1 - fillLevel) * 100}% 0 0)` },
|
|
56
|
+
children: /* @__PURE__ */ jsx(
|
|
57
|
+
StarFilledIcon,
|
|
58
|
+
{
|
|
59
|
+
className: `${iconSize} fill-current ${filledColor}`
|
|
60
|
+
}
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
)
|
|
64
|
+
] });
|
|
65
|
+
}
|
|
66
|
+
return /* @__PURE__ */ jsx(
|
|
67
|
+
StarIcon,
|
|
68
|
+
{
|
|
69
|
+
className: `${iconSize} text-(--enad-text-muted-color)`
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
function InteractiveStarRating({
|
|
74
|
+
rating,
|
|
75
|
+
max,
|
|
76
|
+
iconSize,
|
|
77
|
+
filledColor,
|
|
78
|
+
showValue,
|
|
79
|
+
reviewCount,
|
|
80
|
+
className,
|
|
81
|
+
onRate
|
|
82
|
+
}) {
|
|
83
|
+
const StarIcon = useIcon("star");
|
|
84
|
+
const StarFilledIcon = useIcon("starFilled");
|
|
85
|
+
const [hoveredRating, setHoveredRating] = useState(null);
|
|
86
|
+
const [selectedRating, setSelectedRating] = useState(null);
|
|
87
|
+
const containerRef = useRef(null);
|
|
88
|
+
const baseRating = selectedRating ?? rating;
|
|
89
|
+
const displayRating = hoveredRating !== null ? hoveredRating : baseRating;
|
|
90
|
+
const clampedRating = Math.max(0, Math.min(displayRating, max));
|
|
91
|
+
const handleKeyDown = useCallback(
|
|
92
|
+
(event) => {
|
|
93
|
+
const current = hoveredRating ?? baseRating;
|
|
94
|
+
let next = current;
|
|
95
|
+
switch (event.key) {
|
|
96
|
+
case "ArrowRight":
|
|
97
|
+
case "ArrowUp":
|
|
98
|
+
next = Math.min(max, current + 0.5);
|
|
99
|
+
event.preventDefault();
|
|
100
|
+
break;
|
|
101
|
+
case "ArrowLeft":
|
|
102
|
+
case "ArrowDown":
|
|
103
|
+
next = Math.max(0.5, current - 0.5);
|
|
104
|
+
event.preventDefault();
|
|
105
|
+
break;
|
|
106
|
+
case "Enter":
|
|
107
|
+
case " ":
|
|
108
|
+
event.preventDefault();
|
|
109
|
+
setSelectedRating(current);
|
|
110
|
+
onRate?.(current);
|
|
111
|
+
return;
|
|
112
|
+
default:
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
setHoveredRating(next);
|
|
116
|
+
},
|
|
117
|
+
[hoveredRating, baseRating, max, onRate]
|
|
118
|
+
);
|
|
119
|
+
return /* @__PURE__ */ jsxs("div", { className: `inline-flex items-center gap-1 font-enad ${className}`, children: [
|
|
120
|
+
/* @__PURE__ */ jsx(
|
|
121
|
+
"div",
|
|
122
|
+
{
|
|
123
|
+
ref: containerRef,
|
|
124
|
+
className: "flex items-center gap-0.5",
|
|
125
|
+
role: "radiogroup",
|
|
126
|
+
"aria-label": `Rate from 1 to ${max} stars`,
|
|
127
|
+
onMouseLeave: () => setHoveredRating(null),
|
|
128
|
+
onKeyDown: handleKeyDown,
|
|
129
|
+
children: Array.from({ length: max }, (_, i) => /* @__PURE__ */ jsx(
|
|
130
|
+
"span",
|
|
131
|
+
{
|
|
132
|
+
className: `relative inline-flex ${iconSize} cursor-pointer transition-transform duration-150 motion-reduce:transition-none ${hoveredRating !== null && hoveredRating >= i + 0.5 ? "scale-110" : ""}`,
|
|
133
|
+
role: "radio",
|
|
134
|
+
"aria-checked": rating === i + 1 || rating === i + 0.5,
|
|
135
|
+
"aria-label": `${i + 1} star${i + 1 === 1 ? "" : "s"}`,
|
|
136
|
+
tabIndex: i === 0 ? 0 : -1,
|
|
137
|
+
onMouseMove: (e) => setHoveredRating(getHoverRating(e, i)),
|
|
138
|
+
onClick: (e) => {
|
|
139
|
+
const value = getHoverRating(e, i);
|
|
140
|
+
setSelectedRating(value);
|
|
141
|
+
onRate?.(value);
|
|
142
|
+
},
|
|
143
|
+
onKeyDown: handleKeyDown,
|
|
144
|
+
children: /* @__PURE__ */ jsx(
|
|
145
|
+
StarIcon_,
|
|
146
|
+
{
|
|
147
|
+
fillLevel: Math.max(0, Math.min(1, clampedRating - i)),
|
|
148
|
+
iconSize,
|
|
149
|
+
filledColor,
|
|
150
|
+
StarIcon,
|
|
151
|
+
StarFilledIcon
|
|
152
|
+
}
|
|
153
|
+
)
|
|
154
|
+
},
|
|
155
|
+
i
|
|
156
|
+
))
|
|
157
|
+
}
|
|
158
|
+
),
|
|
159
|
+
/* @__PURE__ */ jsx(RatingMeta, { showValue, clampedRating, reviewCount })
|
|
160
|
+
] });
|
|
161
|
+
}
|
|
162
|
+
function DisplayStarRating({
|
|
163
|
+
rating,
|
|
164
|
+
max,
|
|
165
|
+
iconSize,
|
|
166
|
+
filledColor,
|
|
167
|
+
showValue,
|
|
168
|
+
reviewCount,
|
|
169
|
+
className
|
|
170
|
+
}) {
|
|
171
|
+
const StarIcon = useIcon("star");
|
|
172
|
+
const StarFilledIcon = useIcon("starFilled");
|
|
173
|
+
const clampedRating = Math.max(0, Math.min(rating, max));
|
|
174
|
+
return /* @__PURE__ */ jsxs(
|
|
175
|
+
"div",
|
|
176
|
+
{
|
|
177
|
+
className: `inline-flex items-center gap-1 font-enad ${className}`,
|
|
178
|
+
role: "img",
|
|
179
|
+
"aria-label": `${clampedRating} out of ${max} stars`,
|
|
180
|
+
children: [
|
|
181
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-0.5", children: Array.from({ length: max }, (_, i) => /* @__PURE__ */ jsx("span", { className: `relative inline-flex ${iconSize}`, children: /* @__PURE__ */ jsx(
|
|
182
|
+
StarIcon_,
|
|
183
|
+
{
|
|
184
|
+
fillLevel: Math.max(0, Math.min(1, clampedRating - i)),
|
|
185
|
+
iconSize,
|
|
186
|
+
filledColor,
|
|
187
|
+
StarIcon,
|
|
188
|
+
StarFilledIcon
|
|
189
|
+
}
|
|
190
|
+
) }, i)) }),
|
|
191
|
+
/* @__PURE__ */ jsx(RatingMeta, { showValue, clampedRating, reviewCount })
|
|
192
|
+
]
|
|
193
|
+
}
|
|
194
|
+
);
|
|
195
|
+
}
|
|
196
|
+
function StarRating({
|
|
197
|
+
rating,
|
|
198
|
+
max = 5,
|
|
199
|
+
size = "md",
|
|
200
|
+
showValue = false,
|
|
201
|
+
reviewCount,
|
|
202
|
+
className = "",
|
|
203
|
+
filledClassName,
|
|
204
|
+
interactive = false,
|
|
205
|
+
onRate
|
|
206
|
+
}) {
|
|
207
|
+
const iconSize = sizeMap[size];
|
|
208
|
+
const filledColor = filledClassName || "text-(--enad-star-color)";
|
|
209
|
+
if (interactive) {
|
|
210
|
+
return /* @__PURE__ */ jsx(
|
|
211
|
+
InteractiveStarRating,
|
|
212
|
+
{
|
|
213
|
+
rating,
|
|
214
|
+
max,
|
|
215
|
+
iconSize,
|
|
216
|
+
filledColor,
|
|
217
|
+
showValue,
|
|
218
|
+
reviewCount,
|
|
219
|
+
className,
|
|
220
|
+
onRate
|
|
221
|
+
}
|
|
222
|
+
);
|
|
223
|
+
}
|
|
224
|
+
return /* @__PURE__ */ jsx(
|
|
225
|
+
DisplayStarRating,
|
|
226
|
+
{
|
|
227
|
+
rating,
|
|
228
|
+
max,
|
|
229
|
+
iconSize,
|
|
230
|
+
filledColor,
|
|
231
|
+
showValue,
|
|
232
|
+
reviewCount,
|
|
233
|
+
className
|
|
234
|
+
}
|
|
235
|
+
);
|
|
236
|
+
}
|
|
237
|
+
export {
|
|
238
|
+
StarRating
|
|
239
|
+
};
|
|
240
|
+
//# sourceMappingURL=star-rating.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/client/storefront/components/star-rating.tsx"],"sourcesContent":["\"use client\"\n\nimport { useCallback, useRef, useState } from \"react\"\nimport { useIcon } from \"../../icons/icon-context\"\n\nexport interface StarRatingProps {\n rating: number\n max?: number\n size?: \"sm\" | \"md\" | \"lg\"\n showValue?: boolean\n reviewCount?: number\n className?: string\n filledClassName?: string\n interactive?: boolean\n onRate?: (rating: number) => void\n}\n\nconst sizeMap = {\n sm: \"h-3.5 w-3.5\",\n md: \"h-5 w-5\",\n lg: \"h-6 w-6\",\n} as const\n\nfunction getHoverRating(\n event: React.MouseEvent,\n starIndex: number,\n): number {\n const rect = (event.currentTarget as HTMLElement).getBoundingClientRect()\n const x = event.clientX - rect.left\n const isLeftHalf = x < rect.width / 2\n return isLeftHalf ? starIndex + 0.5 : starIndex + 1\n}\n\nfunction RatingMeta({ showValue, clampedRating, reviewCount }: { showValue: boolean; clampedRating: number; reviewCount?: number }) {\n return (\n <>\n {showValue && (\n <span className=\"text-sm text-(--enad-text-primary-color) font-medium\">\n {clampedRating.toFixed(1)}\n </span>\n )}\n {reviewCount !== undefined && (\n <span className=\"text-sm text-(--enad-text-muted-color)\">\n ({reviewCount} {reviewCount === 1 ? \"review\" : \"reviews\"})\n </span>\n )}\n </>\n )\n}\n\n/* ─── Star rendering helper ─── */\n\nfunction StarIcon_({\n fillLevel,\n iconSize,\n filledColor,\n StarIcon,\n StarFilledIcon,\n}: {\n fillLevel: number\n iconSize: string\n filledColor: string\n StarIcon: React.ComponentType<{ className?: string }>\n StarFilledIcon: React.ComponentType<{ className?: string }>\n}) {\n if (fillLevel >= 1) {\n return (\n <StarFilledIcon\n className={`${iconSize} fill-current ${filledColor}`}\n />\n )\n }\n\n if (fillLevel > 0) {\n return (\n <>\n <StarIcon\n className={`absolute inset-0 ${iconSize} text-(--enad-text-muted-color)`}\n />\n <span\n className=\"absolute inset-0 overflow-hidden\"\n style={{ clipPath: `inset(0 ${(1 - fillLevel) * 100}% 0 0)` }}\n >\n <StarFilledIcon\n className={`${iconSize} fill-current ${filledColor}`}\n />\n </span>\n </>\n )\n }\n\n return (\n <StarIcon\n className={`${iconSize} text-(--enad-text-muted-color)`}\n />\n )\n}\n\n/* ─── Interactive star rating ─── */\n\nfunction InteractiveStarRating({\n rating,\n max,\n iconSize,\n filledColor,\n showValue,\n reviewCount,\n className,\n onRate,\n}: {\n rating: number\n max: number\n iconSize: string\n filledColor: string\n showValue: boolean\n reviewCount?: number\n className: string\n onRate?: (rating: number) => void\n}) {\n const StarIcon = useIcon(\"star\")\n const StarFilledIcon = useIcon(\"starFilled\")\n const [hoveredRating, setHoveredRating] = useState<number | null>(null)\n const [selectedRating, setSelectedRating] = useState<number | null>(null)\n const containerRef = useRef<HTMLDivElement>(null)\n\n const baseRating = selectedRating ?? rating\n const displayRating = hoveredRating !== null ? hoveredRating : baseRating\n const clampedRating = Math.max(0, Math.min(displayRating, max))\n\n const handleKeyDown = useCallback(\n (event: React.KeyboardEvent) => {\n const current = hoveredRating ?? baseRating\n let next = current\n\n switch (event.key) {\n case \"ArrowRight\":\n case \"ArrowUp\":\n next = Math.min(max, current + 0.5)\n event.preventDefault()\n break\n case \"ArrowLeft\":\n case \"ArrowDown\":\n next = Math.max(0.5, current - 0.5)\n event.preventDefault()\n break\n case \"Enter\":\n case \" \":\n event.preventDefault()\n setSelectedRating(current)\n onRate?.(current)\n return\n default:\n return\n }\n\n setHoveredRating(next)\n },\n [hoveredRating, baseRating, max, onRate],\n )\n\n return (\n <div className={`inline-flex items-center gap-1 font-enad ${className}`}>\n <div\n ref={containerRef}\n className=\"flex items-center gap-0.5\"\n role=\"radiogroup\"\n aria-label={`Rate from 1 to ${max} stars`}\n onMouseLeave={() => setHoveredRating(null)}\n onKeyDown={handleKeyDown}\n >\n {Array.from({ length: max }, (_, i) => (\n <span\n key={i}\n className={`relative inline-flex ${iconSize} cursor-pointer transition-transform duration-150 motion-reduce:transition-none ${\n hoveredRating !== null && hoveredRating >= i + 0.5\n ? \"scale-110\"\n : \"\"\n }`}\n role=\"radio\"\n aria-checked={rating === i + 1 || rating === i + 0.5}\n aria-label={`${i + 1} star${i + 1 === 1 ? \"\" : \"s\"}`}\n tabIndex={i === 0 ? 0 : -1}\n onMouseMove={(e) => setHoveredRating(getHoverRating(e, i))}\n onClick={(e) => {\n const value = getHoverRating(e, i)\n setSelectedRating(value)\n onRate?.(value)\n }}\n onKeyDown={handleKeyDown}\n >\n <StarIcon_\n fillLevel={Math.max(0, Math.min(1, clampedRating - i))}\n iconSize={iconSize}\n filledColor={filledColor}\n StarIcon={StarIcon}\n StarFilledIcon={StarFilledIcon}\n />\n </span>\n ))}\n </div>\n\n <RatingMeta showValue={showValue} clampedRating={clampedRating} reviewCount={reviewCount} />\n </div>\n )\n}\n\n/* ─── Display-only star rating ─── */\n\nfunction DisplayStarRating({\n rating,\n max,\n iconSize,\n filledColor,\n showValue,\n reviewCount,\n className,\n}: {\n rating: number\n max: number\n iconSize: string\n filledColor: string\n showValue: boolean\n reviewCount?: number\n className: string\n}) {\n const StarIcon = useIcon(\"star\")\n const StarFilledIcon = useIcon(\"starFilled\")\n const clampedRating = Math.max(0, Math.min(rating, max))\n\n return (\n <div\n className={`inline-flex items-center gap-1 font-enad ${className}`}\n role=\"img\"\n aria-label={`${clampedRating} out of ${max} stars`}\n >\n <div className=\"flex items-center gap-0.5\">\n {Array.from({ length: max }, (_, i) => (\n <span key={i} className={`relative inline-flex ${iconSize}`}>\n <StarIcon_\n fillLevel={Math.max(0, Math.min(1, clampedRating - i))}\n iconSize={iconSize}\n filledColor={filledColor}\n StarIcon={StarIcon}\n StarFilledIcon={StarFilledIcon}\n />\n </span>\n ))}\n </div>\n\n <RatingMeta showValue={showValue} clampedRating={clampedRating} reviewCount={reviewCount} />\n </div>\n )\n}\n\n/* ─── Main component ─── */\n\nexport function StarRating({\n rating,\n max = 5,\n size = \"md\",\n showValue = false,\n reviewCount,\n className = \"\",\n filledClassName,\n interactive = false,\n onRate,\n}: StarRatingProps) {\n const iconSize = sizeMap[size]\n const filledColor = filledClassName || \"text-(--enad-star-color)\"\n\n if (interactive) {\n return (\n <InteractiveStarRating\n rating={rating}\n max={max}\n iconSize={iconSize}\n filledColor={filledColor}\n showValue={showValue}\n reviewCount={reviewCount}\n className={className}\n onRate={onRate}\n />\n )\n }\n\n return (\n <DisplayStarRating\n rating={rating}\n max={max}\n iconSize={iconSize}\n filledColor={filledColor}\n showValue={showValue}\n reviewCount={reviewCount}\n className={className}\n />\n )\n}\n"],"mappings":";AAmCI,mBAEI,KAKA,YAPJ;AAjCJ,SAAS,aAAa,QAAQ,gBAAgB;AAC9C,SAAS,eAAe;AAcxB,MAAM,UAAU;AAAA,EACd,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEA,SAAS,eACP,OACA,WACQ;AACR,QAAM,OAAQ,MAAM,cAA8B,sBAAsB;AACxE,QAAM,IAAI,MAAM,UAAU,KAAK;AAC/B,QAAM,aAAa,IAAI,KAAK,QAAQ;AACpC,SAAO,aAAa,YAAY,MAAM,YAAY;AACpD;AAEA,SAAS,WAAW,EAAE,WAAW,eAAe,YAAY,GAAwE;AAClI,SACE,iCACG;AAAA,iBACC,oBAAC,UAAK,WAAU,wDACb,wBAAc,QAAQ,CAAC,GAC1B;AAAA,IAED,gBAAgB,UACf,qBAAC,UAAK,WAAU,0CAAyC;AAAA;AAAA,MACrD;AAAA,MAAY;AAAA,MAAE,gBAAgB,IAAI,WAAW;AAAA,MAAU;AAAA,OAC3D;AAAA,KAEJ;AAEJ;AAIA,SAAS,UAAU;AAAA,EACjB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAMG;AACD,MAAI,aAAa,GAAG;AAClB,WACE;AAAA,MAAC;AAAA;AAAA,QACC,WAAW,GAAG,QAAQ,iBAAiB,WAAW;AAAA;AAAA,IACpD;AAAA,EAEJ;AAEA,MAAI,YAAY,GAAG;AACjB,WACE,iCACE;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,WAAW,oBAAoB,QAAQ;AAAA;AAAA,MACzC;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,WAAU;AAAA,UACV,OAAO,EAAE,UAAU,YAAY,IAAI,aAAa,GAAG,SAAS;AAAA,UAE5D;AAAA,YAAC;AAAA;AAAA,cACC,WAAW,GAAG,QAAQ,iBAAiB,WAAW;AAAA;AAAA,UACpD;AAAA;AAAA,MACF;AAAA,OACF;AAAA,EAEJ;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,QAAQ;AAAA;AAAA,EACxB;AAEJ;AAIA,SAAS,sBAAsB;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GASG;AACD,QAAM,WAAW,QAAQ,MAAM;AAC/B,QAAM,iBAAiB,QAAQ,YAAY;AAC3C,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAAwB,IAAI;AACtE,QAAM,CAAC,gBAAgB,iBAAiB,IAAI,SAAwB,IAAI;AACxE,QAAM,eAAe,OAAuB,IAAI;AAEhD,QAAM,aAAa,kBAAkB;AACrC,QAAM,gBAAgB,kBAAkB,OAAO,gBAAgB;AAC/D,QAAM,gBAAgB,KAAK,IAAI,GAAG,KAAK,IAAI,eAAe,GAAG,CAAC;AAE9D,QAAM,gBAAgB;AAAA,IACpB,CAAC,UAA+B;AAC9B,YAAM,UAAU,iBAAiB;AACjC,UAAI,OAAO;AAEX,cAAQ,MAAM,KAAK;AAAA,QACjB,KAAK;AAAA,QACL,KAAK;AACH,iBAAO,KAAK,IAAI,KAAK,UAAU,GAAG;AAClC,gBAAM,eAAe;AACrB;AAAA,QACF,KAAK;AAAA,QACL,KAAK;AACH,iBAAO,KAAK,IAAI,KAAK,UAAU,GAAG;AAClC,gBAAM,eAAe;AACrB;AAAA,QACF,KAAK;AAAA,QACL,KAAK;AACH,gBAAM,eAAe;AACrB,4BAAkB,OAAO;AACzB,mBAAS,OAAO;AAChB;AAAA,QACF;AACE;AAAA,MACJ;AAEA,uBAAiB,IAAI;AAAA,IACvB;AAAA,IACA,CAAC,eAAe,YAAY,KAAK,MAAM;AAAA,EACzC;AAEA,SACE,qBAAC,SAAI,WAAW,4CAA4C,SAAS,IACnE;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,KAAK;AAAA,QACL,WAAU;AAAA,QACV,MAAK;AAAA,QACL,cAAY,kBAAkB,GAAG;AAAA,QACjC,cAAc,MAAM,iBAAiB,IAAI;AAAA,QACzC,WAAW;AAAA,QAEV,gBAAM,KAAK,EAAE,QAAQ,IAAI,GAAG,CAAC,GAAG,MAC/B;AAAA,UAAC;AAAA;AAAA,YAEC,WAAW,wBAAwB,QAAQ,mFACzC,kBAAkB,QAAQ,iBAAiB,IAAI,MAC3C,cACA,EACN;AAAA,YACA,MAAK;AAAA,YACL,gBAAc,WAAW,IAAI,KAAK,WAAW,IAAI;AAAA,YACjD,cAAY,GAAG,IAAI,CAAC,QAAQ,IAAI,MAAM,IAAI,KAAK,GAAG;AAAA,YAClD,UAAU,MAAM,IAAI,IAAI;AAAA,YACxB,aAAa,CAAC,MAAM,iBAAiB,eAAe,GAAG,CAAC,CAAC;AAAA,YACzD,SAAS,CAAC,MAAM;AACd,oBAAM,QAAQ,eAAe,GAAG,CAAC;AACjC,gCAAkB,KAAK;AACvB,uBAAS,KAAK;AAAA,YAChB;AAAA,YACA,WAAW;AAAA,YAEX;AAAA,cAAC;AAAA;AAAA,gBACC,WAAW,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,gBAAgB,CAAC,CAAC;AAAA,gBACrD;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA;AAAA,YACF;AAAA;AAAA,UAxBK;AAAA,QAyBP,CACD;AAAA;AAAA,IACH;AAAA,IAEA,oBAAC,cAAW,WAAsB,eAA8B,aAA0B;AAAA,KAC5F;AAEJ;AAIA,SAAS,kBAAkB;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAQG;AACD,QAAM,WAAW,QAAQ,MAAM;AAC/B,QAAM,iBAAiB,QAAQ,YAAY;AAC3C,QAAM,gBAAgB,KAAK,IAAI,GAAG,KAAK,IAAI,QAAQ,GAAG,CAAC;AAEvD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,4CAA4C,SAAS;AAAA,MAChE,MAAK;AAAA,MACL,cAAY,GAAG,aAAa,WAAW,GAAG;AAAA,MAE1C;AAAA,4BAAC,SAAI,WAAU,6BACZ,gBAAM,KAAK,EAAE,QAAQ,IAAI,GAAG,CAAC,GAAG,MAC/B,oBAAC,UAAa,WAAW,wBAAwB,QAAQ,IACvD;AAAA,UAAC;AAAA;AAAA,YACC,WAAW,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,gBAAgB,CAAC,CAAC;AAAA,YACrD;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA;AAAA,QACF,KAPS,CAQX,CACD,GACH;AAAA,QAEA,oBAAC,cAAW,WAAsB,eAA8B,aAA0B;AAAA;AAAA;AAAA,EAC5F;AAEJ;AAIO,SAAS,WAAW;AAAA,EACzB;AAAA,EACA,MAAM;AAAA,EACN,OAAO;AAAA,EACP,YAAY;AAAA,EACZ;AAAA,EACA,YAAY;AAAA,EACZ;AAAA,EACA,cAAc;AAAA,EACd;AACF,GAAoB;AAClB,QAAM,WAAW,QAAQ,IAAI;AAC7B,QAAM,cAAc,mBAAmB;AAEvC,MAAI,aAAa;AACf,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF;AAAA,EAEJ;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface TestimonialProps {
|
|
3
|
+
quote: string;
|
|
4
|
+
name: string;
|
|
5
|
+
role?: string;
|
|
6
|
+
location?: string;
|
|
7
|
+
avatarUrl?: string;
|
|
8
|
+
avatarInitials?: string;
|
|
9
|
+
rating?: number;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface TestimonialGridProps {
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
/** Number of columns at lg breakpoint */
|
|
15
|
+
columns?: 2 | 3 | 4;
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function Testimonial({ quote, name, role, location, avatarUrl, avatarInitials, rating, className, }: TestimonialProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare function TestimonialGrid({ children, columns, className }: TestimonialGridProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
//# sourceMappingURL=testimonial.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testimonial.d.ts","sourceRoot":"","sources":["../../../../src/client/storefront/components/testimonial.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,yCAAyC;IACzC,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAID,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,cAAc,EACd,MAAM,EACN,SAAS,GACV,EAAE,gBAAgB,2CAiClB;AAUD,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,OAAW,EAAE,SAAS,EAAE,EAAE,oBAAoB,2CAQzF"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn } from "../../ui/utils";
|
|
4
|
+
import { StarRating } from "./star-rating";
|
|
5
|
+
function Testimonial({
|
|
6
|
+
quote,
|
|
7
|
+
name,
|
|
8
|
+
role,
|
|
9
|
+
location,
|
|
10
|
+
avatarUrl,
|
|
11
|
+
avatarInitials,
|
|
12
|
+
rating,
|
|
13
|
+
className
|
|
14
|
+
}) {
|
|
15
|
+
const attribution = [role, location].filter(Boolean).join(", ");
|
|
16
|
+
return /* @__PURE__ */ jsxs(
|
|
17
|
+
"figure",
|
|
18
|
+
{
|
|
19
|
+
className: cn(
|
|
20
|
+
"flex flex-col gap-4 rounded-(--enad-border-radius) border border-border bg-background p-6",
|
|
21
|
+
className
|
|
22
|
+
),
|
|
23
|
+
children: [
|
|
24
|
+
rating !== void 0 && /* @__PURE__ */ jsx(StarRating, { rating, size: "sm" }),
|
|
25
|
+
/* @__PURE__ */ jsxs("blockquote", { className: "flex-1 text-sm leading-relaxed text-foreground", children: [
|
|
26
|
+
"\u201C",
|
|
27
|
+
quote,
|
|
28
|
+
"\u201D"
|
|
29
|
+
] }),
|
|
30
|
+
/* @__PURE__ */ jsxs("figcaption", { className: "flex items-center gap-3", children: [
|
|
31
|
+
(avatarUrl || avatarInitials) && /* @__PURE__ */ jsx("div", { className: "flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-full bg-muted text-sm font-medium text-muted-foreground", children: avatarUrl ? /* @__PURE__ */ jsx("img", { src: avatarUrl, alt: name, loading: "lazy", className: "size-full object-cover" }) : avatarInitials }),
|
|
32
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
|
|
33
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium font-enad", children: name }),
|
|
34
|
+
attribution && /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: attribution })
|
|
35
|
+
] })
|
|
36
|
+
] })
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
const columnClasses = {
|
|
42
|
+
2: "sm:columns-2",
|
|
43
|
+
3: "sm:columns-2 lg:columns-3",
|
|
44
|
+
4: "sm:columns-2 lg:columns-3 xl:columns-4"
|
|
45
|
+
};
|
|
46
|
+
function TestimonialGrid({ children, columns = 3, className }) {
|
|
47
|
+
return /* @__PURE__ */ jsx("div", { className: cn("columns-1 gap-4 space-y-4", columnClasses[columns], className), children: React.Children.map(children, (child) => /* @__PURE__ */ jsx("div", { className: "break-inside-avoid", children: child })) });
|
|
48
|
+
}
|
|
49
|
+
export {
|
|
50
|
+
Testimonial,
|
|
51
|
+
TestimonialGrid
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=testimonial.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/client/storefront/components/testimonial.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../ui/utils\";\nimport { StarRating } from \"./star-rating\";\n\n/* ─── Types ─── */\n\nexport interface TestimonialProps {\n quote: string;\n name: string;\n role?: string;\n location?: string;\n avatarUrl?: string;\n avatarInitials?: string;\n rating?: number;\n className?: string;\n}\n\nexport interface TestimonialGridProps {\n children: React.ReactNode;\n /** Number of columns at lg breakpoint */\n columns?: 2 | 3 | 4;\n className?: string;\n}\n\n/* ─── Testimonial ─── */\n\nexport function Testimonial({\n quote,\n name,\n role,\n location,\n avatarUrl,\n avatarInitials,\n rating,\n className,\n}: TestimonialProps) {\n const attribution = [role, location].filter(Boolean).join(\", \");\n\n return (\n <figure\n className={cn(\n \"flex flex-col gap-4 rounded-(--enad-border-radius) border border-border bg-background p-6\",\n className,\n )}\n >\n {rating !== undefined && <StarRating rating={rating} size=\"sm\" />}\n\n <blockquote className=\"flex-1 text-sm leading-relaxed text-foreground\">\n “{quote}”\n </blockquote>\n\n <figcaption className=\"flex items-center gap-3\">\n {(avatarUrl || avatarInitials) && (\n <div className=\"flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-full bg-muted text-sm font-medium text-muted-foreground\">\n {avatarUrl ? (\n <img src={avatarUrl} alt={name} loading=\"lazy\" className=\"size-full object-cover\" />\n ) : (\n avatarInitials\n )}\n </div>\n )}\n <div className=\"flex flex-col\">\n <span className=\"text-sm font-medium font-enad\">{name}</span>\n {attribution && <span className=\"text-xs text-muted-foreground\">{attribution}</span>}\n </div>\n </figcaption>\n </figure>\n );\n}\n\n/* ─── Grid ─── */\n\nconst columnClasses = {\n 2: \"sm:columns-2\",\n 3: \"sm:columns-2 lg:columns-3\",\n 4: \"sm:columns-2 lg:columns-3 xl:columns-4\",\n} as const;\n\nexport function TestimonialGrid({ children, columns = 3, className }: TestimonialGridProps) {\n return (\n <div className={cn(\"columns-1 gap-4 space-y-4\", columnClasses[columns], className)}>\n {React.Children.map(children, (child) => (\n <div className=\"break-inside-avoid\">{child}</div>\n ))}\n </div>\n );\n}\n"],"mappings":"AA6C+B,cAEzB,YAFyB;AA7C/B,YAAY,WAAW;AACvB,SAAS,UAAU;AACnB,SAAS,kBAAkB;AAwBpB,SAAS,YAAY;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAqB;AACnB,QAAM,cAAc,CAAC,MAAM,QAAQ,EAAE,OAAO,OAAO,EAAE,KAAK,IAAI;AAE9D,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MAEC;AAAA,mBAAW,UAAa,oBAAC,cAAW,QAAgB,MAAK,MAAK;AAAA,QAE/D,qBAAC,gBAAW,WAAU,kDAAiD;AAAA;AAAA,UAC7D;AAAA,UAAM;AAAA,WAChB;AAAA,QAEA,qBAAC,gBAAW,WAAU,2BAClB;AAAA,wBAAa,mBACb,oBAAC,SAAI,WAAU,qIACZ,sBACC,oBAAC,SAAI,KAAK,WAAW,KAAK,MAAM,SAAQ,QAAO,WAAU,0BAAyB,IAElF,gBAEJ;AAAA,UAEF,qBAAC,SAAI,WAAU,iBACb;AAAA,gCAAC,UAAK,WAAU,iCAAiC,gBAAK;AAAA,YACrD,eAAe,oBAAC,UAAK,WAAU,iCAAiC,uBAAY;AAAA,aAC/E;AAAA,WACF;AAAA;AAAA;AAAA,EACF;AAEJ;AAIA,MAAM,gBAAgB;AAAA,EACpB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEO,SAAS,gBAAgB,EAAE,UAAU,UAAU,GAAG,UAAU,GAAyB;AAC1F,SACE,oBAAC,SAAI,WAAW,GAAG,6BAA6B,cAAc,OAAO,GAAG,SAAS,GAC9E,gBAAM,SAAS,IAAI,UAAU,CAAC,UAC7B,oBAAC,SAAI,WAAU,sBAAsB,iBAAM,CAC5C,GACH;AAEJ;","names":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface TrustBadge {
|
|
3
|
+
icon: React.ReactNode;
|
|
4
|
+
label: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface TrustBadgesProps {
|
|
8
|
+
badges: TrustBadge[];
|
|
9
|
+
/** Layout direction */
|
|
10
|
+
layout?: "row" | "grid";
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function TrustBadges({ badges, layout, className }: TrustBadgesProps): import("react/jsx-runtime").JSX.Element | null;
|
|
14
|
+
//# sourceMappingURL=trust-badges.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trust-badges.d.ts","sourceRoot":"","sources":["../../../../src/client/storefront/components/trust-badges.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,uBAAuB;IACvB,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAID,wBAAgB,WAAW,CAAC,EAAE,MAAM,EAAE,MAAc,EAAE,SAAS,EAAE,EAAE,gBAAgB,kDA2BlF"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../ui/utils";
|
|
3
|
+
function TrustBadges({ badges, layout = "row", className }) {
|
|
4
|
+
if (badges.length === 0) return null;
|
|
5
|
+
return /* @__PURE__ */ jsx(
|
|
6
|
+
"div",
|
|
7
|
+
{
|
|
8
|
+
className: cn(
|
|
9
|
+
layout === "row" ? "flex flex-wrap items-start justify-center gap-6 sm:gap-8" : "grid grid-cols-2 gap-4 sm:grid-cols-4",
|
|
10
|
+
className
|
|
11
|
+
),
|
|
12
|
+
children: badges.map((badge, i) => /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-2 text-center", children: [
|
|
13
|
+
/* @__PURE__ */ jsx("div", { className: "flex size-10 items-center justify-center rounded-full bg-muted text-foreground", children: badge.icon }),
|
|
14
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-0.5", children: [
|
|
15
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium font-enad", children: badge.label }),
|
|
16
|
+
badge.description && /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: badge.description })
|
|
17
|
+
] })
|
|
18
|
+
] }, i))
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
TrustBadges
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=trust-badges.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/client/storefront/components/trust-badges.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../ui/utils\";\n\n/* ─── Types ─── */\n\nexport interface TrustBadge {\n icon: React.ReactNode;\n label: string;\n description?: string;\n}\n\nexport interface TrustBadgesProps {\n badges: TrustBadge[];\n /** Layout direction */\n layout?: \"row\" | \"grid\";\n className?: string;\n}\n\n/* ─── Component ─── */\n\nexport function TrustBadges({ badges, layout = \"row\", className }: TrustBadgesProps) {\n if (badges.length === 0) return null;\n\n return (\n <div\n className={cn(\n layout === \"row\"\n ? \"flex flex-wrap items-start justify-center gap-6 sm:gap-8\"\n : \"grid grid-cols-2 gap-4 sm:grid-cols-4\",\n className,\n )}\n >\n {badges.map((badge, i) => (\n <div key={i} className=\"flex flex-col items-center gap-2 text-center\">\n <div className=\"flex size-10 items-center justify-center rounded-full bg-muted text-foreground\">\n {badge.icon}\n </div>\n <div className=\"flex flex-col gap-0.5\">\n <span className=\"text-sm font-medium font-enad\">{badge.label}</span>\n {badge.description && (\n <span className=\"text-xs text-muted-foreground\">{badge.description}</span>\n )}\n </div>\n </div>\n ))}\n </div>\n );\n}\n"],"mappings":"AAkCU,cAGA,YAHA;AAjCV,SAAS,UAAU;AAmBZ,SAAS,YAAY,EAAE,QAAQ,SAAS,OAAO,UAAU,GAAqB;AACnF,MAAI,OAAO,WAAW,EAAG,QAAO;AAEhC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT,WAAW,QACP,6DACA;AAAA,QACJ;AAAA,MACF;AAAA,MAEC,iBAAO,IAAI,CAAC,OAAO,MAClB,qBAAC,SAAY,WAAU,gDACrB;AAAA,4BAAC,SAAI,WAAU,kFACZ,gBAAM,MACT;AAAA,QACA,qBAAC,SAAI,WAAU,yBACb;AAAA,8BAAC,UAAK,WAAU,iCAAiC,gBAAM,OAAM;AAAA,UAC5D,MAAM,eACL,oBAAC,UAAK,WAAU,iCAAiC,gBAAM,aAAY;AAAA,WAEvE;AAAA,WATQ,CAUV,CACD;AAAA;AAAA,EACH;AAEJ;","names":[]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface VariantOption {
|
|
2
|
+
id: string;
|
|
3
|
+
label: string;
|
|
4
|
+
available?: boolean;
|
|
5
|
+
value?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface VariantAxis {
|
|
8
|
+
name: string;
|
|
9
|
+
options: VariantOption[];
|
|
10
|
+
}
|
|
11
|
+
export interface VariantSelectorProps {
|
|
12
|
+
axes: VariantAxis[];
|
|
13
|
+
selected: Record<string, string>;
|
|
14
|
+
onChange: (axis: string, optionId: string) => void;
|
|
15
|
+
labels?: {
|
|
16
|
+
unavailableHint?: string;
|
|
17
|
+
};
|
|
18
|
+
className?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare function VariantSelector({ axes, selected, onChange, labels, className, }: VariantSelectorProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
//# sourceMappingURL=variant-selector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variant-selector.d.ts","sourceRoot":"","sources":["../../../../src/client/storefront/components/variant-selector.tsx"],"names":[],"mappings":"AAEA,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,aAAa,EAAE,CAAA;CACzB;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,WAAW,EAAE,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAChC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;IAClD,MAAM,CAAC,EAAE;QACP,eAAe,CAAC,EAAE,MAAM,CAAA;KACzB,CAAA;IACD,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,wBAAgB,eAAe,CAAC,EAC9B,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,MAAW,EACX,SAAc,GACf,EAAE,oBAAoB,2CAqDtB"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
function VariantSelector({
|
|
4
|
+
axes,
|
|
5
|
+
selected,
|
|
6
|
+
onChange,
|
|
7
|
+
labels = {},
|
|
8
|
+
className = ""
|
|
9
|
+
}) {
|
|
10
|
+
const { unavailableHint = "Unavailable" } = labels;
|
|
11
|
+
return /* @__PURE__ */ jsx("div", { className: `font-enad space-y-4 ${className}`, children: axes.map((axis) => /* @__PURE__ */ jsxs("fieldset", { className: "space-y-2", children: [
|
|
12
|
+
/* @__PURE__ */ jsx("legend", { className: "text-sm font-medium text-(--enad-text-primary-color)", children: axis.name }),
|
|
13
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2", role: "radiogroup", "aria-label": axis.name, children: axis.options.map((option) => {
|
|
14
|
+
const isSelected = selected[axis.name] === option.id;
|
|
15
|
+
const isAvailable = option.available !== false;
|
|
16
|
+
return /* @__PURE__ */ jsx(
|
|
17
|
+
"button",
|
|
18
|
+
{
|
|
19
|
+
type: "button",
|
|
20
|
+
role: "radio",
|
|
21
|
+
"aria-checked": isSelected,
|
|
22
|
+
"aria-label": isAvailable ? `${option.label}` : `${option.label} - ${unavailableHint}`,
|
|
23
|
+
onClick: () => onChange(axis.name, option.id),
|
|
24
|
+
className: `
|
|
25
|
+
inline-flex items-center justify-center px-4 py-2 text-sm font-medium
|
|
26
|
+
rounded-(--enad-border-radius) border transition
|
|
27
|
+
motion-reduce:transition-none
|
|
28
|
+
${isSelected ? "bg-(--enad-button-bg) text-(--enad-button-color) border-(--enad-button-bg) ring-2 ring-(--enad-button-bg)/30 ring-offset-1" : "bg-transparent text-(--enad-text-primary-color) border-(--enad-border-color) hover:border-(--enad-button-bg)"}
|
|
29
|
+
${!isAvailable ? "opacity-40 line-through" : ""}
|
|
30
|
+
`,
|
|
31
|
+
children: option.label
|
|
32
|
+
},
|
|
33
|
+
option.id
|
|
34
|
+
);
|
|
35
|
+
}) })
|
|
36
|
+
] }, axis.name)) });
|
|
37
|
+
}
|
|
38
|
+
export {
|
|
39
|
+
VariantSelector
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=variant-selector.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/client/storefront/components/variant-selector.tsx"],"sourcesContent":["\"use client\"\n\nexport interface VariantOption {\n id: string\n label: string\n available?: boolean\n value?: string\n}\n\nexport interface VariantAxis {\n name: string\n options: VariantOption[]\n}\n\nexport interface VariantSelectorProps {\n axes: VariantAxis[]\n selected: Record<string, string>\n onChange: (axis: string, optionId: string) => void\n labels?: {\n unavailableHint?: string\n }\n className?: string\n}\n\nexport function VariantSelector({\n axes,\n selected,\n onChange,\n labels = {},\n className = \"\",\n}: VariantSelectorProps) {\n const { unavailableHint = \"Unavailable\" } = labels\n\n return (\n <div className={`font-enad space-y-4 ${className}`}>\n {axes.map((axis) => (\n <fieldset key={axis.name} className=\"space-y-2\">\n <legend className=\"text-sm font-medium text-(--enad-text-primary-color)\">\n {axis.name}\n </legend>\n\n <div className=\"flex flex-wrap gap-2\" role=\"radiogroup\" aria-label={axis.name}>\n {axis.options.map((option) => {\n const isSelected = selected[axis.name] === option.id\n const isAvailable = option.available !== false\n\n return (\n <button\n key={option.id}\n type=\"button\"\n role=\"radio\"\n aria-checked={isSelected}\n aria-label={\n isAvailable\n ? `${option.label}`\n : `${option.label} - ${unavailableHint}`\n }\n onClick={() => onChange(axis.name, option.id)}\n className={`\n inline-flex items-center justify-center px-4 py-2 text-sm font-medium\n rounded-(--enad-border-radius) border transition\n motion-reduce:transition-none\n ${\n isSelected\n ? \"bg-(--enad-button-bg) text-(--enad-button-color) border-(--enad-button-bg) ring-2 ring-(--enad-button-bg)/30 ring-offset-1\"\n : \"bg-transparent text-(--enad-text-primary-color) border-(--enad-border-color) hover:border-(--enad-button-bg)\"\n }\n ${\n !isAvailable\n ? \"opacity-40 line-through\"\n : \"\"\n }\n `}\n >\n {option.label}\n </button>\n )\n })}\n </div>\n </fieldset>\n ))}\n </div>\n )\n}\n"],"mappings":";AAoCQ,SACE,KADF;AAZD,SAAS,gBAAgB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS,CAAC;AAAA,EACV,YAAY;AACd,GAAyB;AACvB,QAAM,EAAE,kBAAkB,cAAc,IAAI;AAE5C,SACE,oBAAC,SAAI,WAAW,uBAAuB,SAAS,IAC7C,eAAK,IAAI,CAAC,SACT,qBAAC,cAAyB,WAAU,aAClC;AAAA,wBAAC,YAAO,WAAU,wDACf,eAAK,MACR;AAAA,IAEA,oBAAC,SAAI,WAAU,wBAAuB,MAAK,cAAa,cAAY,KAAK,MACtE,eAAK,QAAQ,IAAI,CAAC,WAAW;AAC5B,YAAM,aAAa,SAAS,KAAK,IAAI,MAAM,OAAO;AAClD,YAAM,cAAc,OAAO,cAAc;AAEzC,aACE;AAAA,QAAC;AAAA;AAAA,UAEC,MAAK;AAAA,UACL,MAAK;AAAA,UACL,gBAAc;AAAA,UACd,cACE,cACI,GAAG,OAAO,KAAK,KACf,GAAG,OAAO,KAAK,MAAM,eAAe;AAAA,UAE1C,SAAS,MAAM,SAAS,KAAK,MAAM,OAAO,EAAE;AAAA,UAC5C,WAAW;AAAA;AAAA;AAAA;AAAA,sBAKP,aACI,+HACA,8GACN;AAAA,sBAEE,CAAC,cACG,4BACA,EACN;AAAA;AAAA,UAGD,iBAAO;AAAA;AAAA,QA1BH,OAAO;AAAA,MA2Bd;AAAA,IAEJ,CAAC,GACH;AAAA,OA1Ca,KAAK,IA2CpB,CACD,GACH;AAEJ;","names":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface WishlistToggleProps {
|
|
2
|
+
active?: boolean;
|
|
3
|
+
onToggle?: () => void;
|
|
4
|
+
loading?: boolean;
|
|
5
|
+
size?: "sm" | "default" | "lg";
|
|
6
|
+
className?: string;
|
|
7
|
+
label?: string;
|
|
8
|
+
/** Label when active state is true */
|
|
9
|
+
activeLabel?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function WishlistToggle({ active, onToggle, loading, size, className, label, activeLabel, }: WishlistToggleProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
//# sourceMappingURL=wishlist-toggle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wishlist-toggle.d.ts","sourceRoot":"","sources":["../../../../src/client/storefront/components/wishlist-toggle.tsx"],"names":[],"mappings":"AAMA,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,GAAG,IAAI,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sCAAsC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,cAAc,CAAC,EAC7B,MAAc,EACd,QAAQ,EACR,OAAe,EACf,IAAgB,EAChB,SAAS,EACT,KAAyB,EACzB,WAAoC,GACrC,EAAE,mBAAmB,2CAyCrB"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "../../ui/utils";
|
|
4
|
+
import { useIcon } from "../../icons/icon-context";
|
|
5
|
+
function WishlistToggle({
|
|
6
|
+
active = false,
|
|
7
|
+
onToggle,
|
|
8
|
+
loading = false,
|
|
9
|
+
size = "default",
|
|
10
|
+
className,
|
|
11
|
+
label = "Add to wishlist",
|
|
12
|
+
activeLabel = "Remove from wishlist"
|
|
13
|
+
}) {
|
|
14
|
+
const HeartIcon = useIcon("heart");
|
|
15
|
+
const sizeClasses = {
|
|
16
|
+
sm: "size-8",
|
|
17
|
+
default: "size-10",
|
|
18
|
+
lg: "size-12"
|
|
19
|
+
};
|
|
20
|
+
const iconSizes = {
|
|
21
|
+
sm: "size-4",
|
|
22
|
+
default: "size-5",
|
|
23
|
+
lg: "size-6"
|
|
24
|
+
};
|
|
25
|
+
return /* @__PURE__ */ jsx(
|
|
26
|
+
"button",
|
|
27
|
+
{
|
|
28
|
+
type: "button",
|
|
29
|
+
onClick: onToggle,
|
|
30
|
+
disabled: loading,
|
|
31
|
+
"aria-label": active ? activeLabel : label,
|
|
32
|
+
"aria-pressed": active,
|
|
33
|
+
className: cn(
|
|
34
|
+
"inline-flex items-center justify-center rounded-full transition-all motion-reduce:transition-none",
|
|
35
|
+
"hover:bg-(--enad-hover-bg) active:scale-95 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:outline-none",
|
|
36
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
37
|
+
sizeClasses[size],
|
|
38
|
+
active && "text-(--enad-error-color)",
|
|
39
|
+
!active && "text-(--enad-text-muted-color)",
|
|
40
|
+
className
|
|
41
|
+
),
|
|
42
|
+
children: /* @__PURE__ */ jsx(
|
|
43
|
+
HeartIcon,
|
|
44
|
+
{
|
|
45
|
+
className: cn(
|
|
46
|
+
iconSizes[size],
|
|
47
|
+
"transition-transform motion-reduce:transition-none",
|
|
48
|
+
active && "scale-110"
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
export {
|
|
56
|
+
WishlistToggle
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=wishlist-toggle.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/client/storefront/components/wishlist-toggle.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../ui/utils\";\nimport { useIcon } from \"../../icons/icon-context\";\n\nexport interface WishlistToggleProps {\n active?: boolean;\n onToggle?: () => void;\n loading?: boolean;\n size?: \"sm\" | \"default\" | \"lg\";\n className?: string;\n label?: string;\n /** Label when active state is true */\n activeLabel?: string;\n}\n\nexport function WishlistToggle({\n active = false,\n onToggle,\n loading = false,\n size = \"default\",\n className,\n label = \"Add to wishlist\",\n activeLabel = \"Remove from wishlist\",\n}: WishlistToggleProps) {\n const HeartIcon = useIcon(\"heart\");\n\n const sizeClasses = {\n sm: \"size-8\",\n default: \"size-10\",\n lg: \"size-12\",\n };\n\n const iconSizes = {\n sm: \"size-4\",\n default: \"size-5\",\n lg: \"size-6\",\n };\n\n return (\n <button\n type=\"button\"\n onClick={onToggle}\n disabled={loading}\n aria-label={active ? activeLabel : label}\n aria-pressed={active}\n className={cn(\n \"inline-flex items-center justify-center rounded-full transition-all motion-reduce:transition-none\",\n \"hover:bg-(--enad-hover-bg) active:scale-95 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:outline-none\",\n \"disabled:pointer-events-none disabled:opacity-50\",\n sizeClasses[size],\n active && \"text-(--enad-error-color)\",\n !active && \"text-(--enad-text-muted-color)\",\n className,\n )}\n >\n <HeartIcon\n className={cn(\n iconSizes[size],\n \"transition-transform motion-reduce:transition-none\",\n active && \"scale-110\",\n )}\n />\n </button>\n );\n}\n"],"mappings":";AAyDM;AAtDN,SAAS,UAAU;AACnB,SAAS,eAAe;AAajB,SAAS,eAAe;AAAA,EAC7B,SAAS;AAAA,EACT;AAAA,EACA,UAAU;AAAA,EACV,OAAO;AAAA,EACP;AAAA,EACA,QAAQ;AAAA,EACR,cAAc;AAChB,GAAwB;AACtB,QAAM,YAAY,QAAQ,OAAO;AAEjC,QAAM,cAAc;AAAA,IAClB,IAAI;AAAA,IACJ,SAAS;AAAA,IACT,IAAI;AAAA,EACN;AAEA,QAAM,YAAY;AAAA,IAChB,IAAI;AAAA,IACJ,SAAS;AAAA,IACT,IAAI;AAAA,EACN;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,SAAS;AAAA,MACT,UAAU;AAAA,MACV,cAAY,SAAS,cAAc;AAAA,MACnC,gBAAc;AAAA,MACd,WAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA,YAAY,IAAI;AAAA,QAChB,UAAU;AAAA,QACV,CAAC,UAAU;AAAA,QACX;AAAA,MACF;AAAA,MAEA;AAAA,QAAC;AAAA;AAAA,UACC,WAAW;AAAA,YACT,UAAU,IAAI;AAAA,YACd;AAAA,YACA,UAAU;AAAA,UACZ;AAAA;AAAA,MACF;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface FilterChipProps {
|
|
2
|
+
label: string;
|
|
3
|
+
active: boolean;
|
|
4
|
+
onClick: () => void;
|
|
5
|
+
onRemove?: () => void;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
declare function FilterChip({ label, active, onClick, onRemove, className }: FilterChipProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export { FilterChip, type FilterChipProps };
|
|
10
|
+
//# sourceMappingURL=filter-chip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filter-chip.d.ts","sourceRoot":"","sources":["../../../../src/client/storefront/filters/filter-chip.tsx"],"names":[],"mappings":"AAOA,UAAU,eAAe;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,iBAAS,UAAU,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,eAAe,2CAmBnF;AAED,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useIcon } from "../../icons/icon-context";
|
|
4
|
+
import { Toggle } from "../../ui-resolver/toggle";
|
|
5
|
+
import { cn } from "../../ui/utils";
|
|
6
|
+
function FilterChip({ label, active, onClick, onRemove, className }) {
|
|
7
|
+
const CloseIcon = useIcon("close");
|
|
8
|
+
return /* @__PURE__ */ jsxs(
|
|
9
|
+
Toggle,
|
|
10
|
+
{
|
|
11
|
+
pressed: active,
|
|
12
|
+
onPressedChange: () => active && onRemove ? onRemove() : onClick(),
|
|
13
|
+
variant: "outline",
|
|
14
|
+
className: cn(
|
|
15
|
+
"enad-interactive rounded-[var(--enad-button-radius)] px-3 text-sm",
|
|
16
|
+
active && "bg-primary text-primary-foreground hover:bg-primary-hover hover:text-primary-foreground",
|
|
17
|
+
className
|
|
18
|
+
),
|
|
19
|
+
"aria-label": active ? `Remove ${label}` : label,
|
|
20
|
+
children: [
|
|
21
|
+
label,
|
|
22
|
+
active && onRemove && /* @__PURE__ */ jsx(CloseIcon, { className: "relative size-3 hit-area-6" })
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
FilterChip
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=filter-chip.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/client/storefront/filters/filter-chip.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { useIcon } from \"../../icons/icon-context\";\nimport { Toggle } from \"../../ui-resolver/toggle\";\nimport { cn } from \"../../ui/utils\";\n\ninterface FilterChipProps {\n label: string;\n active: boolean;\n onClick: () => void;\n onRemove?: () => void;\n className?: string;\n}\n\nfunction FilterChip({ label, active, onClick, onRemove, className }: FilterChipProps) {\n const CloseIcon = useIcon(\"close\");\n return (\n <Toggle\n pressed={active}\n onPressedChange={() => (active && onRemove ? onRemove() : onClick())}\n variant=\"outline\"\n className={cn(\n \"enad-interactive rounded-[var(--enad-button-radius)] px-3 text-sm\",\n active &&\n \"bg-primary text-primary-foreground hover:bg-primary-hover hover:text-primary-foreground\",\n className,\n )}\n aria-label={active ? `Remove ${label}` : label}\n >\n {label}\n {active && onRemove && <CloseIcon className=\"relative size-3 hit-area-6\" />}\n </Toggle>\n );\n}\n\nexport { FilterChip, type FilterChipProps };\n"],"mappings":";AAkBI,SAayB,KAbzB;AAfJ,SAAS,eAAe;AACxB,SAAS,cAAc;AACvB,SAAS,UAAU;AAUnB,SAAS,WAAW,EAAE,OAAO,QAAQ,SAAS,UAAU,UAAU,GAAoB;AACpF,QAAM,YAAY,QAAQ,OAAO;AACjC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,SAAS;AAAA,MACT,iBAAiB,MAAO,UAAU,WAAW,SAAS,IAAI,QAAQ;AAAA,MAClE,SAAQ;AAAA,MACR,WAAW;AAAA,QACT;AAAA,QACA,UACE;AAAA,QACF;AAAA,MACF;AAAA,MACA,cAAY,SAAS,UAAU,KAAK,KAAK;AAAA,MAExC;AAAA;AAAA,QACA,UAAU,YAAY,oBAAC,aAAU,WAAU,8BAA6B;AAAA;AAAA;AAAA,EAC3E;AAEJ;","names":[]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
interface FilterOption {
|
|
2
|
+
value: string;
|
|
3
|
+
label: string;
|
|
4
|
+
color?: string;
|
|
5
|
+
count?: number;
|
|
6
|
+
}
|
|
7
|
+
interface FilterGroupProps {
|
|
8
|
+
title: string;
|
|
9
|
+
type: "checkbox" | "color" | "price";
|
|
10
|
+
options: FilterOption[];
|
|
11
|
+
selected: string[];
|
|
12
|
+
onChange: (selected: string[]) => void;
|
|
13
|
+
defaultOpen?: boolean;
|
|
14
|
+
labels?: {
|
|
15
|
+
from?: string;
|
|
16
|
+
to?: string;
|
|
17
|
+
};
|
|
18
|
+
className?: string;
|
|
19
|
+
}
|
|
20
|
+
declare function FilterGroup({ title, type, options, selected, onChange, defaultOpen, labels, className, }: FilterGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export { FilterGroup, type FilterGroupProps, type FilterOption };
|
|
22
|
+
//# sourceMappingURL=filter-group.d.ts.map
|