@anker-in/headless-ui 1.0.19-temp-101705 → 1.0.20-alpha.102201
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/dist/cjs/biz-components/AccordionCards/index.js.map +2 -2
- package/dist/cjs/biz-components/AplusDesc/index.js +2 -0
- package/dist/cjs/biz-components/AplusDesc/index.js.map +7 -0
- package/dist/cjs/biz-components/CollectionsFilters/FilterCardWrap.d.ts +0 -1
- package/dist/cjs/biz-components/CollectionsFilters/FilterCardWrap.js +1 -1
- package/dist/cjs/biz-components/CollectionsFilters/FilterCardWrap.js.map +3 -3
- package/dist/cjs/biz-components/CollectionsFilters/FilterCardWrapItem.js +1 -1
- package/dist/cjs/biz-components/CollectionsFilters/FilterCardWrapItem.js.map +3 -3
- package/dist/cjs/biz-components/CollectionsFilters/component/TabFilter.js +1 -1
- package/dist/cjs/biz-components/CollectionsFilters/component/TabFilter.js.map +2 -2
- package/dist/cjs/biz-components/CollectionsFilters/index.d.ts +0 -1
- package/dist/cjs/biz-components/CollectionsFilters/index.js +1 -1
- package/dist/cjs/biz-components/CollectionsFilters/index.js.map +3 -3
- package/dist/cjs/biz-components/DownLoad/index.d.ts +9 -6
- package/dist/cjs/biz-components/DownLoad/index.js +2 -0
- package/dist/cjs/biz-components/DownLoad/index.js.map +7 -0
- package/dist/cjs/biz-components/Faq/Faq.js +1 -1
- package/dist/cjs/biz-components/Faq/Faq.js.map +2 -2
- package/dist/cjs/biz-components/Features/index.js +2 -0
- package/dist/cjs/biz-components/Features/index.js.map +7 -0
- package/dist/cjs/biz-components/FootCharger/index.js +2 -0
- package/dist/cjs/biz-components/FootCharger/index.js.map +7 -0
- package/dist/cjs/biz-components/FooterNavigation/index.js +1 -1
- package/dist/cjs/biz-components/FooterNavigation/index.js.map +3 -3
- package/dist/cjs/biz-components/FooterNavigation/types.d.ts +2 -1
- package/dist/cjs/biz-components/FooterNavigation/types.js +1 -1
- package/dist/cjs/biz-components/FooterNavigation/types.js.map +2 -2
- package/dist/cjs/biz-components/GiftBox/index.js +2 -0
- package/dist/cjs/biz-components/GiftBox/index.js.map +7 -0
- package/dist/cjs/biz-components/Graphic/index.js +1 -1
- package/dist/cjs/biz-components/Graphic/index.js.map +2 -2
- package/dist/cjs/biz-components/GraphicMore/index.js +2 -0
- package/dist/cjs/biz-components/GraphicMore/index.js.map +7 -0
- package/dist/cjs/biz-components/HeaderNavigation/NavProvider.d.ts +6 -5
- package/dist/cjs/biz-components/HeaderNavigation/NavProvider.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/NavProvider.js.map +3 -3
- package/dist/cjs/biz-components/HeaderNavigation/icons/Polygon.js +2 -0
- package/dist/cjs/biz-components/HeaderNavigation/icons/Polygon.js.map +7 -0
- package/dist/cjs/biz-components/HeaderNavigation/icons/index.d.ts +2 -1
- package/dist/cjs/biz-components/HeaderNavigation/icons/index.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/icons/index.js.map +3 -3
- package/dist/cjs/biz-components/HeaderNavigation/index.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/index.js.map +3 -3
- package/dist/cjs/biz-components/HeaderNavigation/types.d.ts +20 -2
- package/dist/cjs/biz-components/HeaderNavigation/types.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/types.js.map +2 -2
- package/dist/cjs/biz-components/HeaderNavigation/withCategory.d.ts +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/withCategory.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/withCategory.js.map +3 -3
- package/dist/cjs/biz-components/Listing/ProductProvider.d.ts +7 -7
- package/dist/cjs/biz-components/Listing/ProductProvider.js +2 -0
- package/dist/cjs/biz-components/Listing/ProductProvider.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/types.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/types.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/types.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/types.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGridBox.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGridBox.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/types.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/types.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/types.js +2 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/types.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/types.js +2 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/types.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/const.js +2 -0
- package/dist/cjs/biz-components/Listing/const.js.map +7 -0
- package/dist/cjs/biz-components/Listing/hooks/use-options.js +2 -0
- package/dist/cjs/biz-components/Listing/hooks/use-options.js.map +7 -0
- package/dist/cjs/biz-components/Listing/hooks/use-variant-media.js +2 -0
- package/dist/cjs/biz-components/Listing/hooks/use-variant-media.js.map +7 -0
- package/dist/cjs/biz-components/Listing/hooks/use-variant.js +2 -0
- package/dist/cjs/biz-components/Listing/hooks/use-variant.js.map +7 -0
- package/dist/cjs/biz-components/Listing/hooks/useCopy.js +2 -0
- package/dist/cjs/biz-components/Listing/hooks/useCopy.js.map +7 -0
- package/dist/cjs/biz-components/Listing/index.d.ts +1 -1
- package/dist/cjs/biz-components/Listing/index.js +2 -0
- package/dist/cjs/biz-components/Listing/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/types/graphql.js +2 -0
- package/dist/cjs/biz-components/Listing/types/graphql.js.map +7 -0
- package/dist/cjs/biz-components/Listing/types/product.js +2 -0
- package/dist/cjs/biz-components/Listing/types/product.js.map +7 -0
- package/dist/cjs/biz-components/Listing/types/productMetafields.d.js +2 -0
- package/dist/cjs/biz-components/Listing/types/productMetafields.d.js.map +7 -0
- package/dist/cjs/biz-components/Listing/types/type-helper.js +2 -0
- package/dist/cjs/biz-components/Listing/types/type-helper.js.map +7 -0
- package/dist/cjs/biz-components/Listing/types.js +2 -0
- package/dist/cjs/biz-components/Listing/types.js.map +7 -0
- package/dist/cjs/biz-components/Listing/utils/helper.js +2 -0
- package/dist/cjs/biz-components/Listing/utils/helper.js.map +7 -0
- package/dist/cjs/biz-components/Listing/utils/index.js +2 -0
- package/dist/cjs/biz-components/Listing/utils/index.js.map +7 -0
- package/dist/cjs/biz-components/MediaPlayerSticky/index.js +1 -1
- package/dist/cjs/biz-components/MediaPlayerSticky/index.js.map +2 -2
- package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
- package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +2 -2
- package/dist/cjs/biz-components/NavigationSearch/index.js +2 -0
- package/dist/cjs/biz-components/NavigationSearch/index.js.map +7 -0
- package/dist/cjs/biz-components/NavigationSearch/types.js +2 -0
- package/dist/cjs/biz-components/NavigationSearch/types.js.map +7 -0
- package/dist/cjs/biz-components/SearchPage/index.js +2 -0
- package/dist/cjs/biz-components/SearchPage/index.js.map +7 -0
- package/dist/cjs/biz-components/SearchPage/types.js +2 -0
- package/dist/cjs/biz-components/SearchPage/types.js.map +7 -0
- package/dist/cjs/biz-components/SelectStore/index.d.ts +4 -10
- package/dist/cjs/biz-components/SelectStore/index.js +2 -0
- package/dist/cjs/biz-components/SelectStore/index.js.map +7 -0
- package/dist/cjs/biz-components/ShelfDisplay/index.js +1 -1
- package/dist/cjs/biz-components/ShelfDisplay/index.js.map +3 -3
- package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js +4 -4
- package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js.map +3 -3
- package/dist/cjs/biz-components/Specs/dropdown.js +3 -0
- package/dist/cjs/biz-components/Specs/dropdown.js.map +7 -0
- package/dist/cjs/biz-components/Specs/index.js +2 -0
- package/dist/cjs/biz-components/Specs/index.js.map +7 -0
- package/dist/cjs/biz-components/Subscribe/index.d.ts +7 -1
- package/dist/cjs/biz-components/Subscribe/index.js +10 -1
- package/dist/cjs/biz-components/Subscribe/index.js.map +3 -3
- package/dist/cjs/biz-components/Tabs/Tabs.js +1 -1
- package/dist/cjs/biz-components/Tabs/Tabs.js.map +2 -2
- package/dist/cjs/biz-components/TabsGroup/index.d.ts +7 -0
- package/dist/cjs/biz-components/TabsGroup/index.js +2 -0
- package/dist/cjs/biz-components/TabsGroup/index.js.map +7 -0
- package/dist/cjs/biz-components/TabsGroup/types.d.ts +16 -0
- package/dist/cjs/biz-components/TabsGroup/types.js +2 -0
- package/dist/cjs/biz-components/TabsGroup/types.js.map +7 -0
- package/dist/cjs/biz-components/Title/index.js +1 -1
- package/dist/cjs/biz-components/Title/index.js.map +2 -2
- package/dist/cjs/biz-components/Title/types.d.ts +3 -1
- package/dist/cjs/biz-components/Title/types.js +1 -1
- package/dist/cjs/biz-components/Title/types.js.map +1 -1
- package/dist/cjs/biz-components/index.d.ts +26 -0
- package/dist/cjs/biz-components/index.js +1 -1
- package/dist/cjs/biz-components/index.js.map +3 -3
- package/dist/cjs/components/button.js +1 -1
- package/dist/cjs/components/button.js.map +2 -2
- package/dist/cjs/components/checkbox.js +1 -1
- package/dist/cjs/components/checkbox.js.map +3 -3
- package/dist/cjs/components/container.js +1 -1
- package/dist/cjs/components/container.js.map +2 -2
- package/dist/cjs/components/dialog.d.ts +3 -1
- package/dist/cjs/components/dialog.js +1 -1
- package/dist/cjs/components/dialog.js.map +3 -3
- package/dist/cjs/components/index.d.ts +1 -0
- package/dist/cjs/components/index.js +1 -1
- package/dist/cjs/components/index.js.map +3 -3
- package/dist/cjs/components/loadingDots.js +42 -0
- package/dist/cjs/components/loadingDots.js.map +7 -0
- package/dist/cjs/helpers/utils.d.ts +1 -0
- package/dist/cjs/helpers/utils.js +1 -1
- package/dist/cjs/helpers/utils.js.map +3 -3
- package/dist/cjs/stories/aplusdesc.stories.js +2 -0
- package/dist/cjs/stories/aplusdesc.stories.js.map +7 -0
- package/dist/cjs/stories/download.stories.d.ts +1 -6
- package/dist/cjs/stories/download.stories.js +2 -0
- package/dist/cjs/stories/download.stories.js.map +7 -0
- package/dist/cjs/stories/features.stories.js +2 -0
- package/dist/cjs/stories/features.stories.js.map +7 -0
- package/dist/cjs/stories/footcharger.stories.js +2 -0
- package/dist/cjs/stories/footcharger.stories.js.map +7 -0
- package/dist/cjs/stories/giftbox.stories.js +2 -0
- package/dist/cjs/stories/giftbox.stories.js.map +7 -0
- package/dist/cjs/stories/graphicMore.stories.js +2 -0
- package/dist/cjs/stories/graphicMore.stories.js.map +7 -0
- package/dist/cjs/stories/selectstore.stories.js +2 -0
- package/dist/cjs/stories/selectstore.stories.js.map +7 -0
- package/dist/cjs/stories/shelfDisplay.stories.js +644 -1
- package/dist/cjs/stories/shelfDisplay.stories.js.map +2 -2
- package/dist/cjs/stories/tabs.stories.js +1 -1
- package/dist/cjs/stories/tabs.stories.js.map +3 -3
- package/dist/esm/biz-components/AccordionCards/index.js.map +2 -2
- package/dist/esm/biz-components/AplusDesc/index.js +2 -0
- package/dist/esm/biz-components/AplusDesc/index.js.map +7 -0
- package/dist/esm/biz-components/CollectionsFilters/FilterCardWrap.d.ts +0 -1
- package/dist/esm/biz-components/CollectionsFilters/FilterCardWrap.js +1 -1
- package/dist/esm/biz-components/CollectionsFilters/FilterCardWrap.js.map +3 -3
- package/dist/esm/biz-components/CollectionsFilters/FilterCardWrapItem.js +1 -1
- package/dist/esm/biz-components/CollectionsFilters/FilterCardWrapItem.js.map +3 -3
- package/dist/esm/biz-components/CollectionsFilters/component/TabFilter.js +1 -1
- package/dist/esm/biz-components/CollectionsFilters/component/TabFilter.js.map +2 -2
- package/dist/esm/biz-components/CollectionsFilters/index.d.ts +0 -1
- package/dist/esm/biz-components/CollectionsFilters/index.js +1 -1
- package/dist/esm/biz-components/CollectionsFilters/index.js.map +3 -3
- package/dist/esm/biz-components/DownLoad/index.d.ts +9 -6
- package/dist/esm/biz-components/DownLoad/index.js +2 -0
- package/dist/esm/biz-components/DownLoad/index.js.map +7 -0
- package/dist/esm/biz-components/Faq/Faq.js +1 -1
- package/dist/esm/biz-components/Faq/Faq.js.map +3 -3
- package/dist/esm/biz-components/Features/index.js +2 -0
- package/dist/esm/biz-components/Features/index.js.map +7 -0
- package/dist/esm/biz-components/FootCharger/index.js +2 -0
- package/dist/esm/biz-components/FootCharger/index.js.map +7 -0
- package/dist/esm/biz-components/FooterNavigation/index.js +1 -1
- package/dist/esm/biz-components/FooterNavigation/index.js.map +3 -3
- package/dist/esm/biz-components/FooterNavigation/types.d.ts +2 -1
- package/dist/esm/biz-components/FooterNavigation/types.js +1 -1
- package/dist/esm/biz-components/FooterNavigation/types.js.map +2 -2
- package/dist/esm/biz-components/GiftBox/index.js +2 -0
- package/dist/esm/biz-components/GiftBox/index.js.map +7 -0
- package/dist/esm/biz-components/Graphic/index.js +1 -1
- package/dist/esm/biz-components/Graphic/index.js.map +2 -2
- package/dist/esm/biz-components/GraphicMore/index.js +2 -0
- package/dist/esm/biz-components/GraphicMore/index.js.map +7 -0
- package/dist/esm/biz-components/HeaderNavigation/NavProvider.d.ts +6 -5
- package/dist/esm/biz-components/HeaderNavigation/NavProvider.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/NavProvider.js.map +3 -3
- package/dist/esm/biz-components/HeaderNavigation/icons/Polygon.js +2 -0
- package/dist/esm/biz-components/HeaderNavigation/icons/Polygon.js.map +7 -0
- package/dist/esm/biz-components/HeaderNavigation/icons/index.d.ts +2 -1
- package/dist/esm/biz-components/HeaderNavigation/icons/index.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/icons/index.js.map +3 -3
- package/dist/esm/biz-components/HeaderNavigation/index.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/index.js.map +3 -3
- package/dist/esm/biz-components/HeaderNavigation/types.d.ts +20 -2
- package/dist/esm/biz-components/HeaderNavigation/types.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/types.js.map +2 -2
- package/dist/esm/biz-components/HeaderNavigation/withCategory.d.ts +1 -1
- package/dist/esm/biz-components/HeaderNavigation/withCategory.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/withCategory.js.map +3 -3
- package/dist/esm/biz-components/Listing/ProductProvider.d.ts +7 -7
- package/dist/esm/biz-components/Listing/ProductProvider.js +2 -0
- package/dist/esm/biz-components/Listing/ProductProvider.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/types.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/types.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/types.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/types.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGridBox.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGridBox.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/types.js +1 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/types.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/types.js +1 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/types.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/types.js +1 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/types.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/const.js +2 -0
- package/dist/esm/biz-components/Listing/const.js.map +7 -0
- package/dist/esm/biz-components/Listing/hooks/use-options.js +2 -0
- package/dist/esm/biz-components/Listing/hooks/use-options.js.map +7 -0
- package/dist/esm/biz-components/Listing/hooks/use-variant-media.js +2 -0
- package/dist/esm/biz-components/Listing/hooks/use-variant-media.js.map +7 -0
- package/dist/esm/biz-components/Listing/hooks/use-variant.js +2 -0
- package/dist/esm/biz-components/Listing/hooks/use-variant.js.map +7 -0
- package/dist/esm/biz-components/Listing/hooks/useCopy.js +2 -0
- package/dist/esm/biz-components/Listing/hooks/useCopy.js.map +7 -0
- package/dist/esm/biz-components/Listing/index.d.ts +1 -1
- package/dist/esm/biz-components/Listing/index.js +2 -0
- package/dist/esm/biz-components/Listing/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/types/graphql.js +2 -0
- package/dist/esm/biz-components/Listing/types/graphql.js.map +7 -0
- package/dist/esm/biz-components/Listing/types/product.js +2 -0
- package/dist/esm/biz-components/Listing/types/product.js.map +7 -0
- package/dist/esm/biz-components/Listing/types/productMetafields.d.js +2 -0
- package/dist/esm/biz-components/Listing/types/productMetafields.d.js.map +7 -0
- package/dist/esm/biz-components/Listing/types/type-helper.js +1 -0
- package/dist/esm/biz-components/Listing/types/type-helper.js.map +7 -0
- package/dist/esm/biz-components/Listing/types.js +1 -0
- package/dist/esm/biz-components/Listing/types.js.map +7 -0
- package/dist/esm/biz-components/Listing/utils/helper.js +2 -0
- package/dist/esm/biz-components/Listing/utils/helper.js.map +7 -0
- package/dist/esm/biz-components/Listing/utils/index.js +2 -0
- package/dist/esm/biz-components/Listing/utils/index.js.map +7 -0
- package/dist/esm/biz-components/MediaPlayerSticky/index.js +1 -1
- package/dist/esm/biz-components/MediaPlayerSticky/index.js.map +2 -2
- package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
- package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +2 -2
- package/dist/esm/biz-components/NavigationSearch/index.js +2 -0
- package/dist/esm/biz-components/NavigationSearch/index.js.map +7 -0
- package/dist/esm/biz-components/NavigationSearch/types.js +2 -0
- package/dist/esm/biz-components/NavigationSearch/types.js.map +7 -0
- package/dist/esm/biz-components/SearchPage/index.js +2 -0
- package/dist/esm/biz-components/SearchPage/index.js.map +7 -0
- package/dist/esm/biz-components/SearchPage/types.js +2 -0
- package/dist/esm/biz-components/SearchPage/types.js.map +7 -0
- package/dist/esm/biz-components/SelectStore/index.d.ts +4 -10
- package/dist/esm/biz-components/SelectStore/index.js +2 -0
- package/dist/esm/biz-components/SelectStore/index.js.map +7 -0
- package/dist/esm/biz-components/ShelfDisplay/index.js +1 -1
- package/dist/esm/biz-components/ShelfDisplay/index.js.map +3 -3
- package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js +9 -9
- package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js.map +3 -3
- package/dist/esm/biz-components/Specs/dropdown.js +3 -0
- package/dist/esm/biz-components/Specs/dropdown.js.map +7 -0
- package/dist/esm/biz-components/Specs/index.js +2 -0
- package/dist/esm/biz-components/Specs/index.js.map +7 -0
- package/dist/esm/biz-components/Subscribe/index.d.ts +7 -1
- package/dist/esm/biz-components/Subscribe/index.js +10 -1
- package/dist/esm/biz-components/Subscribe/index.js.map +3 -3
- package/dist/esm/biz-components/Tabs/Tabs.js +1 -1
- package/dist/esm/biz-components/Tabs/Tabs.js.map +2 -2
- package/dist/esm/biz-components/TabsGroup/index.d.ts +7 -0
- package/dist/esm/biz-components/TabsGroup/index.js +2 -0
- package/dist/esm/biz-components/TabsGroup/index.js.map +7 -0
- package/dist/esm/biz-components/TabsGroup/types.d.ts +16 -0
- package/dist/esm/biz-components/TabsGroup/types.js +1 -0
- package/dist/esm/biz-components/TabsGroup/types.js.map +7 -0
- package/dist/esm/biz-components/Title/index.js +1 -1
- package/dist/esm/biz-components/Title/index.js.map +2 -2
- package/dist/esm/biz-components/Title/types.d.ts +3 -1
- package/dist/esm/biz-components/index.d.ts +26 -0
- package/dist/esm/biz-components/index.js +1 -1
- package/dist/esm/biz-components/index.js.map +3 -3
- package/dist/esm/components/button.js +1 -1
- package/dist/esm/components/button.js.map +2 -2
- package/dist/esm/components/checkbox.js +1 -1
- package/dist/esm/components/checkbox.js.map +3 -3
- package/dist/esm/components/container.js +1 -1
- package/dist/esm/components/container.js.map +2 -2
- package/dist/esm/components/dialog.d.ts +3 -1
- package/dist/esm/components/dialog.js +1 -1
- package/dist/esm/components/dialog.js.map +3 -3
- package/dist/esm/components/index.d.ts +1 -0
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/index.js.map +2 -2
- package/dist/esm/components/loadingDots.js +42 -0
- package/dist/esm/components/loadingDots.js.map +7 -0
- package/dist/esm/helpers/utils.d.ts +1 -0
- package/dist/esm/helpers/utils.js +1 -1
- package/dist/esm/helpers/utils.js.map +3 -3
- package/dist/esm/stories/aplusdesc.stories.js +2 -0
- package/dist/esm/stories/aplusdesc.stories.js.map +7 -0
- package/dist/esm/stories/download.stories.d.ts +1 -6
- package/dist/esm/stories/download.stories.js +2 -0
- package/dist/esm/stories/download.stories.js.map +7 -0
- package/dist/esm/stories/features.stories.js +2 -0
- package/dist/esm/stories/features.stories.js.map +7 -0
- package/dist/esm/stories/footcharger.stories.js +2 -0
- package/dist/esm/stories/footcharger.stories.js.map +7 -0
- package/dist/esm/stories/giftbox.stories.js +2 -0
- package/dist/esm/stories/giftbox.stories.js.map +7 -0
- package/dist/esm/stories/graphicMore.stories.js +2 -0
- package/dist/esm/stories/graphicMore.stories.js.map +7 -0
- package/dist/esm/stories/selectstore.stories.js +2 -0
- package/dist/esm/stories/selectstore.stories.js.map +7 -0
- package/dist/esm/stories/shelfDisplay.stories.js +644 -1
- package/dist/esm/stories/shelfDisplay.stories.js.map +2 -2
- package/dist/esm/stories/tabs.stories.js +1 -1
- package/dist/esm/stories/tabs.stories.js.map +3 -3
- package/dist/tokens/base.css +1 -1
- package/package.json +1 -1
- package/style.css +9 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as G}from"react/jsx-runtime";import{createContext as k,useContext as o,useState as A}from"react";const e=k({}),F=()=>{if(!o(e))throw new Error("useProductContext must be used in <ProductProvider>");return o(e)},L=({product:t,isLogin:n,isMobile:r,isDesktop:i,children:d,renderRating:a,freeGift:c,bundle:u,checkedBundle:s,checkedGift:p,setCheckedBundle:P,setCheckedGift:m,variant:l,selectedOptions:f,setSelectedOptions:C,compareData:b,coupon:y,finalPrice:h,comparePrice:B,totalSavings:S,savingDetail:x,selectedVariants:v,onAddToCart:D,onBuyNow:V})=>{const[g,R]=A({bundle:void 0,gift:void 0});return G(e.Provider,{value:{product:t,variant:l,isMobile:r,isDesktop:i,isLogin:n,coupon:y,renderRating:a,finalPrice:h,comparePrice:B,savingDetail:x,totalSavings:S,selectedOptions:f,setSelectedOptions:C,freeGift:c,checkedGift:p,setCheckedGift:m,checkedBundle:s,setCheckedBundle:P,bundle:u,compareData:b,selectedVariants:v,onAddToCart:D,onBuyNow:V,joinedRecommendBuyProducts:g,setJoinedRecommendBuyProducts:R},children:d})};var W=L;export{e as ProductContext,W as default,F as useProductContext};
|
|
2
|
+
//# sourceMappingURL=ProductProvider.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/biz-components/Listing/ProductProvider.tsx"],
|
|
4
|
+
"sourcesContent": ["import React, {\n createContext,\n useCallback,\n useContext,\n type Dispatch,\n type SetStateAction,\n type PropsWithChildren,\n useState,\n} from 'react'\nimport type {\n Product,\n ProductPrice,\n ProductVariant,\n VariantCoupon,\n Options,\n FreeGift,\n BundleListItem,\n Bundle,\n} from './types/product'\nimport type { CompareData } from './types.js'\n\nexport type SavingDetail = { coupon: number; bundle: number; member: number; freeGift: number; compare: number }\n\ntype variantWithFinalPrice = ProductVariant & { finalPrice?: ProductPrice }\nexport interface ProductContextType {\n isLogin?: boolean\n isMobile?: boolean\n isDesktop?: boolean\n product: Product\n variant: ProductVariant\n selectedVariants: Array<variantWithFinalPrice>\n renderRating?: React.ReactNode\n coupon?: VariantCoupon\n savingDetail: SavingDetail\n finalPrice: number\n comparePrice: number\n totalSavings: number\n selectedOptions: Options\n setSelectedOptions: Dispatch<SetStateAction<Options>>\n freeGift?: FreeGift\n checkedGift?: ProductVariant\n setCheckedGift?: Dispatch<SetStateAction<ProductVariant | undefined>>\n checkedBundle?: BundleListItem\n setCheckedBundle: Dispatch<SetStateAction<BundleListItem | undefined>>\n // productSummaryStatus: {\n // bundleSummary: boolean\n // giftSummary: boolean\n // }\n joinedRecommendBuyProducts: { bundle?: BundleListItem; gift?: ProductVariant }\n setJoinedRecommendBuyProducts?: Dispatch<SetStateAction<{ bundle?: BundleListItem; gift?: ProductVariant }>>\n // setProductSummaryStatus?: Dispatch<SetStateAction<{ bundleSummary: boolean; giftSummary: boolean }>>\n checkedCareBundle?: ProductVariant\n setCheckedCareBundle?: Dispatch<SetStateAction<ProductVariant | undefined>>\n bundle?: Bundle\n compareData?: CompareData['data']\n onAddToCart?: () => void\n onBuyNow?: () => void\n}\n\n// const initialState: ProductContextType = {\n// isLogin: false,\n// isMobile: false,\n// product: {} as Product,\n// variant: {} as ProductVariant,\n// savingDetail: { coupon: 0, bundle: 0, member: 0, freeGift: 0, compare: 0 },\n// finalPrice: 0,\n// comparePrice: 0,\n// totalSavings: 0,\n// renderRating: null,\n// selectedOptions: {} as Options,\n// setSelectedOptions: () => {},\n// checkedBundle: undefined,\n// checkedGift: undefined,\n// setCheckedBundle: () => {},\n// setCheckedGift: () => {},\n// checkedCareBundle: undefined,\n// setCheckedCareBundle: () => {},\n// }\n\nexport const ProductContext = createContext<ProductContextType>({} as ProductContextType)\n\nexport const useProductContext = () => {\n const context = useContext(ProductContext)\n if (!context) {\n throw new Error('useProductContext must be used in <ProductProvider>')\n }\n return useContext(ProductContext)\n}\n\nconst ProductProvider = ({\n product,\n isLogin,\n isMobile,\n isDesktop,\n children,\n renderRating,\n freeGift,\n bundle,\n checkedBundle,\n checkedGift,\n setCheckedBundle,\n setCheckedGift,\n variant,\n selectedOptions,\n setSelectedOptions,\n compareData,\n coupon,\n finalPrice,\n comparePrice,\n totalSavings,\n savingDetail,\n selectedVariants,\n onAddToCart,\n onBuyNow,\n}: PropsWithChildren<Omit<ProductContextType, 'joinedRecommendBuyProducts' | 'setJoinedRecommendBuyProducts'>>) => {\n const [joinedRecommendBuyProducts, setJoinedRecommendBuyProducts] = useState<{ bundle?: BundleListItem; gift?: ProductVariant }>({\n bundle: undefined,\n gift: undefined,\n })\n return (\n <ProductContext.Provider\n value={{\n product,\n variant,\n isMobile,\n isDesktop,\n isLogin,\n coupon,\n renderRating,\n finalPrice,\n comparePrice,\n savingDetail,\n totalSavings,\n selectedOptions,\n setSelectedOptions,\n freeGift,\n checkedGift,\n setCheckedGift,\n checkedBundle,\n setCheckedBundle,\n bundle,\n compareData,\n selectedVariants,\n onAddToCart,\n onBuyNow,\n joinedRecommendBuyProducts,\n setJoinedRecommendBuyProducts,\n }}\n >\n {children}\n </ProductContext.Provider>\n )\n}\n\nexport default ProductProvider\n"],
|
|
5
|
+
"mappings": "AAwHI,cAAAA,MAAA,oBAxHJ,OACE,iBAAAC,EAEA,cAAAC,EAIA,YAAAC,MACK,QAuEA,MAAMC,EAAiBH,EAAkC,CAAC,CAAuB,EAE3EI,EAAoB,IAAM,CAErC,GAAI,CADYH,EAAWE,CAAc,EAEvC,MAAM,IAAI,MAAM,qDAAqD,EAEvE,OAAOF,EAAWE,CAAc,CAClC,EAEME,EAAkB,CAAC,CACvB,QAAAC,EACA,QAAAC,EACA,SAAAC,EACA,UAAAC,EACA,SAAAC,EACA,aAAAC,EACA,SAAAC,EACA,OAAAC,EACA,cAAAC,EACA,YAAAC,EACA,iBAAAC,EACA,eAAAC,EACA,QAAAC,EACA,gBAAAC,EACA,mBAAAC,EACA,YAAAC,EACA,OAAAC,EACA,WAAAC,EACA,aAAAC,EACA,aAAAC,EACA,aAAAC,EACA,iBAAAC,EACA,YAAAC,EACA,SAAAC,CACF,IAAmH,CACjH,KAAM,CAACC,EAA4BC,CAA6B,EAAI7B,EAA6D,CAC/H,OAAQ,OACR,KAAM,MACR,CAAC,EACD,OACEH,EAACI,EAAe,SAAf,CACC,MAAO,CACL,QAAAG,EACA,QAAAY,EACA,SAAAV,EACA,UAAAC,EACA,QAAAF,EACA,OAAAe,EACA,aAAAX,EACA,WAAAY,EACA,aAAAC,EACA,aAAAE,EACA,aAAAD,EACA,gBAAAN,EACA,mBAAAC,EACA,SAAAR,EACA,YAAAG,EACA,eAAAE,EACA,cAAAH,EACA,iBAAAE,EACA,OAAAH,EACA,YAAAQ,EACA,iBAAAM,EACA,YAAAC,EACA,SAAAC,EACA,2BAAAC,EACA,8BAAAC,CACF,EAEC,SAAArB,EACH,CAEJ,EAEA,IAAOsB,EAAQ3B",
|
|
6
|
+
"names": ["jsx", "createContext", "useContext", "useState", "ProductContext", "useProductContext", "ProductProvider", "product", "isLogin", "isMobile", "isDesktop", "children", "renderRating", "freeGift", "bundle", "checkedBundle", "checkedGift", "setCheckedBundle", "setCheckedGift", "variant", "selectedOptions", "setSelectedOptions", "compareData", "coupon", "finalPrice", "comparePrice", "totalSavings", "savingDetail", "selectedVariants", "onAddToCart", "onBuyNow", "joinedRecommendBuyProducts", "setJoinedRecommendBuyProducts", "ProductProvider_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as s,jsxs as H}from"react/jsx-runtime";import{Text as u}from"../../../../../../components/index.js";import{createContext as g,useContext as B,useState as m}from"react";import{cn as i}from"../../../../../../helpers/index.js";import{Content as v,List as x,Root as L,Trigger as C}from"@radix-ui/react-tabs";const T=g(void 0),P=()=>{const e=B(T);if(!e)throw new Error("ProductBenefitsTabs components must be used within ProductBenefitsTabs");return e},a=({defaultValue:e,value:t,onValueChange:n,children:r,className:o,...l})=>{const[b,p]=m(e),c=t??b,d=f=>{t===void 0&&p(f),n?.(f)};return s(T.Provider,{value:{activeValue:c,setActiveValue:d},children:s("div",{id:"ipc-product-detail-benefits-tabs",className:i("bg-[#EAEAEC] rounded-xl py-4",o),...l,children:s(L,{value:c,onValueChange:d,children:r})})})},h=({children:e,className:t,...n})=>s(x,{className:i("flex space-x-6 overflow-x-auto px-4",t),style:{scrollbarWidth:"none",msOverflowStyle:"none"},...n,children:e}),N=({value:e,children:t,className:n,...r})=>{const{activeValue:o}=P(),l=o===e;return H(C,{value:e,className:i("text-base whitespace-nowrap relative leading-[1.4] font-bold pb-4 text-[#6D6D6F]",n),...r,children:[s(u,{className:i("absolute bottom-0 z-10 left-0 h-[2px] w-0 bg-info-primary transition-all duration-300",l&&"w-full")}),t]})},w=({children:e,className:t,...n})=>s(u,{size:1,className:i("font-bold ml-1 !whitespace-nowrap rounded-full px-2 py-1 text-white bg-[#FF5900]",t),...n,children:e}),A=({value:e,children:t,className:n,...r})=>s(v,{value:e,className:i("mt-4",n),...r,children:t});a.displayName="ProductBenefitsTabs",a.List=h,a.Trigger=N,a.Badge=w,a.Content=A;var R=a;export{R as default};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../../src/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Text } from '../../../../../../components/index.js'\nimport { createContext, useContext, useState, type ReactNode, type HTMLAttributes } from 'react'\nimport { cn } from '../../../../../../helpers/index.js'\nimport { Content, List, Root, Trigger } from '@radix-ui/react-tabs'\n\n\n// Context for sharing state between components\ninterface BenefitsTabsContextType {\n activeValue: string | undefined\n setActiveValue: (value: string) => void\n}\n\nconst BenefitsTabsContext = createContext<BenefitsTabsContextType | undefined>(undefined)\n\nconst useBenefitsTabsContext = () => {\n const context = useContext(BenefitsTabsContext)\n if (!context) {\n throw new Error('ProductBenefitsTabs components must be used within ProductBenefitsTabs')\n }\n return context\n}\n\n// Main container component\ninterface BenefitsTabsProps extends HTMLAttributes<HTMLDivElement> {\n defaultValue?: string\n value?: string\n onValueChange?: (value: string) => void\n children: ReactNode\n}\n\nconst ProductBenefitsTabs = ({ \n defaultValue, \n value, \n onValueChange, \n children, \n className,\n ...props \n}: BenefitsTabsProps) => {\n const [internalValue, setInternalValue] = useState(defaultValue)\n \n const activeValue = value ?? internalValue\n const setActiveValue = (newValue: string) => {\n if (value === undefined) {\n setInternalValue(newValue)\n }\n onValueChange?.(newValue)\n }\n\n return (\n <BenefitsTabsContext.Provider value={{ activeValue, setActiveValue }}>\n <div \n id=\"ipc-product-detail-benefits-tabs\" \n className={cn(\"bg-[#EAEAEC] rounded-xl py-4\", className)}\n {...props}\n >\n <Root value={activeValue} onValueChange={setActiveValue}>\n {children}\n </Root>\n </div>\n </BenefitsTabsContext.Provider>\n )\n}\n\n// List component for triggers\ninterface BenefitsTabsListProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode\n}\n\nconst BenefitsTabsList = ({ children, className, ...props }: BenefitsTabsListProps) => {\n return (\n <List\n className={cn(\"flex space-x-6 overflow-x-auto px-4\", className)}\n style={{\n scrollbarWidth: 'none',\n msOverflowStyle: 'none',\n }}\n {...props}\n >\n {children}\n </List>\n )\n}\n\n// Trigger component\ninterface BenefitsTabsTriggerProps extends HTMLAttributes<HTMLButtonElement> {\n value: string\n children: ReactNode\n}\n\nconst BenefitsTabsTrigger = ({ value, children, className, ...props }: BenefitsTabsTriggerProps) => {\n const { activeValue } = useBenefitsTabsContext()\n const isActive = activeValue === value\n\n return (\n <Trigger\n value={value}\n className={cn(\n 'text-base whitespace-nowrap relative leading-[1.4] font-bold pb-4 text-[#6D6D6F]',\n className\n )}\n {...props}\n >\n <Text\n className={cn(\n 'absolute bottom-0 z-10 left-0 h-[2px] w-0 bg-info-primary transition-all duration-300',\n isActive && 'w-full'\n )}\n />\n {children}\n </Trigger>\n )\n}\n\n// Badge component for trigger\ninterface BenefitsTabsBadgeProps extends HTMLAttributes<HTMLSpanElement> {\n children: ReactNode\n}\n\nconst BenefitsTabsBadge = ({ children, className, ...props }: BenefitsTabsBadgeProps) => {\n return (\n <Text\n size={1}\n className={cn(\n \"font-bold ml-1 !whitespace-nowrap rounded-full px-2 py-1 text-white bg-[#FF5900]\",\n className\n )}\n {...props}\n >\n {children}\n </Text>\n )\n}\n\n// Content component\ninterface BenefitsTabsContentProps extends HTMLAttributes<HTMLDivElement> {\n value: string\n children: ReactNode\n}\n\nconst BenefitsTabsContent = ({ value, children, className, ...props }: BenefitsTabsContentProps) => {\n return (\n <Content \n value={value} \n className={cn(\"mt-4\", className)}\n {...props}\n >\n {children}\n </Content>\n )\n}\n\n\nProductBenefitsTabs.displayName = 'ProductBenefitsTabs'\n\n// Attach sub-components to main component\nProductBenefitsTabs.List = BenefitsTabsList\nProductBenefitsTabs.Trigger = BenefitsTabsTrigger\nProductBenefitsTabs.Badge = BenefitsTabsBadge\nProductBenefitsTabs.Content = BenefitsTabsContent\n\nexport default ProductBenefitsTabs\n"],
|
|
5
|
+
"mappings": "AAuDQ,cAAAA,EAuCJ,QAAAC,MAvCI,oBAvDR,OAAS,QAAAC,MAAY,wCACrB,OAAS,iBAAAC,EAAe,cAAAC,EAAY,YAAAC,MAAqD,QACzF,OAAS,MAAAC,MAAU,qCACnB,OAAS,WAAAC,EAAS,QAAAC,EAAM,QAAAC,EAAM,WAAAC,MAAe,uBAS7C,MAAMC,EAAsBR,EAAmD,MAAS,EAElFS,EAAyB,IAAM,CACnC,MAAMC,EAAUT,EAAWO,CAAmB,EAC9C,GAAI,CAACE,EACH,MAAM,IAAI,MAAM,wEAAwE,EAE1F,OAAOA,CACT,EAUMC,EAAsB,CAAC,CAC3B,aAAAC,EACA,MAAAC,EACA,cAAAC,EACA,SAAAC,EACA,UAAAC,EACA,GAAGC,CACL,IAAyB,CACvB,KAAM,CAACC,EAAeC,CAAgB,EAAIjB,EAASU,CAAY,EAEzDQ,EAAcP,GAASK,EACvBG,EAAkBC,GAAqB,CACvCT,IAAU,QACZM,EAAiBG,CAAQ,EAE3BR,IAAgBQ,CAAQ,CAC1B,EAE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QjB",
|
|
6
|
+
"names": ["jsx", "jsxs", "Text", "createContext", "useContext", "useState", "cn", "Content", "List", "Root", "Trigger", "BenefitsTabsContext", "useBenefitsTabsContext", "context", "ProductBenefitsTabs", "defaultValue", "value", "onValueChange", "children", "className", "props", "internalValue", "setInternalValue", "activeValue", "setActiveValue", "newValue", "BenefitsTabsList", "BenefitsTabsTrigger", "isActive", "BenefitsTabsBadge", "BenefitsTabsContent", "ProductBenefitsTabs_default"]
|
|
7
|
+
}
|
package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as i,jsxs as o}from"react/jsx-runtime";import{Text as r,Picture as g,Checkbox as C}from"../../../../../../components";import{cn as N}from"../../../../../../helpers/index.js";import{useAiuiContext as B}from"../../../../../AiuiProvider";import{useProductContext as b}from"../../../../ProductProvider";import{formatPrice as m}from"../../../../utils";const P=()=>{const{locale:l="us"}=B(),{variant:u,bundle:f,checkedBundle:s,setCheckedBundle:d,setCheckedGift:x,setJoinedRecommendBuyProducts:c,joinedRecommendBuyProducts:n}=b(),{title:v,bundleList:h,showAtListing:k}=f||{},p=h?.filter(e=>e.variants.slice(1,e.variants.length).every(a=>a.variant.availableForSale));if(!p?.length&&k)return null;const y=e=>{s?.id===e.id?(d?.(void 0),c?.({...n,bundle:void 0})):(x?.(void 0),d?.(e),c?.({...n,bundle:e}))};return o("div",{className:"ipc-product-detail-bundle",children:[i(r,{size:3,className:"font-bold",html:v}),p?.map(e=>{const a=e.variants.filter(t=>t.variant.sku!==u.sku);return i("div",{className:"flex flex-col gap-4 mt-3 desktop:mt-4",children:o("div",{className:N("flex items-center gap-2 text-left font-bold px-4 py-6 rounded-2xl border-[#E4E5E6] border",{"border-brand outline outline-1 outline-brand":s?.id===e.id}),children:[i(C,{onCheckedChange:()=>y(e),size:"lg",id:e.id,value:e.id,checked:s?.id===e.id}),i("label",{htmlFor:e.id,className:"size-full cursor-pointer",children:a?.map(t=>o("div",{className:"flex justify-between items-center gap-6 ",children:[o("div",{className:"flex items-center gap-2",children:[i(g,{source:t?.variant?.image?.url,className:"size-12 flex-shrink-0"}),i(r,{className:"text-sm laptop:text-[16px] laptop:text-[20px] desktop:text-[18px] font-bold",html:t.variant.product.title})]}),o("div",{className:"flex items-center justify-end gap-1 laptop:flex-row flex-col shrink-0",children:[i(r,{className:"text-base laptop:text-[20px] desktop:text-2xl font-bold",html:m({amount:t.price,locale:l,currencyCode:t.variant.price.currencyCode})}),t.price<t.variant.price.amount&&i(r,{className:"text-base laptop:text-[20px] desktop:text-2xl font-bold line-through text-[#6D6D6F]",html:m({amount:t.variant.price.amount,locale:l,currencyCode:t.variant.price.currencyCode})})]})]},t.variant.id))})]})},e.id)})]})};var A=P;export{A as default};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../../src/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Text, Picture, Button, Checkbox } from '../../../../../../components'\nimport { cn } from '../../../../../../helpers/index.js'\nimport { useAiuiContext } from '../../../../../AiuiProvider'\nimport { useProductContext } from '../../../../ProductProvider'\nimport { formatPrice } from '../../../../utils'\nimport type { BundleListItem } from '../../../../types/product'\n\nconst ProductBundle = () => {\n const { locale = 'us' } = useAiuiContext()\n const {\n variant,\n bundle,\n checkedBundle,\n setCheckedBundle,\n setCheckedGift,\n setJoinedRecommendBuyProducts,\n joinedRecommendBuyProducts,\n } = useProductContext()\n\n const { title, bundleList, showAtListing } = bundle || {}\n\n const availableBundleList = bundleList?.filter(bundle =>\n bundle.variants.slice(1, bundle.variants.length).every(v => v.variant.availableForSale)\n )\n\n if (!availableBundleList?.length && showAtListing) return null\n\n const handleSelectedChange = (bundleItem: BundleListItem) => {\n if (checkedBundle?.id === bundleItem.id) {\n setCheckedBundle?.(undefined)\n setJoinedRecommendBuyProducts?.({ ...joinedRecommendBuyProducts, bundle: undefined })\n } else {\n setCheckedGift?.(undefined)\n setCheckedBundle?.(bundleItem)\n setJoinedRecommendBuyProducts?.({ ...joinedRecommendBuyProducts, bundle: bundleItem })\n }\n }\n\n return (\n <div className=\"ipc-product-detail-bundle\">\n <Text size={3} className=\"font-bold\" html={title} />\n {availableBundleList?.map(bundle => {\n const bundleVariants = bundle.variants.filter(v => v.variant.sku !== variant.sku)\n return (\n <div key={bundle.id} className=\"flex flex-col gap-4 mt-3 desktop:mt-4\">\n <div\n className={cn(\n 'flex items-center gap-2 text-left font-bold px-4 py-6 rounded-2xl border-[#E4E5E6] border',\n {\n ['border-brand outline outline-1 outline-brand']: checkedBundle?.id === bundle.id,\n }\n )}\n >\n <Checkbox\n onCheckedChange={() => handleSelectedChange(bundle)}\n size=\"lg\"\n id={bundle.id}\n value={bundle.id}\n checked={checkedBundle?.id === bundle.id}\n />\n <label htmlFor={bundle.id} className=\"size-full cursor-pointer\">\n {bundleVariants?.map(bundleVariant => {\n return (\n <div className=\"flex justify-between items-center gap-6 \" key={bundleVariant.variant.id}>\n <div className=\"flex items-center gap-2\">\n <Picture source={bundleVariant?.variant?.image?.url} className=\"size-12 flex-shrink-0\" />\n <Text\n className=\"text-sm laptop:text-[16px] laptop:text-[20px] desktop:text-[18px] font-bold\"\n html={bundleVariant.variant.product.title}\n />\n </div>\n <div className=\"flex items-center justify-end gap-1 laptop:flex-row flex-col shrink-0\">\n <Text\n className=\"text-base laptop:text-[20px] desktop:text-2xl font-bold\"\n html={formatPrice({\n amount: bundleVariant.price,\n locale,\n currencyCode: bundleVariant.variant.price.currencyCode,\n })}\n />\n {bundleVariant.price < bundleVariant.variant.price.amount && (\n <Text\n className=\"text-base laptop:text-[20px] desktop:text-2xl font-bold line-through text-[#6D6D6F]\"\n html={formatPrice({\n amount: bundleVariant.variant.price.amount,\n locale,\n currencyCode: bundleVariant.variant.price.currencyCode,\n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AoB,UAAU,wCAC7B,SAAAC,EAAC,OACC,UAAWI,EACT,4FACA,CACG,+CAAiDQ,GAAe,KAAOD,EAAO,EACjF,CACF,EAEA,UAAAZ,EAACI,EAAA,CACC,gBAAiB,IAAMmB,EAAqBX,CAAM,EAClD,KAAK,KACL,GAAIA,EAAO,GACX,MAAOA,EAAO,GACd,QAASC,GAAe,KAAOD,EAAO,GACxC,EACAZ,EAAC,SAAM,QAASY,EAAO,GAAI,UAAU,2BAClC,SAAAa,GAAgB,IAAIC,GAEjBzB,EAAC,OAAI,UAAU,2CACb,UAAAA,EAAC,OAAI,UAAU,0BACb,UAAAD,EAACG,EAAA,CAAQ,OAAQuB,GAAe,SAAS,OAAO,IAAK,UAAU,wBAAwB,EACvF1B,EAACE,EAAA,CACC,UAAU,8EACV,KAAMwB,EAAc,QAAQ,QAAQ,MACtC,GACF,EACAzB,EAAC,OAAI,UAAU,yEACb,UAAAD,EAACE,EAAA,CACC,UAAU,0DACV,KAAMM,EAAY,CAChB,OAAQkB,EAAc,MACtB,OAAAhB,EACA,aAAcgB,EAAc,QAAQ,MAAM,YAC5C,CAAC,EACH,EACCA,EAAc,MAAQA,EAAc,QAAQ,MAAM,QACjD1B,EAACE,EAAA,CACC,UAAU,sFACV,KAAMM,EAAY,CAChB,OAAQkB,EAAc,QAAQ,MAAM,OACpC,OAAAhB,EACA,aAAcgB,EAAc,QAAQ,MAAM,YAC5C,CAAC,EACH,GAEJ,IA3B6DA,EAAc,QAAQ,EA4BrF,CAEH,EACH,GACF,GAnDQd,EAAO,EAoDjB,CAEJ,CAAC,GACH,CAEJ,EAEA,IAAOe,EAAQlB",
|
|
6
|
+
"names": ["jsx", "jsxs", "Text", "Picture", "Checkbox", "cn", "useAiuiContext", "useProductContext", "formatPrice", "ProductBundle", "locale", "variant", "bundle", "checkedBundle", "setCheckedBundle", "setCheckedGift", "setJoinedRecommendBuyProducts", "joinedRecommendBuyProducts", "title", "bundleList", "showAtListing", "availableBundleList", "v", "handleSelectedChange", "bundleItem", "bundleVariants", "bundleVariant", "ProductBundle_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as t,jsxs as o}from"react/jsx-runtime";import{Text as l,Picture as b,Checkbox as h}from"../../../../../../components";import{cn as k}from"../../../../../../helpers/index.js";import{useMemo as C}from"react";import{useProductContext as v}from"../../../../ProductProvider";import{formatPrice as N}from"../../../../utils";import{useAiuiContext as y}from"../../../../../AiuiProvider";const P=()=>{const{locale:n="us"}=y(),{freeGift:m,checkedGift:d,setCheckedGift:i,setCheckedBundle:p,setJoinedRecommendBuyProducts:r,joinedRecommendBuyProducts:a}=v(),{title:u,giftList:s=[],freeLabel:f}=m||{},c=C(()=>s?.filter(e=>e.availableForSale),[s]),x=e=>{d?.id===e.id?(i?.(void 0),r?.({...a,gift:void 0})):(p?.(void 0),i?.(e),r?.({...a,gift:e}))};return c?.length?o("div",{className:"ipc-product-detail-free-gift",children:[t(l,{size:3,className:"font-bold",html:u}),t("div",{className:"mt-3 flex flex-col gap-4 desktop:mt-4",children:c.map(e=>o("div",{className:k("flex items-center gap-2 text-left font-bold px-4 py-6 rounded-2xl border-[#E4E5E6] border-2",{"border-brand":d?.id===e.id}),children:[t(h,{onCheckedChange:()=>x(e),size:"lg",id:e.id,checked:d?.id===e.id,value:e.id}),o("label",{htmlFor:e.id,className:"flex justify-between items-center gap-4 laptop:gap-0 w-full",children:[o("div",{className:"flex items-center gap-2",children:[t(b,{source:e.image?.url,className:"size-12 flex-shrink-0"}),t(l,{className:"text-sm laptop:text-[16px] desktop:text-[18px] font-bold",html:e.product.title})]}),o("div",{className:"flex items-center gap-1 tablet:flex-row flex-col shrink-0",children:[t(l,{className:"text-base laptop:text-[20px] desktop:text-2xl font-bold",html:f}),t(l,{className:"text-base laptop:text-[20px] desktop:text-2xl font-bold line-through",html:N({amount:e.price.amount,locale:n,currencyCode:e.price.currencyCode})})]})]})]},e.id))})]}):null};var V=P;export{V as default};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../../src/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Text, Picture, Button, RadioGroup, RadioGroupItem, Checkbox } from '../../../../../../components'\nimport { cn } from '../../../../../../helpers/index.js'\nimport { useMemo } from 'react'\nimport { useProductContext } from '../../../../ProductProvider'\nimport { formatPrice } from '../../../../utils'\nimport { useAiuiContext } from '../../../../../AiuiProvider'\nimport type { ProductVariant } from '../../../../types/product'\n\nconst ProductFreeGift = () => {\n const { locale = 'us' } = useAiuiContext()\n const { freeGift, checkedGift, setCheckedGift, setCheckedBundle, setJoinedRecommendBuyProducts, joinedRecommendBuyProducts } = useProductContext()\n const { title, giftList = [], freeLabel } = freeGift || {}\n const availableGifts = useMemo(() => giftList?.filter(item => item.availableForSale), [giftList])\n\n const handleCheckboxClick = (value: ProductVariant) => {\n if (checkedGift?.id === value.id) {\n setCheckedGift?.(undefined)\n setJoinedRecommendBuyProducts?.({ ...joinedRecommendBuyProducts, gift: undefined })\n } else {\n setCheckedBundle?.(undefined)\n setCheckedGift?.(value)\n setJoinedRecommendBuyProducts?.({ ...joinedRecommendBuyProducts, gift: value })\n }\n }\n\n if (!availableGifts?.length) return null\n\n return (\n <div className=\"ipc-product-detail-free-gift\">\n <Text size={3} className=\"font-bold\" html={title} />\n <div className=\"mt-3 flex flex-col gap-4 desktop:mt-4\">\n {availableGifts.map(gift => (\n <div\n key={gift.id}\n className={cn(\n 'flex items-center gap-2 text-left font-bold px-4 py-6 rounded-2xl border-[#E4E5E6] border-2',\n {\n ['border-brand']: checkedGift?.id === gift.id,\n }\n )}\n >\n <Checkbox\n onCheckedChange={() => handleCheckboxClick(gift)}\n size=\"lg\"\n id={gift.id}\n checked={checkedGift?.id === gift.id}\n value={gift.id}\n ></Checkbox>\n <label htmlFor={gift.id} className=\"flex justify-between items-center gap-4 laptop:gap-0 w-full\">\n <div className=\"flex items-center gap-2\">\n <Picture source={gift.image?.url} className=\"size-12 flex-shrink-0\" />\n <Text className=\"text-sm laptop:text-[16px] desktop:text-[18px] font-bold\" html={gift.product.title} />\n </div>\n <div className=\"flex items-center gap-1 tablet:flex-row flex-col shrink-0\">\n <Text className=\"text-base laptop:text-[20px] desktop:text-2xl font-bold\" html={freeLabel} />\n <Text\n className=\"text-base laptop:text-[20px] desktop:text-2xl font-bold line-through\"\n html={formatPrice({\n amount: gift.price.amount,\n locale,\n currencyCode: gift.price.currencyCode,\n })}\n />\n </div>\n </label>\n </div>\n ))}\n </div>\n </div>\n )\n}\n\nexport default ProductFreeGift\n"],
|
|
5
|
+
"mappings": "AA6BM,cAAAA,EAoBQ,QAAAC,MApBR,oBA7BN,OAAS,QAAAC,EAAM,WAAAC,EAA6C,YAAAC,MAAgB,+BAC5E,OAAS,MAAAC,MAAU,qCACnB,OAAS,WAAAC,MAAe,QACxB,OAAS,qBAAAC,MAAyB,8BAClC,OAAS,eAAAC,MAAmB,oBAC5B,OAAS,kBAAAC,MAAsB,8BAG/B,MAAMC,EAAkB,IAAM,CAC5B,KAAM,CAAE,OAAAC,EAAS,IAAK,EAAIF,EAAe,EACnC,CAAE,SAAAG,EAAU,YAAAC,EAAa,eAAAC,EAAgB,iBAAAC,EAAkB,8BAAAC,EAA+B,2BAAAC,CAA2B,EAAIV,EAAkB,EAC3I,CAAE,MAAAW,EAAO,SAAAC,EAAW,CAAC,EAAG,UAAAC,CAAU,EAAIR,GAAY,CAAC,EACnDS,EAAiBf,EAAQ,IAAMa,GAAU,OAAOG,GAAQA,EAAK,gBAAgB,EAAG,CAACH,CAAQ,CAAC,EAE1FI,EAAuBC,GAA0B,CACjDX,GAAa,KAAOW,EAAM,IAC5BV,IAAiB,MAAS,EAC1BE,IAAgC,CAAE,GAAGC,EAA4B,KAAM,MAAU,CAAC,IAElFF,IAAmB,MAAS,EAC5BD,IAAiBU,CAAK,EACtBR,IAAgC,CAAE,GAAGC,EAA4B,KAAMO,CAAM,CAAC,EAElF,EAEA,OAAKH,GAAgB,OAGnBpB,EAAC,OAAI,UAAU,+BACb,UAAAD,EAACE,EAAA,CAAK,KAAM,EAAG,UAAU,YAAY,KAAMgB,EAAO,EAClDlB,EAAC,OAAI,UAAU,wCACZ,SAAAqB,EAAe,IAAII,GAClBxB,EAAC,OAEC,UAAWI,EACT,8FACA,CACG,eAAiBQ,GAAa,KAAOY,EAAK,EAC7C,CACF,EAEA,UAAAzB,EAACI,EAAA,CACC,gBAAiB,IAAMmB,EAAoBE,CAAI,EAC/C,KAAK,KACL,GAAIA,EAAK,GACT,QAASZ,GAAa,KAAOY,EAAK,GAClC,MAAOA,EAAK,GACb,EACDxB,EAAC,SAAM,QAASwB,EAAK,GAAI,UAAU,8DACjC,UAAAxB,EAAC,OAAI,UAAU,0BACb,UAAAD,EAACG,EAAA,CAAQ,OAAQsB,EAAK,OAAO,IAAK,UAAU,wBAAwB,EACpEzB,EAACE,EAAA,CAAK,UAAU,2DAA2D,KAAMuB,EAAK,QAAQ,MAAO,GACvG,EACAxB,EAAC,OAAI,UAAU,4DACb,UAAAD,EAACE,EAAA,CAAK,UAAU,0DAA0D,KAAMkB,EAAW,EAC3FpB,EAACE,EAAA,CACC,UAAU,uEACV,KAAMM,EAAY,CAChB,OAAQiB,EAAK,MAAM,OACnB,OAAAd,EACA,aAAcc,EAAK,MAAM,YAC3B,CAAC,EACH,GACF,GACF,IA/BKA,EAAK,EAgCZ,CACD,EACH,GACF,EA3CkC,IA6CtC,EAEA,IAAOC,EAAQhB",
|
|
6
|
+
"names": ["jsx", "jsxs", "Text", "Picture", "Checkbox", "cn", "useMemo", "useProductContext", "formatPrice", "useAiuiContext", "ProductFreeGift", "locale", "freeGift", "checkedGift", "setCheckedGift", "setCheckedBundle", "setJoinedRecommendBuyProducts", "joinedRecommendBuyProducts", "title", "giftList", "freeLabel", "availableGifts", "item", "handleCheckboxClick", "value", "gift", "ProductFreeGift_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as t,jsxs as c}from"react/jsx-runtime";import{Text as m,Picture as b,Button as k,Dialog as w,DialogContent as y,DialogTrigger as N}from"../../../../../../components";import{Content as x,List as C,Root as D,Trigger as T}from"@radix-ui/react-tabs";import{useEffect as H,useMemo as g,useRef as v,useState as f}from"react";import{cn as L}from"../../../../../../helpers";import{useProductContext as P}from"../../../../ProductProvider";const E=()=>{const{product:s,variant:a,isMobile:r}=P(),[p,d]=f(!1),n=g(()=>{const l=a.metafields?.component?.ksp||s.metafields?.component?.ksp;return(r?l?.mobileList:l?.list)?.filter(h=>!!h?.text)},[a.metafields?.component?.ksp,r]),[e,i]=f(n?.[0]),o=g(()=>s?.payload?.components?.find(l=>l.componentKey==="ProductHighlight")?.data||{},[s?.payload]);return n?.length?c("div",{className:"ipc-product-detail-highlight",children:[c("div",{className:"flex items-center justify-between",children:[o?.title&&t(m,{size:3,className:"font-bold",html:o?.title}),c(w,{open:p,onOpenChange:d,children:[t(N,{asChild:!0,children:t(k,{variant:"link",className:"font-bold !p-0 text-base",children:o?.view})}),t(R,{ksp:n,clickActiveKspItem:e})]})]}),t("div",{className:"flex flex-wrap gap-4 mt-3 desktop:mt-4",children:n.map(l=>t("div",{className:"px-4 py-2 lg-desktop:max-w-[256px] desktop:max-w-[246px] laptop:max-w-[310px] max-w-[227px] rounded-full bg-[#F5F5F7]",children:t(m,{size:3,onClick:()=>{i(l),d(!0)},className:"font-bold cursor-pointer text-[#1D1D1F] text-[16px] break-all line-clamp-1 desktop:text-base overflow-hidden",html:l?.text},l?.text)}))})]}):null},R=({ksp:s,clickActiveKspItem:a})=>{const r=v([]),p=v(null),[d,n]=f(null);return H(()=>{a&&(n(a),setTimeout(()=>{const e=s.findIndex(o=>o.text===a?.text),i=r.current[e];if(i&&p.current){const o=p.current,l=i,u=l.offsetLeft-o.offsetWidth/2+l.offsetWidth/2;o.scrollTo({left:u,behavior:"smooth"})}},100))},[a,s]),t(y,{overlayClassName:"z-[70]",className:"tablet:max-w-[896px] max-w-[326px] mx-auto w-full border-none z-[80] overflow-hidden p-0",children:c(D,{defaultValue:d?.text,className:"w-full overflow-hidden",children:[s.map(e=>t(x,{value:e.text,children:t(b,{source:e.img,className:"w-full h-[304px] desktop:h-[480px]",alt:e.img.alt,imgClassName:"object-cover h-full"})},e.text)),t("div",{className:"py-4 desktop:py-6 w-full overflow-visible",children:c("div",{ref:p,className:"px-4 desktop:px-6 overflow-x-auto",children:[t("div",{className:"w-fit rounded-full bg-[#EAEAEC]",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:t(C,{className:"flex p-1 w-max",children:s.map((e,i)=>t(T,{ref:o=>{o&&(r.current[i]=o)},className:L("lg-desktop:px-7 shrink-0 lg-desktop:pb-[14px] rounded-full lg-desktop:pt-[15px] lg-desktop:text-[16px] px-5 pb-[10px] pt-[11px]",e.text===d?.text&&"bg-white"),onClick:()=>{n(e)},value:e.text,children:t(m,{html:e.text,className:"font-bold text-[14px] leading-tight"})},i))})}),t("div",{className:"mt-4",children:s.map(e=>t(x,{value:e.label,className:"font-bold text-base desktop:text-[18px]",children:e.description}))})]})})]})})};var B=E;export{B as default};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../../src/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import type { HighlightProps } from '../types'\nimport { Text, Picture, Button, Heading, Dialog, DialogContent, DialogTrigger } from '../../../../../../components'\nimport { Content, List, Root, Trigger } from '@radix-ui/react-tabs'\nimport { useEffect, useMemo, useRef, useState } from 'react'\nimport { cn } from '../../../../../../helpers'\nimport { useProductContext } from '../../../../ProductProvider'\n\nconst ProductHighlight = () => {\n const { product, variant, isMobile } = useProductContext()\n const [open, setOpen] = useState(false)\n\n const ksp = useMemo(() => {\n const ksp_value = variant.metafields?.component?.ksp || product.metafields?.component?.ksp\n const result = isMobile ? ksp_value?.mobileList : ksp_value?.list\n return result?.filter((item: any) => !!item?.text)\n }, [variant.metafields?.component?.ksp, isMobile])\n\n const [activeKspItem, setActiveKspItem] = useState(ksp?.[0])\n\n const ProductHighlightData = useMemo(() => {\n return product?.payload?.components?.find((item: any) => item.componentKey === 'ProductHighlight')?.data || {}\n }, [product?.payload])\n\n if (!ksp?.length) return null\n\n return (\n <div className=\"ipc-product-detail-highlight\">\n <div className=\"flex items-center justify-between\">\n {ProductHighlightData?.title && <Text size={3} className=\"font-bold\" html={ProductHighlightData?.title} />}\n <Dialog open={open} onOpenChange={setOpen}>\n <DialogTrigger asChild>\n <Button variant=\"link\" className=\"font-bold !p-0 text-base\">\n {ProductHighlightData?.view}\n </Button>\n </DialogTrigger>\n <ProductHighlightModal ksp={ksp} clickActiveKspItem={activeKspItem} />\n </Dialog>\n </div>\n <div className=\"flex flex-wrap gap-4 mt-3 desktop:mt-4\">\n {ksp.map((item: any) => (\n <div className=\"px-4 py-2 lg-desktop:max-w-[256px] desktop:max-w-[246px] laptop:max-w-[310px] max-w-[227px] rounded-full bg-[#F5F5F7]\">\n <Text\n size={3}\n key={item?.text}\n onClick={() => {\n setActiveKspItem(item)\n setOpen(true)\n }}\n className=\"font-bold cursor-pointer text-[#1D1D1F] text-[16px] break-all line-clamp-1 desktop:text-base overflow-hidden\"\n html={item?.text}\n />\n </div>\n ))}\n </div>\n </div>\n )\n}\n\nconst ProductHighlightModal = ({ ksp, clickActiveKspItem }: { ksp: any[]; clickActiveKspItem: any }) => {\n const highlightRef = useRef<HTMLButtonElement[]>([])\n const scrollContainerRef = useRef<HTMLDivElement>(null)\n const [activeKspItem, setActiveKspItem] = useState<any>(null)\n\n useEffect(() => {\n if (!clickActiveKspItem) return\n setActiveKspItem(clickActiveKspItem)\n\n // \u5EF6\u8FDF\u6267\u884C\uFF0C\u7B49\u5F85 Dialog \u548C\u5185\u90E8\u5143\u7D20\u5B8C\u5168\u6E32\u67D3\n setTimeout(() => {\n const curIndex = ksp.findIndex(item => item.text === clickActiveKspItem?.text)\n const curRef = highlightRef.current[curIndex]\n\n if (curRef && scrollContainerRef.current) {\n const container = scrollContainerRef.current\n const button = curRef\n const scrollLeft = button.offsetLeft - container.offsetWidth / 2 + button.offsetWidth / 2\n\n container.scrollTo({\n left: scrollLeft,\n behavior: 'smooth',\n })\n }\n }, 100)\n }, [clickActiveKspItem, ksp])\n\n return (\n <DialogContent\n overlayClassName=\"z-[70]\"\n className=\"tablet:max-w-[896px] max-w-[326px] mx-auto w-full border-none z-[80] overflow-hidden p-0\"\n >\n <Root defaultValue={activeKspItem?.text} className=\"w-full overflow-hidden\">\n {ksp.map(item => (\n <Content value={item.text} key={item.text}>\n <Picture\n source={item.img}\n className=\"w-full h-[304px] desktop:h-[480px]\"\n alt={item.img.alt}\n imgClassName=\"object-cover h-full\"\n />\n </Content>\n ))}\n <div className=\"py-4 desktop:py-6 w-full overflow-visible\">\n <div ref={scrollContainerRef} className=\"px-4 desktop:px-6 overflow-x-auto\">\n <div\n className=\"w-fit rounded-full bg-[#EAEAEC]\"\n style={{\n scrollbarWidth: 'none',\n msOverflowStyle: 'none',\n }}\n >\n <List className=\"flex p-1 w-max\">\n {ksp.map((item, index) => (\n <Trigger\n ref={el => {\n if (el) {\n highlightRef.current[index] = el\n }\n }}\n className={cn(\n 'lg-desktop:px-7 shrink-0 lg-desktop:pb-[14px] rounded-full lg-desktop:pt-[15px] lg-desktop:text-[16px] px-5 pb-[10px] pt-[11px]',\n item.text === activeKspItem?.text && 'bg-white'\n )}\n onClick={() => {\n setActiveKspItem(item)\n }}\n key={index}\n value={item.text}\n >\n <Text html={item.text} className=\"font-bold text-[14px] leading-tight\" />\n </Trigger>\n ))}\n </List>\n </div>\n <div className=\"mt-4\">\n {ksp.map(item => (\n <Content value={item.label} className=\"font-bold text-base desktop:text-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kB,EAAK,KACnB,SAAA1B,EAACG,EAAA,CACC,OAAQuB,EAAK,IACb,UAAU,qCACV,IAAKA,EAAK,IAAI,IACd,aAAa,sBACf,GAN8BA,EAAK,IAOrC,CACD,EACD1B,EAAC,OAAI,UAAU,4CACb,SAAAC,EAAC,OAAI,IAAKgC,EAAoB,UAAU,oCACtC,UAAAjC,EAAC,OACC,UAAU,kCACV,MAAO,CACL,eAAgB,OAChB,gBAAiB,MACnB,EAEA,SAAAA,EAACS,EAAA,CAAK,UAAU,iBACb,SAAAe,EAAI,IAAI,CAACE,EAAMa,IACdvC,EAACW,EAAA,CACC,IAAK6B,GAAM,CACLA,IACFR,EAAa,QAAQO,CAAK,EAAIC,EAElC,EACA,UAAWxB,EACT,mIACAU,EAAK,OAASC,GAAe,MAAQ,UACvC,EACA,QAAS,IAAM,CACbC,EAAiBF,CAAI,CACvB,EAEA,MAAOA,EAAK,KAEZ,SAAA1B,EAACE,EAAA,CAAK,KAAMwB,EAAK,KAAM,UAAU,sCAAsC,GAHlEa,CAIP,CACD,EACH,EACF,EACAvC,EAAC,OAAI,UAAU,OACZ,SAAAwB,EAAI,IAAIE,GACP1B,EAACQ,EAAA,CAAQ,MAAOkB,EAAK,MAAO,UAAU,0CACnC,SAAAA,EAAK,YACR,CACD,EACH,GACF,EACF,GACF,EACF,CAEJ,EAEA,IAAOe,EAAQvB",
|
|
6
|
+
"names": ["jsx", "jsxs", "Text", "Picture", "Button", "Dialog", "DialogContent", "DialogTrigger", "Content", "List", "Root", "Trigger", "useEffect", "useMemo", "useRef", "useState", "cn", "useProductContext", "ProductHighlight", "product", "variant", "isMobile", "open", "setOpen", "ksp", "ksp_value", "item", "activeKspItem", "setActiveKspItem", "ProductHighlightData", "ProductHighlightModal", "clickActiveKspItem", "highlightRef", "scrollContainerRef", "curIndex", "curRef", "container", "button", "scrollLeft", "index", "el", "ProductHighlight_default"]
|
|
7
|
+
}
|
package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Fragment as k,jsx as o,jsxs as i}from"react/jsx-runtime";import{Text as c,Picture as y}from"../../../../../../components";import{cn as m}from"../../../../../../helpers/index.js";import{useState as N}from"react";import{useProductContext as h}from"../../../../ProductProvider.js";import{useAiuiContext as w}from"../../../../../AiuiProvider/index.js";import{handle as b}from"../../../../utils/helper.js";const _=()=>{const{product:d,selectedOptions:r,setSelectedOptions:a,setJoinedRecommendBuyProducts:u}=h(),{storeDomain:l}=w(),[p,f]=N({});return d.options.length?o("div",{className:"flex flex-col gap-12",children:d.options.map(t=>{const v=t.name.toLowerCase();return["color","colour","couleur"].some(e=>v.includes(e))?i("div",{className:"ipc-product-detail-options",children:[o(c,{as:"p",size:3,className:"font-bold",html:"Select Color: "+r[t.name]}),o("div",{className:"flex items-center gap-4 mt-4",children:t.values.map(({label:e},s)=>{const x=`https://${l}/cdn/shop/files/${b(e)}.png`;return i("div",{className:"relative ipc-product-detail-options-value",children:[o("button",{"aria-label":`switch to ${e}`,title:e,onClick:()=>{a(n=>({...n,[t.name]:e})),u?.({gift:void 0,bundle:void 0})},className:m("flex h-[36px] w-[36px] items-center justify-center rounded-full bg-center bg-no-repeat outline outline-2 outline-offset-4 outline-white",{"outline-brand":r[t.name]===e}),children:!p[e]&&o(k,{children:o(y,{className:"w-full",source:x,onError:({currentTarget:n})=>{n.onerror=null,f(g=>({...g,[e]:!0}))}})})}),o("div",{className:"pointer-events-none absolute inset-0 rounded-full shadow-[inset_0_0_4px_rgba(0,0,0,0.08),inset_0_2px_2px_rgba(0,0,0,0.12)]"})]},e+s)})})]},t.id):i("div",{className:"ipc-product-detail-options",children:[o(c,{as:"p",size:3,className:"font-bold",html:t.name}),o("div",{className:"flex items-center gap-4 mt-4",children:t.values.map(({label:e})=>o("button",{onClick:()=>{a(s=>({...s,[t.name]:e}))},className:m("w-1/2 text-left font-bold px-4 py-6 rounded-2xl border-[#E4E5E6] border-2",{"border-brand":r[t.name]===e}),children:e},e))})]},t.id)})}):null};var B=_;export{B as default};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../../src/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Text, Picture, Button } from '../../../../../../components'\nimport type { ProductOptionsProps } from '../types'\nimport { cn } from '../../../../../../helpers/index.js'\nimport { useState } from 'react'\nimport { useProductContext } from '../../../../ProductProvider.js'\nimport { useAiuiContext } from '../../../../../AiuiProvider/index.js'\nimport { handle } from '../../../../utils/helper.js'\n\nconst ProductOptions = () => {\n const { product, selectedOptions, setSelectedOptions, setJoinedRecommendBuyProducts } = useProductContext()\n const { storeDomain } = useAiuiContext()\n const [imgLoadError, setImgLoadError] = useState({})\n if (!product.options.length) return null\n return (\n <div className=\"flex flex-col gap-12\">\n {product.options.map(option => {\n const lowercasedName = option.name.toLowerCase()\n const colorKeywords = ['color', 'colour', 'couleur']\n if (colorKeywords.some(keyword => lowercasedName.includes(keyword))) {\n return (\n <div key={option.id} className=\"ipc-product-detail-options\">\n <Text as=\"p\" size={3} className=\"font-bold\" html={'Select Color: ' + selectedOptions[option.name]} />\n <div className=\"flex items-center gap-4 mt-4\">\n {option.values.map(({ label }, index) => {\n const imagePath = `https://${storeDomain}/cdn/shop/files/${handle(label)}.png`\n return (\n <div key={label + index} className=\"relative ipc-product-detail-options-value\">\n <button\n aria-label={`switch to ${label}`}\n title={label}\n onClick={() => {\n setSelectedOptions(prev => ({ ...prev, [option.name]: label }))\n setJoinedRecommendBuyProducts?.({ gift: undefined, bundle: undefined })\n }}\n className={cn(\n 'flex h-[36px] w-[36px] items-center justify-center rounded-full bg-center bg-no-repeat outline outline-2 outline-offset-4 outline-white',\n {\n 'outline-brand': selectedOptions[option.name] === label,\n }\n )}\n >\n {!imgLoadError[label as keyof typeof imgLoadError] && (\n <>\n <Picture\n className=\"w-full\"\n source={imagePath}\n onError={({ currentTarget }) => {\n currentTarget.onerror = null // prevents looping\n setImgLoadError(prev => ({ ...prev, [label]: true }))\n }}\n />\n </>\n )}\n </button>\n <div className=\"pointer-events-none absolute inset-0 rounded-full shadow-[inset_0_0_4px_rgba(0,0,0,0.08),inset_0_2px_2px_rgba(0,0,0,0.12)]\"></div>\n </div>\n )\n })}\n </div>\n </div>\n )\n } else {\n return (\n <div key={option.id} className=\"ipc-product-detail-options\">\n <Text as=\"p\" size={3} className=\"font-bold\" html={option.name} />\n <div className=\"flex items-center gap-4 mt-4\">\n {option.values.map(({ label }) => (\n <button\n key={label}\n onClick={() => {\n setSelectedOptions(prev => ({ ...prev, [option.name]: label }))\n // setProductSummaryStatus?.({ giftSummary: false, bundleSummary: false })\n }}\n className={cn('w-1/2 text-left font-bold px-4 py-6 rounded-2xl border-[#E4E5E6] border-2', {\n 'border-brand': selectedOptions[option.name] === label,\n })}\n >\n {label}\n </button>\n ))}\n </div>\n </div>\n )\n }\n })}\n </div>\n )\n}\n\nexport default ProductOptions\n"],
|
|
5
|
+
"mappings": "AAqBc,OAqBY,YAAAA,EArBZ,OAAAC,EAKM,QAAAC,MALN,oBArBd,OAAS,QAAAC,EAAM,WAAAC,MAAuB,+BAEtC,OAAS,MAAAC,MAAU,qCACnB,OAAS,YAAAC,MAAgB,QACzB,OAAS,qBAAAC,MAAyB,iCAClC,OAAS,kBAAAC,MAAsB,uCAC/B,OAAS,UAAAC,MAAc,8BAEvB,MAAMC,EAAiB,IAAM,CAC3B,KAAM,CAAE,QAAAC,EAAS,gBAAAC,EAAiB,mBAAAC,EAAoB,8BAAAC,CAA8B,EAAIP,EAAkB,EACpG,CAAE,YAAAQ,CAAY,EAAIP,EAAe,EACjC,CAACQ,EAAcC,CAAe,EAAIX,EAAS,CAAC,CAAC,EACnD,OAAKK,EAAQ,QAAQ,OAEnBV,EAAC,OAAI,UAAU,uBACZ,SAAAU,EAAQ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KAAM,EAC/DjB,EAAC,OAAI,UAAU,+BACZ,SAAAiB,EAAO,OAAO,IAAI,CAAC,CAAE,MAAAG,CAAM,IAC1BpB,EAAC,UAEC,QAAS,IAAM,CACbY,EAAmBW,IAAS,CAAE,GAAGA,EAAM,CAACN,EAAO,IAAI,EAAGG,CAAM,EAAE,CAEhE,EACA,UAAWhB,EAAG,4EAA6E,CACzF,eAAgBO,EAAgBM,EAAO,IAAI,IAAMG,CACnD,CAAC,EAEA,SAAAA,GATIA,CAUP,CACD,EACH,IAjBQH,EAAO,EAkBjB,CAGN,CAAC,EACH,EAzEkC,IA2EtC,EAEA,IAAOQ,EAAQhB",
|
|
6
|
+
"names": ["Fragment", "jsx", "jsxs", "Text", "Picture", "cn", "useState", "useProductContext", "useAiuiContext", "handle", "ProductOptions", "product", "selectedOptions", "setSelectedOptions", "setJoinedRecommendBuyProducts", "storeDomain", "imgLoadError", "setImgLoadError", "option", "lowercasedName", "keyword", "label", "index", "imagePath", "prev", "currentTarget", "ProductOptions_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as o,jsxs as e}from"react/jsx-runtime";import"./ProductBenefitsTabs/index.js";import t from"./ProductHighlight/index.js";import r from"./ProductFreeGift/index.js";import p from"./ProductOptions/index.js";import i from"./ProductBundle/index.js";const d=l=>e("div",{id:"ipc-product-detail",className:"flex flex-col gap-12 tablet:px-8 laptop:px-16 desktop:px-0 px-4",children:[o(t,{}),o(p,{}),o(r,{}),o(i,{})]});var x=d;export{x as default};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../src/biz-components/Listing/components/ProductCard/ProductDetail/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import ProductBenefitsTabs from './ProductBenefitsTabs/index.js'\nimport ProductHighlight from './ProductHighlight/index.js'\nimport ProductFreeGift from './ProductFreeGift/index.js'\nimport ProductOptions from './ProductOptions/index.js'\nimport ProductBundle from './ProductBundle/index.js'\n\n\nconst ProductDetail = (props: any) => {\n return (\n <div id=\"ipc-product-detail\" className=\"flex flex-col gap-12 tablet:px-8 laptop:px-16 desktop:px-0 px-4\">\n {/* <ProductBenefitsTabs>\n <ProductBenefitsTabs.List>\n <ProductBenefitsTabs.Trigger value=\"Benefits\">Benefits</ProductBenefitsTabs.Trigger>\n <ProductBenefitsTabs.Trigger value=\"Benefits\">Benefits</ProductBenefitsTabs.Trigger>\n </ProductBenefitsTabs.List>\n </ProductBenefitsTabs> */}\n <ProductHighlight />\n <ProductOptions />\n <ProductFreeGift />\n <ProductBundle />\n </div>\n )\n}\n\nexport default ProductDetail\n"],
|
|
5
|
+
"mappings": "AASI,OAOE,OAAAA,EAPF,QAAAC,MAAA,oBATJ,MAAgC,iCAChC,OAAOC,MAAsB,8BAC7B,OAAOC,MAAqB,6BAC5B,OAAOC,MAAoB,4BAC3B,OAAOC,MAAmB,2BAG1B,MAAMC,EAAiBC,GAEnBN,EAAC,OAAI,GAAG,qBAAqB,UAAU,kEAOrC,UAAAD,EAACE,EAAA,EAAiB,EAClBF,EAACI,EAAA,EAAe,EAChBJ,EAACG,EAAA,EAAgB,EACjBH,EAACK,EAAA,EAAc,GACjB,EAIJ,IAAOG,EAAQF",
|
|
6
|
+
"names": ["jsx", "jsxs", "ProductHighlight", "ProductFreeGift", "ProductOptions", "ProductBundle", "ProductDetail", "props", "ProductDetail_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../src/biz-components/Listing/components/ProductCard/ProductDetail/types.ts"],
|
|
4
|
+
"sourcesContent": ["import type {\n ProductVariant,\n Product,\n ProductOption,\n ProductOptionValues,\n} from '../../../../../cpn-components/CpnProductCard/types.js'\nimport type { Img } from '../../../../../types/props.js'\n\nexport interface ProductDetailProps {}\n\nexport enum BenefitsTabsType {\n ALL_BENEFITS = 'allBenefits',\n COUPON = 'coupon',\n INSTALLMENT = 'installment',\n MEMBERSHIP = 'membership',\n}\n\nexport interface ProductBenefitsTabsProps {\n data: {\n allBenefits: {\n benefits: {\n type?: BenefitsTabsType\n tabName: string\n tabValue: string\n collectBgImage?: Img\n coupons?: BenefitsTabCouponProps[]\n }[]\n }\n }\n}\n\nexport interface BenefitsTabCouponProps {\n code: string\n title: string\n description: string\n discount: number\n bgImage: Img\n}\n\nexport interface ProductBenefitsTabCouponProps {\n coupons?: BenefitsTabCouponProps[]\n}\n\nexport interface HighlightProps {\n data: any\n}\n\nexport interface ProductOptionsProps {\n option: ProductOption\n onOptionChange: (arg0: { id: string; value: string }) => void\n}\n"],
|
|
5
|
+
"mappings": "AAUO,IAAKA,OACVA,EAAA,aAAe,cACfA,EAAA,OAAS,SACTA,EAAA,YAAc,cACdA,EAAA,WAAa,aAJHA,OAAA",
|
|
6
|
+
"names": ["BenefitsTabsType"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as e,jsxs as r}from"react/jsx-runtime";import{useEffect as g,useState as b}from"react";import{Dialog as v,DialogTrigger as N,DialogContent as C,DialogHeader as E,DialogTitle as y,Grid as p,GridItem as s,Text as h}from"../../../../../../components";import{useProductContext as D}from"../../../../ProductProvider";import G from"./Select";import{useAiuiContext as w}from"../../../../../AiuiProvider/index.js";import{formatPrice as I}from"../../../../utils";import{ShopifyColorOption as k}from"./ShopifyColorOption";const P=()=>{const{locale:f="us"}=w(),{compareData:o,product:u}=D(),[d,x]=b();g(()=>{x(o?.availableCompareList[0]?.handle)},[o?.availableCompareList]);const m=[o?.currentProductCompareData?.product,o?.availableCompareList.find(t=>t.handle===d)?.product].filter(Boolean);return o?.specificationKeys?r(v,{children:[e(N,{children:e("button",{className:"text-base leading-[1.4] font-bold",children:"Compare"})}),r(C,{overlayClassName:"z-[100]",className:"max-h-[calc(100vh-92px)] z-[110] overflow-y-scroll px-[40px] py-[30px] shadow-lg tablet:min-w-[760px] min-w-[90vw]",children:[e(E,{className:"border-b border-[#E8E8E8]",children:e(y,{children:"Compare"})}),r(p,{className:"gap-[40px] grid-cols-3 items-center gap-[40px] border-b border-[#E8E8E8] py-[24px]",children:[e(s,{span:1}),m.map((t,i)=>e(s,{span:1,className:"flex items-center",children:e("img",{src:t.images[0].url,alt:t.title,className:"h-[200px] w-[200px]",role:"presentation"})},i))]}),r(p,{className:"gap-[40px] grid-cols-3 items-center gap-[40px] border-b border-[#E8E8E8] py-[24px]",children:[e(s,{span:1,children:e("div",{className:"text-[16px] font-bold text-[#595959]",children:"Product"})}),e(s,{span:1,children:e(h,{as:"div",className:"flex h-[38px] w-full items-center rounded-[2px] border border-[#E8E8E8] px-[12px] text-[16px] font-bold",html:o.currentProductCompareData?.shortName||u.title})}),d&&e(s,{span:1,children:e(G,{value:d,onChange:t=>{x(t)},list:o.options})})]}),r(p,{className:"gap-[40px] grid-cols-3 items-center gap-[40px] border-b border-[#E8E8E8] py-[24px]",children:[e(s,{span:1,children:e("div",{className:"text-[16px] font-bold text-[#595959]",children:"Basic Information"})}),m.map((t,i)=>{const l=t.variants[0],c=t.options?.find(a=>["color","colour","couleur"].find(n=>a.name.toLowerCase().includes(n)))?.values.map(a=>a.label);return e(s,{span:1,className:"flex h-full",children:r("div",{className:"flex flex-col gap-[8px]",children:[l.price.amount<9999999&&r("div",{className:"flex items-center gap-[8px]",children:[e("div",{className:"text-[16px] font-semibold text-[#595959]",children:"Price:"}),e("div",{className:"flex items-center gap-[6px]",children:e("span",{className:"text-[16px] font-bold",children:I({locale:f,amount:l.price.amount,currencyCode:l.price.currencyCode})})})]}),c?.length&&r("div",{className:"flex items-center gap-[8px]",children:[e("div",{className:"text-[16px] font-semibold text-[#595959]",children:"Color:"}),e("div",{className:"flex items-center gap-[16px]",children:c.map(a=>e(k,{label:a,className:"h-[16px] w-[16px]"},a))})]})]})},i)})]}),e(p,{className:"gap-[40px] grid-cols-12 items-center gap-[40px] border-b border-[#E8E8E8]",children:o.specificationKeys?.map(t=>r(s,{span:12,className:"grid grid-cols-3 items-center gap-[40px] border-b border-[#E8E8E8] py-[24px]",children:[e("div",{className:"text-[16px] font-bold text-[#595959]",children:t}),m.map((i,l)=>{let a=i.metafields?.global?.specifications?.find(n=>n?.key===t)?.value||"";switch(a.trim().toLowerCase()){case"true":a="\u2714\uFE0F";break;case"false":a="\u274C";break;default:break}return e("div",{className:"flex items-center",children:e("div",{className:"text-[16px] font-semibold text-[#595959]",children:a})},l)})]},t))})]})]}):null};var A=P;export{A as default};
|
|
2
|
+
//# sourceMappingURL=CompareModal.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../../src/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.tsx"],
|
|
4
|
+
"sourcesContent": ["import { useEffect, useState } from 'react'\nimport {\n Dialog,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogTitle,\n Grid,\n GridItem,\n Text,\n} from '../../../../../../components'\nimport { useProductContext } from '../../../../ProductProvider'\nimport type { CompareItem } from '../../../../types'\nimport Select from './Select'\nimport { useAiuiContext } from '../../../../../AiuiProvider/index.js'\nimport { formatPrice } from '../../../../utils'\nimport { ShopifyColorOption } from './ShopifyColorOption'\n\nconst CompareModal = () => {\n const { locale = 'us' } = useAiuiContext()\n const { compareData, product } = useProductContext()\n const [selectedProductHandle, setSelectedProductHandle] = useState<string>()\n\n useEffect(() => {\n setSelectedProductHandle(compareData?.availableCompareList[0]?.handle)\n }, [compareData?.availableCompareList])\n\n const products = [\n compareData?.currentProductCompareData!?.product,\n compareData?.availableCompareList.find(product => product.handle === selectedProductHandle)?.product,\n ].filter(Boolean) as CompareItem['product'][]\n\n if (!compareData?.specificationKeys) return null\n\n return (\n <Dialog>\n <DialogTrigger>\n <button className=\"text-base leading-[1.4] font-bold\">Compare</button>\n </DialogTrigger>\n <DialogContent\n overlayClassName=\"z-[100]\"\n className=\"max-h-[calc(100vh-92px)] z-[110] overflow-y-scroll px-[40px] py-[30px] shadow-lg tablet:min-w-[760px] min-w-[90vw]\"\n >\n <DialogHeader className=\"border-b border-[#E8E8E8]\">\n <DialogTitle>Compare</DialogTitle>\n </DialogHeader>\n <Grid className=\"gap-[40px] grid-cols-3 items-center gap-[40px] border-b border-[#E8E8E8] py-[24px]\">\n <GridItem span={1} />\n {products.map((product, productIndex) => {\n return (\n <GridItem key={productIndex} span={1} className=\"flex items-center\">\n <img\n src={product.images[0].url}\n alt={product.title}\n className=\"h-[200px] w-[200px]\"\n role=\"presentation\"\n />\n </GridItem>\n )\n })}\n </Grid>\n <Grid className=\"gap-[40px] grid-cols-3 items-center gap-[40px] border-b border-[#E8E8E8] py-[24px]\">\n <GridItem span={1}>\n <div className=\"text-[16px] font-bold text-[#595959]\">Product</div>\n </GridItem>\n <GridItem span={1}>\n <Text\n as=\"div\"\n className=\"flex h-[38px] w-full items-center rounded-[2px] border border-[#E8E8E8] px-[12px] text-[16px] font-bold\"\n html={compareData.currentProductCompareData?.shortName || product.title}\n ></Text>\n </GridItem>\n {selectedProductHandle && (\n <GridItem span={1}>\n <Select\n value={selectedProductHandle}\n onChange={value => {\n setSelectedProductHandle(value)\n }}\n list={compareData.options!}\n />\n </GridItem>\n )}\n </Grid>\n <Grid className=\"gap-[40px] grid-cols-3 items-center gap-[40px] border-b border-[#E8E8E8] py-[24px]\">\n <GridItem span={1}>\n <div className=\"text-[16px] font-bold text-[#595959]\">Basic Information</div>\n </GridItem>\n {products.map((product, productIndex) => {\n const variant = product.variants[0]\n const colors = product.options\n ?.find(option =>\n ['color', 'colour', 'couleur'].find(predicate => option.name.toLowerCase().includes(predicate))\n )\n ?.values.map(value => value.label)\n return (\n <GridItem span={1} key={productIndex} className=\"flex h-full\">\n {/* Price with original price */}\n <div className=\"flex flex-col gap-[8px]\">\n {variant.price.amount < 9999999 && (\n <div className=\"flex items-center gap-[8px]\">\n <div className=\"text-[16px] font-semibold text-[#595959]\">Price:</div>\n <div className=\"flex items-center gap-[6px]\">\n <span className=\"text-[16px] font-bold\">\n {formatPrice({\n locale,\n amount: variant.price.amount,\n currencyCode: variant.price.currencyCode,\n })}\n </span>\n\n {/* {Number(coupon?.fixed_value) > 0 && (\n <span className='font-semibold text-[#999999] line-through'>\n {formatPrice({\n locale,\n amount: variant.price.amount,\n currencyCode: variant.price.currencyCode,\n })}\n </span>\n )} */}\n </div>\n </div>\n )}\n {colors?.length && (\n <div className=\"flex items-center gap-[8px]\">\n <div className=\"text-[16px] font-semibold text-[#595959]\">Color:</div>\n <div className=\"flex items-center gap-[16px]\">\n {colors.map(label => (\n <ShopifyColorOption key={label} label={label} className=\"h-[16px] w-[16px]\" />\n ))}\n </div>\n </div>\n )}\n </div>\n </GridItem>\n )\n })}\n </Grid>\n <Grid className=\"gap-[40px] grid-cols-12 items-center gap-[40px] border-b border-[#E8E8E8]\">\n {compareData.specificationKeys?.map((key: string) => {\n return (\n <GridItem\n span={12}\n className=\"grid grid-cols-3 items-center gap-[40px] border-b border-[#E8E8E8] py-[24px]\"\n key={key}\n >\n {/* Detail value */}\n <div className=\"text-[16px] font-bold text-[#595959]\">{key}</div>\n {/* Product Values */}\n {products.map((product, productIndex) => {\n const value =\n product.metafields?.global?.specifications?.find(\n (specification: { key: string }) => specification?.key === key\n )?.value || ''\n let text = value\n switch (text.trim().toLowerCase()) {\n case 'true':\n text = '\u2714\uFE0F'\n break\n case 'false':\n text = '\u274C'\n break\n default:\n break\n }\n return (\n <div key={productIndex} className=\"flex items-center\">\n {/* Other details */}\n <div className=\"text-[16px] font-semibold text-[#595959]\">{text}</div>\n </div>\n )\n })}\n </GridItem>\n )\n })}\n </Grid>\n </DialogContent>\n </Dialog>\n )\n}\n\nexport default CompareModal\n"],
|
|
5
|
+
"mappings": "AAqCQ,cAAAA,EASA,QAAAC,MATA,oBArCR,OAAS,aAAAC,EAAW,YAAAC,MAAgB,QACpC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IAAIG,GACV9B,EAACgB,EAAA,CAA+B,MAAOc,EAAO,UAAU,qBAA/BA,CAAmD,CAC7E,EACH,GACF,GAEJ,GArCsBN,CAsCxB,CAEJ,CAAC,GACH,EACAxB,EAACS,EAAA,CAAK,UAAU,4EACb,SAAAU,EAAY,mBAAmB,IAAKY,GAEjC9B,EAACS,EAAA,CACC,KAAM,GACN,UAAU,+EAIV,UAAAV,EAAC,OAAI,UAAU,uCAAwC,SAAA+B,EAAI,EAE1DR,EAAS,IAAI,CAACH,EAASI,IAAiB,CAKvC,IAAIQ,EAHFZ,EAAQ,YAAY,QAAQ,gBAAgB,KACzCa,GAAmCA,GAAe,MAAQF,CAC7D,GAAG,OAAS,GAEd,OAAQC,EAAK,KAAK,EAAE,YAAY,EAAG,CACjC,IAAK,OACHA,EAAO,eACP,MACF,IAAK,QACHA,EAAO,SACP,MACF,QACE,KACJ,CACA,OACEhC,EAAC,OAAuB,UAAU,oBAEhC,SAAAA,EAAC,OAAI,UAAU,2CAA4C,SAAAgC,EAAK,GAFxDR,CAGV,CAEJ,CAAC,IA3BIO,CA4BP,CAEH,EACH,GACF,GACF,EAjJ0C,IAmJ9C,EAEA,IAAOG,EAAQjB",
|
|
6
|
+
"names": ["jsx", "jsxs", "useEffect", "useState", "Dialog", "DialogTrigger", "DialogContent", "DialogHeader", "DialogTitle", "Grid", "GridItem", "Text", "useProductContext", "Select", "useAiuiContext", "formatPrice", "ShopifyColorOption", "CompareModal", "locale", "compareData", "product", "selectedProductHandle", "setSelectedProductHandle", "products", "productIndex", "value", "variant", "colors", "option", "predicate", "label", "key", "text", "specification", "CompareModal_default"]
|
|
7
|
+
}
|
package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as t,jsxs as r}from"react/jsx-runtime";import{ChevronDownIcon as y}from"@heroicons/react/24/outline";import{cn as n,cn as C}from"../../../../../../helpers";import{useEffect as D,useRef as v,useState as S}from"react";const L=({label:x="",required:m=!1,list:a=[],value:l="",disabled:b=!1,error:s="",errorClassName:g="",onChange:u=f=>{},placeholder:i="",className:h="",containerClassName:w="",selectListClassName:N="",truncate:E=!1,...F})=>{const f=v(null),[d,c]=S(!1),p=v(null),k=a.find(e=>e?.value===l)?.text;return D(()=>{const e=o=>{p.current&&!p.current?.contains(o.target)&&c(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]),r("div",{className:n("relative w-full",w),children:[x&&r("div",{className:"mb-[10px] text-[16px] font-bold",children:[x,m&&t("span",{className:"text-[#F84D4F]",children:"*"})]}),r("div",{ref:p,className:"relative block",children:[r("div",{className:n("flex h-[38px] w-full cursor-pointer items-center justify-between rounded-[2px] border px-[12px] text-[16px] font-bold transition-all x:text-[14px]",i&&!l?"placeholder:text-[#999]":"",b?"pointer-events-none bg-[#F7F8F9]":"bg-white",s?"!border-[#F84D4F]":"border-[#E8E8E8]",a.length<=1&&"cursor-default",h),onClick:()=>{a.length>1&&c(!d)},onChange:e=>{u(e.target.value)},role:"button",tabIndex:0,onKeyDown:e=>{(e.key==="Enter"||e.key===" ")&&e.preventDefault()},...F,children:[!l&&i?t("div",{className:"text-[#999]",children:i}):t("div",{className:C("line-clamp-1",E?"min-w-0 flex-1 truncate":"flex-1"),children:k}),a.length>1&&t(y,{className:n("ml-[4px] h-[18px] w-[18px] flex-shrink-0 stroke-[#999999] transition-transform",d&&"rotate-180")})]}),t("div",{ref:f,className:n("absolute left-0 right-0 top-full z-[1] mt-[8px] max-h-[318px] overflow-auto rounded-[4px] bg-white py-[6px] shadow-[0_1px_12px_0px_#0000001F] transition-all duration-300",d?"":"pointer-events-none opacity-0",N),children:a.map(e=>t("div",{"data-value":e.value,className:n("flex h-[47px] w-full flex-shrink-0 cursor-pointer items-center whitespace-nowrap bg-white px-[14px] text-[15px] font-bold text-[#333] transition-colors duration-300 hover:bg-[#F7F8F9]",l===e.value?"!bg-[#E8E8E8]":"",e?.disabled?"pointer-events-none text-[#C8C8C8]":""),onClick:()=>{u(e.value),c(!1)},role:"button",tabIndex:0,onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&o.preventDefault()},children:e.text},e.value))})]}),s&&t("div",{className:n("mt-[8px] text-[14px] text-[#F84D4F]",g),children:typeof s=="string"?`*${s}`:s})]})};var H=L;export{H as default};
|
|
2
|
+
//# sourceMappingURL=Select.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../../src/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.tsx"],
|
|
4
|
+
"sourcesContent": ["import { ChevronDownIcon } from '@heroicons/react/24/outline'\nimport { cn as classNames, cn } from '../../../../../../helpers'\nimport React, { useEffect, useRef, useState } from 'react'\n\ninterface SelectProps {\n label?: string\n required?: boolean\n list?: { value: string; text: string; disabled?: boolean }[]\n value?: string\n disabled?: boolean\n error?: string\n errorClassName?: string\n onChange?: (value: string) => void\n placeholder?: string\n className?: string\n containerClassName?: string\n selectListClassName?: string\n truncate?: boolean\n}\n\nconst Select = ({\n label = '',\n required = false,\n list = [],\n value = '',\n disabled = false,\n error = '',\n errorClassName = '',\n onChange = (value: string) => {},\n placeholder = '',\n className = '',\n containerClassName = '',\n selectListClassName = '',\n truncate = false,\n ...props\n}: SelectProps) => {\n const dropdownRef = useRef(null)\n const [selecting, setSelecting] = useState(false)\n const buttonRef = useRef<HTMLDivElement>(null)\n\n const displayValue = list.find(item => item?.value === value)?.text\n useEffect(() => {\n const handleClickOutside = (event: MouseEvent) => {\n if (buttonRef.current && !buttonRef.current?.contains(event.target as Node)) {\n setSelecting(false)\n }\n }\n document.addEventListener('mousedown', handleClickOutside)\n return () => {\n document.removeEventListener('mousedown', handleClickOutside)\n }\n }, [])\n\n // useEffect(() => {\n // // scroll to select item when select is open\n // // start_ai_generated\n // if (selecting && value) {\n // const selectedElement = dropdownRef.current.querySelector(`[data-value=\"${value}\"]`)\n // if (selectedElement) {\n // scrollParentToChild(dropdownRef.current, selectedElement)\n // }\n // }\n // // end_ai_generated\n // }, [selecting, value])\n\n return (\n <div className={classNames('relative w-full', containerClassName)}>\n {label && (\n <div className=\"mb-[10px] text-[16px] font-bold\">\n {label}\n {required && <span className=\"text-[#F84D4F]\">*</span>}\n </div>\n )}\n <div ref={buttonRef} className=\"relative block\">\n <div\n className={classNames(\n 'flex h-[38px] w-full cursor-pointer items-center justify-between rounded-[2px] border px-[12px] text-[16px] font-bold transition-all x:text-[14px]',\n placeholder && !value ? 'placeholder:text-[#999]' : '',\n disabled ? 'pointer-events-none bg-[#F7F8F9]' : 'bg-white',\n error ? '!border-[#F84D4F]' : 'border-[#E8E8E8]',\n list.length <= 1 && 'cursor-default',\n className\n )}\n onClick={() => {\n if (list.length > 1) {\n setSelecting(!selecting)\n }\n }}\n onChange={event => {\n onChange((event.target as HTMLSelectElement).value)\n }}\n role=\"button\"\n tabIndex={0}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n }\n }}\n {...props}\n >\n {!value && placeholder ? (\n <div className=\"text-[#999]\">{placeholder}</div>\n ) : (\n <div className={cn('line-clamp-1', truncate ? 'min-w-0 flex-1 truncate' : 'flex-1')}>{displayValue}</div>\n )}\n {list.length > 1 && (\n <ChevronDownIcon\n className={classNames(\n 'ml-[4px] h-[18px] w-[18px] flex-shrink-0 stroke-[#999999] transition-transform',\n selecting && 'rotate-180'\n )}\n />\n )}\n </div>\n <div\n ref={dropdownRef}\n className={classNames(\n 'absolute left-0 right-0 top-full z-[1] mt-[8px] max-h-[318px] overflow-auto rounded-[4px] bg-white py-[6px] shadow-[0_1px_12px_0px_#0000001F] transition-all duration-300',\n selecting ? '' : 'pointer-events-none opacity-0',\n selectListClassName\n )}\n >\n {list.map(item => (\n <div\n key={item.value}\n data-value={item.value}\n className={classNames(\n 'flex h-[47px] w-full flex-shrink-0 cursor-pointer items-center whitespace-nowrap bg-white px-[14px] text-[15px] font-bold text-[#333] transition-colors duration-300 hover:bg-[#F7F8F9]',\n value === item.value ? '!bg-[#E8E8E8]' : '',\n item?.disabled ? 'pointer-events-none text-[#C8C8C8]' : ''\n )}\n onClick={() => {\n onChange(item.value)\n setSelecting(false)\n }}\n role=\"button\"\n tabIndex={0}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n }\n }}\n >\n {item.text}\n </div>\n ))}\n </div>\n </div>\n {error && (\n <div className={classNames('mt-[8px] text-[14px] text-[#F84D4F]', errorClassName)}>\n {typeof error === 'string' ? `*${error}` : error}\n </div>\n )}\n </div>\n )\n}\n\nexport default Select"],
|
|
5
|
+
"mappings": "AAoEQ,OAEe,OAAAA,EAFf,QAAAC,MAAA,oBApER,OAAS,mBAAAC,MAAuB,8BAChC,OAAS,MAAMC,EAAY,MAAAC,MAAU,4BACrC,OAAgB,aAAAC,EAAW,UAAAC,EAAQ,YAAAC,MAAgB,QAkBnD,MAAMC,EAAS,CAAC,CACd,MAAAC,EAAQ,GACR,SAAAC,EAAW,GACX,KAAAC,EAAO,CAAC,EACR,MAAAC,EAAQ,GACR,SAAAC,EAAW,GACX,MAAAC,EAAQ,GACR,eAAAC,EAAiB,GACjB,SAAAC,EAAYJ,GAAkB,CAAC,EAC/B,YAAAK,EAAc,GACd,UAAAC,EAAY,GACZ,mBAAAC,EAAqB,GACrB,oBAAAC,EAAsB,GACtB,SAAAC,EAAW,GACX,GAAGC,CACL,IAAmB,CACjB,MAAMC,EAAcjB,EAAO,IAAI,EACzB,CAACkB,EAAWC,CAAY,EAAIlB,EAAS,EAAK,EAC1CmB,EAAYpB,EAAuB,IAAI,EAEvCqB,EAAehB,EAAK,KAAKiB,GAAQA,GAAM,QAAUhB,CAAK,GAAG,KAC/D,OAAAP,EAAU,IAAM,CACd,MAAMwB,EAAsBC,GAAsB,CAC5CJ,EAAU,SAAW,CAACA,EAAU,SAAS,SAASI,EAAM,MAAc,GACxEL,EAAa,EAAK,C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Aa,EAAK,CACpB,EACA,KAAK,SACL,SAAU,EACV,UAAWM,GAAK,EACVA,EAAE,MAAQ,SAAWA,EAAE,MAAQ,MACjCA,EAAE,eAAe,CAErB,EAEC,SAAAH,EAAK,MAnBDA,EAAK,KAoBZ,CACD,EACH,GACF,EACCd,GACCd,EAAC,OAAI,UAAWG,EAAW,sCAAuCY,CAAc,EAC7E,gBAAOD,GAAU,SAAW,IAAIA,CAAK,GAAKA,EAC7C,GAEJ,CAEJ,EAEA,IAAOkB,EAAQxB",
|
|
6
|
+
"names": ["jsx", "jsxs", "ChevronDownIcon", "classNames", "cn", "useEffect", "useRef", "useState", "Select", "label", "required", "list", "value", "disabled", "error", "errorClassName", "onChange", "placeholder", "className", "containerClassName", "selectListClassName", "truncate", "props", "dropdownRef", "selecting", "setSelecting", "buttonRef", "displayValue", "item", "handleClickOutside", "event", "e", "Select_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Fragment as g,jsx as t,jsxs as h}from"react/jsx-runtime";import{Picture as c}from"../../../../../../components";import{handle as m}from"../../../../utils/helper.js";import{useState as f}from"react";import{cn as d}from"../../../../../../helpers";import{useAiuiContext as p}from"../../../../../AiuiProvider/index.js";const w=({onClick:e,label:o,className:s})=>{const[r,i]=f({}),{locale:_,storeDomain:a}=p(),n=`https://${a}/cdn/shop/files/${m(o)}.png`;return h("div",{className:"relative",children:[t("button",{className:d("relative flex h-[36px] w-[36px] items-center justify-center rounded-full bg-center bg-no-repeat outline outline-2 outline-offset-4 outline-white",!e&&"cursor-default",s),"aria-label":`switch to ${o}`,onClick:e||(()=>{}),title:o,style:r[o]?{background:o}:{},children:!r[o]&&t(g,{children:t(c,{className:"w-full",source:n,onError:({currentTarget:l})=>{l.onerror=null,i(u=>({...u,[o]:!0}))}})})}),t("div",{className:"absolute inset-0 rounded-full shadow-[inset_0_0_4px_rgba(0,0,0,0.08),inset_0_2px_2px_rgba(0,0,0,0.12)]"})]})};export{w as ShopifyColorOption};
|
|
2
|
+
//# sourceMappingURL=ShopifyColorOption.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../../src/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Picture } from '../../../../../../components'\nimport { handle } from '../../../../utils/helper.js'\nimport { useState } from 'react'\nimport { cn as classNames } from '../../../../../../helpers'\nimport { useAiuiContext } from '../../../../../AiuiProvider/index.js'\n\nexport const ShopifyColorOption = ({\n onClick,\n label,\n className,\n}: {\n onClick?: () => void\n label: string\n className?: string\n}) => {\n const [imgLoadError, setImgLoadError] = useState({})\n\n const { locale, storeDomain } = useAiuiContext()\n const imagePath = `https://${storeDomain}/cdn/shop/files/${handle(label)}.png`\n return (\n <div className='relative'>\n <button\n className={classNames(\n `relative flex h-[36px] w-[36px] items-center justify-center rounded-full bg-center bg-no-repeat outline outline-2 outline-offset-4 outline-white`,\n !onClick && 'cursor-default',\n className,\n )}\n aria-label={`switch to ${label}`}\n onClick={onClick ? onClick : () => {}}\n title={label}\n // If the image fails to load, set the background color to the color of the label\n style={imgLoadError[label as keyof typeof imgLoadError] ? { background: label } : {}}\n >\n {!imgLoadError[label as keyof typeof imgLoadError] && (\n <>\n <Picture\n className='w-full'\n source={imagePath}\n onError={({ currentTarget }) => {\n currentTarget.onerror = null // prevents looping\n setImgLoadError((prev) => ({ ...prev, [label]: true }))\n }}\n />\n </>\n )}\n </button>\n <div className='absolute inset-0 rounded-full shadow-[inset_0_0_4px_rgba(0,0,0,0.08),inset_0_2px_2px_rgba(0,0,0,0.12)]'></div>\n </div>\n )\n}\n"],
|
|
5
|
+
"mappings": "AAoBI,OAcM,YAAAA,EACE,OAAAC,EAfR,QAAAC,MAAA,oBApBJ,OAAS,WAAAC,MAAe,+BACxB,OAAS,UAAAC,MAAc,8BACvB,OAAS,YAAAC,MAAgB,QACzB,OAAS,MAAMC,MAAkB,4BACjC,OAAS,kBAAAC,MAAsB,uCAExB,MAAMC,EAAqB,CAAC,CACjC,QAAAC,EACA,MAAAC,EACA,UAAAC,CACF,IAIM,CACJ,KAAM,CAACC,EAAcC,CAAe,EAAIR,EAAS,CAAC,CAAC,EAE7C,CAAE,OAAAS,EAAQ,YAAAC,CAAY,EAAIR,EAAe,EACzCS,EAAY,WAAWD,CAAW,mBAAmBX,EAAOM,CAAK,CAAC,OACxE,OACER,EAAC,OAAI,UAAU,WACb,UAAAD,EAAC,UACC,UAAWK,EACT,mJACA,CAACG,GAAW,iBACZE,CACF,EACA,aAAY,aAAaD,CAAK,GAC9B,QAASD,IAAoB,IAAM,CAAC,GACpC,MAAOC,EAEP,MAAOE,EAAaF,CAAkC,EAAI,CAAE,WAAYA,CAAM,EAAI,CAAC,EAElF,UAACE,EAAaF,CAAkC,GAC/CT,EAAAD,EAAA,CACE,SAAAC,EAACE,EAAA,CACC,UAAU,SACV,OAAQa,EACR,QAAS,CAAC,CAAE,cAAAC,CAAc,IAAM,CAC9BA,EAAc,QAAU,KACxBJ,EAAiBK,IAAU,CAAE,GAAGA,EAAM,CAACR,CAAK,EAAG,EAAK,EAAE,CACxD,EACF,EACF,EAEJ,EACAT,EAAC,OAAI,UAAU,yGAAyG,GAC1H,CAEJ",
|
|
6
|
+
"names": ["Fragment", "jsx", "jsxs", "Picture", "handle", "useState", "classNames", "useAiuiContext", "ShopifyColorOption", "onClick", "label", "className", "imgLoadError", "setImgLoadError", "locale", "storeDomain", "imagePath", "currentTarget", "prev"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as e,jsxs as o}from"react/jsx-runtime";import{Dialog as s,DialogTrigger as i,DialogContent as m,DialogHeader as d,DialogTitle as n,Grid as g,GridItem as c,Text as a}from"../../../../../../components";import{useProductContext as x}from"../../../../ProductProvider";const f=()=>{const{product:l}=x();return o(s,{children:[e(i,{children:e("button",{className:"text-base leading-[1.4] font-bold",children:"Specs"})}),o(m,{overlayClassName:"z-[100]",className:"max-h-[80vh] z-[110] overflow-y-scroll tablet:min-w-[600px] min-w-[90vw]",children:[e(d,{className:"border-b border-[#E8E8E8]",children:e(n,{children:"Specs"})}),e(g,{className:"gap-[40px]",children:l.metafields?.global?.specifications?.map(({key:r,value:t})=>o(c,{span:12,className:"flex w-full py-[24px] border-b border-[#E8E8E8]",children:[e(a,{className:"flex-1 text-[16px] font-bold text-[#595959]",children:r}),e("div",{className:"flex-1 flex items-center",children:e(a,{className:"text-[16px] font-semibold text-[#595959]",html:t?.trim().toLowerCase()==="true"?"\u2714\uFE0F":t?.trim().toLowerCase()==="false"?"\u274C":t})})]}))})]})]})};export{f as SpecsModal};
|
|
2
|
+
//# sourceMappingURL=SpecsModal.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../../src/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.tsx"],
|
|
4
|
+
"sourcesContent": ["import {\n Dialog,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogTitle,\n Grid,\n GridItem,\n Text,\n} from '../../../../../../components'\nimport { useProductContext } from '../../../../ProductProvider'\n\nexport const SpecsModal = () => {\n const { product } = useProductContext()\n\n return (\n <Dialog>\n <DialogTrigger>\n <button className=\"text-base leading-[1.4] font-bold\">Specs</button>\n </DialogTrigger>\n <DialogContent\n overlayClassName=\"z-[100]\"\n className=\"max-h-[80vh] z-[110] overflow-y-scroll tablet:min-w-[600px] min-w-[90vw]\"\n >\n <DialogHeader className=\"border-b border-[#E8E8E8]\">\n <DialogTitle>Specs</DialogTitle>\n </DialogHeader>\n <Grid className=\"gap-[40px]\">\n {product.metafields?.global?.specifications?.map(({ key, value }: { key: string; value: string }) => (\n <GridItem span={12} className=\"flex w-full py-[24px] border-b border-[#E8E8E8]\">\n <Text className=\"flex-1 text-[16px] font-bold text-[#595959]\">{key}</Text>\n <div className=\"flex-1 flex items-center\">\n <Text\n className=\"text-[16px] font-semibold text-[#595959]\"\n html={\n value?.trim().toLowerCase() === 'true'\n ? '\u2714\uFE0F'\n : value?.trim().toLowerCase() === 'false'\n ? '\u274C'\n : value\n }\n />\n </div>\n </GridItem>\n ))}\n </Grid>\n </DialogContent>\n </Dialog>\n )\n}\n"],
|
|
5
|
+
"mappings": "AAkBQ,cAAAA,EAWI,QAAAC,MAXJ,oBAlBR,OACE,UAAAC,EACA,iBAAAC,EACA,iBAAAC,EACA,gBAAAC,EACA,eAAAC,EACA,QAAAC,EACA,YAAAC,EACA,QAAAC,MACK,+BACP,OAAS,qBAAAC,MAAyB,8BAE3B,MAAMC,EAAa,IAAM,CAC9B,KAAM,CAAE,QAAAC,CAAQ,EAAIF,EAAkB,EAEtC,OACET,EAACC,EAAA,CACC,UAAAF,EAACG,EAAA,CACC,SAAAH,EAAC,UAAO,UAAU,oCAAoC,iBAAK,EAC7D,EACAC,EAACG,EAAA,CACC,iBAAiB,UACjB,UAAU,2EAEV,UAAAJ,EAACK,EAAA,CAAa,UAAU,4BACtB,SAAAL,EAACM,EAAA,CAAY,iBAAK,EACpB,EACAN,EAACO,EAAA,CAAK,UAAU,aACb,SAAAK,EAAQ,YAAY,QAAQ,gBAAgB,IAAI,CAAC,CAAE,IAAAC,EAAK,MAAAC,CAAM,IAC7Db,EAACO,EAAA,CAAS,KAAM,GAAI,UAAU,kDAC5B,UAAAR,EAACS,EAAA,CAAK,UAAU,8CAA+C,SAAAI,EAAI,EACnEb,EAAC,OAAI,UAAU,2BACb,SAAAA,EAACS,EAAA,CACC,UAAU,2CACV,KACEK,GAAO,KAAK,EAAE,YAAY,IAAM,OAC5B,eACAA,GAAO,KAAK,EAAE,YAAY,IAAM,QAC9B,SACAA,EAEV,EACF,GACF,CACD,EACH,GACF,GACF,CAEJ",
|
|
6
|
+
"names": ["jsx", "jsxs", "Dialog", "DialogTrigger", "DialogContent", "DialogHeader", "DialogTitle", "Grid", "GridItem", "Text", "useProductContext", "SpecsModal", "product", "key", "value"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Fragment as ee,jsx as e,jsxs as i}from"react/jsx-runtime";import{useAiuiContext as M}from"../../../../AiuiProvider/index.js";import{Text as D,Picture as T,Badge as j}from"../../../../../components";import{useMemo as V,useState as b,forwardRef as F,useRef as E}from"react";import{Swiper as k,SwiperSlide as N}from"swiper/react";import{Navigation as L,Mousewheel as I,Thumbs as G,Pagination as z}from"swiper/modules";import{cn as y}from"../../../../../helpers/index.js";import{GalleryTabType as R}from"./types.js";import{Content as _,List as O,Root as W,Trigger as Y}from"@radix-ui/react-tabs";import{useProductContext as P}from"../../../ProductProvider.js";import{useVariantMedia as Z}from"../../../hooks/use-variant-media.js";import{SpecsModal as H}from"./components/SpecsModal.js";import K from"./components/CompareModal.js";import{formatPrice as q}from"../../../utils/index.js";const A=t=>i("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[e("rect",{x:"48",y:"48",width:"48",height:"48",rx:"24",transform:"rotate(-180 48 48)",fill:"white"}),e("path",{d:"M25.1035 16.8545C25.5372 16.3818 26.246 16.3818 26.6797 16.8545C27.1067 17.3201 27.1067 18.0706 26.6797 18.5361L21.668 24L26.6797 29.4639C27.1067 29.9294 27.1067 30.6799 26.6797 31.1455C26.246 31.6182 25.5372 31.6182 25.1035 31.1455L19.3203 24.8408C18.8933 24.3752 18.8933 23.6248 19.3203 23.1592L25.1035 16.8545Z",fill:"currentColor"})]}),B=t=>i("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[e("rect",{width:"48",height:"48",rx:"24",transform:"matrix(1 -8.74228e-08 -8.74228e-08 -1 0 48)",fill:"white"}),e("path",{d:"M22.8965 16.8545C22.4628 16.3818 21.754 16.3818 21.3203 16.8545C20.8933 17.3201 20.8933 18.0706 21.3203 18.5361L26.332 24L21.3203 29.4639C20.8933 29.9294 20.8933 30.6799 21.3203 31.1455C21.754 31.6182 22.4628 31.6182 22.8965 31.1455L28.6797 24.8408C29.1067 24.3752 29.1067 23.6248 28.6797 23.1592L22.8965 16.8545Z",fill:"currentColor"})]}),J=()=>{const{copyWriting:t}=M(),{product:o,variant:s,isMobile:v}=P(),a=Z({product:o,variant:s}),[w,h]=b(null),n=s?.metafields?.component?.custom_media_list;let p,u,g,m;n&&n?.available?(p=n?.product||[],u=n?.scenarios||[],g=n?.keyFeatures||[],m=n?.video||[]):(p=a?.productList,u=a?.sceneList,g=a?.keyFeaturesList,m=a?.videoList);const C=V(()=>[...p,...u,...m],[p,u,m]),S={productList:p,sceneList:u,keyFeaturesList:g,videoList:m},c=V(()=>(o?.payload?.components?.find(r=>r.componentKey==="ProductGallery")?.data||[])?.map(r=>({...r,galleries:S[r?.galleries]||[]})).filter(r=>r.galleries.length>0),[o?.payload,S]),l=E({}),[f,x]=b(c?.[0]),$=(d,r)=>{switch(d?.galleryTabType){case R.GALLERY_IMAGE:return e(U,{...d,onCurrentTabLoopEnd:()=>{x(c?.[r])},onCurrentTabLoopStart:()=>{x(c?.[r])},index:r});case R.GALLERY_VIDEO:return e(X,{...d});default:return null}};return e("div",{id:"ipc-product-gallery",children:i(W,{className:"relative",defaultValue:c?.[0]?.tabValue,children:[e("div",{className:"h-[420px] tablet:h-[620px] desktop:rounded-2xl desktop:h-[560px] lg-desktop:h-[700px] bg-[#EAEAEC] desktop:relative ",children:c.map((d,r)=>e(_,{className:"h-full",value:d.tabValue,children:$(d,r)},d.tabValue))}),e(Q,{galleryTabs:c,activeGalleryTab:f,setActiveGalleryTab:x})]})})},Q=({galleryTabs:t,activeGalleryTab:o,setActiveGalleryTab:s})=>{const{product:v}=P();return i("div",{className:"absolute z-[2] bottom-4 left-4 right-4 laptop:left-16 laptop:right-16 flex justify-between items-center tablet:mt-3 desktop:static",children:[e(O,{className:"rounded-full bg-[#EAEAEC] p-1 laptop:p-0 desktop:p-1 overflow-x-auto",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:e("div",{className:"whitespace-nowrap",children:t?.map(a=>e(Y,{className:y("lg-desktop:px-7 lg-desktop:pb-[14px] rounded-full font-bold lg-desktop:pt-[15px] lg-desktop:text-[16px] px-5 pb-[10px] pt-[11px] text-[14px] leading-tight",a.tabValue===o?.tabValue&&"bg-white"),onClick:()=>s(a),value:a.tabValue,children:a.tabLabel},a.tabValue))})}),e("div",{className:"laptop:gap-2 hidden laptop:flex",children:v.metafields?.global?.specifications&&i(ee,{children:[e(H,{})," | ",e(K,{})]})})]})},U=F((t,o)=>{const{locale:s="us",copyWriting:v}=M(),{variant:a,totalSavings:w}=P(),h=E(null),[n,p]=b(null),[u,g]=b(!0),[m,C]=b(!1),[S,c]=b(null);return i("div",{className:"h-full",children:[e(k,{ref:o,className:"h-full",navigation:{nextEl:`.ipc-product-gallery-${t?.id}-custom-swiper-button-next`,prevEl:`.ipc-product-gallery-${t?.id}-custom-swiper-button-prev`},onSwiper:c,onProgress:l=>{g(l.isBeginning),C(l.isEnd)},pagination:{clickable:!0,el:h.current},onSlideChange:l=>{l&&(l.isEnd?t?.onCurrentTabLoopEnd?.():l.isBeginning&&t?.onCurrentTabLoopStart?.())},thumbs:{swiper:n},modules:[I,G,L,z],mousewheel:{forceToAxis:!0},breakpoints:{0:{slidesPerView:1,freeMode:!1}},children:t?.galleries?.map((l,f)=>e(N,{className:"h-full",children:e(T,{source:l?.image?.url,alt:l?.image?.altText,className:"h-full",imgClassName:"object-contain h-full "})},t?.id+"SwiperSlideItem"+f))}),a.availableForSale&&!!w&&!t.index&&e(j,{size:"lg",className:"absolute bg-brand text-white top-3 laptop:left-16 laptop:top-5 left-4 z-[2] desktop:left-6 desktop:top-6",children:`${q({amount:w,currencyCode:a?.price?.currencyCode,locale:s})} ${v?.off}`}),e("div",{className:y("hidden tablet:block tablet:absolute tablet:top-1/2 tablet:left-6 z-10 -translate-y-1/2 cursor-pointer",`ipc-product-gallery-${t?.id}-custom-swiper-button-prev`),children:e(A,{className:"tablet:size-10 lg-desktop:size-12"})}),e("div",{className:y("hidden tablet:block tablet:absolute tablet:top-1/2 tablet:right-6 z-10 -translate-y-1/2 cursor-pointer",`ipc-product-gallery-${t?.id}-custom-swiper-button-next`),children:e(B,{className:"tablet:size-10 lg-desktop:size-12"})}),i("div",{className:"absolute bottom-[94px] tablet:bottom-[70px] left-4 right-4 z-10 items-center tablet:flex justify-between laptop:left-16 laptop:right-16 desktop:bottom-[20px] desktop:right-[6] desktop:left-[6]",children:[e("div",{className:"hidden tablet:block",children:e(k,{className:"flex items-center justify-between",onSwiper:p,spaceBetween:12,slidesPerView:6,freeMode:!0,watchSlidesProgress:!0,modules:[L,G],children:t?.galleries?.map((l,f)=>e(N,{className:"!w-auto [&.swiper-slide-thumb-active]:border [&.swiper-slide-thumb-active]:border-brand",children:e(T,{source:l.image?.url,alt:l.image?.altText,className:"size-10 lg-desktop:size-12 rounded",imgClassName:"object-contain h-full"})},t?.id+"SwiperSlideThumbItem"+f))})}),!t?.index&&i("div",{className:"flex items-center gap-2",children:[e(T,{source:t?.comment?.avatar?.url,className:"size-10 rounded-full shrink-0",imgClassName:"object-cover "}),e(D,{html:t?.comment?.content,className:"text-sm lg-desktop:text-base max-w-[528px] font-bold text-[#6D6D6F] line-clamp-2"})]})]}),e("div",{ref:h,className:"tablet:hidden text-center absolute !bottom-[70px] left-4 right-4 z-10"})]})}),X=t=>i("div",{className:"h-full",children:[e(k,{className:"h-full",navigation:{nextEl:`.ipc-product-gallery-${t?.id}-custom-swiper-button-next`,prevEl:`.ipc-product-gallery-${t?.id}-custom-swiper-button-prev`},modules:[I,G,L,z],mousewheel:{forceToAxis:!0},breakpoints:{0:{slidesPerView:1,freeMode:!1}},children:t?.galleries?.map((o,s)=>e(N,{className:"h-full",children:i("video",{controls:!0,className:"size-full",children:[e("track",{kind:"captions"}),e("source",{src:o?.sources?.[0]?.url,type:"video/mp4"}),e("source",{src:o?.sources?.[0]?.url,type:"video/webm"}),e("source",{src:o?.sources?.[0]?.url,type:"video/ogg"})]})},t?.id+"SwiperSlideItem"+s))}),e("div",{className:y("hidden tablet:block tablet:absolute tablet:top-1/2 tablet:left-6 z-10 -translate-y-1/2 cursor-pointer",`ipc-product-gallery-${t?.id}-custom-swiper-button-prev`),children:e(A,{className:"tablet:size-10 lg-desktop:size-12"})}),e("div",{className:y("hidden tablet:block tablet:absolute tablet:top-1/2 tablet:right-6 z-10 -translate-y-1/2 cursor-pointer",`ipc-product-gallery-${t?.id}-custom-swiper-button-next`),children:e(B,{className:"tablet:size-10 lg-desktop:size-12"})})]}),ye=t=>e("div",{children:"3D View"});var ve=J;export{ve as default};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../src/biz-components/Listing/components/ProductCard/ProductGallery/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import { useAiuiContext } from '../../../../AiuiProvider/index.js'\nimport { Text, Picture, Button, Badge } from '../../../../../components'\nimport {\n useCallback,\n useMemo,\n useState,\n forwardRef,\n useRef,\n type RefObject,\n useEffect,\n type Dispatch,\n type SetStateAction,\n} from 'react'\nimport { Swiper, SwiperSlide, type SwiperRef } from 'swiper/react'\nimport { Navigation, Mousewheel, Thumbs, Pagination } from 'swiper/modules'\nimport { cn } from '../../../../../helpers/index.js'\nimport { GalleryTabType } from './types.js'\nimport { Content, List, Root, Trigger } from '@radix-ui/react-tabs'\nimport { useProductContext } from '../../../ProductProvider.js'\nimport { useVariantMedia } from '../../../hooks/use-variant-media.js'\nimport { SpecsModal } from './components/SpecsModal.js'\nimport CompareModal from './components/CompareModal.js'\nimport { formatPrice } from '../../../utils/index.js'\n\nimport type { Swiper as SwiperType } from 'swiper'\nimport type { ImageMedia, VideoMedia } from '../../../hooks/use-variant-media.js'\nimport type { ProductGalleryProps, ProductGalleryTabItemProps, GalleryTabItemProps } from './types.js'\n\nconst SwiperLeftButtonIcon = (props: React.SVGProps<SVGSVGElement>) => {\n return (\n <svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <rect x=\"48\" y=\"48\" width=\"48\" height=\"48\" rx=\"24\" transform=\"rotate(-180 48 48)\" fill=\"white\" />\n <path\n d=\"M25.1035 16.8545C25.5372 16.3818 26.246 16.3818 26.6797 16.8545C27.1067 17.3201 27.1067 18.0706 26.6797 18.5361L21.668 24L26.6797 29.4639C27.1067 29.9294 27.1067 30.6799 26.6797 31.1455C26.246 31.6182 25.5372 31.6182 25.1035 31.1455L19.3203 24.8408C18.8933 24.3752 18.8933 23.6248 19.3203 23.1592L25.1035 16.8545Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n}\n\nconst SwiperRightButtonIcon = (props: React.SVGProps<SVGSVGElement>) => {\n return (\n <svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <rect width=\"48\" height=\"48\" rx=\"24\" transform=\"matrix(1 -8.74228e-08 -8.74228e-08 -1 0 48)\" fill=\"white\" />\n <path\n d=\"M22.8965 16.8545C22.4628 16.3818 21.754 16.3818 21.3203 16.8545C20.8933 17.3201 20.8933 18.0706 21.3203 18.5361L26.332 24L21.3203 29.4639C20.8933 29.9294 20.8933 30.6799 21.3203 31.1455C21.754 31.6182 22.4628 31.6182 22.8965 31.1455L28.6797 24.8408C29.1067 24.3752 29.1067 23.6248 28.6797 23.1592L22.8965 16.8545Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n}\n\nconst ProductGallery = () => {\n const { copyWriting } = useAiuiContext()\n const { product, variant, isMobile } = useProductContext()\n const defaultMediaData = useVariantMedia({ product, variant })\n const [swiper, setSwiper] = useState<SwiperType | null>(null)\n\n const customMediaList = variant?.metafields?.component?.custom_media_list\n let productList: ImageMedia[], sceneList: ImageMedia[], keyFeaturesList: ImageMedia[], videoList: VideoMedia[]\n\n if (customMediaList && customMediaList?.available) {\n productList = customMediaList?.product || []\n sceneList = customMediaList?.scenarios || []\n keyFeaturesList = customMediaList?.keyFeatures || []\n videoList = customMediaList?.video || []\n } else {\n productList = defaultMediaData?.productList\n sceneList = defaultMediaData?.sceneList\n keyFeaturesList = defaultMediaData?.keyFeaturesList\n videoList = defaultMediaData?.videoList\n }\n\n const allMedia = useMemo(() => [...productList, ...sceneList, ...videoList], [productList, sceneList, videoList])\n\n const galleryMap: Record<string, ImageMedia[] | VideoMedia[]> = {\n productList: productList,\n sceneList: sceneList,\n keyFeaturesList: keyFeaturesList,\n videoList: videoList,\n }\n\n const galleryTabs = useMemo(() => {\n const productTab =\n product?.payload?.components?.find((item: any) => item.componentKey === 'ProductGallery')?.data || []\n\n return productTab\n ?.map((item: any) => ({\n ...item,\n galleries: galleryMap[item?.galleries] || [],\n }))\n .filter((item: any) => item.galleries.length > 0)\n }, [product?.payload, galleryMap])\n\n // \u4E3A\u6BCF\u4E2A galleryTab \u521B\u5EFA\u5BF9\u5E94\u7684 ref\n const gallerySwiperRefs = useRef<{ [key: string]: SwiperRef | null }>({})\n\n const [activeGalleryTab, setActiveGalleryTab] = useState<GalleryTabItemProps>(galleryTabs?.[0])\n\n // \u4E3A\u6BCF\u4E2A tab \u6E32\u67D3\u5BF9\u5E94\u7684\u7EC4\u4EF6\n const renderGalleryForTab = (tab: any, index: number) => {\n switch (tab?.galleryTabType) {\n case GalleryTabType.GALLERY_IMAGE:\n return (\n <ProductGalleryTabImage\n {...tab}\n onCurrentTabLoopEnd={() => {\n setActiveGalleryTab(galleryTabs?.[index])\n }}\n onCurrentTabLoopStart={() => {\n setActiveGalleryTab(galleryTabs?.[index])\n }}\n index={index}\n />\n )\n case GalleryTabType.GALLERY_VIDEO:\n return <ProductGalleryTabVideo {...tab} />\n // case GalleryTabType.GALLERY_3D_VIEW:\n // return <ProductGalleryTab3DView {...item} />\n default:\n return null\n }\n }\n\n return (\n <div id=\"ipc-product-gallery\">\n <Root className=\"relative\" defaultValue={galleryTabs?.[0]?.tabValue}>\n {/* <Swiper\n className=\"h-[420px] laptop:h-[700px] bg-[#EAEAEC] rounded-2xl\"\n onSwiper={setSwiper}\n loop={true}\n // onProgress={swiper => {\n // setStart(swiper.isBeginning)\n // setEnd(swiper.isEnd)\n // }}\n modules={[Mousewheel]}\n mousewheel={{\n forceToAxis: true,\n }}\n >\n {galleryTabs.map((item, index) => {\n return (\n <Content forceMount key={item.tabValue} value={item.tabValue}>\n <SwiperSlide key={index}>{renderGalleryForTab(activeGalleryTab)}</SwiperSlide>\n </Content>\n )\n })}\n </Swiper>\n <div\n className={cn(\n 'absolute top-1/2 left-6 z-10 -translate-y-1/2 cursor-pointer',\n `ipc-product-gallery-custom-swiper-button-prev`\n )}\n >\n <SwiperLeftButtonIcon\n className=\"size-12\"\n onClick={() => {\n if (activeGalleryTab?.tabValue) {\n const currentRef = gallerySwiperRefs.current[activeGalleryTab.tabValue]\n currentRef?.swiper?.slidePrev()\n }\n }}\n />\n </div>\n <div\n className={cn(\n 'absolute top-1/2 right-6 z-10 -translate-y-1/2 cursor-pointer',\n `ipc-product-gallery-custom-swiper-button-next`\n )}\n >\n <SwiperRightButtonIcon\n className=\"size-12\"\n onClick={() => {\n if (activeGalleryTab?.tabValue) {\n const currentRef = gallerySwiperRefs.current[activeGalleryTab.tabValue]\n currentRef?.swiper?.slideNext()\n }\n }}\n />\n </div> */}\n <div className=\"h-[420px] tablet:h-[620px] desktop:rounded-2xl desktop:h-[560px] lg-desktop:h-[700px] bg-[#EAEAEC] desktop:relative \">\n {galleryTabs.map((item: any, index: number) => {\n return (\n <Content key={item.tabValue} className=\"h-full\" value={item.tabValue}>\n {renderGalleryForTab(item, index)}\n </Content>\n )\n })}\n </div>\n <ProductGalleryTab\n galleryTabs={galleryTabs}\n activeGalleryTab={activeGalleryTab}\n setActiveGalleryTab={setActiveGalleryTab}\n />\n </Root>\n </div>\n )\n}\n\nconst ProductGalleryTab = ({\n galleryTabs,\n activeGalleryTab,\n setActiveGalleryTab,\n}: {\n galleryTabs: GalleryTabItemProps[]\n activeGalleryTab: GalleryTabItemProps\n setActiveGalleryTab: Dispatch<SetStateAction<GalleryTabItemProps>>\n}) => {\n const { product } = useProductContext()\n return (\n <div className=\"absolute z-[2] bottom-4 left-4 right-4 laptop:left-16 laptop:right-16 flex justify-between items-center tablet:mt-3 desktop:static\">\n <List\n className=\"rounded-full bg-[#EAEAEC] p-1 laptop:p-0 desktop:p-1 overflow-x-auto\"\n style={{\n scrollbarWidth: 'none',\n msOverflowStyle: 'none',\n }}\n >\n <div className=\"whitespace-nowrap\">\n {galleryTabs?.map(item => {\n return (\n <Trigger\n className={cn(\n 'lg-desktop:px-7 lg-desktop:pb-[14px] rounded-full font-bold lg-desktop:pt-[15px] lg-desktop:text-[16px] px-5 pb-[10px] pt-[11px] text-[14px] leading-tight',\n item.tabValue === activeGalleryTab?.tabValue && 'bg-white'\n )}\n onClick={() => setActiveGalleryTab(item)}\n key={item.tabValue}\n value={item.tabValue}\n >\n {item.tabLabel}\n </Trigger>\n )\n })}\n </div>\n </List>\n <div className=\"laptop:gap-2 hidden laptop:flex\">\n {product.metafields?.global?.specifications && (\n <>\n <SpecsModal /> | <CompareModal />\n </>\n )}\n </div>\n </div>\n )\n}\n\nconst ProductGalleryTabImage = forwardRef<SwiperRef, ProductGalleryTabItemProps>((props, ref) => {\n const { locale = 'us', copyWriting } = useAiuiContext()\n const { variant, totalSavings } = useProductContext()\n const paginationRef = useRef<HTMLDivElement>(null)\n const [thumbsSwiper, setThumbsSwiper] = useState<SwiperType | null>(null)\n const [isStart, setStart] = useState(true)\n const [isEnd, setEnd] = useState(false)\n const [swiper, setSwiper] = useState<SwiperType | null>(null)\n\n return (\n <div className=\"h-full\">\n <Swiper\n ref={ref}\n className=\"h-full\"\n navigation={{\n nextEl: `.ipc-product-gallery-${props?.id}-custom-swiper-button-next`,\n prevEl: `.ipc-product-gallery-${props?.id}-custom-swiper-button-prev`,\n }}\n onSwiper={setSwiper}\n onProgress={swiper => {\n setStart(swiper.isBeginning)\n setEnd(swiper.isEnd)\n }}\n pagination={{\n clickable: true,\n el: paginationRef.current,\n }}\n onSlideChange={swiper => {\n if (swiper) {\n if (swiper.isEnd) {\n props?.onCurrentTabLoopEnd?.()\n } else if (swiper.isBeginning) {\n props?.onCurrentTabLoopStart?.()\n }\n }\n }}\n thumbs={{ swiper: thumbsSwiper }}\n modules={[Mousewheel, Thumbs, Navigation, Pagination]}\n mousewheel={{\n forceToAxis: true,\n }}\n breakpoints={{\n 0: {\n slidesPerView: 1,\n freeMode: false,\n },\n }}\n >\n {props?.galleries?.map((item, jIndex) => {\n return (\n <SwiperSlide className=\"h-full\" key={props?.id + 'SwiperSlideItem' + jIndex}>\n <Picture\n source={item?.image?.url}\n alt={item?.image?.altText}\n className=\"h-full\"\n imgClassName=\"object-contain h-full \"\n />\n </SwiperSlide>\n )\n })}\n </Swiper>\n {variant.availableForSale && !!totalSavings && !props.index && (\n <Badge\n size=\"lg\"\n className=\"absolute bg-brand text-white top-3 laptop:left-16 laptop:top-5 left-4 z-[2] desktop:left-6 desktop:top-6\"\n >\n {`${formatPrice({\n amount: totalSavings,\n currencyCode: variant?.price?.currencyCode,\n locale: locale,\n })} ${copyWriting?.off}`}\n </Badge>\n )}\n <div\n className={cn(\n 'hidden tablet:block tablet:absolute tablet:top-1/2 tablet:left-6 z-10 -translate-y-1/2 cursor-pointer',\n `ipc-product-gallery-${props?.id}-custom-swiper-button-prev`\n )}\n >\n <SwiperLeftButtonIcon className=\"tablet:size-10 lg-desktop:size-12\" />\n </div>\n <div\n className={cn(\n 'hidden tablet:block tablet:absolute tablet:top-1/2 tablet:right-6 z-10 -translate-y-1/2 cursor-pointer',\n `ipc-product-gallery-${props?.id}-custom-swiper-button-next`\n )}\n >\n <SwiperRightButtonIcon className=\"tablet:size-10 lg-desktop:size-12\" />\n </div>\n {/* {props?.galleries?.map((item, jIndex) => {\n return (\n <Picture\n key={props?.id + 'SwiperSlideItem' + jIndex}\n source={item?.image?.url}\n alt={item?.image?.altText}\n className=\"h-full\"\n imgClassName=\"object-cover h-full\"\n />\n )\n })} */}\n <div className=\"absolute bottom-[94px] tablet:bottom-[70px] left-4 right-4 z-10 items-center tablet:flex justify-between laptop:left-16 laptop:right-16 desktop:bottom-[20px] desktop:right-[6] desktop:left-[6]\">\n <div className=\"hidden tablet:block\">\n <Swiper\n className=\"flex items-center justify-between\"\n onSwiper={setThumbsSwiper}\n spaceBetween={12}\n slidesPerView={6}\n freeMode={true}\n watchSlidesProgress={true}\n modules={[Navigation, Thumbs]}\n >\n {props?.galleries?.map((item, jIndex) => (\n <SwiperSlide\n key={props?.id + 'SwiperSlideThumbItem' + jIndex}\n className=\"!w-auto [&.swiper-slide-thumb-active]:border [&.swiper-slide-thumb-active]:border-brand\"\n >\n <Picture\n source={item.image?.url}\n alt={item.image?.altText}\n className=\"size-10 lg-desktop:size-12 rounded\"\n imgClassName=\"object-contain h-full\"\n />\n </SwiperSlide>\n ))}\n </Swiper>\n </div>\n {!props?.index && (\n <div className=\"flex items-center gap-2\">\n <Picture\n source={props?.comment?.avatar?.url}\n className=\"size-10 rounded-full shrink-0\"\n imgClassName=\"object-cover \"\n />\n <Text\n html={props?.comment?.content}\n className=\"text-sm lg-desktop:text-base max-w-[528px] font-bold text-[#6D6D6F] line-clamp-2\"\n />\n </div>\n )}\n </div>\n <div ref={paginationRef} className=\"tablet:hidden text-center absolute !bottom-[70px] left-4 right-4 z-10\" />\n </div>\n )\n})\n\nconst ProductGalleryTabVideo = (props: ProductGalleryTabItemProps) => {\n return (\n <div className=\"h-full\">\n <Swiper\n className=\"h-full\"\n navigation={{\n nextEl: `.ipc-product-gallery-${props?.id}-custom-swiper-button-next`,\n prevEl: `.ipc-product-gallery-${props?.id}-custom-swiper-button-prev`,\n }}\n modules={[Mousewheel, Thumbs, Navigation, Pagination]}\n mousewheel={{\n forceToAxis: true,\n }}\n breakpoints={{\n 0: {\n slidesPerView: 1,\n freeMode: false,\n },\n }}\n >\n {props?.galleries?.map((item, jIndex) => {\n return (\n <SwiperSlide className=\"h-full\" key={props?.id + 'SwiperSlideItem' + jIndex}>\n <video controls className=\"size-full\">\n <track kind=\"captions\" />\n <source src={item?.sources?.[0]?.url} type=\"video/mp4\" />\n <source src={item?.sources?.[0]?.url} type=\"video/webm\" />\n <source src={item?.sources?.[0]?.url} type=\"video/ogg\" />\n </video>\n </SwiperSlide>\n )\n })}\n </Swiper>\n <div\n className={cn(\n 'hidden tablet:block tablet:absolute tablet:top-1/2 tablet:left-6 z-10 -translate-y-1/2 cursor-pointer',\n `ipc-product-gallery-${props?.id}-custom-swiper-button-prev`\n )}\n >\n <SwiperLeftButtonIcon className=\"tablet:size-10 lg-desktop:size-12\" />\n </div>\n <div\n className={cn(\n 'hidden tablet:block tablet:absolute tablet:top-1/2 tablet:right-6 z-10 -translate-y-1/2 cursor-pointer',\n `ipc-product-gallery-${props?.id}-custom-swiper-button-next`\n )}\n >\n <SwiperRightButtonIcon className=\"tablet:size-10 lg-desktop:size-12\" />\n </div>\n </div>\n )\n}\n\nconst ProductGalleryTab3DView = (props: ProductGalleryTabItemProps) => {\n return <div>3D View</div>\n}\n\nexport default ProductGallery\n"],
|
|
5
|
+
"mappings": "AA8BI,OAgNM,YAAAA,GA/MJ,OAAAC,EADF,QAAAC,MAAA,oBA9BJ,OAAS,kBAAAC,MAAsB,oCAC/B,OAAS,QAAAC,EAAM,WAAAC,EAAiB,SAAAC,MAAa,4BAC7C,OAEE,WAAAC,EACA,YAAAC,EACA,cAAAC,EACA,UAAAC,MAKK,QACP,OAAS,UAAAC,EAAQ,eAAAC,MAAmC,eACpD,OAAS,cAAAC,EAAY,cAAAC,EAAY,UAAAC,EAAQ,cAAAC,MAAkB,iBAC3D,OAAS,MAAAC,MAAU,kCACnB,OAAS,kBAAAC,MAAsB,aAC/B,OAAS,WAAAC,EAAS,QAAAC,EA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ACvD9C,EAAC,UAAO,IAAK8C,GAAM,UAAU,CAAC,GAAG,IAAK,KAAK,aAAa,EACxD9C,EAAC,UAAO,IAAK8C,GAAM,UAAU,CAAC,GAAG,IAAK,KAAK,YAAY,GACzD,GANmClB,GAAO,GAAK,kBAAoBsC,CAOrE,CAEH,EACH,EACAlE,EAAC,OACC,UAAWgB,EACT,wGACA,uBAAuBY,GAAO,EAAE,4BAClC,EAEA,SAAA5B,EAAC2B,EAAA,CAAqB,UAAU,oCAAoC,EACtE,EACA3B,EAAC,OACC,UAAWgB,EACT,yGACA,uBAAuBY,GAAO,EAAE,4BAClC,EAEA,SAAA5B,EAAC6B,EAAA,CAAsB,UAAU,oCAAoC,EACvE,GACF,EAIEsC,GAA2BvC,GACxB5B,EAAC,OAAI,mBAAO,EAGrB,IAAOoE,GAAQtC",
|
|
6
|
+
"names": ["Fragment", "jsx", "jsxs", "useAiuiContext", "Text", "Picture", "Badge", "useMemo", "useState", "forwardRef", "useRef", "Swiper", "SwiperSlide", "Navigation", "Mousewheel", "Thumbs", "Pagination", "cn", "GalleryTabType", "Content", "List", "Root", "Trigger", "useProductContext", "useVariantMedia", "SpecsModal", "CompareModal", "formatPrice", "SwiperLeftButtonIcon", "props", "SwiperRightButtonIcon", "ProductGallery", "copyWriting", "product", "variant", "isMobile", "defaultMediaData", "swiper", "setSwiper", "customMediaList", "productList", "sceneList", "keyFeaturesList", "videoList", "allMedia", "galleryMap", "galleryTabs", "item", "gallerySwiperRefs", "activeGalleryTab", "setActiveGalleryTab", "renderGalleryForTab", "tab", "index", "ProductGalleryTabImage", "ProductGalleryTabVideo", "ProductGalleryTab", "ref", "locale", "totalSavings", "paginationRef", "thumbsSwiper", "setThumbsSwiper", "isStart", "setStart", "isEnd", "setEnd", "jIndex", "ProductGalleryTab3DView", "ProductGallery_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../src/biz-components/Listing/components/ProductCard/ProductGallery/types.ts"],
|
|
4
|
+
"sourcesContent": ["import type { Img, Video } from '../../../../../types/props.js'\nimport type { ImageMedia, VideoMedia } from '../../../hooks/use-variant-media.js'\n\nexport interface ProductGalleryProps {\n data: {\n gallerySections: {\n title: string\n }[]\n }\n}\n\nexport interface ProductGalleryTabItemProps {\n index: number\n galleryTabType: GalleryTabType\n galleries: ImageMedia[] | VideoMedia[]\n onCurrentTabLoopStart?: () => void\n onCurrentTabLoopEnd?: () => void\n id: string\n comment?: {\n content: string\n avatar: Img\n }\n tabLabel: string\n tabValue: string\n // galleryImgs?: Img[]\n // galleryVideo?: Video\n // gallery3DView?: Video\n}\n\nexport interface GalleryTabItemProps {\n tabLabel: string\n tabValue: string\n id: string\n galleryTabType: GalleryTabType\n galleries: ImageMedia[] | VideoMedia[]\n}[]\n\nexport enum GalleryTabType {\n GALLERY_IMAGE = 'ipc-gallery-tab-image',\n GALLERY_VIDEO = 'ipc-gallery-tab-video',\n GALLERY_3D_VIEW = 'ipc-gallery-tab-3d-view',\n}\n"],
|
|
5
|
+
"mappings": "AAqCO,IAAKA,OACVA,EAAA,cAAgB,wBAChBA,EAAA,cAAgB,wBAChBA,EAAA,gBAAkB,0BAHRA,OAAA",
|
|
6
|
+
"names": ["GalleryTabType"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as o,jsxs as e}from"react/jsx-runtime";import{Grid as s,GridItem as t}from"../../../../components";const c=({BoxLeftGallery:a,BoxRightDetail:p,BoxBottomSummary:d})=>e("div",{id:"ipc-product-card",className:"desktop:mt-6 desktop:px-16 lg-desktop:px-[calc(50%-832px)]",children:[e(s,{className:"laptop:gap-6",children:[o(t,{className:"col-span-12 tablet:px-8 laptop:px-0 desktop:col-start-1 desktop:col-span-8 desktop:sticky desktop:top-[124px] h-fit",children:a}),o(t,{className:"col-span-12 desktop:col-start-9 desktop:col-span-4",children:p})]}),d]});var r=c;export{r as default};
|
|
2
|
+
//# sourceMappingURL=ProductGridBox.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/biz-components/Listing/components/ProductCard/ProductGridBox.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Grid, GridItem } from '../../../../components'\n\nconst ProductGridBox = ({\n BoxLeftGallery,\n BoxRightDetail,\n BoxBottomSummary,\n}: {\n BoxLeftGallery: React.ReactNode\n BoxRightDetail: React.ReactNode\n BoxBottomSummary: React.ReactNode\n}) => {\n return (\n <div id=\"ipc-product-card\" className=\"desktop:mt-6 desktop:px-16 lg-desktop:px-[calc(50%-832px)]\">\n <Grid className=\"laptop:gap-6\">\n <GridItem className=\"col-span-12 tablet:px-8 laptop:px-0 desktop:col-start-1 desktop:col-span-8 desktop:sticky desktop:top-[124px] h-fit\">\n {BoxLeftGallery}\n </GridItem>\n <GridItem className=\"col-span-12 desktop:col-start-9 desktop:col-span-4\">{BoxRightDetail}</GridItem>\n </Grid>\n {BoxBottomSummary}\n </div>\n )\n}\n\nexport default ProductGridBox\n"],
|
|
5
|
+
"mappings": "AAaM,OACE,OAAAA,EADF,QAAAC,MAAA,oBAbN,OAAS,QAAAC,EAAM,YAAAC,MAAgB,yBAE/B,MAAMC,EAAiB,CAAC,CACtB,eAAAC,EACA,eAAAC,EACA,iBAAAC,CACF,IAMIN,EAAC,OAAI,GAAG,mBAAmB,UAAU,6DACnC,UAAAA,EAACC,EAAA,CAAK,UAAU,eACd,UAAAF,EAACG,EAAA,CAAS,UAAU,sHACjB,SAAAE,EACH,EACAL,EAACG,EAAA,CAAS,UAAU,qDAAsD,SAAAG,EAAe,GAC3F,EACCC,GACH,EAIJ,IAAOC,EAAQJ",
|
|
6
|
+
"names": ["jsx", "jsxs", "Grid", "GridItem", "ProductGridBox", "BoxLeftGallery", "BoxRightDetail", "BoxBottomSummary", "ProductGridBox_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{Text as s,Button as g,Grid as I,GridItem as G,Picture as N,Heading as L}from"../../../../../components";import{useProductContext as y}from"../../../ProductProvider";import{useEffect as R,useMemo as A,useState as O}from"react";import{formatPrice as f}from"../../../utils";import{useAiuiContext as C}from"../../../../AiuiProvider";import{cn as F}from"../../../../../helpers";import V from"decimal.js";const S=({})=>{const{locale:d="us",copyWriting:a}=C(),{product:l,variant:o,finalPrice:p,comparePrice:m,coupon:n,selectedOptions:c,onAddToCart:k,onBuyNow:h,savingDetail:b,joinedRecommendBuyProducts:i,setJoinedRecommendBuyProducts:u}=y();if(!o.availableForSale)return null;const{bundleVariant:B,giftVariant:w}=$()||{},[r,v]=O();R(()=>{v({bundle:i.bundle?void 0:B,gift:i.gift?void 0:w})},[B,w,i]);const D=A(()=>new V(m).minus(b.freeGift).toNumber(),[m,b]);return e("div",{className:"ipc-product-summary bg-[#F5F5F7] mt-16",children:t(I,{className:"px-4 py-6 tablet:p-8",children:[t(G,{className:"col-span-12 desktop:col-start-1 desktop:col-span-5",children:[e(L,{className:"font-bold text-[24px] lg-desktop:text-[48px] laptop:text-[32px] desktop:text-[40px] leading-[1] mb-4 [&>span]:text-[#D1D1D1]",html:`${l.title} is ready <br/><span>Just the way you want it.</span>`}),e("div",{className:"aspect-[644/320]",children:e(N,{source:o.image?.url||l?.images?.[0]?.url,className:"h-full w-full",imgClassName:"object-contain h-full"})})]}),t(G,{className:"col-span-12 mt-8 desktop:col-start-7 laptop:mt-0 desktop:col-span-6 flex flex-col gap-6 justify-between",children:[t("div",{children:[t("div",{className:"flex flex-col gap-4",children:[t("div",{className:"flex items-center justify-between",children:[t("div",{className:"shrink-0 flex items-center gap-4",children:[e(N,{source:o.image?.url||l?.images?.[0]?.url,className:"size-16 object-cover"}),t("div",{className:"flex flex-col gap-[6px] max-w-[178px] tablet:max-w-none",children:[e(s,{className:"font-bold text-[14px] desktop:text-[16px] lg-desktop:text-[18px]",html:l.title}),e(s,{className:"text-[12px] laptop:text-[14px] desktop:text-[18px] font-bold text-[#6D6D6F]",html:`x1 | ${c.color||c.colour||c.couleur}`})]})]}),t("div",{className:"flex items-center gap-1",children:[e(s,{className:"text-base desktop:text-2xl font-bold",html:f({amount:p,currencyCode:o.price.currencyCode,locale:d})}),n&&e(s,{className:"text-base desktop:text-2xl font-bold line-through text-[#6D6D6F]",html:f({amount:D,currencyCode:o.price.currencyCode,locale:d})})]})]}),i?.gift&&e(z,{giftOperation:x=>{u?.({...i,gift:void 0}),v?.({...r,gift:x})},giftStatus:!!i?.gift,gift:i?.gift}),i?.bundle&&e(j,{bundleOperation:x=>{u?.({...i,bundle:void 0}),v?.({...r,bundle:x})},bundleStatus:!!i?.bundle,bundleListItem:i?.bundle})]}),(r?.bundle||r?.gift)&&t("div",{className:"mt-6",children:[e(s,{className:"text-sm desktop:text-[18px] font-bold",html:"Recommend Buy"}),t("div",{className:"flex flex-col gap-6 mt-6",children:[r?.gift&&e(z,{giftOperation:x=>{u?.({...i,gift:x}),v?.({...r,gift:void 0})},giftStatus:!r?.gift,gift:r?.gift}),r?.bundle&&e(j,{bundleOperation:x=>{u?.({...i,bundle:x}),v?.({...r,bundle:void 0})},bundleStatus:!r?.bundle,bundleListItem:r?.bundle})]})]})]}),t("div",{className:"text-right",children:[e(s,{className:"laptop:text-xl desktop:text-2xl font-bold text-right",html:`${a?.totalPrice} ${f({amount:p,currencyCode:o.price.currencyCode,locale:d})}`}),n&&e(s,{className:"text-base desktop:text-2xl ml-1 font-bold line-through text-[#6D6D6F]",html:f({amount:D,currencyCode:o.price.currencyCode,locale:d})}),t("div",{className:"flex gap-3 mt-2",children:[e(g,{size:"lg",variant:"secondary",className:"w-1/2",onClick:()=>k?.(),children:a?.addToCart}),e(g,{size:"lg",variant:"primary",className:"w-1/2",onClick:()=>h?.(),children:a?.shopNow})]})]})]})]})})},$=()=>{const{bundle:d,variant:a,checkedBundle:l,freeGift:o,checkedGift:p}=y();let m,n;const{bundleList:c}=d||{},{giftList:k=[]}=o||{},h=c?.filter(u=>u.variants.slice(1,u.variants.length).every(P=>P.variant.availableForSale))||[],[b]=h;m=l||b;const[i]=k?.filter(u=>u.availableForSale);return n=p||i,{bundleVariant:m,giftVariant:n}},j=({bundleOperation:d,bundleStatus:a,bundleListItem:l})=>{const{locale:o="us"}=C(),{variant:p,setCheckedBundle:m}=y(),n=l?.variants.filter(c=>c.variant.sku!==p.sku);return t("div",{className:"flex items-center justify-between",children:[n?.map(c=>t("div",{className:"flex items-center gap-4",children:[e(N,{source:c?.variant?.image?.url,className:"size-16 object-cover"}),e("div",{className:"flex flex-col gap-[6px] max-w-[178px] tablet:max-w-none",children:e(s,{className:"font-bold text-[14px] desktop:text-[16px] lg-desktop:text-[18px]",html:c.variant.product.title})})]},c.variant.id)),t("div",{className:"flex flex-col items-end gap-1 justify-center",children:[a&&e(s,{className:"text-base desktop:text-2xl font-bold",html:f({amount:n[0]?.price,locale:o,currencyCode:n[0]?.variant?.price?.currencyCode})}),e(g,{size:a?"icon":"lg",variant:a?"link":"primary",onClick:()=>{m?.(a?void 0:l),d(l)},className:F("shrink-0 size-auto",{underline:a}),children:a?"Remove":"Add +"})]})]})},z=({giftOperation:d,giftStatus:a,gift:l})=>{const{locale:o="us"}=C(),{freeGift:p,setCheckedGift:m}=y(),{freeLabel:n}=p||{};return t("div",{className:"flex items-center justify-between",children:[t("div",{className:"flex items-center gap-4",children:[e(N,{source:l?.image?.url,className:"size-16 object-cover"}),t("div",{className:"flex flex-col gap-[6px] max-w-[178px] tablet:max-w-none",children:[e(s,{className:"font-bold text-[14px] desktop:text-[16px] lg-desktop:text-[18px]",html:l?.product?.title}),e(s,{className:"text-[12px] laptop:text-[14px] desktop:text-[18px] font-bold text-[#6D6D6F]",html:`x1 | ${n}`})]})]}),t("div",{className:"flex flex-col items-end gap-2 justify-center",children:[a&&t("div",{className:"flex items-center gap-1",children:[e(s,{className:"text-base desktop:text-2xl font-bold",html:n}),e(s,{className:"text-base desktop:text-2xl font-bold line-through text-[#6D6D6F]",html:f({amount:l.price.amount,locale:o,currencyCode:l.price.currencyCode})})]}),e(g,{size:a?"icon":"lg",variant:a?"link":"primary",onClick:()=>{m?.(a?void 0:l),d(l)},className:F("shrink-0 size-auto",{underline:a}),children:a?"Remove":"Add +"})]})]})};var Q=S;export{Q as default};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|