@anker-in/headless-ui 1.0.19-temp-101406 → 1.0.19-temp-101408
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/CollectionsFilters/FilterCardWrap.js +1 -1
- package/dist/cjs/biz-components/CollectionsFilters/FilterCardWrap.js.map +3 -3
- package/dist/cjs/biz-components/CollectionsFilters/component/filtersFun.js.map +1 -1
- 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 +1 -2
- 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/HeaderNavigation/NavProvider.d.ts +5 -6
- 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/index.d.ts +1 -2
- 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 +2 -16
- 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/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
- package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +2 -2
- 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/shelfDisplay.js +1 -1
- package/dist/cjs/biz-components/ShelfDisplay/shelfDisplay.js.map +2 -2
- 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/Subscribe/index.d.ts +1 -7
- package/dist/cjs/biz-components/Subscribe/index.js +1 -1
- package/dist/cjs/biz-components/Subscribe/index.js.map +3 -3
- 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 +1 -3
- 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 +0 -25
- 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/container.js +1 -1
- package/dist/cjs/components/container.js.map +2 -2
- package/dist/cjs/components/dialog.d.ts +1 -3
- package/dist/cjs/components/dialog.js +1 -1
- package/dist/cjs/components/dialog.js.map +3 -3
- package/dist/cjs/components/index.d.ts +0 -1
- package/dist/cjs/components/index.js +1 -1
- package/dist/cjs/components/index.js.map +3 -3
- package/dist/cjs/helpers/utils.d.ts +0 -1
- package/dist/cjs/helpers/utils.js +1 -1
- package/dist/cjs/helpers/utils.js.map +3 -3
- package/dist/cjs/stories/shelfDisplay.stories.js +1 -644
- 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/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/esm/biz-components/AccordionCards/index.js.map +2 -2
- 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/component/filtersFun.js.map +1 -1
- 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 +1 -2
- 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/HeaderNavigation/NavProvider.d.ts +5 -6
- 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/index.d.ts +1 -2
- 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 +2 -16
- 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/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
- package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +2 -2
- 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/shelfDisplay.js +1 -1
- package/dist/esm/biz-components/ShelfDisplay/shelfDisplay.js.map +2 -2
- 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/Subscribe/index.d.ts +1 -7
- package/dist/esm/biz-components/Subscribe/index.js +1 -1
- package/dist/esm/biz-components/Subscribe/index.js.map +3 -3
- 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 +1 -3
- package/dist/esm/biz-components/index.d.ts +0 -25
- 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/container.js +1 -1
- package/dist/esm/components/container.js.map +2 -2
- package/dist/esm/components/dialog.d.ts +1 -3
- package/dist/esm/components/dialog.js +1 -1
- package/dist/esm/components/dialog.js.map +3 -3
- package/dist/esm/components/index.d.ts +0 -1
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/index.js.map +2 -2
- package/dist/esm/helpers/utils.d.ts +0 -1
- package/dist/esm/helpers/utils.js +1 -1
- package/dist/esm/helpers/utils.js.map +3 -3
- package/dist/esm/stories/shelfDisplay.stories.js +1 -644
- 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/esm/tsconfig.tsbuildinfo +1 -1
- package/dist/tokens/base.css +1 -1
- package/package.json +1 -1
- package/style.css +0 -4
- package/dist/cjs/biz-components/AplusDesc/index.js +0 -2
- package/dist/cjs/biz-components/AplusDesc/index.js.map +0 -7
- package/dist/cjs/biz-components/DownLoad/index.js +0 -2
- package/dist/cjs/biz-components/DownLoad/index.js.map +0 -7
- package/dist/cjs/biz-components/Features/index.js +0 -2
- package/dist/cjs/biz-components/Features/index.js.map +0 -7
- package/dist/cjs/biz-components/FootCharger/index.js +0 -2
- package/dist/cjs/biz-components/FootCharger/index.js.map +0 -7
- package/dist/cjs/biz-components/GiftBox/index.js +0 -2
- package/dist/cjs/biz-components/GiftBox/index.js.map +0 -7
- package/dist/cjs/biz-components/GraphicMore/index.js +0 -2
- package/dist/cjs/biz-components/GraphicMore/index.js.map +0 -7
- package/dist/cjs/biz-components/HeaderNavigation/icons/Polygon.js +0 -2
- package/dist/cjs/biz-components/HeaderNavigation/icons/Polygon.js.map +0 -7
- package/dist/cjs/biz-components/Listing/ProductProvider.js +0 -2
- package/dist/cjs/biz-components/Listing/ProductProvider.js.map +0 -7
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js +0 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js.map +0 -7
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js +0 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +0 -7
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js +0 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js.map +0 -7
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js +0 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js.map +0 -7
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js +0 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js.map +0 -7
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/index.js +0 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/index.js.map +0 -7
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/types.js +0 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/types.js.map +0 -7
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js +0 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js.map +0 -7
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js +0 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js.map +0 -7
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.js +0 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.js.map +0 -7
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js +0 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js.map +0 -7
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js +0 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +0 -7
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/types.js +0 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/types.js.map +0 -7
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGridBox.js +0 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGridBox.js.map +0 -7
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js +0 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +0 -7
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/types.js +0 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/types.js.map +0 -7
- package/dist/cjs/biz-components/Listing/components/ProductCard/index.js +0 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/index.js.map +0 -7
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +0 -2
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +0 -7
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js +0 -2
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js.map +0 -7
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/types.js +0 -2
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/types.js.map +0 -7
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.js +0 -2
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.js.map +0 -7
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/types.js +0 -2
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/types.js.map +0 -7
- package/dist/cjs/biz-components/Listing/components/index.js +0 -2
- package/dist/cjs/biz-components/Listing/components/index.js.map +0 -7
- package/dist/cjs/biz-components/Listing/const.js +0 -2
- package/dist/cjs/biz-components/Listing/const.js.map +0 -7
- package/dist/cjs/biz-components/Listing/hooks/use-options.js +0 -2
- package/dist/cjs/biz-components/Listing/hooks/use-options.js.map +0 -7
- package/dist/cjs/biz-components/Listing/hooks/use-variant-media.js +0 -2
- package/dist/cjs/biz-components/Listing/hooks/use-variant-media.js.map +0 -7
- package/dist/cjs/biz-components/Listing/hooks/use-variant.js +0 -2
- package/dist/cjs/biz-components/Listing/hooks/use-variant.js.map +0 -7
- package/dist/cjs/biz-components/Listing/hooks/useCopy.js +0 -2
- package/dist/cjs/biz-components/Listing/hooks/useCopy.js.map +0 -7
- package/dist/cjs/biz-components/Listing/index.js +0 -2
- package/dist/cjs/biz-components/Listing/index.js.map +0 -7
- package/dist/cjs/biz-components/Listing/types/graphql.js +0 -2
- package/dist/cjs/biz-components/Listing/types/graphql.js.map +0 -7
- package/dist/cjs/biz-components/Listing/types/product.js +0 -2
- package/dist/cjs/biz-components/Listing/types/product.js.map +0 -7
- package/dist/cjs/biz-components/Listing/types/productMetafields.d.js +0 -2
- package/dist/cjs/biz-components/Listing/types/productMetafields.d.js.map +0 -7
- package/dist/cjs/biz-components/Listing/types/type-helper.js +0 -2
- package/dist/cjs/biz-components/Listing/types/type-helper.js.map +0 -7
- package/dist/cjs/biz-components/Listing/types.js +0 -2
- package/dist/cjs/biz-components/Listing/types.js.map +0 -7
- package/dist/cjs/biz-components/Listing/utils/helper.js +0 -2
- package/dist/cjs/biz-components/Listing/utils/helper.js.map +0 -7
- package/dist/cjs/biz-components/Listing/utils/index.js +0 -2
- package/dist/cjs/biz-components/Listing/utils/index.js.map +0 -7
- package/dist/cjs/biz-components/NavigationSearch/index.js +0 -2
- package/dist/cjs/biz-components/NavigationSearch/index.js.map +0 -7
- package/dist/cjs/biz-components/NavigationSearch/types.js +0 -2
- package/dist/cjs/biz-components/NavigationSearch/types.js.map +0 -7
- package/dist/cjs/biz-components/SearchPage/index.js +0 -2
- package/dist/cjs/biz-components/SearchPage/index.js.map +0 -7
- package/dist/cjs/biz-components/SearchPage/types.js +0 -2
- package/dist/cjs/biz-components/SearchPage/types.js.map +0 -7
- package/dist/cjs/biz-components/SelectStore/index.js +0 -2
- package/dist/cjs/biz-components/SelectStore/index.js.map +0 -7
- package/dist/cjs/biz-components/Specs/dropdown.js +0 -3
- package/dist/cjs/biz-components/Specs/dropdown.js.map +0 -7
- package/dist/cjs/biz-components/Specs/index.js +0 -2
- package/dist/cjs/biz-components/Specs/index.js.map +0 -7
- package/dist/cjs/components/loadingDots.js +0 -42
- package/dist/cjs/components/loadingDots.js.map +0 -7
- package/dist/cjs/stories/aplusdesc.stories.js +0 -2
- package/dist/cjs/stories/aplusdesc.stories.js.map +0 -7
- package/dist/cjs/stories/download.stories.js +0 -2
- package/dist/cjs/stories/download.stories.js.map +0 -7
- package/dist/cjs/stories/features.stories.js +0 -2
- package/dist/cjs/stories/features.stories.js.map +0 -7
- package/dist/cjs/stories/footcharger.stories.js +0 -2
- package/dist/cjs/stories/footcharger.stories.js.map +0 -7
- package/dist/cjs/stories/giftbox.stories.js +0 -2
- package/dist/cjs/stories/giftbox.stories.js.map +0 -7
- package/dist/cjs/stories/graphicMore.stories.js +0 -2
- package/dist/cjs/stories/graphicMore.stories.js.map +0 -7
- package/dist/cjs/stories/selectstore.stories.js +0 -2
- package/dist/cjs/stories/selectstore.stories.js.map +0 -7
- package/dist/esm/biz-components/AplusDesc/index.js +0 -2
- package/dist/esm/biz-components/AplusDesc/index.js.map +0 -7
- package/dist/esm/biz-components/DownLoad/index.js +0 -2
- package/dist/esm/biz-components/DownLoad/index.js.map +0 -7
- package/dist/esm/biz-components/Features/index.js +0 -2
- package/dist/esm/biz-components/Features/index.js.map +0 -7
- package/dist/esm/biz-components/FootCharger/index.js +0 -2
- package/dist/esm/biz-components/FootCharger/index.js.map +0 -7
- package/dist/esm/biz-components/GiftBox/index.js +0 -2
- package/dist/esm/biz-components/GiftBox/index.js.map +0 -7
- package/dist/esm/biz-components/GraphicMore/index.js +0 -2
- package/dist/esm/biz-components/GraphicMore/index.js.map +0 -7
- package/dist/esm/biz-components/HeaderNavigation/icons/Polygon.js +0 -2
- package/dist/esm/biz-components/HeaderNavigation/icons/Polygon.js.map +0 -7
- package/dist/esm/biz-components/Listing/ProductProvider.js +0 -2
- package/dist/esm/biz-components/Listing/ProductProvider.js.map +0 -7
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js +0 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js.map +0 -7
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js +0 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +0 -7
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js +0 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js.map +0 -7
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js +0 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js.map +0 -7
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js +0 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js.map +0 -7
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/index.js +0 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/index.js.map +0 -7
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/types.js +0 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/types.js.map +0 -7
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js +0 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js.map +0 -7
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js +0 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js.map +0 -7
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.js +0 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.js.map +0 -7
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js +0 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js.map +0 -7
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js +0 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +0 -7
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/types.js +0 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/types.js.map +0 -7
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGridBox.js +0 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGridBox.js.map +0 -7
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js +0 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +0 -7
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/types.js +0 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/types.js.map +0 -7
- package/dist/esm/biz-components/Listing/components/ProductCard/index.js +0 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/index.js.map +0 -7
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +0 -2
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +0 -7
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js +0 -2
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js.map +0 -7
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/types.js +0 -1
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/types.js.map +0 -7
- package/dist/esm/biz-components/Listing/components/PurchaseBar/index.js +0 -2
- package/dist/esm/biz-components/Listing/components/PurchaseBar/index.js.map +0 -7
- package/dist/esm/biz-components/Listing/components/PurchaseBar/types.js +0 -1
- package/dist/esm/biz-components/Listing/components/PurchaseBar/types.js.map +0 -7
- package/dist/esm/biz-components/Listing/components/index.js +0 -2
- package/dist/esm/biz-components/Listing/components/index.js.map +0 -7
- package/dist/esm/biz-components/Listing/const.js +0 -2
- package/dist/esm/biz-components/Listing/const.js.map +0 -7
- package/dist/esm/biz-components/Listing/hooks/use-options.js +0 -2
- package/dist/esm/biz-components/Listing/hooks/use-options.js.map +0 -7
- package/dist/esm/biz-components/Listing/hooks/use-variant-media.js +0 -2
- package/dist/esm/biz-components/Listing/hooks/use-variant-media.js.map +0 -7
- package/dist/esm/biz-components/Listing/hooks/use-variant.js +0 -2
- package/dist/esm/biz-components/Listing/hooks/use-variant.js.map +0 -7
- package/dist/esm/biz-components/Listing/hooks/useCopy.js +0 -2
- package/dist/esm/biz-components/Listing/hooks/useCopy.js.map +0 -7
- package/dist/esm/biz-components/Listing/index.js +0 -2
- package/dist/esm/biz-components/Listing/index.js.map +0 -7
- package/dist/esm/biz-components/Listing/types/graphql.js +0 -2
- package/dist/esm/biz-components/Listing/types/graphql.js.map +0 -7
- package/dist/esm/biz-components/Listing/types/product.js +0 -2
- package/dist/esm/biz-components/Listing/types/product.js.map +0 -7
- package/dist/esm/biz-components/Listing/types/productMetafields.d.js +0 -2
- package/dist/esm/biz-components/Listing/types/productMetafields.d.js.map +0 -7
- package/dist/esm/biz-components/Listing/types/type-helper.js +0 -1
- package/dist/esm/biz-components/Listing/types/type-helper.js.map +0 -7
- package/dist/esm/biz-components/Listing/types.js +0 -1
- package/dist/esm/biz-components/Listing/types.js.map +0 -7
- package/dist/esm/biz-components/Listing/utils/helper.js +0 -2
- package/dist/esm/biz-components/Listing/utils/helper.js.map +0 -7
- package/dist/esm/biz-components/Listing/utils/index.js +0 -2
- package/dist/esm/biz-components/Listing/utils/index.js.map +0 -7
- package/dist/esm/biz-components/NavigationSearch/index.js +0 -2
- package/dist/esm/biz-components/NavigationSearch/index.js.map +0 -7
- package/dist/esm/biz-components/NavigationSearch/types.js +0 -2
- package/dist/esm/biz-components/NavigationSearch/types.js.map +0 -7
- package/dist/esm/biz-components/SearchPage/index.js +0 -2
- package/dist/esm/biz-components/SearchPage/index.js.map +0 -7
- package/dist/esm/biz-components/SearchPage/types.js +0 -2
- package/dist/esm/biz-components/SearchPage/types.js.map +0 -7
- package/dist/esm/biz-components/SelectStore/index.js +0 -2
- package/dist/esm/biz-components/SelectStore/index.js.map +0 -7
- package/dist/esm/biz-components/Specs/dropdown.js +0 -3
- package/dist/esm/biz-components/Specs/dropdown.js.map +0 -7
- package/dist/esm/biz-components/Specs/index.js +0 -2
- package/dist/esm/biz-components/Specs/index.js.map +0 -7
- package/dist/esm/components/loadingDots.js +0 -42
- package/dist/esm/components/loadingDots.js.map +0 -7
- package/dist/esm/stories/aplusdesc.stories.js +0 -2
- package/dist/esm/stories/aplusdesc.stories.js.map +0 -7
- package/dist/esm/stories/download.stories.js +0 -2
- package/dist/esm/stories/download.stories.js.map +0 -7
- package/dist/esm/stories/features.stories.js +0 -2
- package/dist/esm/stories/features.stories.js.map +0 -7
- package/dist/esm/stories/footcharger.stories.js +0 -2
- package/dist/esm/stories/footcharger.stories.js.map +0 -7
- package/dist/esm/stories/giftbox.stories.js +0 -2
- package/dist/esm/stories/giftbox.stories.js.map +0 -7
- package/dist/esm/stories/graphicMore.stories.js +0 -2
- package/dist/esm/stories/graphicMore.stories.js.map +0 -7
- package/dist/esm/stories/selectstore.stories.js +0 -2
- package/dist/esm/stories/selectstore.stories.js.map +0 -7
|
@@ -1,7 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
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
|
|
@@ -1,7 +0,0 @@
|
|
|
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,OACE,UAAAC,EACA,iBAAAC,EACA,iBAAAC,EACA,gBAAAC,EACA,eAAAC,EACA,QAAAC,EACA,YAAAC,EACA,QAAAC,MACK,+BACP,OAAS,qBAAAC,MAAyB,8BAElC,OAAOC,MAAY,WACnB,OAAS,kBAAAC,MAAsB,uCAC/B,OAAS,eAAAC,MAAmB,oBAC5B,OAAS,sBAAAC,MAA0B,uBAEnC,MAAMC,EAAe,IAAM,CACzB,KAAM,CAAE,OAAAC,EAAS,IAAK,EAAIJ,EAAe,EACnC,CAAE,YAAAK,EAAa,QAAAC,CAAQ,EAAIR,EAAkB,EAC7C,CAACS,EAAuBC,CAAwB,EAAInB,EAAiB,EAE3ED,EAAU,IAAM,CACdoB,EAAyBH,GAAa,qBAAqB,CAAC,GAAG,MAAM,CACvE,EAAG,CAACA,GAAa,oBAAoB,CAAC,EAEtC,MAAMI,EAAW,CACfJ,GAAa,2BAA4B,QACzCA,GAAa,qBAAqB,KAAKC,GAAWA,EAAQ,SA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AU,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
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
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
|
|
@@ -1,7 +0,0 @@
|
|
|
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,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L,SAAU,EACV,UAAW,GAAK,EACV,EAAE,MAAQ,SAAW,EAAE,MAAQ,MACjC,EAAE,eAAe,CAErB,EACC,GAAGR,EAEH,WAACV,GAASK,EACTjB,EAAC,OAAI,UAAU,cAAe,SAAAiB,EAAY,EAE1CjB,EAAC,OAAI,UAAWI,EAAG,eAAgBiB,EAAW,0BAA4B,QAAQ,EAAI,SAAAM,EAAa,EAEpGhB,EAAK,OAAS,GACbX,EAACE,EAAA,CACC,UAAWC,EACT,iFACAqB,GAAa,YACf,EACF,GAEJ,EACAxB,EAAC,OACC,IAAKuB,EACL,UAAWpB,EACT,4KACAqB,EAAY,GAAK,gCACjBJ,CACF,EAEC,SAAAT,EAAK,IAAIiB,GACR5B,EAAC,OAEC,aAAY4B,EAAK,MACjB,UAAWzB,EACT,0LACAS,IAAUgB,EAAK,MAAQ,gBAAkB,GACzCA,GAAM,SAAW,qCAAuC,EAC1D,EACA,QAAS,IAAM,CACbZ,EAASY,EAAK,KAAK,EACnBH,EAAa,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
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
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
|
|
@@ -1,7 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
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
|
|
@@ -1,7 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as e,jsxs as d}from"react/jsx-runtime";import{useAiuiContext as L}from"../../../../AiuiProvider/index.js";import{Text as z,Picture as S,Badge as A}from"../../../../../components";import{useMemo as G,useState as g,forwardRef as B,useRef as C}from"react";import{Swiper as N,SwiperSlide as P}from"swiper/react";import{Navigation as M,Mousewheel as D,Thumbs as V,Pagination as j}from"swiper/modules";import{cn as x}from"../../../../../helpers/index.js";import{GalleryTabType as E}from"./types.js";import{Content as F,List as $,Root as _,Trigger as O}from"@radix-ui/react-tabs";import{useProductContext as I}from"../../../ProductProvider.js";import{useVariantMedia as W}from"../../../hooks/use-variant-media.js";import{SpecsModal as Y}from"./components/SpecsModal.js";import Z from"./components/CompareModal.js";import{formatPrice as H}from"../../../utils/index.js";const K=t=>d("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"})]}),q=t=>d("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}=L(),{product:c,variant:b,isMobile:r}=I(),p=W({product:c,variant:b}),[v,w]=g(null),i=b?.metafields?.component?.custom_media_list;let o,u,f,m;i&&i?.available?(o=i?.product||[],u=i?.scenarios||[],f=i?.keyFeatures||[],m=i?.video||[]):(o=p?.productList,u=p?.sceneList,f=p?.keyFeaturesList,m=p?.videoList);const T=G(()=>[...o,...u,...m],[o,u,m]),k={productList:o,keyFeaturesList:f,sceneList:u,videoList:m},s=G(()=>(c?.payload?.components?.find(l=>l.componentKey==="ProductGallery")?.data||[])?.map(l=>({...l,galleries:k[l?.galleries]||[]})).filter(l=>l.galleries.length>0),[c?.payload,o,u,m]),a=C({}),[y,h]=g(s?.[0]),R=(n,l)=>{switch(n?.galleryTabType){case E.GALLERY_IMAGE:return e(U,{...n,onCurrentTabLoopEnd:()=>{h(s?.[l])},onCurrentTabLoopStart:()=>{h(s?.[l])},index:l});case E.GALLERY_VIDEO:return e(X,{...n});default:return null}};return e("div",{id:"ipc-product-gallery",children:d(_,{className:"relative",defaultValue:s?.[0]?.tabValue,children:[e("div",{className:"h-[420px] tablet:h-[620px] desktop:h-[560px] lg-desktop:h-[700px] bg-[#EAEAEC] desktop:relative ",children:s.map((n,l)=>e(F,{className:"h-full",value:n.tabValue,children:R(n,l)},n.tabValue))}),e(Q,{galleryTabs:s,activeGalleryTab:y,setActiveGalleryTab:h})]})})},Q=({galleryTabs:t,activeGalleryTab:c,setActiveGalleryTab:b})=>d("div",{className:"absolute z-[2] bottom-4 left-4 right-4 flex justify-between items-center tablet:mt-3 desktop:static",children:[e($,{className:"rounded-full bg-[#EAEAEC] p-1",children:t?.map(r=>e(O,{className:x("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",r.tabValue===c?.tabValue&&"bg-white"),onClick:()=>b(r),value:r.tabValue,children:r.tabLabel},r.tabValue))}),d("div",{className:"laptop:gap-2 hidden laptop:flex",children:[e(Y,{})," |",e(Z,{})]})]}),U=B((t,c)=>{const{locale:b="us",copyWriting:r}=L(),{variant:p,totalSavings:v}=I(),w=C(null),[i,o]=g(null),[u,f]=g(!0),[m,T]=g(!1),[k,s]=g(null);return d("div",{className:"h-full",children:[e(N,{ref:c,className:"desktop:rounded-2xl h-full",navigation:{nextEl:`.ipc-product-gallery-${t?.id}-custom-swiper-button-next`,prevEl:`.ipc-product-gallery-${t?.id}-custom-swiper-button-prev`},onSwiper:s,onProgress:a=>{f(a.isBeginning),T(a.isEnd)},pagination:{clickable:!0,el:w.current},onSlideChange:a=>{a&&(a.isEnd?t?.onCurrentTabLoopEnd?.():a.isBeginning&&t?.onCurrentTabLoopStart?.())},thumbs:{swiper:i},modules:[D,V,M,j],mousewheel:{forceToAxis:!0},breakpoints:{0:{slidesPerView:1,freeMode:!1}},children:t?.galleries?.map((a,y)=>e(P,{className:"h-full",children:e(S,{source:a?.image?.url,alt:a?.image?.altText,className:"h-full",imgClassName:"object-contain h-full "})},t?.id+"SwiperSlideItem"+y))}),!t.index&&p.availableForSale&&v&&e(A,{size:"lg",className:"absolute bg-brand text-white top-3 left-4 z-[2]",children:`${H({amount:v,currencyCode:p?.price?.currencyCode,locale:b})} ${r?.off}`}),e("div",{className:x("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(K,{className:"tablet:size-10 lg-desktop:size-12"})}),e("div",{className:x("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(q,{className:"tablet:size-10 lg-desktop:size-12"})}),d("div",{className:"absolute bottom-[94px] tablet:bottom-[70px] left-4 right-4 z-10 items-center tablet:flex justify-between desktop:bottom-[20px] desktop:right-[6] desktop:left-[6]",children:[e("div",{className:"hidden tablet:block",children:e(N,{className:"flex items-center justify-between",onSwiper:o,spaceBetween:12,slidesPerView:6,freeMode:!0,watchSlidesProgress:!0,modules:[M,V],children:t?.galleries?.map((a,y)=>e(P,{className:"!w-auto [&.swiper-slide-thumb-active]:border [&.swiper-slide-thumb-active]:border-brand",children:e(S,{source:a.image?.url,alt:a.image?.altText,className:"size-10 lg-desktop:size-12 rounded",imgClassName:"object-contain h-full"})},t?.id+"SwiperSlideThumbItem"+y))})}),!t?.index&&d("div",{className:"flex items-center gap-2",children:[e(S,{source:t?.comment?.avatar?.url,className:"size-10 rounded-full shrink-0",imgClassName:"object-cover "}),e(z,{html:t?.comment?.content,className:"text-sm lg-desktop:text-base max-w-[528px] font-bold text-[#6D6D6F] line-clamp-2"})]})]}),e("div",{ref:w,className:"tablet:hidden text-center absolute !bottom-[70px] left-4 right-4 z-10"})]})}),X=t=>e("div",{className:"h-full",children:e("video",{controls:!0,className:"size-full",children:e("track",{kind:"captions"})})}),fe=t=>e("div",{children:"3D View"});var ye=J;export{ye as default};
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
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 keyFeaturesList: keyFeaturesList,\n sceneList: sceneList,\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, productList, sceneList, videoList])\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: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 return (\n <div className=\"absolute z-[2] bottom-4 left-4 right-4 flex justify-between items-center tablet:mt-3 desktop:static\">\n <List className=\"rounded-full bg-[#EAEAEC] p-1\">\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 </List>\n <div className=\"laptop:gap-2 hidden laptop:flex\">\n <SpecsModal /> |\n <CompareModal />\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 return (\n <div className=\"h-full\">\n <Swiper\n ref={ref}\n className=\"desktop:rounded-2xl 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 {!props.index && variant.availableForSale && totalSavings && (\n <Badge size=\"lg\" className=\"absolute bg-brand text-white top-3 left-4 z-[2]\">\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 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 <video controls className=\"size-full\">\n <track kind=\"captions\" />\n {/* <source src={props?.galleryVideo?.url} type=\"video/mp4\" />\n <source src={props?.galleryVideo?.url} type=\"video/webm\" />\n <source src={props?.galleryVideo?.url} type=\"video/ogg\" /> */}\n </video>\n </div>\n )\n}\n\nconst ProductGalleryTab3DView = (props: ProductGalleryTabItemProps) => {\n return <div>3D View</div>\n}\n\nexport default ProductGallery\n"],
|
|
5
|
-
"mappings": "AA8BI,OACE,OAAAA,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,EAAM,QAAAC,EAAM,WAAA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,IAC5BlE,EAACW,EAAA,CAEC,UAAU,0FAEV,SAAAX,EAACI,EAAA,CACC,OAAQ0C,EAAK,OAAO,IACpB,IAAKA,EAAK,OAAO,QACjB,UAAU,qCACV,aAAa,wBACf,GARKlB,GAAO,GAAK,uBAAyBsC,CAS5C,CACD,EACH,EACF,EACC,CAACtC,GAAO,OACP3B,EAAC,OAAI,UAAU,0BACb,UAAAD,EAACI,EAAA,CACC,OAAQwB,GAAO,SAAS,QAAQ,IAChC,UAAU,gCACV,aAAa,gBACf,EACA5B,EAACG,EAAA,CACC,KAAMyB,GAAO,SAAS,QACtB,UAAU,mFACZ,GACF,GAEJ,EACA5B,EAAC,OAAI,IAAK2D,EAAe,UAAU,wEAAwE,GAC7G,CAEJ,CAAC,EAEKL,EAA0B1B,GAE5B5B,EAAC,OAAI,UAAU,SACb,SAAAA,EAAC,SAAM,SAAQ,GAAC,UAAU,YACxB,SAAAA,EAAC,SAAM,KAAK,WAAW,EAIzB,EACF,EAIEmE,GAA2BvC,GACxB5B,EAAC,OAAI,mBAAO,EAGrB,IAAOoE,GAAQtC",
|
|
6
|
-
"names": ["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
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as o,jsxs as e}from"react/jsx-runtime";import{Grid as s,GridItem as t}from"../../../../components";const c=({BoxLeftGallery:p,BoxRightDetail:a,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-16 desktop:px-0 desktop:col-start-1 desktop:col-span-8 desktop:sticky desktop:top-[124px] h-fit",children:p}),o(t,{className:"col-span-12 desktop:col-start-9 desktop:col-span-4",children:a})]}),d]});var r=c;export{r as default};
|
|
2
|
-
//# sourceMappingURL=ProductGridBox.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
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-16 desktop: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,oIACjB,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
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as e,jsxs as a}from"react/jsx-runtime";import{Text as i,Button as x,Grid as S,GridItem as b,Picture as f,Heading as C}from"../../../../../components";import{useProductContext as y}from"../../../ProductProvider";import"react";import{formatPrice as v}from"../../../utils";import{useAiuiContext as w}from"../../../../AiuiProvider";import{cn as g}from"../../../../../helpers";const P=({})=>{const{locale:m="us",copyWriting:l}=w(),{product:n,variant:s,finalPrice:d,selectedOptions:o,onAddToCart:p,onBuyNow:u,productSummaryStatus:t,setProductSummaryStatus:c}=y();return s.availableForSale?e("div",{className:"ipc-product-summary bg-[#F5F5F7] mt-16",children:a(S,{className:"px-4 py-6 tablet:p-8",children:[a(b,{className:"col-span-12 desktop:col-start-1 desktop:col-span-5",children:[e(C,{className:"font-bold text-[24px] lg-desktop:text-[48px] laptop:text-[32px] desktop:text-[40px] leading-[1] mb-4 [&>span]:text-[#D1D1D1]",html:`${n.title} is ready <br/><span>Just the way you want it.</span>`}),e("div",{className:"aspect-[644/320]",children:e(f,{source:s.image?.url||n?.images?.[0]?.url,className:"h-full w-full",imgClassName:"object-contain h-full"})})]}),a(b,{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:[a("div",{children:[a("div",{className:"flex flex-col gap-4",children:[a("div",{className:"flex items-center justify-between",children:[a("div",{className:"shrink-0 flex items-center gap-4",children:[e(f,{source:s.image?.url||n?.images?.[0]?.url,className:"size-16 object-cover"}),a("div",{className:"flex flex-col gap-[6px] max-w-[178px] tablet:max-w-none",children:[e(i,{className:"font-bold text-[14px] desktop:text-[16px] lg-desktop:text-[18px]",html:n.title}),e(i,{className:"text-[12px] laptop:text-[14px] desktop:text-[18px] font-bold text-[#6D6D6F]",html:`x1 | ${o.color||o.colour||o.couleur}`})]})]}),a("div",{className:"flex items-center gap-1",children:[e(i,{className:"text-base desktop:text-2xl font-bold",html:v({amount:d,currencyCode:s.price.currencyCode,locale:m})}),e(i,{className:"text-base desktop:text-2xl font-bold line-through text-[#6D6D6F]",html:v({amount:s.price.amount,currencyCode:s.price.currencyCode,locale:m})})]})]}),t?.giftSummary&&e(k,{giftOperation:()=>c?.({...t,giftSummary:!1}),giftStatus:t.giftSummary}),t?.bundleSummary&&e(N,{bundleOperation:()=>c?.({...t,bundleSummary:!1}),bundleStatus:t.bundleSummary})]}),(!t?.bundleSummary||!t?.giftSummary)&&a("div",{className:"mt-6",children:[e(i,{className:"text-sm desktop:text-[18px] font-bold",html:"Recommend Buy"}),a("div",{className:"flex flex-col gap-6 mt-6",children:[!t.giftSummary&&e(k,{giftOperation:()=>c?.({...t,giftSummary:!0}),giftStatus:t.giftSummary}),!t?.bundleSummary&&e(N,{bundleOperation:()=>c?.({...t,bundleSummary:!0}),bundleStatus:t.bundleSummary})]})]})]}),a("div",{className:"text-right",children:[e(i,{className:"laptop:text-xl desktop:text-2xl font-bold text-right",html:`${l?.totalPrice} ${v({amount:d,currencyCode:s.price.currencyCode,locale:m})}`}),e(i,{className:"text-base desktop:text-2xl ml-1 font-bold line-through text-[#6D6D6F]",html:v({amount:s.price.amount,currencyCode:s.price.currencyCode,locale:m})}),a("div",{className:"flex gap-3 mt-2",children:[e(x,{size:"lg",variant:"secondary",className:"w-1/2",onClick:()=>p?.(),children:l?.addToCart}),e(x,{size:"lg",variant:"primary",className:"w-1/2",onClick:()=>u?.(),children:l?.shopNow})]})]})]})]})}):null},N=({bundleOperation:m,bundleStatus:l})=>{const{bundle:n,variant:s,setCheckedBundle:d,checkedBundle:o}=y(),{bundleList:p}=n||{},u=p?.filter(r=>r.variants.slice(1,r.variants.length).every(h=>h.variant.availableForSale));if(!u?.length)return null;const[t]=u,c=(o||t)?.variants.filter(r=>r.variant.sku!==s.sku);return a("div",{className:"flex items-center justify-between",children:[c?.map(r=>a("div",{className:"flex items-center gap-4",children:[e(f,{source:r?.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(i,{className:"font-bold text-[14px] desktop:text-[16px] lg-desktop:text-[18px]",html:r.variant.product.title})})]},r.variant.id)),e(x,{size:l?"icon":"lg",variant:l?"link":"primary",onClick:()=>{d?.(l?void 0:t),m(t)},className:g("shrink-0",{underline:l}),children:l?"Remove":"Add +"})]})},k=({giftOperation:m,giftStatus:l})=>{const{freeGift:n,setCheckedGift:s,checkedGift:d}=y(),{giftList:o=[],freeLabel:p}=n||{};if(!o?.length)return null;const[u]=o.filter(c=>c.availableForSale),t=d||u;return a("div",{className:"flex items-center justify-between",children:[a("div",{className:"flex items-center gap-4",children:[e(f,{source:t?.image?.url,className:"size-16 object-cover"}),a("div",{className:"flex flex-col gap-[6px] max-w-[178px] tablet:max-w-none",children:[e(i,{className:"font-bold text-[14px] desktop:text-[16px] lg-desktop:text-[18px]",html:t?.product?.title}),e(i,{className:"text-[12px] laptop:text-[14px] desktop:text-[18px] font-bold text-[#6D6D6F]",html:`x1 | ${p}`})]})]}),e(x,{size:l?"icon":"lg",variant:l?"link":"primary",onClick:()=>{s?.(l?void 0:o[0]),m(o[0])},className:g("shrink-0",{underline:l}),children:l?"Remove":"Add +"})]})};var I=P;export{I as default};
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../../src/biz-components/Listing/components/ProductCard/ProductSummary/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Text, Button, Container, Grid, GridItem, Picture, Heading } from '../../../../../components'\nimport type { ProductSummaryProps } from './types'\nimport { useProductContext } from '../../../ProductProvider'\nimport { useMemo, useState } from 'react'\nimport { formatPrice } from '../../../utils'\nimport { useAiuiContext } from '../../../../AiuiProvider'\nimport type { BundleListItem, ProductVariant } from '../../../types/product'\nimport { cn } from '../../../../../helpers'\n\nconst ProductSummary = ({}: ProductSummaryProps) => {\n const { locale = 'us', copyWriting } = useAiuiContext()\n const {\n product,\n variant,\n finalPrice,\n selectedOptions,\n onAddToCart,\n onBuyNow,\n productSummaryStatus,\n setProductSummaryStatus,\n } = useProductContext()\n\n const isAvailable = variant.availableForSale\n if (!isAvailable) return null\n return (\n <div className=\"ipc-product-summary bg-[#F5F5F7] mt-16\">\n <Grid className=\"px-4 py-6 tablet:p-8\">\n <GridItem className=\"col-span-12 desktop:col-start-1 desktop:col-span-5\">\n <Heading\n className=\"font-bold text-[24px] lg-desktop:text-[48px] laptop:text-[32px] desktop:text-[40px] leading-[1] mb-4 [&>span]:text-[#D1D1D1]\"\n html={`${product.title} is ready <br/><span>Just the way you want it.</span>`}\n />\n <div className=\"aspect-[644/320]\">\n <Picture\n source={variant.image?.url || product?.images?.[0]?.url}\n className=\"h-full w-full\"\n imgClassName=\"object-contain h-full\"\n />\n </div>\n </GridItem>\n <GridItem className=\"col-span-12 mt-8 desktop:col-start-7 laptop:mt-0 desktop:col-span-6 flex flex-col gap-6 justify-between\">\n <div>\n <div className=\"flex flex-col gap-4\">\n <div className=\"flex items-center justify-between\">\n <div className=\"shrink-0 flex items-center gap-4\">\n <Picture source={variant.image?.url || product?.images?.[0]?.url} className=\"size-16 object-cover\" />\n <div className=\"flex flex-col gap-[6px] max-w-[178px] tablet:max-w-none\">\n <Text\n className=\"font-bold text-[14px] desktop:text-[16px] lg-desktop:text-[18px]\"\n html={product.title}\n />\n <Text\n className=\"text-[12px] laptop:text-[14px] desktop:text-[18px] font-bold text-[#6D6D6F]\"\n html={`x1 | ${selectedOptions.color || selectedOptions.colour || selectedOptions.couleur}`}\n />\n </div>\n </div>\n <div className=\"flex items-center gap-1\">\n <Text\n className=\"text-base desktop:text-2xl font-bold\"\n html={formatPrice({ amount: finalPrice, currencyCode: variant.price.currencyCode, locale })}\n />\n <Text\n className=\"text-base desktop:text-2xl font-bold line-through text-[#6D6D6F]\"\n html={formatPrice({\n amount: variant.price.amount,\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />\n </div>\n </div>\n {productSummaryStatus?.giftSummary && (\n <ProductGiftSummary\n giftOperation={() => setProductSummaryStatus?.({ ...productSummaryStatus, giftSummary: false })}\n giftStatus={productSummaryStatus.giftSummary}\n />\n )}\n {productSummaryStatus?.bundleSummary && (\n <ProductBundleSummary\n bundleOperation={() => setProductSummaryStatus?.({ ...productSummaryStatus, bundleSummary: false })}\n bundleStatus={productSummaryStatus.bundleSummary}\n />\n )}\n </div>\n {(!productSummaryStatus?.bundleSummary || !productSummaryStatus?.giftSummary) && (\n <div className=\"mt-6\">\n <Text className=\"text-sm desktop:text-[18px] font-bold\" html={'Recommend Buy'} />\n <div className=\"flex flex-col gap-6 mt-6\">\n {!productSummaryStatus.giftSummary && (\n <ProductGiftSummary\n giftOperation={() => setProductSummaryStatus?.({ ...productSummaryStatus, giftSummary: true })}\n giftStatus={productSummaryStatus.giftSummary}\n />\n )}\n {!productSummaryStatus?.bundleSummary && (\n <ProductBundleSummary\n bundleOperation={() =>\n setProductSummaryStatus?.({ ...productSummaryStatus, bundleSummary: true })\n }\n bundleStatus={productSummaryStatus.bundleSummary}\n />\n )}\n </div>\n </div>\n )}\n </div>\n <div className=\"text-right\">\n <Text\n className=\"laptop:text-xl desktop:text-2xl font-bold text-right\"\n html={`${copyWriting?.totalPrice} ${formatPrice({ amount: finalPrice, currencyCode: variant.price.currencyCode, locale })}`}\n />\n\n <Text\n className=\"text-base desktop:text-2xl ml-1 font-bold line-through text-[#6D6D6F]\"\n html={formatPrice({\n amount: variant.price.amount,\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />\n <div className=\"flex gap-3 mt-2\">\n <Button size=\"lg\" variant=\"secondary\" className=\"w-1/2\" onClick={() => onAddToCart?.()}>\n {copyWriting?.addToCart}\n </Button>\n <Button size=\"lg\" variant=\"primary\" className=\"w-1/2\" onClick={() => onBuyNow?.()}>\n {copyWriting?.shopNow}\n </Button>\n </div>\n </div>\n </GridItem>\n </Grid>\n </div>\n )\n}\n\nconst ProductBundleSummary = ({\n bundleOperation,\n bundleStatus,\n}: {\n bundleOperation: (bundle: BundleListItem) => void\n bundleStatus: boolean\n}) => {\n const { bundle, variant, setCheckedBundle, checkedBundle } = useProductContext()\n const { bundleList } = bundle || {}\n const availableBundleList = bundleList?.filter(bundle =>\n bundle.variants.slice(1, bundle.variants.length).every(v => v.variant.availableForSale)\n )\n if (!availableBundleList?.length) return null\n const [firstAvailableBundle] = availableBundleList\n const bundleVariants = (checkedBundle || firstAvailableBundle)?.variants.filter(v => v.variant.sku !== variant.sku)\n\n return (\n <div className=\"flex items-center justify-between\">\n {bundleVariants?.map(bundleVariant => {\n return (\n <div className=\"flex items-center gap-4\" key={bundleVariant.variant.id}>\n <Picture source={bundleVariant?.variant?.image?.url} className=\"size-16 object-cover\" />\n <div className=\"flex flex-col gap-[6px] max-w-[178px] tablet:max-w-none\">\n <Text\n className=\"font-bold text-[14px] desktop:text-[16px] lg-desktop:text-[18px]\"\n html={bundleVariant.variant.product.title}\n />\n </div>\n </div>\n )\n })}\n <Button\n size={bundleStatus ? 'icon' : 'lg'}\n variant={bundleStatus ? 'link' : 'primary'}\n onClick={() => {\n setCheckedBundle?.(bundleStatus ? undefined : firstAvailableBundle)\n bundleOperation(firstAvailableBundle)\n }}\n className={cn('shrink-0', {\n underline: bundleStatus,\n })}\n >\n {bundleStatus ? 'Remove' : 'Add +'}\n </Button>\n </div>\n )\n}\n\nconst ProductGiftSummary = ({\n giftOperation,\n giftStatus,\n}: {\n giftOperation: (gift: ProductVariant) => void\n giftStatus: boolean\n}) => {\n const { freeGift, setCheckedGift, checkedGift } = useProductContext()\n const { giftList = [], freeLabel } = freeGift || {}\n if (!giftList?.length) return null\n const [firstAvailableGift] = giftList.filter(gift => gift.availableForSale)\n const gift = checkedGift || firstAvailableGift\n\n return (\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-4\">\n <Picture source={gift?.image?.url} className=\"size-16 object-cover\" />\n <div className=\"flex flex-col gap-[6px] max-w-[178px] tablet:max-w-none\">\n <Text\n className=\"font-bold text-[14px] desktop:text-[16px] lg-desktop:text-[18px]\"\n html={gift?.product?.title}\n />\n <Text\n className=\"text-[12px] laptop:text-[14px] desktop:text-[18px] font-bold text-[#6D6D6F]\"\n html={`x1 | ${freeLabel}`}\n />\n </div>\n </div>\n <Button\n size={giftStatus ? 'icon' : 'lg'}\n variant={giftStatus ? 'link' : 'primary'}\n onClick={() => {\n setCheckedGift?.(giftStatus ? undefined : giftList[0])\n giftOperation(giftList[0])\n }}\n className={cn('shrink-0', {\n underline: giftStatus,\n })}\n >\n {giftStatus ? 'Remove' : 'Add +'}\n </Button>\n </div>\n )\n}\n\nexport default ProductSummary\n"],
|
|
5
|
-
"mappings": "AA2BQ,OACE,OAAAA,EADF,QAAAC,MAAA,oBA3BR,OAAS,QAAAC,EAAM,UAAAC,EAAmB,QAAAC,EAAM,YAAAC,EAAU,WAAAC,EAAS,WAAAC,MAAe,4BAE1E,OAAS,qBAAAC,MAAyB,2BAClC,MAAkC,QAClC,OAAS,eAAAC,MAAmB,iBAC5B,OAAS,kBAAAC,MAAsB,2BAE/B,OAAS,MAAAC,MAAU,yBAEnB,MAAMC,EAAiB,CAAC,CAAC,IAA2B,CAClD,KAAM,CAAE,OAAAC,EAAS,KAAM,YAAAC,CAAY,EAAIJ,EAAe,EAChD,CACJ,QAAAK,EACA,QAAAC,EACA,WAAAC,EACA,gBAAAC,EACA,YAAAC,EACA,SAAAC,EACA,qBAAAC,EACA,wBAAAC,CACF,EAAId,EAAkB,EAGtB,OADoBQ,EAAQ,iBAG1BhB,EAAC,OAAI,UAAU,yCACb,SAAAC,EAACG,EAAA,CAAK,UAAU,uBACd,UAAAH,EAACI,EAAA,CAAS,UAAU,qDAClB,UAAAL,EAACO,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AAD,EAACM,EAAA,CAAQ,OAAQsC,GAAM,OAAO,IAAK,UAAU,uBAAuB,EACpE3C,EAAC,OAAI,UAAU,0DACb,UAAAD,EAACE,EAAA,CACC,UAAU,mEACV,KAAM0C,GAAM,SAAS,MACvB,EACA5C,EAACE,EAAA,CACC,UAAU,8EACV,KAAM,QAAQwC,CAAS,GACzB,GACF,GACF,EACA1C,EAACG,EAAA,CACC,KAAMkC,EAAa,OAAS,KAC5B,QAASA,EAAa,OAAS,UAC/B,QAAS,IAAM,CACbE,IAAiBF,EAAa,OAAYI,EAAS,CAAC,CAAC,EACrDL,EAAcK,EAAS,CAAC,CAAC,CAC3B,EACA,UAAW9B,EAAG,WAAY,CACxB,UAAW0B,CACb,CAAC,EAEA,SAAAA,EAAa,SAAW,QAC3B,GACF,CAEJ,EAEA,IAAOQ,EAAQjC",
|
|
6
|
-
"names": ["jsx", "jsxs", "Text", "Button", "Grid", "GridItem", "Picture", "Heading", "useProductContext", "formatPrice", "useAiuiContext", "cn", "ProductSummary", "locale", "copyWriting", "product", "variant", "finalPrice", "selectedOptions", "onAddToCart", "onBuyNow", "productSummaryStatus", "setProductSummaryStatus", "ProductGiftSummary", "ProductBundleSummary", "bundleOperation", "bundleStatus", "bundle", "setCheckedBundle", "checkedBundle", "bundleList", "availableBundleList", "v", "firstAvailableBundle", "bundleVariants", "bundleVariant", "giftOperation", "giftStatus", "freeGift", "setCheckedGift", "checkedGift", "giftList", "freeLabel", "firstAvailableGift", "gift", "ProductSummary_default"]
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=types.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as t,jsxs as p}from"react/jsx-runtime";import{Grid as d,GridItem as o}from"../../../../components";import r from"./ProductGallery/index.js";import s from"./ProductDetail/index.js";import a from"./ProductSummary/index.js";const e=()=>p("div",{id:"ipc-product-card",className:"desktop:mt-6 desktop:px-16 lg-desktop:px-[calc(50%-832px)]",children:[p(d,{className:"laptop:gap-6",children:[t(o,{className:"col-span-12 tablet:px-8 laptop:px-16 desktop:px-0 desktop:col-start-1 desktop:col-span-8 desktop:sticky desktop:top-[124px] h-fit",children:t(r,{})}),t(o,{className:"col-span-12 desktop:col-start-9 desktop:col-span-4",children:t(s,{})})]}),t(a,{})]});var k=e;export{k as default};
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../src/biz-components/Listing/components/ProductCard/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Grid, GridItem } from '../../../../components'\nimport ProductGallery from './ProductGallery/index.js'\nimport ProductDetail from './ProductDetail/index.js'\nimport ProductSummary from './ProductSummary/index.js'\n\n\n\nconst ProductCard = () => {\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-16 desktop:px-0 desktop:col-start-1 desktop:col-span-8 desktop:sticky desktop:top-[124px] h-fit\">\n <ProductGallery />\n </GridItem>\n <GridItem className=\"col-span-12 desktop:col-start-9 desktop:col-span-4\">\n <ProductDetail />\n </GridItem>\n </Grid>\n <ProductSummary />\n </div>\n )\n}\n\nexport default ProductCard\n"],
|
|
5
|
-
"mappings": "AAUM,OAEI,OAAAA,EAFJ,QAAAC,MAAA,oBAVN,OAAS,QAAAC,EAAM,YAAAC,MAAgB,yBAC/B,OAAOC,MAAoB,4BAC3B,OAAOC,MAAmB,2BAC1B,OAAOC,MAAoB,4BAI3B,MAAMC,EAAc,IAEhBN,EAAC,OAAI,GAAG,mBAAmB,UAAU,6DACnC,UAAAA,EAACC,EAAA,CAAK,UAAU,eACd,UAAAF,EAACG,EAAA,CAAS,UAAU,oIAClB,SAAAH,EAACI,EAAA,EAAe,EAClB,EACAJ,EAACG,EAAA,CAAS,UAAU,qDAClB,SAAAH,EAACK,EAAA,EAAe,EAClB,GACF,EACAL,EAACM,EAAA,EAAe,GAClB,EAIJ,IAAOE,EAAQD",
|
|
6
|
-
"names": ["jsx", "jsxs", "Grid", "GridItem", "ProductGallery", "ProductDetail", "ProductSummary", "ProductCard", "ProductCard_default"]
|
|
7
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as e,jsxs as l}from"react/jsx-runtime";import{Text as o,Button as s}from"../../../../../components";import{useAiuiContext as f}from"../../../../AiuiProvider/index.js";import{useProductContext as p}from"../../../ProductProvider.js";import{useMemo as v}from"react";import{formatPrice as i}from"../../../utils";import g from"decimal.js";const y=()=>{const{copyWriting:a,locale:r="us"}=f(),{variant:t,finalPrice:m,totalSavings:d,comparePrice:n,onAddToCart:u,onBuyNow:b,savingDetail:c}=p(),x=v(()=>new g(n).minus(c.freeGift).toNumber(),[n,c]);return l("div",{className:"bg-white py-3 px-4 tablet:p-0 tablet:flex tablet:items-center tablet:gap-4",children:[t.availableForSale?l("div",{className:"flex items-center justify-between tablet:flex-col desktop:items-end",children:[l("div",{className:"flex items-center gap-1",children:[e(o,{className:"text-xl font-bold leading-[1.2] tablet:text-2xl",html:i({amount:m,currencyCode:t.price.currencyCode,locale:r})}),e(o,{className:"text-xl font-bold line-through text-[#999] leading-[1.2] tablet:text-2xl",html:i({amount:x,currencyCode:t.price.currencyCode,locale:r})})]}),e(o,{className:"text-brand-0 text-base leading-[1.4] font-bold tablet:text-2xl",html:`${a?.totalSavings} ${i({amount:d,currencyCode:t.price.currencyCode,locale:r})}`})]}):e(o,{className:"text-[20px] font-bold text-[#999999]",html:a?.soldOut??"Sold Out"}),l("div",{className:"flex items-center gap-2 mt-2 tablet:mt-0",children:[e(s,{variant:"secondary",disabled:!t.availableForSale,size:"lg",className:"w-1/2 tablet:w-auto",onClick:()=>u?.(),children:a?.addToCart??"Add to Cart"}),e(s,{variant:"primary",disabled:!t.availableForSale,size:"lg",className:"w-1/2 tablet:w-auto",onClick:()=>b?.(),children:a?.buyNow??"Buy Now"})]})]})};var B=y;export{B as default};
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../../src/biz-components/Listing/components/PurchaseBar/ProductActions/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Text, Button } from '../../../../../components'\nimport { useAiuiContext } from '../../../../AiuiProvider/index.js'\nimport { useProductContext } from '../../../ProductProvider.js'\nimport { useMemo } from 'react'\nimport { formatPrice } from '../../../utils'\nimport Decimal from 'decimal.js'\n\nconst ProductActions = () => {\n const { copyWriting, locale = 'us' } = useAiuiContext()\n const { variant, finalPrice, totalSavings, comparePrice, onAddToCart, onBuyNow, savingDetail } = useProductContext()\n\n const comparePriceRemovedFreeGift = useMemo(\n () => new Decimal(comparePrice).minus(savingDetail.freeGift).toNumber(),\n [comparePrice, savingDetail]\n )\n\n return (\n <div className=\"bg-white py-3 px-4 tablet:p-0 tablet:flex tablet:items-center tablet:gap-4\">\n {variant.availableForSale ? (\n <div className=\"flex items-center justify-between tablet:flex-col desktop:items-end\">\n <div className=\"flex items-center gap-1\">\n <Text\n className=\"text-xl font-bold leading-[1.2] tablet:text-2xl\"\n html={formatPrice({ amount: finalPrice, currencyCode: variant.price.currencyCode, locale })}\n />\n <Text\n className=\"text-xl font-bold line-through text-[#999] leading-[1.2] tablet:text-2xl\"\n html={formatPrice({\n amount: comparePriceRemovedFreeGift,\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />\n </div>\n <Text\n className=\"text-brand-0 text-base leading-[1.4] font-bold tablet:text-2xl\"\n html={`${copyWriting?.totalSavings} ${formatPrice({ amount: totalSavings, currencyCode: variant.price.currencyCode, locale })}`}\n />\n </div>\n ) : (\n <Text className=\"text-[20px] font-bold text-[#999999]\" html={copyWriting?.soldOut ?? 'Sold Out'} />\n )}\n <div className=\"flex items-center gap-2 mt-2 tablet:mt-0\">\n <Button\n variant=\"secondary\"\n disabled={!variant.availableForSale}\n size=\"lg\"\n className=\"w-1/2 tablet:w-auto\"\n onClick={() => onAddToCart?.()}\n >\n {copyWriting?.addToCart ?? 'Add to Cart'}\n </Button>\n <Button\n variant=\"primary\"\n disabled={!variant.availableForSale}\n size=\"lg\"\n className=\"w-1/2 tablet:w-auto\"\n onClick={() => onBuyNow?.()}\n >\n {copyWriting?.buyNow ?? 'Buy Now'}\n </Button>\n </div>\n </div>\n )\n}\n\nexport default ProductActions\n"],
|
|
5
|
-
"mappings": "AAoBU,OACE,OAAAA,EADF,QAAAC,MAAA,oBApBV,OAAS,QAAAC,EAAM,UAAAC,MAAc,4BAC7B,OAAS,kBAAAC,MAAsB,oCAC/B,OAAS,qBAAAC,MAAyB,8BAClC,OAAS,WAAAC,MAAe,QACxB,OAAS,eAAAC,MAAmB,iBAC5B,OAAOC,MAAa,aAEpB,MAAMC,EAAiB,IAAM,CAC3B,KAAM,CAAE,YAAAC,EAAa,OAAAC,EAAS,IAAK,EAAIP,EAAe,EAChD,CAAE,QAAAQ,EAAS,WAAAC,EAAY,aAAAC,EAAc,aAAAC,EAAc,YAAAC,EAAa,SAAAC,EAAU,aAAAC,CAAa,EAAIb,EAAkB,EAE7Gc,EAA8Bb,EAClC,IAAM,IAAIE,EAAQO,CAAY,EAAE,MAAMG,EAAa,QAAQ,EAAE,SAAS,EACtE,CAACH,EAAcG,CAAY,CAC7B,EAEA,OACEjB,EAAC,OAAI,UAAU,6EACZ,UAAAW,EAAQ,iBACPX,EAAC,OAAI,UAAU,sEACb,UAAAA,EAAC,OAAI,UAAU,0BACb,UAAAD,EAACE,EAAA,CACC,UAAU,kDACV,KAAMK,EAAY,CAAE,OAAQM,EAAY,aAAcD,EAAQ,MAAM,aAAc,OAAAD,CAAO,CAAC,EAC5F,EACAX,EAACE,EAAA,CACC,UAAU,2EACV,KAAMK,EAAY,CAChB,OAAQY,EACR,aAAcP,EAAQ,MAAM,aAC5B,OAAAD,CACF,CAAC,EACH,GACF,EACAX,EAACE,EAAA,CACC,UAAU,iEACV,KAAM,GAAGQ,GAAa,YAAY,IAAIH,EAAY,CAAE,OAAQO,EAAc,aAAcF,EAAQ,MAAM,aAAc,OAAAD,CAAO,CAAC,CAAC,GAC/H,GACF,EAEAX,EAACE,EAAA,CAAK,UAAU,uCAAuC,KAAMQ,GAAa,SAAW,WAAY,EAEnGT,EAAC,OAAI,UAAU,2CACb,UAAAD,EAACG,EAAA,CACC,QAAQ,YACR,SAAU,CAACS,EAAQ,iBACnB,KAAK,KACL,UAAU,sBACV,QAAS,IAAMI,IAAc,EAE5B,SAAAN,GAAa,WAAa,cAC7B,EACAV,EAACG,EAAA,CACC,QAAQ,UACR,SAAU,CAACS,EAAQ,iBACnB,KAAK,KACL,UAAU,sBACV,QAAS,IAAMK,IAAW,EAEzB,SAAAP,GAAa,QAAU,UAC1B,GACF,GACF,CAEJ,EAEA,IAAOU,EAAQX",
|
|
6
|
-
"names": ["jsx", "jsxs", "Text", "Button", "useAiuiContext", "useProductContext", "useMemo", "formatPrice", "Decimal", "ProductActions", "copyWriting", "locale", "variant", "finalPrice", "totalSavings", "comparePrice", "onAddToCart", "onBuyNow", "savingDetail", "comparePriceRemovedFreeGift", "ProductActions_default"]
|
|
7
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as t,jsxs as a}from"react/jsx-runtime";import"../../../../AiuiProvider/index.js";import{cn as f}from"../../../../../helpers/index.js";import{useState as c,useCallback as p,useRef as x}from"react";import{gsap as N}from"gsap";import{useProductContext as S}from"../../../ProductProvider.js";const h=({tabs:l,purchaseBarHeight:s,onSpyNavItemClick:i})=>{const[n,r]=c(!1),[o,m]=c(l?.[0]),d=x(null),{renderRating:u}=S(),b=p(e=>{m(e),i?.(e),r(!1)},[]),v=p(()=>{r(!n),N.fromTo(d?.current,{height:0},{height:"auto",duration:.5,ease:"power2.inOut"})},[n]);return a("div",{children:[t("button",{className:"text-sm h-[28px] font-bold leading-[28px] px-[10px] border rounded-full border-black",onClick:v,children:o?.label}),a("div",{className:f("absolute top-full w-full flex flex-col z-[60] bg-black/60 left-0",{hidden:!n}),style:{height:`calc(100dvh - ${s}px)`},children:[a("div",{ref:d,className:"border-t overflow-hidden border-[#E4E5E6] flex flex-col bg-white",children:[l?.map(e=>t("button",{className:"text-sm hover:bg-[#EAEAEC] p-4 text-left font-bold",onClick:()=>b(e),children:e.label},e.id)),t("button",{className:"text-sm hover:bg-[#EAEAEC] p-4 text-left font-bold",children:u})]}),t("div",{className:"flex-1",onClick:()=>r(!1)})]})]})},y=({tabs:l,onSpyNavItemClick:s})=>{const[i,n]=c(l?.[0]),r=p(o=>{n(o),s?.(o)},[]);return t("div",{className:"flex gap-8",children:l?.map(o=>a("button",{className:"text-sm relative py-[10px] font-bold",onClick:()=>r(o),children:[o.label,t("div",{className:f("absolute bottom-0 left-0 w-0 transition-all duration-300 ease-in-out h-[2px] bg-brand-0",{"w-full":i?.id===o.id})})]},o.id))})};export{y as DesktopScrollSpyNav,h as MobileScrollSpyNav};
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../../src/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import { useAiuiContext } from '../../../../AiuiProvider/index.js'\nimport { cn } from '../../../../../helpers/index.js'\nimport { useState, useCallback, useRef } from 'react'\nimport { gsap } from 'gsap'\nimport type { ScrollSpyNavItem, ScrollSpyNavProps } from './types.js'\nimport { useProductContext } from '../../../ProductProvider.js'\n\nconst MobileScrollSpyNav = ({ tabs, purchaseBarHeight, onSpyNavItemClick }: ScrollSpyNavProps) => {\n const [dropdownOpen, setDropdownOpen] = useState(false)\n const [activeTab, setActiveTab] = useState(tabs?.[0])\n const dropdownRef = useRef<HTMLDivElement>(null)\n const { renderRating } = useProductContext()\n \n const onTabClick = useCallback((tab: ScrollSpyNavItem) => {\n setActiveTab(tab)\n onSpyNavItemClick?.(tab)\n setDropdownOpen(false)\n }, [])\n\n const onDropdownOpen = useCallback(() => {\n setDropdownOpen(!dropdownOpen)\n gsap.fromTo(dropdownRef?.current, { height: 0 }, { height: 'auto', duration: 0.5, ease: 'power2.inOut' })\n }, [dropdownOpen])\n\n return (\n <div>\n <button\n className=\"text-sm h-[28px] font-bold leading-[28px] px-[10px] border rounded-full border-black\"\n onClick={onDropdownOpen}\n >\n {activeTab?.label}\n </button>\n <div\n className={cn('absolute top-full w-full flex flex-col z-[60] bg-black/60 left-0', {\n ['hidden']: !dropdownOpen,\n })}\n style={{\n height: `calc(100dvh - ${purchaseBarHeight}px)`,\n }}\n >\n <div ref={dropdownRef} className=\"border-t overflow-hidden border-[#E4E5E6] flex flex-col bg-white\">\n {tabs?.map(tab => (\n <button\n className=\"text-sm hover:bg-[#EAEAEC] p-4 text-left font-bold\"\n key={tab.id}\n onClick={() => onTabClick(tab)}\n >\n {tab.label}\n </button>\n ))}\n <button className=\"text-sm hover:bg-[#EAEAEC] p-4 text-left font-bold\">{renderRating}</button>\n </div>\n <div className=\"flex-1\" onClick={() => setDropdownOpen(false)} />\n </div>\n </div>\n )\n}\n\nconst DesktopScrollSpyNav = ({ tabs, onSpyNavItemClick }: ScrollSpyNavProps) => {\n const [activeTab, setActiveTab] = useState(tabs?.[0])\n\n const onTabClick = useCallback((tab: ScrollSpyNavItem) => {\n setActiveTab(tab)\n onSpyNavItemClick?.(tab)\n }, [])\n\n return (\n <div className=\"flex gap-8\">\n {tabs?.map(tab => (\n <button className=\"text-sm relative py-[10px] font-bold\" key={tab.id} onClick={() => onTabClick(tab)}>\n {tab.label}\n <div\n className={cn('absolute bottom-0 left-0 w-0 transition-all duration-300 ease-in-out h-[2px] bg-brand-0', {\n 'w-full': activeTab?.id === tab.id,\n })}\n />\n </button>\n ))}\n </div>\n )\n}\n\nexport { Mob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Aa,GACvF,EACAjB,EAAC,OAAI,UAAU,SAAS,QAAS,IAAMa,EAAgB,EAAK,EAAG,GACjE,GACF,CAEJ,EAEMQ,EAAsB,CAAC,CAAE,KAAAZ,EAAM,kBAAAE,CAAkB,IAAyB,CAC9E,KAAM,CAACG,EAAWC,CAAY,EAAIZ,EAASM,IAAO,CAAC,CAAC,EAE9CS,EAAad,EAAae,GAA0B,CACxDJ,EAAaI,CAAG,EAChBR,IAAoBQ,CAAG,CACzB,EAAG,CAAC,CAAC,EAEL,OACEnB,EAAC,OAAI,UAAU,aACZ,SAAAS,GAAM,IAAIU,GACTlB,EAAC,UAAO,UAAU,uCAAoD,QAAS,IAAMiB,EAAWC,CAAG,EAChG,UAAAA,EAAI,MACLnB,EAAC,OACC,UAAWE,EAAG,0FAA2F,CACvG,SAAUY,GAAW,KAAOK,EAAI,EAClC,CAAC,EACH,IAN4DA,EAAI,EAOlE,CACD,EACH,CAEJ",
|
|
6
|
-
"names": ["jsx", "jsxs", "cn", "useState", "useCallback", "useRef", "gsap", "useProductContext", "MobileScrollSpyNav", "tabs", "purchaseBarHeight", "onSpyNavItemClick", "dropdownOpen", "setDropdownOpen", "activeTab", "setActiveTab", "dropdownRef", "renderRating", "onTabClick", "tab", "onDropdownOpen", "DesktopScrollSpyNav"]
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=types.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as e,jsxs as a}from"react/jsx-runtime";import{useEffect as m,useState as n,useMemo as u}from"react";import{Heading as d,Container as f}from"../../../../components";import"gsap";import"../../../AiuiProvider/index.js";import"../../../../helpers/index.js";import{ProductActions as b}from"../index.js";import{useProductContext as h}from"../../ProductProvider.js";import{MobileScrollSpyNav as y,DesktopScrollSpyNav as v}from"./ScrollSpyNav/index.js";const g=({onSpyNavItemClick:o})=>{const[p,i]=n(0),{isMobile:x,product:t,renderRating:l,isDesktop:r}=h(),s=u(()=>t?.payload?.components?.find(c=>c.componentKey==="PurchaseBar")?.data||[],[t?.payload]);return m(()=>{i(document.querySelector("#purchase-bar")?.clientHeight||0)},[]),e("div",{id:"purchase-bar",className:"bg-white sticky top-0 left-0 w-full z-[52]",children:e(f,{className:"py-3 desktop:pt-6 desktop:pb-0",children:a("div",{className:"flex gap-[10px] items-center tablet:justify-between tablet:gap-0 tablet:w-full",children:[a("div",{className:"flex-1 tablet:flex-none",children:[e(d,{size:2,className:"line-clamp-2 tablet:max-w-[406px] desktop:max-w-none",html:t?.title}),r&&a("div",{className:"flex justify-between gap-8 items-center",children:[e(v,{tabs:s,onSpyNavItemClick:o}),l]})]}),r?e(b,{}):e(y,{tabs:s,purchaseBarHeight:p,onSpyNavItemClick:o})]})})})};var q=g;export{q as default};
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../src/biz-components/Listing/components/PurchaseBar/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import { useCallback, useEffect, useRef, useState, useMemo } from 'react'\nimport { Text, Heading, Button, Container } from '../../../../components'\nimport type { PurchaseBarProps, ScrollSpyNavProps, ScrollSpyNavItem } from './types.js'\nimport { gsap } from 'gsap'\nimport { useAiuiContext } from '../../../AiuiProvider/index.js'\nimport { cn } from '../../../../helpers/index.js'\nimport { ProductActions } from '../index.js'\nimport { useProductContext } from '../../ProductProvider.js'\nimport { MobileScrollSpyNav, DesktopScrollSpyNav } from './ScrollSpyNav/index.js'\n\nconst PurchaseBar = ({ onSpyNavItemClick }: PurchaseBarProps) => {\n const [purchaseBarHeight, setPurchaseBarHeight] = useState(0)\n const { isMobile, product, renderRating, isDesktop } = useProductContext()\n\n const PurchaseBarData = useMemo(() => {\n return product?.payload?.components?.find((item: any) => item.componentKey === 'PurchaseBar')?.data || []\n }, [product?.payload])\n\n useEffect(() => {\n setPurchaseBarHeight(document.querySelector('#purchase-bar')?.clientHeight || 0)\n }, [])\n\n return (\n <div id=\"purchase-bar\" className=\"bg-white sticky top-0 left-0 w-full z-[52]\">\n <Container className=\"py-3 desktop:pt-6 desktop:pb-0\">\n <div className=\"flex gap-[10px] items-center tablet:justify-between tablet:gap-0 tablet:w-full\">\n <div className=\"flex-1 tablet:flex-none\">\n <Heading size={2} className=\"line-clamp-2 tablet:max-w-[406px] desktop:max-w-none\" html={product?.title} />\n {isDesktop && (\n <div className=\"flex justify-between gap-8 items-center\">\n <DesktopScrollSpyNav tabs={PurchaseBarData} onSpyNavItemClick={onSpyNavItemClick} />\n {renderRating}\n </div>\n )}\n </div>\n {!isDesktop ? (\n <MobileScrollSpyNav\n tabs={PurchaseBarData}\n purchaseBarHeight={purchaseBarHeight}\n onSpyNavItemClick={onSpyNavItemClick}\n />\n ) : (\n <ProductActions />\n )}\n </div>\n </Container>\n </div>\n )\n}\n\nexport default PurchaseBar\n"],
|
|
5
|
-
"mappings": "AA2BY,cAAAA,EAEE,QAAAC,MAFF,oBA3BZ,OAAsB,aAAAC,EAAmB,YAAAC,EAAU,WAAAC,MAAe,QAClE,OAAe,WAAAC,EAAiB,aAAAC,MAAiB,yBAEjD,MAAqB,OACrB,MAA+B,iCAC/B,MAAmB,+BACnB,OAAS,kBAAAC,MAAsB,cAC/B,OAAS,qBAAAC,MAAyB,2BAClC,OAAS,sBAAAC,EAAoB,uBAAAC,MAA2B,0BAExD,MAAMC,EAAc,CAAC,CAAE,kBAAAC,CAAkB,IAAwB,CAC/D,KAAM,CAACC,EAAmBC,CAAoB,EAAIX,EAAS,CAAC,EACtD,CAAE,SAAAY,EAAU,QAAAC,EAAS,aAAAC,EAAc,UAAAC,CAAU,EAAIV,EAAkB,EAEnEW,EAAkBf,EAAQ,IACvBY,GAAS,SAAS,YAAY,KAAMI,GAAcA,EAAK,eAAiB,aAAa,GAAG,MAAQ,CAAC,EACvG,CAACJ,GAAS,OAAO,CAAC,EAErB,OAAAd,EAAU,IAAM,CACdY,EAAqB,SAAS,cAAc,eAAe,GAAG,cAAgB,CAAC,CACjF,EAAG,CAAC,CAAC,EAGHd,EAAC,OAAI,GAAG,eAAe,UAAU,6CAC/B,SAAAA,EAACM,EAAA,CAAU,UAAU,iCACnB,SAAAL,EAAC,OAAI,UAAU,iFACb,UAAAA,EAAC,OAAI,UAAU,0BACb,UAAAD,EAACK,EAAA,CAAQ,KAAM,EAAG,UAAU,uDAAuD,KAAMW,GAAS,MAAO,EACxGE,GACCjB,EAAC,OAAI,UAAU,0CACb,UAAAD,EAACU,EAAA,CAAoB,KAAMS,EAAiB,kBAAmBP,EAAmB,EACjFK,GACH,GAEJ,EACEC,EAOAlB,EAACO,EAAA,EAAe,EANhBP,EAACS,EAAA,CACC,KAAMU,EACN,kBAAmBN,EACnB,kBAAmBD,EACrB,GAIJ,EACF,EACF,CAEJ,EAEA,IAAOS,EAAQV",
|
|
6
|
-
"names": ["jsx", "jsxs", "useEffect", "useState", "useMemo", "Heading", "Container", "ProductActions", "useProductContext", "MobileScrollSpyNav", "DesktopScrollSpyNav", "PurchaseBar", "onSpyNavItemClick", "purchaseBarHeight", "setPurchaseBarHeight", "isMobile", "product", "renderRating", "isDesktop", "PurchaseBarData", "item", "PurchaseBar_default"]
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=types.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../src/biz-components/Listing/components/index.ts"],
|
|
4
|
-
"sourcesContent": ["export { default as PurchaseBar } from './PurchaseBar/index.js'\nexport { default as ProductActions } from './PurchaseBar/ProductActions/index.js'\nexport { default as ProductCard } from './ProductCard/index.js'"],
|
|
5
|
-
"mappings": "AAAA,OAAoB,WAAXA,MAA8B,yBACvC,OAAoB,WAAXA,MAAiC,wCAC1C,OAAoB,WAAXA,MAA8B",
|
|
6
|
-
"names": ["default"]
|
|
7
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var L=(e=>(e.fixedAmount="fixed_amount",e.percentage="percentage",e))(L||{}),c=(r=>(r.LIGHTNING_DEAL="LIGHTNING_DEAL",r.DEAL="LIGHTNING_DEAL",r.COUPON="COUPON",r.PED="PED",r.WS24="WS24",r.WSTD="WSTD",r.WSCH="WSCH",r))(c||{});const E={us:"$",uk:"\xA3",ca:"$",eu:"\u20AC",pl:"z\u0142",fr:"\u20AC",de:"\u20AC",vn:"\u20AB",cl:"$",sg:"$",ae:"AED",es:"\u20AC"},t=["color","colour","couleur","cor","colore","farbe","\uC0C9","\u8272","\u30AB\u30E9\u30FC","f\xE4rg","farve"];export{t as COLOR_LABEL,c as CouponChannel,L as DiscountType,E as PRICE_SYMBOL};
|
|
2
|
-
//# sourceMappingURL=const.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/biz-components/Listing/const.ts"],
|
|
4
|
-
"sourcesContent": ["export enum DiscountType {\n fixedAmount = 'fixed_amount',\n percentage = 'percentage',\n}\n\nexport enum CouponChannel {\n LIGHTNING_DEAL = 'LIGHTNING_DEAL',\n DEAL = 'LIGHTNING_DEAL',\n COUPON = 'COUPON',\n PED = 'PED',\n WS24 = 'WS24',\n WSTD = 'WSTD',\n WSCH = 'WSCH',\n}\n\nexport const PRICE_SYMBOL = {\n us: '$',\n uk: '\u00A3',\n ca: '$',\n eu: '\u20AC',\n pl: 'z\u0142',\n fr: '\u20AC',\n de: '\u20AC',\n vn: '\u20AB',\n cl: '$',\n sg: '$',\n ae: 'AED',\n es: '\u20AC',\n}\n\nexport const COLOR_LABEL = [\n 'color',\n 'colour',\n 'couleur',\n 'cor',\n 'colore',\n 'farbe',\n '\uC0C9',\n '\u8272',\n '\u30AB\u30E9\u30FC',\n 'f\u00E4rg',\n 'farve',\n]"],
|
|
5
|
-
"mappings": "AAAO,IAAKA,OACVA,EAAA,YAAc,eACdA,EAAA,WAAa,aAFHA,OAAA,IAKAC,OACVA,EAAA,eAAiB,iBACjBA,EAAA,KAAO,iBACPA,EAAA,OAAS,SACTA,EAAA,IAAM,MACNA,EAAA,KAAO,OACPA,EAAA,KAAO,OACPA,EAAA,KAAO,OAPGA,OAAA,IAUL,MAAMC,EAAe,CAC1B,GAAI,IACJ,GAAI,OACJ,GAAI,IACJ,GAAI,SACJ,GAAI,UACJ,GAAI,SACJ,GAAI,SACJ,GAAI,SACJ,GAAI,IACJ,GAAI,IACJ,GAAI,MACJ,GAAI,QACN,EAEaC,EAAc,CACzB,QACA,SACA,UACA,MACA,SACA,QACA,SACA,SACA,qBACA,UACA,OACF",
|
|
6
|
-
"names": ["DiscountType", "CouponChannel", "PRICE_SYMBOL", "COLOR_LABEL"]
|
|
7
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{btoaID as f,isObjEmpty as m}from"../utils/helper";import{parse as u}from"query-string";import{useEffect as d,useState as O}from"react";import{optionsConstructor as v}from"../utils";function l(t,o){const[p,i]=O({});return d(()=>{const n=u(window.location.search);let r=t.variants[0];if(n.variant){const c=f(n.variant),a=t.variants.find(e=>o?e.sku===o:e.id===c);a&&(r=a)}const s=v(r.options);m(s)||i(s)},[t,o]),[p,i]}export{l as useSelectedOptions};
|
|
2
|
-
//# sourceMappingURL=use-options.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../src/biz-components/Listing/hooks/use-options.ts"],
|
|
4
|
-
"sourcesContent": ["import type { Options, Product, ProductVariant } from '../types/product'\nimport { btoaID, isObjEmpty } from '../utils/helper'\nimport { parse } from 'query-string'\nimport { type Dispatch, type SetStateAction, useEffect, useState } from 'react'\n\nimport { optionsConstructor } from '../utils'\n\nexport function useSelectedOptions(product: Product, sku?: string) {\n /**\n * \u6839\u636E query string \u521D\u59CB\u5316 selectedOptions\n * \u5982\u679C\u4F20\u5165 sku \u5219\u6839\u636E sku \u83B7\u53D6 variant\uFF0C\u5426\u5219\u9ED8\u8BA4\u6839\u636E query \u7684 variant \u83B7\u53D6\n */\n const [options, setOptions] = useState<Options>({})\n\n useEffect(() => {\n const query = parse(window.location.search) as { variant?: string }\n // \u9875\u9762\u521D\u59CB\u5316\u8BFB\u53D6 query \u4E2D\u7684 variant, \u5982\u679C\u6CA1\u6709\u627E\u5230\u5BF9\u5E94 query \u4E2D id \u7684 variant\uFF0C\u9ED8\u8BA4\u9009\u4E2D\u7B2C\u4E00\u4E2A\n let variant = product.variants[0]\n if (query.variant) {\n const variantId = btoaID(query.variant)\n\n const foundVariant = product.variants.find((variant: ProductVariant) =>\n sku ? variant.sku === sku : variant.id === variantId,\n )\n if (foundVariant) {\n variant = foundVariant\n }\n }\n\n // \u66F4\u65B0\u5F53\u524D variant \u5BF9\u5E94\u7684 options\n const options = optionsConstructor(variant.options)\n\n if (!isObjEmpty(options)) {\n setOptions(options)\n }\n }, [product, sku])\n\n return [options, setOptions] as [Options, Dispatch<SetStateAction<Options>>]\n}\n"],
|
|
5
|
-
"mappings": "AACA,OAAS,UAAAA,EAAQ,cAAAC,MAAkB,kBACnC,OAAS,SAAAC,MAAa,eACtB,OAA6C,aAAAC,EAAW,YAAAC,MAAgB,QAExE,OAAS,sBAAAC,MAA0B,WAE5B,SAASC,EAAmBC,EAAkBC,EAAc,CAKjE,KAAM,CAACC,EAASC,CAAU,EAAIN,EAAkB,CAAC,CAAC,EAElD,OAAAD,EAAU,IAAM,CACd,MAAMQ,EAAQT,EAAM,OAAO,SAAS,MAAM,EAE1C,IAAIU,EAAUL,EAAQ,SAAS,CAAC,EAChC,GAAII,EAAM,QAAS,CACjB,MAAME,EAAYb,EAAOW,EAAM,OAAO,EAEhCG,EAAeP,EAAQ,SAAS,KAAMK,GAC1CJ,EAAMI,EAAQ,MAAQJ,EAAMI,EAAQ,KAAOC,CAC7C,EACIC,IACFF,EAAUE,EAEd,CAGA,MAAML,EAAUJ,EAAmBO,EAAQ,OAAO,EAE7CX,EAAWQ,CAAO,GACrBC,EAAWD,CAAO,CAEtB,EAAG,CAACF,EAASC,CAAG,CAAC,EAEV,CAACC,EAASC,CAAU,CAC7B",
|
|
6
|
-
"names": ["btoaID", "isObjEmpty", "parse", "useEffect", "useState", "optionsConstructor", "useSelectedOptions", "product", "sku", "options", "setOptions", "query", "variant", "variantId", "foundVariant"]
|
|
7
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{MediaContentType as a}from"../types/graphql";import{getVariantMediaList as f}from"../utils/helper";import{useEffect as C,useState as s}from"react";function v({product:i,variant:m}){const d=i?.media?.filter(e=>e.mediaContentType===a.Image),o=[d?.[0]],r=d?.slice(1,o.length),c=d?.slice(2,o.length),p=i?.media?.filter(e=>e.mediaContentType===a.Video),[M,g]=s(o||[]),[y,L]=s(r||[]),[u,l]=s(p||[]),[I,V]=s(c||[]);return C(()=>{const e=f({product:i,variant:m}),t=e?.filter(n=>n.mediaContentType===a.Image);g(t?.[0]?[t[0]]:[]),L(t?.slice(1,t?.length)||[]),V(t?.slice(2,t?.length)||[]),l(e?.filter(n=>n.mediaContentType===a.Video)||[])},[i,m]),{productList:M,sceneList:y,videoList:u,keyFeaturesList:I}}export{v as useVariantMedia};
|
|
2
|
-
//# sourceMappingURL=use-variant-media.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../src/biz-components/Listing/hooks/use-variant-media.ts"],
|
|
4
|
-
"sourcesContent": ["import { MediaContentType } from '../types/graphql'\nimport { getVariantMediaList } from '../utils/helper'\nimport type { Replace } from '../types/type-helper'\nimport type { Product, ProductMedia, ProductVariant } from '../types/product'\nimport { useEffect, useState } from 'react'\n\nexport type ImageMedia = Replace<ProductMedia, 'mediaContentType', MediaContentType.Image>\nexport type VideoMedia = Replace<ProductMedia, 'mediaContentType', MediaContentType.Video>\n\nexport function useVariantMedia({ product, variant }: { product: Product; variant: ProductVariant }): {\n productList: ImageMedia[]\n sceneList: ImageMedia[]\n keyFeaturesList: ImageMedia[]\n videoList: VideoMedia[]\n} {\n const mediaList = product?.media?.filter((media) => media.mediaContentType === MediaContentType.Image)\n const productImageList = [mediaList?.[0]] as ImageMedia[]\n const scenes = mediaList?.slice(1, productImageList.length) as ImageMedia[]\n const keyFeatures = mediaList?.slice(2, productImageList.length) as ImageMedia[]\n const videos = product?.media?.filter((media) => media.mediaContentType === MediaContentType.Video) as VideoMedia[]\n const [imageList, setImageList] = useState<ImageMedia[]>(productImageList || [])\n const [sceneList, setSeneList] = useState<ImageMedia[]>(scenes || [])\n const [videoList, setVideoList] = useState<VideoMedia[]>(videos || [])\n const [keyFeaturesList, setKeyFeaturesList] = useState<ImageMedia[]>(keyFeatures || [])\n useEffect(() => {\n const mediaList = getVariantMediaList({ product, variant })\n\n const imageList = mediaList?.filter((media) => media.mediaContentType === MediaContentType.Image) as ImageMedia[]\n setImageList(imageList?.[0] ? [imageList[0]] : [])\n setSeneList(imageList?.slice(1, imageList?.length) || [])\n setKeyFeaturesList(imageList?.slice(2, imageList?.length) || [])\n setVideoList(\n (mediaList?.filter((media) => media.mediaContentType === MediaContentType.Video) as VideoMedia[]) || [],\n )\n }, [product, variant])\n\n return { productList: imageList, sceneList, videoList: videoList, keyFeaturesList }\n}\n"],
|
|
5
|
-
"mappings": "AAAA,OAAS,oBAAAA,MAAwB,mBACjC,OAAS,uBAAAC,MAA2B,kBAGpC,OAAS,aAAAC,EAAW,YAAAC,MAAgB,QAK7B,SAASC,EAAgB,CAAE,QAAAC,EAAS,QAAAC,CAAQ,EAKjD,CACA,MAAMC,EAAYF,GAAS,OAAO,OAAQG,GAAUA,EAAM,mBAAqBR,EAAiB,KAAK,EAC/FS,EAAmB,CAACF,IAAY,CAAC,CAAC,EAClCG,EAASH,GAAW,MAAM,EAAGE,EAAiB,MAAM,EACpDE,EAAcJ,GAAW,MAAM,EAAGE,EAAiB,MAAM,EACzDG,EAASP,GAAS,OAAO,OAAQG,GAAUA,EAAM,mBAAqBR,EAAiB,KAAK,EAC5F,CAACa,EAAWC,CAAY,EAAIX,EAAuBM,GAAoB,CAAC,CAAC,EACzE,CAACM,EAAWC,CAAW,EAAIb,EAAuBO,GAAU,CAAC,CAAC,EAC9D,CAACO,EAAWC,CAAY,EAAIf,EAAuBS,GAAU,CAAC,CAAC,EAC/D,CAACO,EAAiBC,CAAkB,EAAIjB,EAAuBQ,GAAe,CAAC,CAAC,EACtF,OAAAT,EAAU,IAAM,CACd,MAAMK,EAAYN,EAAoB,CAAE,QAAAI,EAAS,QAAAC,CAAQ,CAAC,EAEpDO,EAAYN,GAAW,OAAQC,GAAUA,EAAM,mBAAqBR,EAAiB,KAAK,EAChGc,EAAaD,IAAY,CAAC,EAAI,CAACA,EAAU,CAAC,CAAC,EAAI,CAAC,CAAC,EACjDG,EAAYH,GAAW,MAAM,EAAGA,GAAW,MAAM,GAAK,CAAC,CAAC,EACxDO,EAAmBP,GAAW,MAAM,EAAGA,GAAW,MAAM,GAAK,CAAC,CAAC,EAC/DK,EACGX,GAAW,OAAQC,GAAUA,EAAM,mBAAqBR,EAAiB,KAAK,GAAsB,CAAC,CACxG,CACF,EAAG,CAACK,EAASC,CAAO,CAAC,EAEd,CAAE,YAAaO,EAAW,UAAAE,EAAW,UAAWE,EAAW,gBAAAE,CAAgB,CACpF",
|
|
6
|
-
"names": ["MediaContentType", "getVariantMediaList", "useEffect", "useState", "useVariantMedia", "product", "variant", "mediaList", "media", "productImageList", "scenes", "keyFeatures", "videos", "imageList", "setImageList", "sceneList", "setSeneList", "videoList", "setVideoList", "keyFeaturesList", "setKeyFeaturesList"]
|
|
7
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{useEffect as e,useState as n}from"react";import{getFirstAvailableVariant as s,getVariantFromSelectedOptions as c}from"../utils/index";function f({product:t,selectedOptions:a}){const[r,o]=n(s(t));return e(()=>{const i=c({product:t,selectedOptions:a});i&&i.id!==r.id&&o(i)},[a,t.variants,r,t]),r}export{f as useVariant};
|
|
2
|
-
//# sourceMappingURL=use-variant.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../src/biz-components/Listing/hooks/use-variant.ts"],
|
|
4
|
-
"sourcesContent": ["import type { Options, Product, ProductVariant } from '../types/product'\nimport { useEffect, useState } from 'react'\n\nimport { getFirstAvailableVariant, getVariantFromSelectedOptions } from '../utils/index'\n\nexport function useVariant({\n product,\n selectedOptions,\n}: {\n product: Product\n selectedOptions: Options\n}): ProductVariant {\n const [variant, setVariant] = useState(getFirstAvailableVariant(product))\n\n // \u6839\u636E\u5DF2\u9009\u7684 option \u83B7\u53D6\u5F53\u524D\u7684 variant\n useEffect(() => {\n const v = getVariantFromSelectedOptions({ product, selectedOptions })\n if (v && v.id !== variant.id) {\n setVariant(v)\n }\n }, [selectedOptions, product.variants, variant, product])\n\n return variant\n}\n"],
|
|
5
|
-
"mappings": "AACA,OAAS,aAAAA,EAAW,YAAAC,MAAgB,QAEpC,OAAS,4BAAAC,EAA0B,iCAAAC,MAAqC,iBAEjE,SAASC,EAAW,CACzB,QAAAC,EACA,gBAAAC,CACF,EAGmB,CACjB,KAAM,CAACC,EAASC,CAAU,EAAIP,EAASC,EAAyBG,CAAO,CAAC,EAGxE,OAAAL,EAAU,IAAM,CACd,MAAMS,EAAIN,EAA8B,CAAE,QAAAE,EAAS,gBAAAC,CAAgB,CAAC,EAChEG,GAAKA,EAAE,KAAOF,EAAQ,IACxBC,EAAWC,CAAC,CAEhB,EAAG,CAACH,EAAiBD,EAAQ,SAAUE,EAASF,CAAO,CAAC,EAEjDE,CACT",
|
|
6
|
-
"names": ["useEffect", "useState", "getFirstAvailableVariant", "getVariantFromSelectedOptions", "useVariant", "product", "selectedOptions", "variant", "setVariant", "v"]
|
|
7
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{useState as t,useCallback as i}from"react";const p=()=>{const[s,r]=t(!1),[l,o]=t(null),n=i(async a=>{try{await navigator.clipboard.writeText(a),r(!0),o(null)}catch(e){r(!1),o(e instanceof Error?e:new Error("Copy failed"))}finally{setTimeout(()=>{r(!1)},2e3)}},[]);return{isCopied:s,copyError:l,copyToClipboard:n,reset:()=>{r(!1),o(null)}}};var y=p;export{y as default};
|
|
2
|
-
//# sourceMappingURL=useCopy.js.map
|