@anker-in/headless-ui 1.3.56 → 1.3.58
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/AccessoriesShelf/components/AccessoriesProductGrid/index.d.ts +11 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoriesProductGrid/index.js +2 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoriesProductGrid/index.js.map +7 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/ProductCard.d.ts +23 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/ProductCard.js +2 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/ProductCard.js.map +7 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/index.d.ts +40 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/index.js +2 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/index.js.map +7 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/types.d.ts +107 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/types.js +2 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/types.js.map +7 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AddToCartSuccessPopover/index.d.ts +82 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AddToCartSuccessPopover/index.js +2 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AddToCartSuccessPopover/index.js.map +7 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/MainProductArea/index.d.ts +22 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/MainProductArea/index.js +2 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/MainProductArea/index.js.map +7 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/PromoBanner/index.d.ts +10 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/PromoBanner/index.js +2 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/PromoBanner/index.js.map +7 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/SectionHeader/index.d.ts +9 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/SectionHeader/index.js +2 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/SectionHeader/index.js.map +7 -0
- package/dist/cjs/biz-components/AccessoriesShelf/index.d.ts +9 -0
- package/dist/cjs/biz-components/AccessoriesShelf/index.js +2 -0
- package/dist/cjs/biz-components/AccessoriesShelf/index.js.map +7 -0
- package/dist/cjs/biz-components/AccessoriesShelf/types.d.ts +16 -0
- package/dist/cjs/biz-components/AccessoriesShelf/types.js +2 -0
- package/dist/cjs/biz-components/AccessoriesShelf/types.js.map +7 -0
- package/dist/cjs/biz-components/ActiveShelf/ProductCard.js +1 -1
- package/dist/cjs/biz-components/ActiveShelf/ProductCard.js.map +2 -2
- package/dist/cjs/biz-components/BuyOneGetOneShelf/PriceAndActions.js +1 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/PriceAndActions.js.map +2 -2
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/CartGiftSection.d.ts +15 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/CartGiftSection.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/CartGiftSection.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/GiftConfirmDialog.d.ts +11 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/GiftConfirmDialog.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/GiftConfirmDialog.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/index.d.ts +2 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/index.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/index.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/GiftOptionRow.d.ts +14 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/GiftOptionRow.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/GiftOptionRow.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/index.d.ts +2 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/index.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/index.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/index.d.ts +2 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/index.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/index.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/CartItemRow.d.ts +56 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/CartItemRow.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/CartItemRow.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/CartItemGiftShipping.d.ts +4 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/CartItemGiftShipping.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/CartItemGiftShipping.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/index.d.ts +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/index.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/index.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/types.d.ts +10 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/types.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/types.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemInfo/CartItemInfo.d.ts +11 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemInfo/CartItemInfo.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemInfo/CartItemInfo.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemInfo/index.d.ts +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemInfo/index.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemInfo/index.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemKsp/CartItemKsp.d.ts +13 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemKsp/CartItemKsp.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemKsp/CartItemKsp.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemKsp/index.d.ts +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemKsp/index.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemKsp/index.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/CartItemRemoveConfirm.d.ts +4 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/CartItemRemoveConfirm.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/CartItemRemoveConfirm.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/index.d.ts +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/index.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/index.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/types.d.ts +11 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/types.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/types.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemShipping/CartItemShipping.d.ts +8 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemShipping/CartItemShipping.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemShipping/CartItemShipping.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemShipping/index.d.ts +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemShipping/index.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemShipping/index.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/index.d.ts +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/index.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/index.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartPerksSection/CartPerksSection.d.ts +34 -0
- package/dist/cjs/biz-components/CartDetail/CartPerksSection/CartPerksSection.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartPerksSection/CartPerksSection.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartPerksSection/index.d.ts +2 -0
- package/dist/cjs/biz-components/CartDetail/CartPerksSection/index.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartPerksSection/index.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartPriceSummary/CartPriceSummary.d.ts +49 -0
- package/dist/cjs/biz-components/CartDetail/CartPriceSummary/CartPriceSummary.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartPriceSummary/CartPriceSummary.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartPriceSummary/index.d.ts +2 -0
- package/dist/cjs/biz-components/CartDetail/CartPriceSummary/index.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartPriceSummary/index.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartSummaryHeader/CartSummaryHeader.d.ts +26 -0
- package/dist/cjs/biz-components/CartDetail/CartSummaryHeader/CartSummaryHeader.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartSummaryHeader/CartSummaryHeader.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartSummaryHeader/index.d.ts +2 -0
- package/dist/cjs/biz-components/CartDetail/CartSummaryHeader/index.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartSummaryHeader/index.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartThirdParty/CartThirdParty.d.ts +10 -0
- package/dist/cjs/biz-components/CartDetail/CartThirdParty/CartThirdParty.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartThirdParty/CartThirdParty.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartThirdParty/index.d.ts +2 -0
- package/dist/cjs/biz-components/CartDetail/CartThirdParty/index.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartThirdParty/index.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/index.d.ts +16 -0
- package/dist/cjs/biz-components/CartDetail/index.js +2 -0
- package/dist/cjs/biz-components/CartDetail/index.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/types.d.ts +132 -0
- package/dist/cjs/biz-components/CartDetail/types.js +2 -0
- package/dist/cjs/biz-components/CartDetail/types.js.map +7 -0
- package/dist/cjs/biz-components/CreditsShelf/ProductCard.js +1 -1
- package/dist/cjs/biz-components/CreditsShelf/ProductCard.js.map +2 -2
- package/dist/cjs/biz-components/HeaderNavigation/index.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/index.js.map +2 -2
- package/dist/cjs/biz-components/ImageOverlayShelf/ProductCard.js +1 -1
- package/dist/cjs/biz-components/ImageOverlayShelf/ProductCard.js.map +2 -2
- package/dist/cjs/biz-components/MediaShelf/ProductCard.js +1 -1
- package/dist/cjs/biz-components/MediaShelf/ProductCard.js.map +2 -2
- package/dist/cjs/biz-components/SceneShelf/ProductsPanel.js +1 -1
- package/dist/cjs/biz-components/SceneShelf/ProductsPanel.js.map +2 -2
- package/dist/cjs/biz-components/SceneShelfV2/index.js +1 -1
- package/dist/cjs/biz-components/SceneShelfV2/index.js.map +2 -2
- package/dist/cjs/biz-components/SceneShelfV3/ProductCard.js +1 -1
- package/dist/cjs/biz-components/SceneShelfV3/ProductCard.js.map +2 -2
- package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js +1 -1
- package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js.map +2 -2
- package/dist/cjs/biz-components/index.d.ts +6 -0
- package/dist/cjs/biz-components/index.js +1 -1
- package/dist/cjs/biz-components/index.js.map +3 -3
- package/dist/cjs/components/breadcrumb.d.ts +12 -0
- package/dist/cjs/components/breadcrumb.js +2 -0
- package/dist/cjs/components/breadcrumb.js.map +7 -0
- package/dist/cjs/components/index.d.ts +3 -1
- package/dist/cjs/components/index.js +1 -1
- package/dist/cjs/components/index.js.map +3 -3
- package/dist/cjs/components/input-number.d.ts +22 -0
- package/dist/cjs/components/input-number.js +1 -1
- package/dist/cjs/components/input-number.js.map +3 -3
- package/dist/cjs/components/input.d.ts +5 -0
- package/dist/cjs/components/input.js +1 -1
- package/dist/cjs/components/input.js.map +3 -3
- package/dist/cjs/components/popover.d.ts +17 -2
- package/dist/cjs/components/popover.js +1 -1
- package/dist/cjs/components/popover.js.map +3 -3
- package/dist/cjs/components/toast.d.ts +25 -0
- package/dist/cjs/components/toast.js +2 -0
- package/dist/cjs/components/toast.js.map +7 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AccessoriesProductGrid/index.d.ts +11 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AccessoriesProductGrid/index.js +2 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AccessoriesProductGrid/index.js.map +7 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/ProductCard.d.ts +23 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/ProductCard.js +2 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/ProductCard.js.map +7 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/index.d.ts +40 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/index.js +2 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/index.js.map +7 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/types.d.ts +107 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/types.js +1 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/types.js.map +7 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AddToCartSuccessPopover/index.d.ts +82 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AddToCartSuccessPopover/index.js +2 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AddToCartSuccessPopover/index.js.map +7 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/MainProductArea/index.d.ts +22 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/MainProductArea/index.js +2 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/MainProductArea/index.js.map +7 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/PromoBanner/index.d.ts +10 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/PromoBanner/index.js +2 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/PromoBanner/index.js.map +7 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/SectionHeader/index.d.ts +9 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/SectionHeader/index.js +2 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/SectionHeader/index.js.map +7 -0
- package/dist/esm/biz-components/AccessoriesShelf/index.d.ts +9 -0
- package/dist/esm/biz-components/AccessoriesShelf/index.js +2 -0
- package/dist/esm/biz-components/AccessoriesShelf/index.js.map +7 -0
- package/dist/esm/biz-components/AccessoriesShelf/types.d.ts +16 -0
- package/dist/esm/biz-components/AccessoriesShelf/types.js +1 -0
- package/dist/esm/biz-components/AccessoriesShelf/types.js.map +7 -0
- package/dist/esm/biz-components/ActiveShelf/ProductCard.js +1 -1
- package/dist/esm/biz-components/ActiveShelf/ProductCard.js.map +2 -2
- package/dist/esm/biz-components/BuyOneGetOneShelf/PriceAndActions.js +1 -1
- package/dist/esm/biz-components/BuyOneGetOneShelf/PriceAndActions.js.map +2 -2
- package/dist/esm/biz-components/CartDetail/CartGiftSection/CartGiftSection.d.ts +15 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/CartGiftSection.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/CartGiftSection.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/GiftConfirmDialog.d.ts +11 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/GiftConfirmDialog.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/GiftConfirmDialog.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/index.d.ts +2 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/index.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/index.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/GiftOptionRow.d.ts +14 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/GiftOptionRow.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/GiftOptionRow.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/index.d.ts +2 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/index.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/index.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/index.d.ts +2 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/index.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/index.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/CartItemRow.d.ts +56 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/CartItemRow.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/CartItemRow.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/CartItemGiftShipping.d.ts +4 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/CartItemGiftShipping.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/CartItemGiftShipping.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/index.d.ts +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/index.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/index.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/types.d.ts +10 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/types.js +1 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/types.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemInfo/CartItemInfo.d.ts +11 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemInfo/CartItemInfo.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemInfo/CartItemInfo.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemInfo/index.d.ts +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemInfo/index.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemInfo/index.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemKsp/CartItemKsp.d.ts +13 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemKsp/CartItemKsp.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemKsp/CartItemKsp.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemKsp/index.d.ts +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemKsp/index.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemKsp/index.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/CartItemRemoveConfirm.d.ts +4 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/CartItemRemoveConfirm.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/CartItemRemoveConfirm.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/index.d.ts +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/index.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/index.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/types.d.ts +11 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/types.js +1 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/types.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemShipping/CartItemShipping.d.ts +8 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemShipping/CartItemShipping.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemShipping/CartItemShipping.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemShipping/index.d.ts +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemShipping/index.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemShipping/index.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/index.d.ts +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/index.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/index.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartPerksSection/CartPerksSection.d.ts +34 -0
- package/dist/esm/biz-components/CartDetail/CartPerksSection/CartPerksSection.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartPerksSection/CartPerksSection.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartPerksSection/index.d.ts +2 -0
- package/dist/esm/biz-components/CartDetail/CartPerksSection/index.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartPerksSection/index.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartPriceSummary/CartPriceSummary.d.ts +49 -0
- package/dist/esm/biz-components/CartDetail/CartPriceSummary/CartPriceSummary.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartPriceSummary/CartPriceSummary.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartPriceSummary/index.d.ts +2 -0
- package/dist/esm/biz-components/CartDetail/CartPriceSummary/index.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartPriceSummary/index.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartSummaryHeader/CartSummaryHeader.d.ts +26 -0
- package/dist/esm/biz-components/CartDetail/CartSummaryHeader/CartSummaryHeader.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartSummaryHeader/CartSummaryHeader.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartSummaryHeader/index.d.ts +2 -0
- package/dist/esm/biz-components/CartDetail/CartSummaryHeader/index.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartSummaryHeader/index.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartThirdParty/CartThirdParty.d.ts +10 -0
- package/dist/esm/biz-components/CartDetail/CartThirdParty/CartThirdParty.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartThirdParty/CartThirdParty.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartThirdParty/index.d.ts +2 -0
- package/dist/esm/biz-components/CartDetail/CartThirdParty/index.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartThirdParty/index.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/index.d.ts +16 -0
- package/dist/esm/biz-components/CartDetail/index.js +2 -0
- package/dist/esm/biz-components/CartDetail/index.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/types.d.ts +132 -0
- package/dist/esm/biz-components/CartDetail/types.js +1 -0
- package/dist/esm/biz-components/CartDetail/types.js.map +7 -0
- package/dist/esm/biz-components/CreditsShelf/ProductCard.js +1 -1
- package/dist/esm/biz-components/CreditsShelf/ProductCard.js.map +2 -2
- package/dist/esm/biz-components/HeaderNavigation/index.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/index.js.map +2 -2
- package/dist/esm/biz-components/ImageOverlayShelf/ProductCard.js +1 -1
- package/dist/esm/biz-components/ImageOverlayShelf/ProductCard.js.map +2 -2
- package/dist/esm/biz-components/MediaShelf/ProductCard.js +1 -1
- package/dist/esm/biz-components/MediaShelf/ProductCard.js.map +2 -2
- package/dist/esm/biz-components/SceneShelf/ProductsPanel.js +1 -1
- package/dist/esm/biz-components/SceneShelf/ProductsPanel.js.map +2 -2
- package/dist/esm/biz-components/SceneShelfV2/index.js +1 -1
- package/dist/esm/biz-components/SceneShelfV2/index.js.map +2 -2
- package/dist/esm/biz-components/SceneShelfV3/ProductCard.js +1 -1
- package/dist/esm/biz-components/SceneShelfV3/ProductCard.js.map +2 -2
- package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js +1 -1
- package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js.map +2 -2
- package/dist/esm/biz-components/index.d.ts +6 -0
- package/dist/esm/biz-components/index.js +1 -1
- package/dist/esm/biz-components/index.js.map +3 -3
- package/dist/esm/components/breadcrumb.d.ts +12 -0
- package/dist/esm/components/breadcrumb.js +2 -0
- package/dist/esm/components/breadcrumb.js.map +7 -0
- package/dist/esm/components/index.d.ts +3 -1
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/index.js.map +3 -3
- package/dist/esm/components/input-number.d.ts +22 -0
- package/dist/esm/components/input-number.js +1 -1
- package/dist/esm/components/input-number.js.map +3 -3
- package/dist/esm/components/input.d.ts +5 -0
- package/dist/esm/components/input.js +1 -1
- package/dist/esm/components/input.js.map +3 -3
- package/dist/esm/components/popover.d.ts +17 -2
- package/dist/esm/components/popover.js +1 -1
- package/dist/esm/components/popover.js.map +3 -3
- package/dist/esm/components/toast.d.ts +25 -0
- package/dist/esm/components/toast.js +2 -0
- package/dist/esm/components/toast.js.map +7 -0
- package/package.json +1 -1
- package/style.css +285 -6
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{Fragment as Pe,jsx as e,jsxs as o}from"react/jsx-runtime";import{forwardRef as ae,useCallback as ne,useEffect as G,useImperativeHandle as Ee,useMemo as D,useRef as J,useState as E}from"react";import{Picture as me,Text as w,Button as oe,Container as pe,BrandStrip as Te}from"../../components/index.js";import{withLayout as He}from"../../shared/Styles.js";import{cn as T,getLocalizedPath as ie}from"../../helpers/utils.js";import Le,{useNavContext as te}from"./NavProvider.js";import{HeaderNavigationMenu as W,HeaderNavigationBlockType as H,HeaderNavigationActionBlockType as x}from"./types.js";import ze from"jump.js";import{useGSAP as le}from"@gsap/react";import{gsap as re}from"gsap";import{WithSidebar as fe,WithSupports as be,WithMulticol as ve,WithGroupCategory as ge,WithResource as he}from"./withCategory.js";import{Menu as Re,Close as ye,User as Be,LeftArrow as Ie,DownArrow as Ne,Polygon as Ae}from"./icons/index.js";import Oe from"../NavigationSearch/index.js";import{ResourceSidebarDropdown as je}from"./ResourceSidebarDropdown.js";import{MobileResourceSidebarMenu as _e}from"./MobileResourceSidebarMenu.js";import{SidebarDropdown as We}from"./SidebarDropdown.js";import{useScrollLock as se}from"./useScrollLock.js";import{MulticolDropdown as $e}from"./MulticolDropdown.js";import{SupportsDropdown as Ke}from"./SupportsDropdown.js";import{MobileSidebarMenu as Fe}from"./MobileSidebarMenu.js";import{MobileSupportMenu as Ue}from"./MobileSupportMenu.js";import{MobileMulticolMenu as Ge}from"./MobileMulticolMenu.js";import{MenuItem as ce}from"./MobileMenuComponents.js";import{useAiuiContext as ue}from"../AiuiProvider/index.js";import ke from"../../shared/throttle.js";const we=ae((a,l)=>{const{data:{header:r}={},buildProps:s,event:f,profile:C,theme:n="light",isTop:c=!1,searchResult:N,onSearch:p,isSearching:u,keywords:$,onPrimaryNavClick:y,onSeriesProductClick:v,onSidebarNavClick:M,onMobileMenuToggle:Y,headerId:S,cartCount:z,menuData:R,render:B,componentOverrides:q,...Q}=a,[I,d]=E(!1),[K,A]=E(!1),[O,L]=E(!1),[V,b]=E(!1),j=J(null),k=J(null),X=()=>{const g=document?.querySelector("body")?.offsetWidth||0;b(g<=1440)};G(()=>(X(),window.addEventListener("resize",X),()=>{window.removeEventListener("resize",X)}),[]),Ee(l,()=>k.current),G(()=>{k.current&&c&&ze(k.current,{duration:0,offset:k.current?.getBoundingClientRect()?.bottom||0})},[c]),G(()=>{if(c){A(!1),L(!1);return}let g=0,t=0,i=0;const m=()=>document?.documentElement?.scrollTop||document?.body?.scrollTop||0,h=m();g=h,A(h>300),L(h>30);const F=ke(()=>{const P=m(),U=P-g;L(P>30),U>0?(t=0,i+=U,i>=300&&P>300&&A(!0)):U<0&&(i=0,t+=Math.abs(U),t>=300&&(A(!1),t=0)),g=P},100);return window.addEventListener("scroll",F,{passive:!0}),()=>window.removeEventListener("scroll",F)},[c]),G(()=>{f&&(f.search=()=>d(!0))},[f]),le(()=>{j?.current&&I&&re.fromTo(j.current,{height:0},{height:"auto",duration:.3})},[I]),se(I);const Z=D(()=>r?.bar?.actions?.find(g=>g?.blockType===x.Search)?.searchBar?.[0]||{},[r]),_=B?.mobileHeaderNavigation;return e(Le,{buildProps:s,profile:C,isMobile:V,event:f,payloadData:r,onSidebarNavClick:M,onSeriesProductClick:v,cartCount:z,componentOverrides:q,children:e("header",{...Q,id:S||"header","data-ui-component-id":"HeaderNavigation",className:c?"relative z-[100] bg-white":T("sticky top-0 z-[100] transition-transform duration-500 ease-in-out",{"translate-y-[-100%]":K}),ref:k,children:o("div",{className:T("hover:bg-white hover:text-black",n==="light"?"text-black":"text-white",{"!bg-white transition-all duration-500 ease-in-out":!c&&O},{"hover:!text-black":n==="dark","!text-black":!c&&O}),onClick:()=>!c&&L(!0),children:[e(xe,{data:r,className:"desktop:block hidden !bg-white",theme:n,onNavItemClick:()=>!c&&L(!0),onPrimaryNavClick:y}),_?e(_,{className:"desktop:hidden block !bg-white",menuData:R,data:r,onPrimaryNavClick:y}):e(Ce,{menuData:R,data:r,className:"desktop:hidden block !bg-white",onPrimaryNavClick:y,onMobileMenuToggle:Y}),I&&o("div",{className:"absolute left-0 top-0 z-[60] flex w-full flex-col bg-black/70",style:{height:`calc(100dvh - ${k?.current?.getBoundingClientRect()?.top}px)`},role:"dialog","aria-modal":"true","aria-label":"Search",children:[e("div",{ref:j,className:T("overflow-y-auto",{}),children:e(Oe,{data:Z,keywords:$,isSearching:u,searchResult:N,onSearch:g=>{p?.(g)},onClose:()=>{p?.(),d(!1)}})}),e("div",{className:"flex-1 bg-transparent",onClick:()=>d(!1),role:"button",tabIndex:0,"aria-label":"Close search",onKeyDown:g=>{(g.key==="Enter"||g.key===" "||g.key==="Escape")&&(g.preventDefault(),d(!1))}})]})]})})})}),xe=ae((a,l)=>{const{data:r,onNavItemClick:s,className:f,theme:C,onPrimaryNavClick:n}=a,{event:c,profile:N}=te(),[p,u]=E(!1),{locale:$="us"}=ue(),y=D(()=>ge(r?.categories?.filter(t=>t?.pcShow)),[r]),[v,M]=E(null),[Y,S]=E([]),z=J(null),[R,B]=E(!1),q=J(null),Q=J(null),I=J(y.map(t=>Array(t?.length||0).fill(null)));G(()=>{y?.length&&S(y?.map((t,i)=>t?.map((m,h)=>({groupIndex:i,index:h,open:!1}))))},[y]);const d=D(()=>{let t=null;for(const i of Y){for(const m of i)if(m.open){t=m;break}if(t)break}return t},[Y]);se(!!d?.open||R);const K=(t,i,m)=>{B(!1);const h=y[i][m];if(h?.components?.[0]?.blockType===H.Links)h?.components?.[0]?.url&&window.open(h?.components?.[0]?.url,h?.components?.[0]?.target??"_blank");else{const F=y?.flat()||[],P=F?.findIndex(U=>U?.id===y[i][m]?.id);t.stopPropagation(),s?.(),n?.(F[P],P),M(h),S(U=>U.map(De=>De.map(ee=>ee.groupIndex===i&&ee.index===m?{...ee,open:!ee.open}:{...ee,open:!1})))}},A=(t,i,m)=>{t.key==="Enter"||t.key===" "?(t.preventDefault(),K(t,i,m)):t.key==="Escape"&&d?.groupIndex===i&&d?.index===m&&(t.preventDefault(),O())},O=()=>{S(t=>t.map(i=>i.map(m=>({...m,open:!1}))))},L=D(()=>{if(v)return v?.components?.[0]?.blockType},[v]),V=fe(We,v),b=he(je,v),j=ve($e,v),k=be(Ke,{categoriesItem:v,currentNavItemRef:I.current?.[d?.groupIndex||0]?.[d?.index||0]}),X=D(()=>{switch(L){case H.Sidebar:return e(V,{});case H.Resource:return e(b,{});case H.Supports:return e(k,{});case H.Multicol:return e(j,{});default:return null}},[L,v]),Z=D(()=>r?.bar?.actions?.filter(t=>t?.pcShow),[r]),_=D(()=>Z?.find(t=>t?.blockType===x.Profile),[Z]),g=ne(()=>{B(t=>!t)},[]);return G(()=>{if(z?.current){const t=z.current;return t.addEventListener("click",g),()=>{t.removeEventListener("click",g)}}},[g]),le(()=>{d?.open&&re.fromTo(Q?.current,{height:0},{height:"auto"})},[d?.open]),o(pe,{className:T("relative h-[96px]",f),children:[o("div",{ref:q,onClick:O,className:"flex h-full flex-col justify-end gap-4",children:[o("div",{className:"flex items-center justify-between",children:[e(Me,{}),e(de,{ref:z,actions:Z,activeStatus:R})]}),e("nav",{className:"flex justify-between",role:"navigation","aria-label":"Primary navigation",children:y?.map((t,i)=>e("div",{className:"flex gap-3",children:t?.map((m,h)=>{const F=d?.groupIndex===i&&d?.index===h;return e("div",{ref:P=>{I.current[i][h]=P},className:"group",children:o("div",{className:"relative",children:[o("button",{className:"flex cursor-pointer items-center gap-1 border-0 bg-transparent pb-4",onClick:P=>K(P,i,h),onKeyDown:P=>A(P,i,h),"aria-expanded":F,"aria-haspopup":"true","aria-label":m.text,children:[e(w,{html:m.text,className:"text-sm font-bold leading-[1.4]"}),e(Ne,{className:T("size-4 opacity-0 transition-opacity duration-500 group-hover:opacity-100",{"rotate-180":d?.groupIndex===i&&d?.index===h,"opacity-100":p&&d?.groupIndex===i&&d?.index===h,invisible:!m?.components?.length||m?.components?.[0]?.blockType===H.Links})})]}),e("div",{className:T("absolute bottom-0 left-0 h-[2px] w-0 transition-all duration-500",{"w-[calc(100%-20px)]":F},C==="dark"?"bg-white":"bg-[#080A0F]"),"aria-hidden":"true"})]})},m.id)})},`groupCategory-${i}`))})]}),o("div",{role:"menu","aria-hidden":!(d?.open&&v),className:T("absolute left-0 top-full z-[999] flex w-full flex-col overflow-hidden border-t border-b-[#E4E5E6] bg-black/70 text-black",{hidden:!(d?.open&&v)}),onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),style:{height:`calc(100dvh - ${q?.current?.getBoundingClientRect()?.bottom}px)`},children:[e("div",{ref:Q,className:T("relative z-50",{"overflow-hidden":L!==H.Supports}),children:X}),e("div",{className:"flex-1 bg-transparent",onClick:O,role:"button",tabIndex:0,"aria-label":"Close menu",onKeyDown:t=>{(t.key==="Enter"||t.key===" "||t.key==="Escape")&&(t.preventDefault(),O())}})]}),R&&o("div",{className:"absolute left-0 top-full z-[999] flex h-dvh w-full bg-black/70",role:"dialog","aria-modal":"true","aria-label":"User profile menu",children:[e("div",{className:"rounded-box absolute w-[272px] overflow-hidden bg-white p-4",style:{right:`calc(100% - ${z?.current?.getBoundingClientRect()?.right}px)`,top:"-36px"},children:N?.email?o(Pe,{children:[e(w,{html:N?.nick_name||_?.welcome,className:"text-sm font-bold"}),e("div",{className:"mt-2 h-px bg-[#D9D9D9]","aria-hidden":"true"}),e("nav",{className:"mt-2",role:"navigation","aria-label":"Profile navigation",children:_?.profiles?.map(t=>e(ce,{className:"py-2",label:t?.title,href:ie(t?.url,$)},t.id))})]}):o(Pe,{children:[e(Ae,{className:"absolute -top-2 right-[46px] z-30 text-white","aria-hidden":"true"}),e(w,{html:_?.benefits_title,className:"text-sm font-bold leading-[1.4]"}),e("div",{className:"mt-2 flex flex-col gap-1",children:_?.benefits?.map(t=>o("div",{className:"flex items-center gap-[6px]",children:[e(me,{source:t.benefitIcon?.url,className:"size-4 shrink-0",alt:t.benefit,width:16,height:16}),e(w,{html:t.benefit,className:"text-sm font-bold leading-[1.4]"})]},t.id))}),o("div",{className:"mt-4 flex flex-wrap gap-2",children:[e(oe,{className:"grow",variant:"secondary",size:"lg",onClick:()=>c?.join?.(),children:e(w,{html:_?.primaryButton||"Join Now",className:"font-bold"})}),e(oe,{className:"grow",variant:"primary",size:"lg",onClick:()=>c?.login?.(),children:e(w,{html:_?.secondaryButton||"Log In",className:"font-bold"})})]})]})}),e("div",{className:"flex-1 bg-transparent",onClick:()=>B(!1),role:"button",tabIndex:0,"aria-label":"Close profile menu",onKeyDown:t=>{(t.key==="Enter"||t.key===" "||t.key==="Escape")&&(t.preventDefault(),B(!1))}})]})]})}),Ce=ae(({data:a,menuData:l,className:r,onPrimaryNavClick:s,onMobileMenuToggle:f},C)=>{const n=D(()=>ge(a?.categories?.filter(b=>b?.mobileShow)),[a]),{currentMenu:c,setCurrentMenu:N,subSubCategory:p}=te(),[u,$]=E(!1),[y,v]=E(0),[M,Y]=E(null),S=J(null),z=J(!1);G(()=>{if(S?.current&&u){const b=S?.current?.getBoundingClientRect();v(window?.innerHeight-(b?.top||0))}f?.({open:u})},[u,f]),G(()=>{if(!u)return;const b=ke(()=>{if(S?.current){const j=S.current.getBoundingClientRect();z.current=!0,v(window?.innerHeight-(j?.top||0))}},100);return window.addEventListener("resize",b),()=>window.removeEventListener("resize",b)},[u]),le(()=>{if(z.current){re.set(S.current,{height:y}),z.current=!1;return}re.fromTo(S.current,{height:0},{height:y,duration:.3})},[y]),se(u);const R=D(()=>M?.components?.[0]?.blockType,[M]),B=be(Ue,{categoriesItem:M}),q=fe(Fe,M),Q=he(_e,M),I=ve(Ge,M),d=D(()=>{switch(R){case H.Sidebar:return e(q,{});case H.Resource:return e(Q,{});case H.Supports:return e(B,{});case H.Multicol:return e(I,{});default:return null}},[R,M,B]),K=ne(()=>{$(!1),v(0),N&&N(W.Primary)},[$,v,N]),A=D(()=>a?.bar?.actions?.filter(b=>b?.mobileShow&&b?.blockType!==x.Profile),[a]),O=D(()=>a?.bar?.actions?.find(b=>b?.mobileShow&&b?.blockType===x.Profile)||{},[a]),L=D(()=>{switch(c){case W.Primary:return e(qe,{actions:A,menuOpen:u,onMenuOpenClose:()=>{$(!1),v(0)},onMenuOpenClick:()=>$(!0)});case W.Secondary:return e(Se,{title:M?.text,onMenuOpenClose:K,onMenuBackClick:()=>N?.(W.Primary)});case W.Third:return e(Se,{title:p?.label,onMenuOpenClose:K,onMenuBackClick:()=>N?.(W.Secondary)});default:return null}},[u,c,N,M,A,p,K]),V=ne((b,j)=>{const k=Array.isArray(n)?Array.isArray(n[b])?n[b][j]:{}:{};Y(k),k?.components?.[0]?.blockType===H.Links?k?.components?.[0]?.url&&window.open(k?.components?.[0]?.url,k?.components?.[0]?.target??"_blank"):N?.(W.Secondary)},[n,N]);return o(pe,{className:T("relative h-[52px]",r),children:[L,u&&o("nav",{ref:S,className:"absolute left-0 top-full z-[999] w-full overflow-y-auto border-t border-[#E4E5E6] bg-white text-black",style:{height:y},role:"navigation","aria-label":"Mobile navigation menu",children:[c===W.Primary&&l?e("div",{className:"pt-4",children:e(Te,{data:l})}):null,c===W.Primary?e(Je,{categories:n,onPrimaryMenuClick:V,onPrimaryNavClick:s,profileAction:O}):d]})]})}),Je=({categories:a,onPrimaryMenuClick:l,profileAction:r,onPrimaryNavClick:s})=>o("div",{className:"flex h-full flex-col justify-between",children:[e("div",{className:"tablet:px-8 laptop:px-16 p-4",children:a?.map((f,C)=>o("div",{className:"",children:[e("div",{className:T("my-2 h-px w-full bg-[#E5E5E7]")}),f?.map((n,c)=>e(ce,{label:n.text,onClick:()=>{const p=(a?.flat()||[])?.findIndex(u=>u?.id===a[C][c]?.id);l(C,c),s?.(n,p)},icon:n.components?.[0]?.icon},n.id))]},`groupCategory-${C}`))}),e(Ye,{profileAction:r})]}),Ye=({profileAction:a})=>{const[l,r]=E(!1),{profile:s,event:f}=te(),{locale:C="us"}=ue();return o("div",{className:T("tablet:px-8 laptop:px-16 bg-[#F5F5F7] px-4 py-6",{"p-4":l}),children:[o("button",{className:"flex w-full cursor-pointer items-center justify-between border-0 bg-transparent",onClick:()=>r(!l),"aria-expanded":l,"aria-label":s?.nick_name||a?.welcome,children:[o("div",{className:"flex items-center gap-[14px]",children:[e("div",{className:"flex size-[40px] shrink-0 items-center justify-center rounded-full bg-white",children:e(Be,{"aria-hidden":"true"})}),e(w,{html:s?.nick_name||a?.welcome,className:"text-base font-bold leading-[1.4]"})]}),!s?.email&&e(Ne,{"aria-hidden":"true",className:T("laptop:size-4 size-5",{"rotate-180":l})})]}),s?.email&&e("nav",{className:"mt-4",role:"navigation","aria-label":"Profile menu",children:a?.profiles?.map(n=>e(ce,{label:n?.title,href:ie(n?.url,C)},n.id))}),l&&!s?.email&&o("div",{className:"mt-4",children:[e(w,{html:a?.benefits_title,className:"text-sm font-bold leading-[1.4]"}),e("div",{className:"mt-2 flex flex-col gap-1",children:a?.benefits?.map(n=>o("div",{className:"flex items-center gap-[6px]",children:[e(me,{source:n.benefitIcon?.url,className:"size-4",alt:n.benefit,width:16,height:16}),e(w,{html:n.benefit,className:"text-sm font-bold leading-[1.4]"})]},n.id))})]}),!s?.email&&o("div",{className:"mt-4 flex items-center gap-3",children:[e(oe,{className:"tablet:flex-none flex-1",variant:"secondary",size:"base",onClick:()=>f?.join?.(),children:e(w,{html:a?.primaryButton||"Join Now",className:"text-sm font-bold leading-[1.4]"})}),e(oe,{className:"tablet:flex-none flex-1",variant:"primary",size:"base",onClick:()=>f?.login?.(),children:e(w,{html:a?.secondaryButton||"Log In",className:"text-sm font-bold leading-[1.4]"})})]})]})},qe=({menuOpen:a,onMenuOpenClose:l,onMenuOpenClick:r,actions:s})=>o("div",{className:"flex h-full items-center justify-between gap-4",children:[e(Me,{}),o("div",{className:"desktop:gap-6 flex items-center gap-4",children:[e(de,{actions:s}),a?e("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>l(),"aria-label":"Close menu","aria-expanded":"true",children:e(ye,{className:"size-5","aria-hidden":"true"})}):e("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>r(),"aria-label":"Open menu","aria-expanded":"false","aria-haspopup":"true",children:e(Re,{className:"size-5","aria-hidden":"true"})})]})]}),Me=()=>{const{payloadData:a,isMobile:l}=te(),{locale:r="us"}=ue();return e("a",{href:ie("/",r),className:"hover:text-brand-0 [&>svg]:w-full","aria-label":"Home",dangerouslySetInnerHTML:{__html:l?a?.bar?.mobileLogo:a?.bar?.desktopLogo}})},de=ae(({actions:a,activeStatus:l=!1},r)=>{const{event:s,cartCount:f}=te(),[C,n]=E(null),c=p=>{switch(p){case x.Search:return"Search";case x.Cart:return`Shopping cart${f>0?` (${f} items)`:""}`;case x.Profile:return"User profile";case x.Livestream:return"Livestream";default:return"Action"}},N=ne((p,u)=>{switch(n(u),p?.blockType){case x.Search:s?.search?.();break;case x.Cart:s?.cart?.();break;case x.Profile:s?.profile?.();break;case x.Livestream:s?.livestream?.();break;default:return()=>{}}},[s]);return e("div",{className:"desktop:gap-6 flex items-center gap-4",children:Array.isArray(a)&&a?.map((p,u)=>o("button",{className:"relative cursor-pointer border-0 bg-transparent p-0",ref:p.blockType===x.Profile?r:null,onClick:()=>N(p,u),"aria-label":c(p.blockType),"aria-pressed":l&&C===u,children:[e(w,{html:p.icon,className:T("size-5",{"text-brand-0":l&&C===u}),"aria-hidden":"true"}),p.blockType===x.Cart&&f>0&&e("div",{className:"bg-brand-0 absolute right-[-12px] top-[calc(100%-16px)] z-[1] flex min-h-5 min-w-5 items-center justify-center rounded-full px-[2px]","aria-hidden":"true",children:e(w,{html:f?.toString(),className:"text-sm font-bold leading-[1.2] text-white"})})]},p.id))})}),Se=({title:a,onMenuOpenClose:l,onMenuBackClick:r})=>o("div",{className:"flex h-full items-center gap-3",children:[e("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>r(),"aria-label":"Back to previous menu",children:e(Ie,{className:"size-5","aria-hidden":"true"})}),e(w,{html:a,className:"flex-1 text-center text-base font-bold leading-[1.4]"}),e("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>l(),"aria-label":"Close menu",children:e(ye,{className:"size-5","aria-hidden":"true"})})]});Ce.displayName="MobileNavigation",de.displayName="Actions",we.displayName="HeaderNavigation",xe.displayName="DesktopNavigation";var kt=He(we);export{kt as default};
|
|
1
|
+
"use client";import{Fragment as Pe,jsx as e,jsxs as o}from"react/jsx-runtime";import{forwardRef as ae,useCallback as ne,useEffect as G,useImperativeHandle as Ee,useMemo as D,useRef as J,useState as E}from"react";import{Picture as me,Text as w,Button as oe,Container as pe,BrandStrip as Te}from"../../components/index.js";import{withLayout as He}from"../../shared/Styles.js";import{cn as T,getLocalizedPath as ie}from"../../helpers/utils.js";import Le,{useNavContext as te}from"./NavProvider.js";import{HeaderNavigationMenu as W,HeaderNavigationBlockType as H,HeaderNavigationActionBlockType as x}from"./types.js";import ze from"jump.js";import{useGSAP as le}from"@gsap/react";import{gsap as re}from"gsap";import{WithSidebar as fe,WithSupports as be,WithMulticol as ve,WithGroupCategory as ge,WithResource as he}from"./withCategory.js";import{Menu as Re,Close as ye,User as Be,LeftArrow as Ie,DownArrow as Ne,Polygon as Ae}from"./icons/index.js";import Oe from"../NavigationSearch/index.js";import{ResourceSidebarDropdown as je}from"./ResourceSidebarDropdown.js";import{MobileResourceSidebarMenu as _e}from"./MobileResourceSidebarMenu.js";import{SidebarDropdown as We}from"./SidebarDropdown.js";import{useScrollLock as se}from"./useScrollLock.js";import{MulticolDropdown as $e}from"./MulticolDropdown.js";import{SupportsDropdown as Ke}from"./SupportsDropdown.js";import{MobileSidebarMenu as Fe}from"./MobileSidebarMenu.js";import{MobileSupportMenu as Ue}from"./MobileSupportMenu.js";import{MobileMulticolMenu as Ge}from"./MobileMulticolMenu.js";import{MenuItem as ce}from"./MobileMenuComponents.js";import{useAiuiContext as ue}from"../AiuiProvider/index.js";import ke from"../../shared/throttle.js";const we=ae((a,l)=>{const{data:{header:r}={},buildProps:s,event:f,profile:C,theme:n="light",isTop:c=!1,searchResult:N,onSearch:m,isSearching:u,keywords:$,onPrimaryNavClick:y,onSeriesProductClick:v,onSidebarNavClick:M,onMobileMenuToggle:Y,headerId:S,cartCount:z,menuData:R,render:B,componentOverrides:q,...Q}=a,[I,d]=E(!1),[K,A]=E(!1),[O,L]=E(!1),[V,b]=E(!1),j=J(null),k=J(null),X=()=>{const g=document?.querySelector("body")?.offsetWidth||0;b(g<=1440)};G(()=>(X(),window.addEventListener("resize",X),()=>{window.removeEventListener("resize",X)}),[]),Ee(l,()=>k.current),G(()=>{k.current&&c&&ze(k.current,{duration:0,offset:k.current?.getBoundingClientRect()?.bottom||0})},[c]),G(()=>{if(c){A(!1),L(!1);return}let g=0,t=0,i=0;const p=()=>document?.documentElement?.scrollTop||document?.body?.scrollTop||0,h=p();g=h,A(h>300),L(h>30);const F=ke(()=>{const P=p(),U=P-g;L(P>30),U>0?(t=0,i+=U,i>=300&&P>300&&A(!0)):U<0&&(i=0,t+=Math.abs(U),t>=300&&(A(!1),t=0)),g=P},100);return window.addEventListener("scroll",F,{passive:!0}),()=>window.removeEventListener("scroll",F)},[c]),G(()=>{f&&(f.search=()=>d(!0))},[f]),le(()=>{j?.current&&I&&re.fromTo(j.current,{height:0},{height:"auto",duration:.3})},[I]),se(I);const Z=D(()=>r?.bar?.actions?.find(g=>g?.blockType===x.Search)?.searchBar?.[0]||{},[r]),_=B?.mobileHeaderNavigation;return e(Le,{buildProps:s,profile:C,isMobile:V,event:f,payloadData:r,onSidebarNavClick:M,onSeriesProductClick:v,cartCount:z,componentOverrides:q,children:e("header",{...Q,id:S||"header","data-ui-component-id":"HeaderNavigation",className:c?"relative z-[100] bg-white":T("sticky top-0 z-[100] transition-transform duration-500 ease-in-out",{"translate-y-[-100%]":K}),ref:k,children:o("div",{className:T("hover:bg-white hover:text-black",n==="light"?"text-black":"text-white",{"!bg-white transition-all duration-500 ease-in-out":!c&&O},{"hover:!text-black":n==="dark","!text-black":!c&&O}),onClick:()=>!c&&L(!0),children:[e(xe,{data:r,className:"desktop:block hidden !bg-white",theme:n,onNavItemClick:()=>!c&&L(!0),onPrimaryNavClick:y}),_?e(_,{className:"desktop:hidden block !bg-white",menuData:R,data:r,onPrimaryNavClick:y}):e(Ce,{menuData:R,data:r,className:"desktop:hidden block !bg-white",onPrimaryNavClick:y,onMobileMenuToggle:Y}),I&&o("div",{className:"absolute left-0 top-0 z-[60] flex w-full flex-col bg-black/70",style:{height:`calc(100dvh - ${k?.current?.getBoundingClientRect()?.top}px)`},role:"dialog","aria-modal":"true","aria-label":"Search",children:[e("div",{ref:j,className:T("overflow-y-auto",{}),children:e(Oe,{data:Z,keywords:$,isSearching:u,searchResult:N,onSearch:g=>{m?.(g)},onClose:()=>{m?.(),d(!1)}})}),e("div",{className:"flex-1 bg-transparent",onClick:()=>d(!1),role:"button",tabIndex:0,"aria-label":"Close search",onKeyDown:g=>{(g.key==="Enter"||g.key===" "||g.key==="Escape")&&(g.preventDefault(),d(!1))}})]})]})})})}),xe=ae((a,l)=>{const{data:r,onNavItemClick:s,className:f,theme:C,onPrimaryNavClick:n}=a,{event:c,profile:N}=te(),[m,u]=E(!1),{locale:$="us"}=ue(),y=D(()=>ge(r?.categories?.filter(t=>t?.pcShow)),[r]),[v,M]=E(null),[Y,S]=E([]),z=J(null),[R,B]=E(!1),q=J(null),Q=J(null),I=J(y.map(t=>Array(t?.length||0).fill(null)));G(()=>{y?.length&&S(y?.map((t,i)=>t?.map((p,h)=>({groupIndex:i,index:h,open:!1}))))},[y]);const d=D(()=>{let t=null;for(const i of Y){for(const p of i)if(p.open){t=p;break}if(t)break}return t},[Y]);se(!!d?.open||R);const K=(t,i,p)=>{B(!1);const h=y[i][p];if(h?.components?.[0]?.blockType===H.Links)h?.components?.[0]?.url&&window.open(h?.components?.[0]?.url,h?.components?.[0]?.target??"_blank");else{const F=y?.flat()||[],P=F?.findIndex(U=>U?.id===y[i][p]?.id);t.stopPropagation(),s?.(),n?.(F[P],P),M(h),S(U=>U.map(De=>De.map(ee=>ee.groupIndex===i&&ee.index===p?{...ee,open:!ee.open}:{...ee,open:!1})))}},A=(t,i,p)=>{t.key==="Enter"||t.key===" "?(t.preventDefault(),K(t,i,p)):t.key==="Escape"&&d?.groupIndex===i&&d?.index===p&&(t.preventDefault(),O())},O=()=>{S(t=>t.map(i=>i.map(p=>({...p,open:!1}))))},L=D(()=>{if(v)return v?.components?.[0]?.blockType},[v]),V=fe(We,v),b=he(je,v),j=ve($e,v),k=be(Ke,{categoriesItem:v,currentNavItemRef:I.current?.[d?.groupIndex||0]?.[d?.index||0]}),X=D(()=>{switch(L){case H.Sidebar:return e(V,{});case H.Resource:return e(b,{});case H.Supports:return e(k,{});case H.Multicol:return e(j,{});default:return null}},[L,v]),Z=D(()=>r?.bar?.actions?.filter(t=>t?.pcShow),[r]),_=D(()=>Z?.find(t=>t?.blockType===x.Profile),[Z]),g=ne(()=>{B(t=>!t)},[]);return G(()=>{if(z?.current){const t=z.current;return t.addEventListener("click",g),()=>{t.removeEventListener("click",g)}}},[g]),le(()=>{d?.open&&re.fromTo(Q?.current,{height:0},{height:"auto"})},[d?.open]),o(pe,{className:T("relative h-[96px]",f),children:[o("div",{ref:q,onClick:O,className:"flex h-full flex-col justify-end gap-4",children:[o("div",{className:"flex items-center justify-between",children:[e(Me,{}),e(de,{ref:z,actions:Z,activeStatus:R})]}),e("nav",{className:"flex justify-between",role:"navigation","aria-label":"Primary navigation",children:y?.map((t,i)=>e("div",{className:"flex gap-3",children:t?.map((p,h)=>{const F=d?.groupIndex===i&&d?.index===h;return e("div",{ref:P=>{I.current[i][h]=P},className:"group",children:o("div",{className:"relative",children:[o("button",{className:"flex cursor-pointer items-center gap-1 border-0 bg-transparent pb-4",onClick:P=>K(P,i,h),onKeyDown:P=>A(P,i,h),"aria-expanded":F,"aria-haspopup":"true","aria-label":p.text,children:[e(w,{html:p.text,className:"text-sm font-bold leading-[1.4]"}),e(Ne,{className:T("size-4 opacity-0 transition-opacity duration-500 group-hover:opacity-100",{"rotate-180":d?.groupIndex===i&&d?.index===h,"opacity-100":m&&d?.groupIndex===i&&d?.index===h,invisible:!p?.components?.length||p?.components?.[0]?.blockType===H.Links})})]}),e("div",{className:T("absolute bottom-0 left-0 h-[2px] w-0 transition-all duration-500",{"w-[calc(100%-20px)]":F},C==="dark"?"bg-white":"bg-[#080A0F]"),"aria-hidden":"true"})]})},p.id)})},`groupCategory-${i}`))})]}),o("div",{role:"menu","aria-hidden":!(d?.open&&v),className:T("absolute left-0 top-full z-[999] flex w-full flex-col overflow-hidden border-t border-b-[#E4E5E6] bg-black/70 text-black",{hidden:!(d?.open&&v)}),onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),style:{height:`calc(100dvh - ${q?.current?.getBoundingClientRect()?.bottom}px)`},children:[e("div",{ref:Q,className:T("relative z-50",{"overflow-hidden":L!==H.Supports}),children:X}),e("div",{className:"flex-1 bg-transparent",onClick:O,role:"button",tabIndex:0,"aria-label":"Close menu",onKeyDown:t=>{(t.key==="Enter"||t.key===" "||t.key==="Escape")&&(t.preventDefault(),O())}})]}),R&&o("div",{className:"absolute left-0 top-full z-[999] flex h-dvh w-full bg-black/70",role:"dialog","aria-modal":"true","aria-label":"User profile menu",children:[e("div",{className:"rounded-box absolute w-[272px] overflow-hidden bg-white p-4",style:{right:`calc(100% - ${z?.current?.getBoundingClientRect()?.right}px)`,top:"-36px"},children:N?.email?o(Pe,{children:[e(w,{html:N?.nick_name||_?.welcome,className:"text-sm font-bold"}),e("div",{className:"mt-2 h-px bg-[#D9D9D9]","aria-hidden":"true"}),e("nav",{className:"mt-2",role:"navigation","aria-label":"Profile navigation",children:_?.profiles?.map(t=>e(ce,{className:"py-2",label:t?.title,href:ie(t?.url,$)},t.id))})]}):o(Pe,{children:[e(Ae,{className:"absolute -top-2 right-[46px] z-30 text-white","aria-hidden":"true"}),e(w,{html:_?.benefits_title,className:"text-sm font-bold leading-[1.4]"}),e("div",{className:"mt-2 flex flex-col gap-1",children:_?.benefits?.map(t=>o("div",{className:"flex items-center gap-[6px]",children:[e(me,{source:t.benefitIcon?.url,className:"size-4 shrink-0",alt:t.benefit,width:16,height:16}),e(w,{html:t.benefit,className:"text-sm font-bold leading-[1.4]"})]},t.id))}),o("div",{className:"mt-4 flex flex-wrap gap-2",children:[e(oe,{className:"grow",variant:"secondary",size:"lg",onClick:()=>c?.join?.(),children:e(w,{html:_?.primaryButton||"Join Now",className:"font-bold"})}),e(oe,{className:"grow",variant:"primary",size:"lg",onClick:()=>c?.login?.(),children:e(w,{html:_?.secondaryButton||"Log In",className:"font-bold"})})]})]})}),e("div",{className:"flex-1 bg-transparent",onClick:()=>B(!1),role:"button",tabIndex:0,"aria-label":"Close profile menu",onKeyDown:t=>{(t.key==="Enter"||t.key===" "||t.key==="Escape")&&(t.preventDefault(),B(!1))}})]})]})}),Ce=ae(({data:a,menuData:l,className:r,onPrimaryNavClick:s,onMobileMenuToggle:f},C)=>{const n=D(()=>ge(a?.categories?.filter(b=>b?.mobileShow)),[a]),{currentMenu:c,setCurrentMenu:N,subSubCategory:m}=te(),[u,$]=E(!1),[y,v]=E(0),[M,Y]=E(null),S=J(null),z=J(!1);G(()=>{if(S?.current&&u){const b=S?.current?.getBoundingClientRect();v(window?.innerHeight-(b?.top||0))}f?.({open:u})},[u,f]),G(()=>{if(!u)return;const b=ke(()=>{if(S?.current){const j=S.current.getBoundingClientRect();z.current=!0,v(window?.innerHeight-(j?.top||0))}},100);return window.addEventListener("resize",b),()=>window.removeEventListener("resize",b)},[u]),le(()=>{if(z.current){re.set(S.current,{height:y}),z.current=!1;return}re.fromTo(S.current,{height:0},{height:y,duration:.3})},[y]),se(u);const R=D(()=>M?.components?.[0]?.blockType,[M]),B=be(Ue,{categoriesItem:M}),q=fe(Fe,M),Q=he(_e,M),I=ve(Ge,M),d=D(()=>{switch(R){case H.Sidebar:return e(q,{});case H.Resource:return e(Q,{});case H.Supports:return e(B,{});case H.Multicol:return e(I,{});default:return null}},[R,M,B]),K=ne(()=>{$(!1),v(0),N&&N(W.Primary)},[$,v,N]),A=D(()=>a?.bar?.actions?.filter(b=>b?.mobileShow&&b?.blockType!==x.Profile),[a]),O=D(()=>a?.bar?.actions?.find(b=>b?.mobileShow&&b?.blockType===x.Profile)||{},[a]),L=D(()=>{switch(c){case W.Primary:return e(qe,{actions:A,menuOpen:u,onMenuOpenClose:()=>{$(!1),v(0)},onMenuOpenClick:()=>$(!0)});case W.Secondary:return e(Se,{title:M?.text,onMenuOpenClose:K,onMenuBackClick:()=>N?.(W.Primary)});case W.Third:return e(Se,{title:m?.label,onMenuOpenClose:K,onMenuBackClick:()=>N?.(W.Secondary)});default:return null}},[u,c,N,M,A,m,K]),V=ne((b,j)=>{const k=Array.isArray(n)?Array.isArray(n[b])?n[b][j]:{}:{};Y(k),k?.components?.[0]?.blockType===H.Links?k?.components?.[0]?.url&&window.open(k?.components?.[0]?.url,k?.components?.[0]?.target??"_blank"):N?.(W.Secondary)},[n,N]);return o(pe,{className:T("relative h-[52px]",r),children:[L,u&&o("nav",{ref:S,className:"absolute left-0 top-full z-[999] w-full overflow-y-auto border-t border-[#E4E5E6] bg-white text-black",style:{height:y},role:"navigation","aria-label":"Mobile navigation menu",children:[c===W.Primary&&l?e("div",{className:"pt-4",children:e(Te,{data:l})}):null,c===W.Primary?e(Je,{categories:n,onPrimaryMenuClick:V,onPrimaryNavClick:s,profileAction:O}):d]})]})}),Je=({categories:a,onPrimaryMenuClick:l,profileAction:r,onPrimaryNavClick:s})=>o("div",{className:"flex h-full flex-col justify-between",children:[e("div",{className:"tablet:px-8 laptop:px-16 p-4",children:a?.map((f,C)=>o("div",{className:"",children:[e("div",{className:T("my-2 h-px w-full bg-[#E5E5E7]")}),f?.map((n,c)=>e(ce,{label:n.text,onClick:()=>{const m=(a?.flat()||[])?.findIndex(u=>u?.id===a[C][c]?.id);l(C,c),s?.(n,m)},icon:n.components?.[0]?.icon},n.id))]},`groupCategory-${C}`))}),e(Ye,{profileAction:r})]}),Ye=({profileAction:a})=>{const[l,r]=E(!1),{profile:s,event:f}=te(),{locale:C="us"}=ue();return o("div",{className:T("tablet:px-8 laptop:px-16 bg-[#F5F5F7] px-4 py-6",{"p-4":l}),children:[o("button",{className:"flex w-full cursor-pointer items-center justify-between border-0 bg-transparent",onClick:()=>r(!l),"aria-expanded":l,"aria-label":s?.nick_name||a?.welcome,children:[o("div",{className:"flex items-center gap-[14px]",children:[e("div",{className:"flex size-[40px] shrink-0 items-center justify-center rounded-full bg-white",children:e(Be,{"aria-hidden":"true"})}),e(w,{html:s?.nick_name||a?.welcome,className:"text-base font-bold leading-[1.4]"})]}),!s?.email&&e(Ne,{"aria-hidden":"true",className:T("laptop:size-4 size-5",{"rotate-180":l})})]}),s?.email&&e("nav",{className:"mt-4",role:"navigation","aria-label":"Profile menu",children:a?.profiles?.map(n=>e(ce,{label:n?.title,href:ie(n?.url,C)},n.id))}),l&&!s?.email&&o("div",{className:"mt-4",children:[e(w,{html:a?.benefits_title,className:"text-sm font-bold leading-[1.4]"}),e("div",{className:"mt-2 flex flex-col gap-1",children:a?.benefits?.map(n=>o("div",{className:"flex items-center gap-[6px]",children:[e(me,{source:n.benefitIcon?.url,className:"size-4",alt:n.benefit,width:16,height:16}),e(w,{html:n.benefit,className:"text-sm font-bold leading-[1.4]"})]},n.id))})]}),!s?.email&&o("div",{className:"mt-4 flex items-center gap-3",children:[e(oe,{className:"tablet:flex-none flex-1",variant:"secondary",size:"base",onClick:()=>f?.join?.(),children:e(w,{html:a?.primaryButton||"Join Now",className:"text-sm font-bold leading-[1.4]"})}),e(oe,{className:"tablet:flex-none flex-1",variant:"primary",size:"base",onClick:()=>f?.login?.(),children:e(w,{html:a?.secondaryButton||"Log In",className:"text-sm font-bold leading-[1.4]"})})]})]})},qe=({menuOpen:a,onMenuOpenClose:l,onMenuOpenClick:r,actions:s})=>o("div",{className:"flex h-full items-center justify-between gap-4",children:[e(Me,{}),o("div",{className:"desktop:gap-6 flex items-center gap-4",children:[e(de,{actions:s}),a?e("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>l(),"aria-label":"Close menu","aria-expanded":"true",children:e(ye,{className:"size-5","aria-hidden":"true"})}):e("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>r(),"aria-label":"Open menu","aria-expanded":"false","aria-haspopup":"true",children:e(Re,{className:"size-5","aria-hidden":"true"})})]})]}),Me=()=>{const{payloadData:a,isMobile:l}=te(),{locale:r="us"}=ue();return e("a",{href:ie("/",r),className:"hover:text-brand-0 [&>svg]:w-full","aria-label":"Home",dangerouslySetInnerHTML:{__html:l?a?.bar?.mobileLogo:a?.bar?.desktopLogo}})},de=ae(({actions:a,activeStatus:l=!1},r)=>{const{event:s,cartCount:f}=te(),[C,n]=E(null),c=m=>{switch(m){case x.Search:return"Search";case x.Cart:return`Shopping cart${f>0?` (${f} items)`:""}`;case x.Profile:return"User profile";case x.Livestream:return"Livestream";default:return"Action"}},N=ne((m,u)=>{switch(n(u),m?.blockType){case x.Search:s?.search?.();break;case x.Cart:s?.cart?.();break;case x.Profile:s?.profile?.();break;case x.Livestream:s?.livestream?.();break;default:return()=>{}}},[s]);return e("div",{className:"desktop:gap-6 flex items-center gap-4",children:Array.isArray(a)&&a?.map((m,u)=>o("button",{className:"relative cursor-pointer border-0 bg-transparent p-0","data-tag":m?.tag||"",ref:m.blockType===x.Profile?r:null,onClick:()=>N(m,u),"aria-label":c(m.blockType),"aria-pressed":l&&C===u,children:[e(w,{html:m.icon,className:T("size-5",{"text-brand-0":l&&C===u}),"aria-hidden":"true"}),m.blockType===x.Cart&&f>0&&e("div",{className:"bg-brand-0 absolute right-[-12px] top-[calc(100%-16px)] z-[1] flex min-h-5 min-w-5 items-center justify-center rounded-full px-[2px]","aria-hidden":"true",children:e(w,{html:f?.toString(),className:"text-sm font-bold leading-[1.2] text-white"})})]},m.id))})}),Se=({title:a,onMenuOpenClose:l,onMenuBackClick:r})=>o("div",{className:"flex h-full items-center gap-3",children:[e("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>r(),"aria-label":"Back to previous menu",children:e(Ie,{className:"size-5","aria-hidden":"true"})}),e(w,{html:a,className:"flex-1 text-center text-base font-bold leading-[1.4]"}),e("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>l(),"aria-label":"Close menu",children:e(ye,{className:"size-5","aria-hidden":"true"})})]});Ce.displayName="MobileNavigation",de.displayName="Actions",we.displayName="HeaderNavigation",xe.displayName="DesktopNavigation";var kt=He(we);export{kt as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/HeaderNavigation/index.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\nimport React, { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react'\n\nimport { Picture, Text, Button, Container, BrandStrip } from '../../components/index.js'\n\nimport { withLayout } from '../../shared/Styles.js'\n\nimport { cn, getLocalizedPath } from '../../helpers/utils.js'\n\nimport type {\n MobilePrimaryNavigationData,\n MobileSecondaryNavigationData,\n MobileNavigationProps,\n DesktopNavigationProps,\n HeaderNavigationProps,\n} from './types.js'\nimport NavProvider, { useNavContext } from './NavProvider.js'\n\nimport { HeaderNavigationMenu, HeaderNavigationBlockType, HeaderNavigationActionBlockType } from './types.js'\n\nimport jump from 'jump.js'\n\nimport { useGSAP } from '@gsap/react'\nimport { gsap } from 'gsap'\n\nimport { WithSidebar, WithSupports, WithMulticol, WithGroupCategory, WithResource } from './withCategory.js'\n\nimport { Menu, Close, User, LeftArrow, DownArrow, Polygon } from './icons/index.js'\n\nimport NavigationSearch from '../NavigationSearch/index.js'\nimport { ResourceSidebarDropdown } from './ResourceSidebarDropdown.js'\nimport { MobileResourceSidebarMenu } from './MobileResourceSidebarMenu.js'\nimport { SidebarDropdown } from './SidebarDropdown.js'\nimport { useScrollLock } from './useScrollLock.js'\nimport { MulticolDropdown } from './MulticolDropdown.js'\nimport { SupportsDropdown } from './SupportsDropdown.js'\nimport { MobileSidebarMenu } from './MobileSidebarMenu.js'\nimport { MobileSupportMenu } from './MobileSupportMenu.js'\nimport { MobileMulticolMenu } from './MobileMulticolMenu.js'\nimport { MenuItem } from './MobileMenuComponents.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport throttle from '../../shared/throttle.js'\n\nconst HeaderNavigation = forwardRef<HTMLDivElement, HeaderNavigationProps>((props, ref) => {\n const {\n data: { header } = {},\n buildProps,\n event,\n profile,\n theme = 'light',\n isTop = false,\n searchResult,\n onSearch,\n isSearching,\n keywords,\n onPrimaryNavClick,\n onSeriesProductClick,\n onSidebarNavClick,\n onMobileMenuToggle,\n headerId,\n cartCount,\n menuData,\n render,\n componentOverrides,\n ...rest\n } = props\n\n const [searchOpen, setSearchOpen] = useState(false)\n const [headerHidden, setHeaderHidden] = useState(false)\n const [changeHeaderBackground, setChangeHeaderBackground] = useState(false)\n const [isMobile, setIsMobile] = useState(false)\n const searchRef = useRef<HTMLDivElement>(null)\n\n const headerRef = useRef<HTMLDivElement>(null)\n\n const resizeWindow = () => {\n const offsetWidth = document?.querySelector('body')?.offsetWidth || 0\n setIsMobile(offsetWidth <= 1440)\n }\n\n useEffect(() => {\n resizeWindow()\n window.addEventListener('resize', resizeWindow)\n return () => {\n window.removeEventListener('resize', resizeWindow)\n }\n }, [])\n\n useImperativeHandle(ref, () => headerRef.current as HTMLDivElement)\n\n useEffect(() => {\n if (headerRef.current && isTop) {\n jump(headerRef.current, { duration: 0, offset: headerRef.current?.getBoundingClientRect()?.bottom || 0 })\n }\n }, [isTop])\n\n useEffect(() => {\n // \u5982\u679C isTop \u4E3A true\uFF0C\u4E0D\u9700\u8981\u6EDA\u52A8\u76D1\u542C\u548C\u52A8\u6548\n if (isTop) {\n setHeaderHidden(false)\n setChangeHeaderBackground(false)\n return\n }\n\n let lastScrollY = 0\n let upwardDistance = 0\n let downwardDistance = 0\n\n const getScrollTop = () => {\n return document?.documentElement?.scrollTop || document?.body?.scrollTop || 0\n }\n\n // \u521D\u59CB\u5316\u72B6\u6001\n const initialScrollTop = getScrollTop()\n lastScrollY = initialScrollTop\n setHeaderHidden(initialScrollTop > 300)\n setChangeHeaderBackground(initialScrollTop > 30)\n\n const handleScroll = throttle(() => {\n const currentScrollY = getScrollTop()\n const delta = currentScrollY - lastScrollY\n\n // \u66F4\u65B0\u80CC\u666F\u72B6\u6001\n setChangeHeaderBackground(currentScrollY > 30)\n\n if (delta > 0) {\n // \u5411\u4E0B\u6EDA\u52A8\n upwardDistance = 0 // \u91CD\u7F6E\u5411\u4E0A\u7D2F\u8BA1\n downwardDistance += delta\n\n if (downwardDistance >= 300 && currentScrollY > 300) {\n setHeaderHidden(true)\n }\n } else if (delta < 0) {\n // \u5411\u4E0A\u6EDA\u52A8\n downwardDistance = 0 // \u91CD\u7F6E\u5411\u4E0B\u7D2F\u8BA1\n upwardDistance += Math.abs(delta)\n\n if (upwardDistance >= 300) {\n setHeaderHidden(false)\n upwardDistance = 0\n }\n }\n\n lastScrollY = currentScrollY\n }, 100)\n\n window.addEventListener('scroll', handleScroll, { passive: true })\n return () => window.removeEventListener('scroll', handleScroll)\n }, [isTop])\n\n useEffect(() => {\n if (event) {\n event.search = () => setSearchOpen(true)\n }\n }, [event])\n\n useGSAP(() => {\n if (searchRef?.current && searchOpen) {\n gsap.fromTo(\n searchRef.current,\n {\n height: 0,\n },\n {\n height: 'auto',\n duration: 0.3,\n }\n )\n }\n }, [searchOpen])\n\n useScrollLock(searchOpen)\n\n const searchPage = useMemo(() => {\n return (\n header?.bar?.actions?.find((item: any) => item?.blockType === HeaderNavigationActionBlockType.Search)\n ?.searchBar?.[0] || {}\n )\n }, [header])\n\n const CustomMobileHeaderNavigation = render?.mobileHeaderNavigation\n\n return (\n <NavProvider\n buildProps={buildProps}\n profile={profile}\n isMobile={isMobile}\n event={event}\n payloadData={header}\n onSidebarNavClick={onSidebarNavClick}\n onSeriesProductClick={onSeriesProductClick}\n cartCount={cartCount}\n componentOverrides={componentOverrides}\n >\n <header\n {...rest}\n id={headerId || 'header'}\n data-ui-component-id=\"HeaderNavigation\"\n className={\n isTop\n ? 'relative z-[100] bg-white'\n : cn('sticky top-0 z-[100] transition-transform duration-500 ease-in-out', {\n ['translate-y-[-100%]']: headerHidden,\n })\n }\n // className=\"relative z-[100] bg-white\"\n ref={headerRef}\n >\n <div\n className={cn(\n 'hover:bg-white hover:text-black',\n theme === 'light' ? 'text-black' : 'text-white',\n {\n ['!bg-white transition-all duration-500 ease-in-out']: !isTop && changeHeaderBackground,\n },\n {\n ['hover:!text-black']: theme === 'dark',\n ['!text-black']: !isTop && changeHeaderBackground,\n }\n )}\n onClick={() => !isTop && setChangeHeaderBackground(true)}\n >\n <DesktopNavigation\n data={header}\n className=\"desktop:block hidden !bg-white\"\n theme={theme}\n onNavItemClick={() => !isTop && setChangeHeaderBackground(true)}\n onPrimaryNavClick={onPrimaryNavClick}\n />\n {CustomMobileHeaderNavigation ? (\n <CustomMobileHeaderNavigation\n className=\"desktop:hidden block !bg-white\"\n menuData={menuData}\n data={header}\n onPrimaryNavClick={onPrimaryNavClick}\n />\n ) : (\n <MobileNavigation\n menuData={menuData}\n data={header}\n className=\"desktop:hidden block !bg-white\"\n onPrimaryNavClick={onPrimaryNavClick}\n onMobileMenuToggle={onMobileMenuToggle}\n />\n )}\n {searchOpen && (\n <div\n className=\"absolute left-0 top-0 z-[60] flex w-full flex-col bg-black/70\"\n style={{ height: `calc(100dvh - ${headerRef?.current?.getBoundingClientRect()?.top}px)` }}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"Search\"\n >\n <div ref={searchRef} className={cn('overflow-y-auto', {})}>\n <NavigationSearch\n data={searchPage}\n keywords={keywords}\n isSearching={isSearching}\n searchResult={searchResult}\n onSearch={(value: string) => {\n onSearch?.(value)\n }}\n onClose={() => {\n onSearch?.()\n setSearchOpen(false)\n }}\n />\n </div>\n <div\n className=\"flex-1 bg-transparent\"\n onClick={() => setSearchOpen(false)}\n role=\"button\"\n tabIndex={0}\n aria-label=\"Close search\"\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ' || e.key === 'Escape') {\n e.preventDefault()\n setSearchOpen(false)\n }\n }}\n />\n </div>\n )}\n </div>\n </header>\n </NavProvider>\n )\n})\n\nconst DesktopNavigation = forwardRef<HTMLDivElement, DesktopNavigationProps>((props, ref) => {\n const { data, onNavItemClick, className, theme, onPrimaryNavClick } = props\n const { event, profile } = useNavContext()\n const [downdownHover, setDowndownHover] = useState(false)\n const { locale = 'us' } = useAiuiContext()\n\n const groupCategories = useMemo(() => {\n return WithGroupCategory(data?.categories?.filter((item: any) => item?.pcShow)) as any[][]\n }, [data])\n\n const [categoriesItem, setCategoriesItem] = useState<any>(null)\n const [navStatusArray, setNavStatusArray] = useState<{ index: number; groupIndex: number; open: boolean }[][]>([])\n const profileRef = useRef<HTMLButtonElement>(null)\n const [userProfileOpen, setUserProfileOpen] = useState(false)\n const headerRef = useRef<HTMLDivElement>(null)\n const dropdownRef = useRef<HTMLDivElement>(null)\n const navItemRefs = useRef<HTMLDivElement[][]>(\n groupCategories.map((categories: any) => Array(categories?.length || 0).fill(null))\n )\n\n useEffect(() => {\n if (groupCategories?.length) {\n setNavStatusArray(\n groupCategories?.map((groupItem: any, groupIndex: number) => {\n return groupItem?.map((_: any, index: number) => ({ groupIndex, index, open: false }))\n })\n )\n }\n }, [groupCategories])\n\n const currentNavItem = useMemo(() => {\n let currentNavItem: { index: number; groupIndex: number; open: boolean } | null = null\n for (const groupItem of navStatusArray) {\n for (const item of groupItem) {\n if (item.open) {\n currentNavItem = item\n break\n }\n }\n if (currentNavItem) break\n }\n return currentNavItem\n }, [navStatusArray])\n\n useScrollLock(!!currentNavItem?.open || userProfileOpen)\n\n const handleNavItemClick = (e: any, groupIndex: number, index: number) => {\n setUserProfileOpen(false)\n // if (categoriesItem?.components?.[0]?.blockType === HeaderNavigationBlockType.Links) {\n const currentCategoriesItem = groupCategories[groupIndex][index]\n if (currentCategoriesItem?.components?.[0]?.blockType === HeaderNavigationBlockType.Links) {\n // link\u6A21\u5757\u7279\u6B8A\u5904\u7406\n // categoriesItem?.components?.[0]?.url && window.open(categoriesItem?.components?.[0]?.url)\n currentCategoriesItem?.components?.[0]?.url &&\n window.open(\n currentCategoriesItem?.components?.[0]?.url,\n currentCategoriesItem?.components?.[0]?.target ?? '_blank'\n )\n } else {\n const categories = groupCategories?.flat() || []\n const position = categories?.findIndex(item => item?.id === groupCategories[groupIndex][index]?.id)\n e.stopPropagation()\n onNavItemClick?.()\n onPrimaryNavClick?.(categories[position], position)\n // setCategoriesItem(groupCategories[groupIndex][index])\n setCategoriesItem(currentCategoriesItem)\n setNavStatusArray(prev =>\n prev.map(groupItem =>\n groupItem.map(item =>\n item.groupIndex === groupIndex && item.index === index\n ? { ...item, open: !item.open }\n : { ...item, open: false }\n )\n )\n )\n }\n }\n\n const handleNavItemKeyDown = (e: React.KeyboardEvent, groupIndex: number, index: number) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n handleNavItemClick(e, groupIndex, index)\n } else if (e.key === 'Escape' && currentNavItem?.groupIndex === groupIndex && currentNavItem?.index === index) {\n e.preventDefault()\n handleNavMenuClose()\n }\n }\n\n const handleNavMenuClose = () => {\n setNavStatusArray(prev => prev.map(groupItem => groupItem.map(item => ({ ...item, open: false }))))\n }\n\n const currentBlockTypeCategories = useMemo(() => {\n if (categoriesItem) return categoriesItem?.components?.[0]?.blockType\n }, [categoriesItem])\n\n const SidebarDropdownComp = WithSidebar(SidebarDropdown, categoriesItem)\n const ResourceSidebarDropdownComp = WithResource(ResourceSidebarDropdown, categoriesItem)\n const MulticolDropdownComp = WithMulticol(MulticolDropdown, categoriesItem)\n const SupportsDropdownComp = WithSupports(SupportsDropdown, {\n categoriesItem,\n currentNavItemRef: navItemRefs.current?.[currentNavItem?.groupIndex || 0]?.[currentNavItem?.index || 0],\n })\n\n const DropdownComp = useMemo(() => {\n switch (currentBlockTypeCategories) {\n case HeaderNavigationBlockType.Sidebar:\n return <SidebarDropdownComp />\n case HeaderNavigationBlockType.Resource:\n return <ResourceSidebarDropdownComp />\n case HeaderNavigationBlockType.Supports:\n return <SupportsDropdownComp />\n case HeaderNavigationBlockType.Multicol:\n return <MulticolDropdownComp />\n default:\n return null\n }\n }, [currentBlockTypeCategories, categoriesItem])\n\n const actions = useMemo(() => {\n return data?.bar?.actions?.filter((item: any) => item?.pcShow)\n }, [data])\n\n const profileAction = useMemo(() => {\n return actions?.find((item: any) => item?.blockType === HeaderNavigationActionBlockType.Profile)\n }, [actions])\n\n const handleProfileClick = useCallback(() => {\n setUserProfileOpen(prev => !prev)\n }, [])\n\n useEffect(() => {\n if (profileRef?.current) {\n const profileRefElement = profileRef.current as HTMLButtonElement\n profileRefElement.addEventListener('click', handleProfileClick)\n\n return () => {\n profileRefElement.removeEventListener('click', handleProfileClick)\n }\n }\n }, [handleProfileClick])\n\n useGSAP(() => {\n if (currentNavItem?.open) {\n gsap.fromTo(\n dropdownRef?.current,\n {\n height: 0,\n },\n {\n height: 'auto',\n }\n )\n }\n }, [currentNavItem?.open])\n\n return (\n <Container className={cn('relative h-[96px]', className)}>\n <div ref={headerRef} onClick={handleNavMenuClose} className=\"flex h-full flex-col justify-end gap-4\">\n <div className=\"flex items-center justify-between\">\n <Logo />\n <Actions ref={profileRef} actions={actions} activeStatus={userProfileOpen} />\n </div>\n <nav className=\"flex justify-between\" role=\"navigation\" aria-label=\"Primary navigation\">\n {groupCategories?.map((groupItem: any, groupIndex: number) => {\n return (\n <div key={`groupCategory-${groupIndex}`} className=\"flex gap-3\">\n {groupItem?.map((item: any, index: number) => {\n const isExpanded = currentNavItem?.groupIndex === groupIndex && currentNavItem?.index === index\n return (\n <div\n key={item.id}\n ref={(el: HTMLDivElement) => {\n navItemRefs.current[groupIndex][index] = el\n }}\n className=\"group\"\n >\n <div className=\"relative\">\n <button\n className=\"flex cursor-pointer items-center gap-1 border-0 bg-transparent pb-4\"\n onClick={e => handleNavItemClick(e, groupIndex, index)}\n onKeyDown={e => handleNavItemKeyDown(e, groupIndex, index)}\n aria-expanded={isExpanded}\n aria-haspopup=\"true\"\n aria-label={item.text}\n >\n <Text html={item.text} className=\"text-sm font-bold leading-[1.4]\" />\n {/* <DownArrow\n aria-hidden=\"true\"\n className={cn('size-4 opacity-0 transition-opacity duration-500 group-hover:opacity-100', {\n ['rotate-180']: isExpanded,\n ['opacity-100']: downdownHover && isExpanded,\n })}\n /> */}\n <DownArrow\n className={cn('size-4 opacity-0 transition-opacity duration-500 group-hover:opacity-100', {\n ['rotate-180']:\n currentNavItem?.groupIndex === groupIndex && currentNavItem?.index === index,\n ['opacity-100']:\n downdownHover &&\n currentNavItem?.groupIndex === groupIndex &&\n currentNavItem?.index === index,\n ['invisible']:\n !item?.components?.length ||\n item?.components?.[0]?.blockType === HeaderNavigationBlockType.Links,\n })}\n />\n </button>\n <div\n className={cn(\n 'absolute bottom-0 left-0 h-[2px] w-0 transition-all duration-500',\n {\n 'w-[calc(100%-20px)]': isExpanded,\n },\n theme === 'dark' ? 'bg-white' : 'bg-[#080A0F]'\n )}\n aria-hidden=\"true\"\n />\n </div>\n </div>\n )\n })}\n </div>\n )\n })}\n </nav>\n </div>\n <div\n role=\"menu\"\n aria-hidden={!(currentNavItem?.open && categoriesItem)}\n className={cn(\n 'absolute left-0 top-full z-[999] flex w-full flex-col overflow-hidden border-t border-b-[#E4E5E6] bg-black/70 text-black',\n {\n hidden: !(currentNavItem?.open && categoriesItem),\n }\n )}\n onMouseEnter={() => setDowndownHover(true)}\n onMouseLeave={() => setDowndownHover(false)}\n style={{ height: `calc(100dvh - ${headerRef?.current?.getBoundingClientRect()?.bottom}px)` }}\n >\n <div\n ref={dropdownRef}\n className={cn('relative z-50', {\n 'overflow-hidden': currentBlockTypeCategories !== HeaderNavigationBlockType.Supports,\n })}\n >\n {DropdownComp}\n </div>\n <div\n className=\"flex-1 bg-transparent\"\n onClick={handleNavMenuClose}\n role=\"button\"\n tabIndex={0}\n aria-label=\"Close menu\"\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ' || e.key === 'Escape') {\n e.preventDefault()\n handleNavMenuClose()\n }\n }}\n />\n </div>\n {userProfileOpen && (\n <div\n className=\"absolute left-0 top-full z-[999] flex h-dvh w-full bg-black/70\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"User profile menu\"\n // style={{\n // height: `calc(100dvh - ${profileRef?.current?.getBoundingClientRect()?.bottom}px)`,\n // top: `calc(96px)`,\n // }}\n >\n <div\n className=\"rounded-box absolute w-[272px] overflow-hidden bg-white p-4\"\n style={{\n right: `calc(100% - ${profileRef?.current?.getBoundingClientRect()?.right}px)`,\n top: '-36px',\n }}\n >\n {profile?.email ? (\n <>\n <Text html={profile?.nick_name || profileAction?.welcome} className=\"text-sm font-bold\" />\n <div className=\"mt-2 h-px bg-[#D9D9D9]\" aria-hidden=\"true\" />\n <nav className=\"mt-2\" role=\"navigation\" aria-label=\"Profile navigation\">\n {profileAction?.profiles?.map((item: any) => (\n <MenuItem\n className=\"py-2\"\n key={item.id}\n label={item?.title}\n href={getLocalizedPath(item?.url, locale)}\n />\n ))}\n </nav>\n </>\n ) : (\n <>\n <Polygon className=\"absolute -top-2 right-[46px] z-30 text-white\" aria-hidden=\"true\" />\n <Text html={profileAction?.benefits_title} className=\"text-sm font-bold leading-[1.4]\" />\n <div className=\"mt-2 flex flex-col gap-1\">\n {profileAction?.benefits?.map((item: any) => (\n <div key={item.id} className=\"flex items-center gap-[6px]\">\n <Picture\n source={item.benefitIcon?.url}\n className=\"size-4 shrink-0\"\n alt={item.benefit}\n width={16}\n height={16}\n />\n <Text html={item.benefit} className=\"text-sm font-bold leading-[1.4]\" />\n </div>\n ))}\n </div>\n <div className=\"mt-4 flex flex-wrap gap-2\">\n <Button className=\"grow\" variant=\"secondary\" size=\"lg\" onClick={() => event?.join?.()}>\n <Text html={profileAction?.primaryButton || 'Join Now'} className=\"font-bold\" />\n </Button>\n <Button className=\"grow\" variant=\"primary\" size=\"lg\" onClick={() => event?.login?.()}>\n <Text html={profileAction?.secondaryButton || 'Log In'} className=\"font-bold\" />\n </Button>\n </div>\n </>\n )}\n </div>\n <div\n className=\"flex-1 bg-transparent\"\n onClick={() => setUserProfileOpen(false)}\n role=\"button\"\n tabIndex={0}\n aria-label=\"Close profile menu\"\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ' || e.key === 'Escape') {\n e.preventDefault()\n setUserProfileOpen(false)\n }\n }}\n />\n </div>\n )}\n </Container>\n )\n})\n\nconst MobileNavigation = forwardRef<HTMLDivElement, MobileNavigationProps>(\n ({ data, menuData, className, onPrimaryNavClick, onMobileMenuToggle }, ref) => {\n const groupCategories = useMemo(() => {\n return WithGroupCategory(data?.categories?.filter((item: any) => item?.mobileShow))\n }, [data])\n\n const { currentMenu, setCurrentMenu, subSubCategory } = useNavContext()\n const [mobileMenuOpen, setMobileMenuOpen] = useState(false)\n const [menuInnerHeight, setMenuInnerHeight] = useState(0)\n const [categoriesItem, setCategoriesItem] = useState<any>(null)\n\n const mobileMenuRef = useRef<HTMLDivElement>(null)\n // resize \u89E6\u53D1\u7684\u9AD8\u5EA6\u66F4\u65B0\u53EA\u9700\u76F4\u63A5\u540C\u6B65\uFF0C\u4E0D\u9700\u8981\u91CD\u653E\u5C55\u5F00\u52A8\u753B\n const skipOpenAnimationRef = useRef(false)\n\n useEffect(() => {\n if (mobileMenuRef?.current && mobileMenuOpen) {\n const rect = mobileMenuRef?.current?.getBoundingClientRect()\n setMenuInnerHeight(window?.innerHeight - (rect?.top || 0))\n }\n\n onMobileMenuToggle?.({ open: mobileMenuOpen })\n }, [mobileMenuOpen, onMobileMenuToggle])\n\n // \u79FB\u52A8\u7AEF\u83DC\u5355\u5C55\u5F00\u65F6\uFF0C\u76D1\u542C\u7A97\u53E3\u5C3A\u5BF8\u53D8\u5316\uFF0C\u9632\u6B62\u7528\u6237\u8C03\u6574\u6D4F\u89C8\u5668\u7A97\u53E3\u5927\u5C0F\u540E\u83DC\u5355\u9AD8\u5EA6\u4E0D\u540C\u6B65\n useEffect(() => {\n if (!mobileMenuOpen) return\n\n const handleResize = throttle(() => {\n if (mobileMenuRef?.current) {\n const rect = mobileMenuRef.current.getBoundingClientRect()\n skipOpenAnimationRef.current = true\n setMenuInnerHeight(window?.innerHeight - (rect?.top || 0))\n }\n }, 100)\n\n window.addEventListener('resize', handleResize)\n return () => window.removeEventListener('resize', handleResize)\n }, [mobileMenuOpen])\n\n useGSAP(() => {\n if (skipOpenAnimationRef.current) {\n // resize \u5F15\u8D77\u7684\u9AD8\u5EA6\u53D8\u5316\uFF1A\u76F4\u63A5\u540C\u6B65\u9AD8\u5EA6\uFF0C\u4E0D\u64AD\u653E\u5C55\u5F00\u52A8\u753B\n gsap.set(mobileMenuRef.current, { height: menuInnerHeight })\n skipOpenAnimationRef.current = false\n return\n }\n\n gsap.fromTo(\n mobileMenuRef.current,\n {\n height: 0,\n },\n {\n height: menuInnerHeight,\n duration: 0.3,\n }\n )\n }, [menuInnerHeight])\n\n useScrollLock(mobileMenuOpen)\n\n const currentBlockTypeCategories = useMemo(() => {\n return categoriesItem?.components?.[0]?.blockType\n }, [categoriesItem])\n\n const MobileSupportMenuComp = WithSupports(MobileSupportMenu, {\n categoriesItem,\n })\n\n const MobileSidebarMenuComp = WithSidebar(MobileSidebarMenu, categoriesItem)\n const MobileResourceSidebarMenuComp = WithResource(MobileResourceSidebarMenu, categoriesItem)\n const MobileMulticolMenuComp = WithMulticol(MobileMulticolMenu, categoriesItem)\n\n const MobileCategoriesMenuComp = useMemo(() => {\n switch (currentBlockTypeCategories) {\n case HeaderNavigationBlockType.Sidebar:\n return <MobileSidebarMenuComp />\n case HeaderNavigationBlockType.Resource:\n return <MobileResourceSidebarMenuComp />\n case HeaderNavigationBlockType.Supports:\n return <MobileSupportMenuComp />\n case HeaderNavigationBlockType.Multicol:\n return <MobileMulticolMenuComp />\n default:\n return null\n }\n }, [currentBlockTypeCategories, categoriesItem, MobileSupportMenuComp])\n\n const handleSecondaryMenuClose = useCallback(() => {\n setMobileMenuOpen(false)\n setMenuInnerHeight(0)\n setCurrentMenu && setCurrentMenu(HeaderNavigationMenu.Primary)\n }, [setMobileMenuOpen, setMenuInnerHeight, setCurrentMenu])\n\n const menuActions = useMemo(() => {\n return data?.bar?.actions?.filter(\n (item: any) => item?.mobileShow && item?.blockType !== HeaderNavigationActionBlockType.Profile // \u79FB\u52A8\u7AEF\u4E0D\u663E\u793Aprofile\u6309\u94AE\n )\n }, [data])\n\n const profileAction = useMemo(() => {\n return (\n data?.bar?.actions?.find(\n (item: any) => item?.mobileShow && item?.blockType === HeaderNavigationActionBlockType.Profile\n ) || {}\n )\n }, [data])\n\n const MobileCategoriesHeaderComp = useMemo(() => {\n switch (currentMenu) {\n case HeaderNavigationMenu.Primary:\n return (\n <PrimaryHeader\n actions={menuActions}\n menuOpen={mobileMenuOpen}\n onMenuOpenClose={() => {\n setMobileMenuOpen(false)\n setMenuInnerHeight(0)\n }}\n onMenuOpenClick={() => setMobileMenuOpen(true)}\n />\n )\n case HeaderNavigationMenu.Secondary:\n return (\n <SecondaryHeader\n title={categoriesItem?.text}\n onMenuOpenClose={handleSecondaryMenuClose}\n onMenuBackClick={() => setCurrentMenu?.(HeaderNavigationMenu.Primary)}\n />\n )\n case HeaderNavigationMenu.Third:\n return (\n <SecondaryHeader\n title={subSubCategory?.label}\n onMenuOpenClose={handleSecondaryMenuClose}\n onMenuBackClick={() => setCurrentMenu?.(HeaderNavigationMenu.Secondary)}\n />\n )\n default:\n return null\n }\n }, [\n mobileMenuOpen,\n currentMenu,\n setCurrentMenu,\n categoriesItem,\n menuActions,\n subSubCategory,\n handleSecondaryMenuClose,\n ])\n\n const handlePrimaryMenuClick = useCallback(\n (groupIndex: number, index: number) => {\n const categoriesItem = Array.isArray(groupCategories)\n ? Array.isArray(groupCategories[groupIndex])\n ? // @ts-ignore\n groupCategories[groupIndex][index]\n : {}\n : {}\n setCategoriesItem(categoriesItem)\n if (categoriesItem?.components?.[0]?.blockType === HeaderNavigationBlockType.Links) {\n // link\u6A21\u5757\u7279\u6B8A\u5904\u7406\n categoriesItem?.components?.[0]?.url &&\n window.open(categoriesItem?.components?.[0]?.url, categoriesItem?.components?.[0]?.target ?? '_blank')\n } else {\n setCurrentMenu?.(HeaderNavigationMenu.Secondary)\n }\n },\n [groupCategories, setCurrentMenu]\n )\n\n return (\n <Container className={cn('relative h-[52px]', className)}>\n {/* \u79FB\u52A8\u7AEF\u5206\u7C7B\u83DC\u5355 */}\n {MobileCategoriesHeaderComp}\n {mobileMenuOpen && (\n <nav\n ref={mobileMenuRef}\n className=\"absolute left-0 top-full z-[999] w-full overflow-y-auto border-t border-[#E4E5E6] bg-white text-black\"\n style={{ height: menuInnerHeight }}\n role=\"navigation\"\n aria-label=\"Mobile navigation menu\"\n >\n {currentMenu === HeaderNavigationMenu.Primary && menuData ? (\n <div className=\"pt-4\">\n <BrandStrip data={menuData} />\n </div>\n ) : null}\n {currentMenu === HeaderNavigationMenu.Primary ? (\n <MobilePrimaryMenu\n categories={groupCategories}\n onPrimaryMenuClick={handlePrimaryMenuClick}\n onPrimaryNavClick={onPrimaryNavClick}\n profileAction={profileAction}\n />\n ) : (\n MobileCategoriesMenuComp\n )}\n </nav>\n )}\n </Container>\n )\n }\n)\n\n/**\n * \u79FB\u52A8\u7AEF\u4E00\u7EA7\u83DC\u5355\n * @param categories \u5206\u7C7B\n * @param onPrimaryMenuClick \u4E00\u7EA7\u83DC\u5355\u70B9\u51FB\n */\nconst MobilePrimaryMenu = ({\n categories,\n onPrimaryMenuClick,\n profileAction,\n onPrimaryNavClick,\n}: {\n categories: any\n onPrimaryMenuClick: (groupIndex: number, index: number) => void\n profileAction: any\n onPrimaryNavClick?: (category: any, position: number) => void\n}) => {\n return (\n <div className=\"flex h-full flex-col justify-between\">\n <div className=\"tablet:px-8 laptop:px-16 p-4\">\n {categories?.map((groupItem: any, groupIndex: number) => (\n <div key={`groupCategory-${groupIndex}`} className=\"\">\n <div className={cn('my-2 h-px w-full bg-[#E5E5E7]')} />\n {groupItem?.map((item: any, index: number) => (\n <MenuItem\n key={item.id}\n label={item.text}\n onClick={() => {\n const flatCategories = categories?.flat() || []\n const position = flatCategories?.findIndex(\n (item: any) => item?.id === categories[groupIndex][index]?.id\n )\n onPrimaryMenuClick(groupIndex, index)\n onPrimaryNavClick?.(item, position)\n }}\n icon={item.components?.[0]?.icon}\n />\n ))}\n </div>\n ))}\n </div>\n <ProfileComp profileAction={profileAction} />\n </div>\n )\n}\n\n/**\n * \u79FB\u52A8\u7AEF\u4FA7\u8FB9\u680F\u4E0B\u62C9\n * @param sidebarCategoriesMetadata \u4FA7\u8FB9\u680F\u5206\u7C7B\u5143\u6570\u636E\n * @param seriesMetadata \u4FA7\u8FB9\u680F\u7CFB\u5217\u5143\u6570\u636E\n */\nconst ProfileComp = ({ profileAction }: { profileAction: any }) => {\n const [profileOpen, setProfileOpen] = useState(false)\n const { profile, event } = useNavContext()\n const { locale = 'us' } = useAiuiContext()\n return (\n <div\n className={cn('tablet:px-8 laptop:px-16 bg-[#F5F5F7] px-4 py-6', {\n 'p-4': profileOpen,\n })}\n >\n <button\n className=\"flex w-full cursor-pointer items-center justify-between border-0 bg-transparent\"\n onClick={() => setProfileOpen(!profileOpen)}\n aria-expanded={profileOpen}\n aria-label={profile?.nick_name || profileAction?.welcome}\n >\n <div className=\"flex items-center gap-[14px]\">\n <div className=\"flex size-[40px] shrink-0 items-center justify-center rounded-full bg-white\">\n <User aria-hidden=\"true\" />\n </div>\n <Text html={profile?.nick_name || profileAction?.welcome} className=\"text-base font-bold leading-[1.4]\" />\n </div>\n {!profile?.email && (\n <DownArrow aria-hidden=\"true\" className={cn('laptop:size-4 size-5', { 'rotate-180': profileOpen })} />\n )}\n </button>\n {profile?.email && (\n <nav className=\"mt-4\" role=\"navigation\" aria-label=\"Profile menu\">\n {profileAction?.profiles?.map((item: any) => (\n <MenuItem key={item.id} label={item?.title} href={getLocalizedPath(item?.url, locale)} />\n ))}\n </nav>\n )}\n {profileOpen && !profile?.email && (\n <div className=\"mt-4\">\n <Text html={profileAction?.benefits_title} className=\"text-sm font-bold leading-[1.4]\" />\n <div className=\"mt-2 flex flex-col gap-1\">\n {profileAction?.benefits?.map((item: any) => (\n <div key={item.id} className=\"flex items-center gap-[6px]\">\n <Picture source={item.benefitIcon?.url} className=\"size-4\" alt={item.benefit} width={16} height={16} />\n <Text html={item.benefit} className=\"text-sm font-bold leading-[1.4]\" />\n </div>\n ))}\n </div>\n </div>\n )}\n {!profile?.email && (\n <div className=\"mt-4 flex items-center gap-3\">\n <Button className=\"tablet:flex-none flex-1\" variant=\"secondary\" size=\"base\" onClick={() => event?.join?.()}>\n <Text html={profileAction?.primaryButton || 'Join Now'} className=\"text-sm font-bold leading-[1.4]\" />\n </Button>\n <Button className=\"tablet:flex-none flex-1\" variant=\"primary\" size=\"base\" onClick={() => event?.login?.()}>\n <Text html={profileAction?.secondaryButton || 'Log In'} className=\"text-sm font-bold leading-[1.4]\" />\n </Button>\n </div>\n )}\n </div>\n )\n}\n\nconst PrimaryHeader = ({ menuOpen, onMenuOpenClose, onMenuOpenClick, actions }: MobilePrimaryNavigationData) => {\n return (\n <div className=\"flex h-full items-center justify-between gap-4\">\n <Logo />\n <div className=\"desktop:gap-6 flex items-center gap-4\">\n <Actions actions={actions} />\n {menuOpen ? (\n <button\n className=\"cursor-pointer border-0 bg-transparent p-0\"\n onClick={() => onMenuOpenClose()}\n aria-label=\"Close menu\"\n aria-expanded=\"true\"\n >\n <Close className=\"size-5\" aria-hidden=\"true\" />\n </button>\n ) : (\n <button\n className=\"cursor-pointer border-0 bg-transparent p-0\"\n onClick={() => onMenuOpenClick()}\n aria-label=\"Open menu\"\n aria-expanded=\"false\"\n aria-haspopup=\"true\"\n >\n <Menu className=\"size-5\" aria-hidden=\"true\" />\n </button>\n )}\n </div>\n </div>\n )\n}\n\nconst Logo = () => {\n const { payloadData, isMobile } = useNavContext()\n const { locale = 'us' } = useAiuiContext()\n return (\n <a\n href={getLocalizedPath('/', locale)}\n className=\"hover:text-brand-0 [&>svg]:w-full\"\n aria-label=\"Home\"\n dangerouslySetInnerHTML={{\n __html: isMobile ? payloadData?.bar?.mobileLogo : payloadData?.bar?.desktopLogo,\n }}\n />\n )\n}\n\nconst Actions = forwardRef<HTMLButtonElement, { actions: any; activeStatus?: boolean }>(\n ({ actions, activeStatus = false }, ref) => {\n const { event, cartCount } = useNavContext()\n const [activeAction, setActiveAction] = useState<any>(null)\n\n const getActionLabel = (blockType: string) => {\n switch (blockType) {\n case HeaderNavigationActionBlockType.Search:\n return 'Search'\n case HeaderNavigationActionBlockType.Cart:\n return `Shopping cart${cartCount > 0 ? ` (${cartCount} items)` : ''}`\n case HeaderNavigationActionBlockType.Profile:\n return 'User profile'\n case HeaderNavigationActionBlockType.Livestream:\n return 'Livestream'\n default:\n return 'Action'\n }\n }\n\n const handleActionClick = useCallback(\n (action: any, index: number) => {\n setActiveAction(index)\n switch (action?.blockType) {\n case HeaderNavigationActionBlockType.Search:\n event?.search?.()\n break\n case HeaderNavigationActionBlockType.Cart:\n event?.cart?.()\n break\n case HeaderNavigationActionBlockType.Profile:\n event?.profile?.()\n break\n case HeaderNavigationActionBlockType.Livestream:\n event?.livestream?.()\n break\n default:\n return () => {}\n }\n },\n [event]\n )\n\n return (\n <div className=\"desktop:gap-6 flex items-center gap-4\">\n {Array.isArray(actions) &&\n actions?.map((action: any, index: number) => (\n <button\n className=\"relative cursor-pointer border-0 bg-transparent p-0\"\n key={action.id}\n ref={action.blockType === HeaderNavigationActionBlockType.Profile ? ref : null}\n onClick={() => handleActionClick(action, index)}\n aria-label={getActionLabel(action.blockType)}\n aria-pressed={activeStatus && activeAction === index}\n >\n <Text\n html={action.icon}\n className={cn('size-5', { 'text-brand-0': activeStatus && activeAction === index })}\n aria-hidden=\"true\"\n />\n {action.blockType === HeaderNavigationActionBlockType.Cart && cartCount > 0 && (\n <div\n className=\"bg-brand-0 absolute right-[-12px] top-[calc(100%-16px)] z-[1] flex min-h-5 min-w-5 items-center justify-center rounded-full px-[2px]\"\n aria-hidden=\"true\"\n >\n <Text html={cartCount?.toString()} className=\"text-sm font-bold leading-[1.2] text-white\" />\n </div>\n )}\n </button>\n ))}\n </div>\n )\n }\n)\n\nconst SecondaryHeader = ({ title, onMenuOpenClose, onMenuBackClick }: MobileSecondaryNavigationData) => {\n return (\n <div className=\"flex h-full items-center gap-3\">\n <button\n className=\"cursor-pointer border-0 bg-transparent p-0\"\n onClick={() => onMenuBackClick()}\n aria-label=\"Back to previous menu\"\n >\n <LeftArrow className=\"size-5\" aria-hidden=\"true\" />\n </button>\n <Text html={title} className=\"flex-1 text-center text-base font-bold leading-[1.4]\" />\n <button\n className=\"cursor-pointer border-0 bg-transparent p-0\"\n onClick={() => onMenuOpenClose()}\n aria-label=\"Close menu\"\n >\n <Close className=\"size-5\" aria-hidden=\"true\" />\n </button>\n </div>\n )\n}\n\nMobileNavigation.displayName = 'MobileNavigation'\nActions.displayName = 'Actions'\nHeaderNavigation.displayName = 'HeaderNavigation'\nDesktopNavigation.displayName = 'DesktopNavigation'\n\nexport default withLayout(HeaderNavigation)\n"],
|
|
5
|
-
"mappings": "aA+NU,OA4VI,YAAAA,GA5VJ,OAAAC,EAwBE,QAAAC,MAxBF,oBA9NV,OAAgB,cAAAC,GAAY,eAAAC,GAAa,aAAAC,EAAW,uBAAAC,GAAqB,WAAAC,EAAS,UAAAC,EAAQ,YAAAC,MAAgB,QAE1G,OAAS,WAAAC,GAAS,QAAAC,EAAM,UAAAC,GAAQ,aAAAC,GAAW,cAAAC,OAAkB,4BAE7D,OAAS,cAAAC,OAAkB,yBAE3B,OAAS,MAAAC,EAAI,oBAAAC,OAAwB,yBASrC,OAAOC,IAAe,iBAAAC,OAAqB,mBAE3C,OAAS,wBAAAC,EAAsB,6BAAAC,EAA2B,mCAAAC,MAAuC,aAEjG,OAAOC,OAAU,UAEjB,OAAS,WAAAC,OAAe,cACxB,OAAS,QAAAC,OAAY,OAErB,OAAS,eAAAC,GAAa,gBAAAC,GAAc,gBAAAC,GAAc,qBAAAC,GAAmB,gBAAAC,OAAoB,oBAEzF,OAAS,QAAAC,GAAM,SAAAC,GAAO,QAAAC,GAAM,aAAAC,GAAW,aAAAC,GAAW,WAAAC,OAAe,mBAEjE,OAAOC,OAAsB,+BAC7B,OAAS,2BAAAC,OAA+B,+BACxC,OAAS,6BAAAC,OAAiC,iCAC1C,OAAS,mBAAAC,OAAuB,uBAChC,OAAS,iBAAAC,OAAqB,qBAC9B,OAAS,oBAAAC,OAAwB,wBACjC,OAAS,oBAAAC,OAAwB,wBACjC,OAAS,qBAAAC,OAAyB,yBAClC,OAAS,qBAAAC,OAAyB,yBAClC,OAAS,sBAAAC,OAA0B,0BACnC,OAAS,YAAAC,OAAgB,4BACzB,OAAS,kBAAAC,OAAsB,2BAC/B,OAAO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,YAAc7J,EAAgC,MAAQ8C,EAAY,GACxEnE,EAAC,OACC,UAAU,uIACV,cAAY,OAEZ,SAAAA,EAACU,EAAA,CAAK,KAAMyD,GAAW,SAAS,EAAG,UAAU,6CAA6C,EAC5F,IAjBG+G,EAAO,EAmBd,CACD,EACL,CAEJ,CACF,EAEMjB,GAAkB,CAAC,CAAE,MAAAkB,EAAO,gBAAAV,EAAiB,gBAAAW,CAAgB,IAE/DnL,EAAC,OAAI,UAAU,iCACb,UAAAD,EAAC,UACC,UAAU,6CACV,QAAS,IAAMoL,EAAgB,EAC/B,aAAW,wBAEX,SAAApL,EAACiC,GAAA,CAAU,UAAU,SAAS,cAAY,OAAO,EACnD,EACAjC,EAACU,EAAA,CAAK,KAAMyK,EAAO,UAAU,uDAAuD,EACpFnL,EAAC,UACC,UAAU,6CACV,QAAS,IAAMyK,EAAgB,EAC/B,aAAW,aAEX,SAAAzK,EAAC+B,GAAA,CAAM,UAAU,SAAS,cAAY,OAAO,EAC/C,GACF,EAIJiE,GAAiB,YAAc,mBAC/B0C,GAAQ,YAAc,UACtBzF,GAAiB,YAAc,mBAC/B8C,GAAkB,YAAc,oBAEhC,IAAOsF,GAAQvK,GAAWmC,EAAgB",
|
|
4
|
+
"sourcesContent": ["'use client'\nimport React, { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react'\n\nimport { Picture, Text, Button, Container, BrandStrip } from '../../components/index.js'\n\nimport { withLayout } from '../../shared/Styles.js'\n\nimport { cn, getLocalizedPath } from '../../helpers/utils.js'\n\nimport type {\n MobilePrimaryNavigationData,\n MobileSecondaryNavigationData,\n MobileNavigationProps,\n DesktopNavigationProps,\n HeaderNavigationProps,\n} from './types.js'\nimport NavProvider, { useNavContext } from './NavProvider.js'\n\nimport { HeaderNavigationMenu, HeaderNavigationBlockType, HeaderNavigationActionBlockType } from './types.js'\n\nimport jump from 'jump.js'\n\nimport { useGSAP } from '@gsap/react'\nimport { gsap } from 'gsap'\n\nimport { WithSidebar, WithSupports, WithMulticol, WithGroupCategory, WithResource } from './withCategory.js'\n\nimport { Menu, Close, User, LeftArrow, DownArrow, Polygon } from './icons/index.js'\n\nimport NavigationSearch from '../NavigationSearch/index.js'\nimport { ResourceSidebarDropdown } from './ResourceSidebarDropdown.js'\nimport { MobileResourceSidebarMenu } from './MobileResourceSidebarMenu.js'\nimport { SidebarDropdown } from './SidebarDropdown.js'\nimport { useScrollLock } from './useScrollLock.js'\nimport { MulticolDropdown } from './MulticolDropdown.js'\nimport { SupportsDropdown } from './SupportsDropdown.js'\nimport { MobileSidebarMenu } from './MobileSidebarMenu.js'\nimport { MobileSupportMenu } from './MobileSupportMenu.js'\nimport { MobileMulticolMenu } from './MobileMulticolMenu.js'\nimport { MenuItem } from './MobileMenuComponents.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport throttle from '../../shared/throttle.js'\n\nconst HeaderNavigation = forwardRef<HTMLDivElement, HeaderNavigationProps>((props, ref) => {\n const {\n data: { header } = {},\n buildProps,\n event,\n profile,\n theme = 'light',\n isTop = false,\n searchResult,\n onSearch,\n isSearching,\n keywords,\n onPrimaryNavClick,\n onSeriesProductClick,\n onSidebarNavClick,\n onMobileMenuToggle,\n headerId,\n cartCount,\n menuData,\n render,\n componentOverrides,\n ...rest\n } = props\n\n const [searchOpen, setSearchOpen] = useState(false)\n const [headerHidden, setHeaderHidden] = useState(false)\n const [changeHeaderBackground, setChangeHeaderBackground] = useState(false)\n const [isMobile, setIsMobile] = useState(false)\n const searchRef = useRef<HTMLDivElement>(null)\n\n const headerRef = useRef<HTMLDivElement>(null)\n\n const resizeWindow = () => {\n const offsetWidth = document?.querySelector('body')?.offsetWidth || 0\n setIsMobile(offsetWidth <= 1440)\n }\n\n useEffect(() => {\n resizeWindow()\n window.addEventListener('resize', resizeWindow)\n return () => {\n window.removeEventListener('resize', resizeWindow)\n }\n }, [])\n\n useImperativeHandle(ref, () => headerRef.current as HTMLDivElement)\n\n useEffect(() => {\n if (headerRef.current && isTop) {\n jump(headerRef.current, { duration: 0, offset: headerRef.current?.getBoundingClientRect()?.bottom || 0 })\n }\n }, [isTop])\n\n useEffect(() => {\n // \u5982\u679C isTop \u4E3A true\uFF0C\u4E0D\u9700\u8981\u6EDA\u52A8\u76D1\u542C\u548C\u52A8\u6548\n if (isTop) {\n setHeaderHidden(false)\n setChangeHeaderBackground(false)\n return\n }\n\n let lastScrollY = 0\n let upwardDistance = 0\n let downwardDistance = 0\n\n const getScrollTop = () => {\n return document?.documentElement?.scrollTop || document?.body?.scrollTop || 0\n }\n\n // \u521D\u59CB\u5316\u72B6\u6001\n const initialScrollTop = getScrollTop()\n lastScrollY = initialScrollTop\n setHeaderHidden(initialScrollTop > 300)\n setChangeHeaderBackground(initialScrollTop > 30)\n\n const handleScroll = throttle(() => {\n const currentScrollY = getScrollTop()\n const delta = currentScrollY - lastScrollY\n\n // \u66F4\u65B0\u80CC\u666F\u72B6\u6001\n setChangeHeaderBackground(currentScrollY > 30)\n\n if (delta > 0) {\n // \u5411\u4E0B\u6EDA\u52A8\n upwardDistance = 0 // \u91CD\u7F6E\u5411\u4E0A\u7D2F\u8BA1\n downwardDistance += delta\n\n if (downwardDistance >= 300 && currentScrollY > 300) {\n setHeaderHidden(true)\n }\n } else if (delta < 0) {\n // \u5411\u4E0A\u6EDA\u52A8\n downwardDistance = 0 // \u91CD\u7F6E\u5411\u4E0B\u7D2F\u8BA1\n upwardDistance += Math.abs(delta)\n\n if (upwardDistance >= 300) {\n setHeaderHidden(false)\n upwardDistance = 0\n }\n }\n\n lastScrollY = currentScrollY\n }, 100)\n\n window.addEventListener('scroll', handleScroll, { passive: true })\n return () => window.removeEventListener('scroll', handleScroll)\n }, [isTop])\n\n useEffect(() => {\n if (event) {\n event.search = () => setSearchOpen(true)\n }\n }, [event])\n\n useGSAP(() => {\n if (searchRef?.current && searchOpen) {\n gsap.fromTo(\n searchRef.current,\n {\n height: 0,\n },\n {\n height: 'auto',\n duration: 0.3,\n }\n )\n }\n }, [searchOpen])\n\n useScrollLock(searchOpen)\n\n const searchPage = useMemo(() => {\n return (\n header?.bar?.actions?.find((item: any) => item?.blockType === HeaderNavigationActionBlockType.Search)\n ?.searchBar?.[0] || {}\n )\n }, [header])\n\n const CustomMobileHeaderNavigation = render?.mobileHeaderNavigation\n\n return (\n <NavProvider\n buildProps={buildProps}\n profile={profile}\n isMobile={isMobile}\n event={event}\n payloadData={header}\n onSidebarNavClick={onSidebarNavClick}\n onSeriesProductClick={onSeriesProductClick}\n cartCount={cartCount}\n componentOverrides={componentOverrides}\n >\n <header\n {...rest}\n id={headerId || 'header'}\n data-ui-component-id=\"HeaderNavigation\"\n className={\n isTop\n ? 'relative z-[100] bg-white'\n : cn('sticky top-0 z-[100] transition-transform duration-500 ease-in-out', {\n ['translate-y-[-100%]']: headerHidden,\n })\n }\n // className=\"relative z-[100] bg-white\"\n ref={headerRef}\n >\n <div\n className={cn(\n 'hover:bg-white hover:text-black',\n theme === 'light' ? 'text-black' : 'text-white',\n {\n ['!bg-white transition-all duration-500 ease-in-out']: !isTop && changeHeaderBackground,\n },\n {\n ['hover:!text-black']: theme === 'dark',\n ['!text-black']: !isTop && changeHeaderBackground,\n }\n )}\n onClick={() => !isTop && setChangeHeaderBackground(true)}\n >\n <DesktopNavigation\n data={header}\n className=\"desktop:block hidden !bg-white\"\n theme={theme}\n onNavItemClick={() => !isTop && setChangeHeaderBackground(true)}\n onPrimaryNavClick={onPrimaryNavClick}\n />\n {CustomMobileHeaderNavigation ? (\n <CustomMobileHeaderNavigation\n className=\"desktop:hidden block !bg-white\"\n menuData={menuData}\n data={header}\n onPrimaryNavClick={onPrimaryNavClick}\n />\n ) : (\n <MobileNavigation\n menuData={menuData}\n data={header}\n className=\"desktop:hidden block !bg-white\"\n onPrimaryNavClick={onPrimaryNavClick}\n onMobileMenuToggle={onMobileMenuToggle}\n />\n )}\n {searchOpen && (\n <div\n className=\"absolute left-0 top-0 z-[60] flex w-full flex-col bg-black/70\"\n style={{ height: `calc(100dvh - ${headerRef?.current?.getBoundingClientRect()?.top}px)` }}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"Search\"\n >\n <div ref={searchRef} className={cn('overflow-y-auto', {})}>\n <NavigationSearch\n data={searchPage}\n keywords={keywords}\n isSearching={isSearching}\n searchResult={searchResult}\n onSearch={(value: string) => {\n onSearch?.(value)\n }}\n onClose={() => {\n onSearch?.()\n setSearchOpen(false)\n }}\n />\n </div>\n <div\n className=\"flex-1 bg-transparent\"\n onClick={() => setSearchOpen(false)}\n role=\"button\"\n tabIndex={0}\n aria-label=\"Close search\"\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ' || e.key === 'Escape') {\n e.preventDefault()\n setSearchOpen(false)\n }\n }}\n />\n </div>\n )}\n </div>\n </header>\n </NavProvider>\n )\n})\n\nconst DesktopNavigation = forwardRef<HTMLDivElement, DesktopNavigationProps>((props, ref) => {\n const { data, onNavItemClick, className, theme, onPrimaryNavClick } = props\n const { event, profile } = useNavContext()\n const [downdownHover, setDowndownHover] = useState(false)\n const { locale = 'us' } = useAiuiContext()\n\n const groupCategories = useMemo(() => {\n return WithGroupCategory(data?.categories?.filter((item: any) => item?.pcShow)) as any[][]\n }, [data])\n\n const [categoriesItem, setCategoriesItem] = useState<any>(null)\n const [navStatusArray, setNavStatusArray] = useState<{ index: number; groupIndex: number; open: boolean }[][]>([])\n const profileRef = useRef<HTMLButtonElement>(null)\n const [userProfileOpen, setUserProfileOpen] = useState(false)\n const headerRef = useRef<HTMLDivElement>(null)\n const dropdownRef = useRef<HTMLDivElement>(null)\n const navItemRefs = useRef<HTMLDivElement[][]>(\n groupCategories.map((categories: any) => Array(categories?.length || 0).fill(null))\n )\n\n useEffect(() => {\n if (groupCategories?.length) {\n setNavStatusArray(\n groupCategories?.map((groupItem: any, groupIndex: number) => {\n return groupItem?.map((_: any, index: number) => ({ groupIndex, index, open: false }))\n })\n )\n }\n }, [groupCategories])\n\n const currentNavItem = useMemo(() => {\n let currentNavItem: { index: number; groupIndex: number; open: boolean } | null = null\n for (const groupItem of navStatusArray) {\n for (const item of groupItem) {\n if (item.open) {\n currentNavItem = item\n break\n }\n }\n if (currentNavItem) break\n }\n return currentNavItem\n }, [navStatusArray])\n\n useScrollLock(!!currentNavItem?.open || userProfileOpen)\n\n const handleNavItemClick = (e: any, groupIndex: number, index: number) => {\n setUserProfileOpen(false)\n // if (categoriesItem?.components?.[0]?.blockType === HeaderNavigationBlockType.Links) {\n const currentCategoriesItem = groupCategories[groupIndex][index]\n if (currentCategoriesItem?.components?.[0]?.blockType === HeaderNavigationBlockType.Links) {\n // link\u6A21\u5757\u7279\u6B8A\u5904\u7406\n // categoriesItem?.components?.[0]?.url && window.open(categoriesItem?.components?.[0]?.url)\n currentCategoriesItem?.components?.[0]?.url &&\n window.open(\n currentCategoriesItem?.components?.[0]?.url,\n currentCategoriesItem?.components?.[0]?.target ?? '_blank'\n )\n } else {\n const categories = groupCategories?.flat() || []\n const position = categories?.findIndex(item => item?.id === groupCategories[groupIndex][index]?.id)\n e.stopPropagation()\n onNavItemClick?.()\n onPrimaryNavClick?.(categories[position], position)\n // setCategoriesItem(groupCategories[groupIndex][index])\n setCategoriesItem(currentCategoriesItem)\n setNavStatusArray(prev =>\n prev.map(groupItem =>\n groupItem.map(item =>\n item.groupIndex === groupIndex && item.index === index\n ? { ...item, open: !item.open }\n : { ...item, open: false }\n )\n )\n )\n }\n }\n\n const handleNavItemKeyDown = (e: React.KeyboardEvent, groupIndex: number, index: number) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n handleNavItemClick(e, groupIndex, index)\n } else if (e.key === 'Escape' && currentNavItem?.groupIndex === groupIndex && currentNavItem?.index === index) {\n e.preventDefault()\n handleNavMenuClose()\n }\n }\n\n const handleNavMenuClose = () => {\n setNavStatusArray(prev => prev.map(groupItem => groupItem.map(item => ({ ...item, open: false }))))\n }\n\n const currentBlockTypeCategories = useMemo(() => {\n if (categoriesItem) return categoriesItem?.components?.[0]?.blockType\n }, [categoriesItem])\n\n const SidebarDropdownComp = WithSidebar(SidebarDropdown, categoriesItem)\n const ResourceSidebarDropdownComp = WithResource(ResourceSidebarDropdown, categoriesItem)\n const MulticolDropdownComp = WithMulticol(MulticolDropdown, categoriesItem)\n const SupportsDropdownComp = WithSupports(SupportsDropdown, {\n categoriesItem,\n currentNavItemRef: navItemRefs.current?.[currentNavItem?.groupIndex || 0]?.[currentNavItem?.index || 0],\n })\n\n const DropdownComp = useMemo(() => {\n switch (currentBlockTypeCategories) {\n case HeaderNavigationBlockType.Sidebar:\n return <SidebarDropdownComp />\n case HeaderNavigationBlockType.Resource:\n return <ResourceSidebarDropdownComp />\n case HeaderNavigationBlockType.Supports:\n return <SupportsDropdownComp />\n case HeaderNavigationBlockType.Multicol:\n return <MulticolDropdownComp />\n default:\n return null\n }\n }, [currentBlockTypeCategories, categoriesItem])\n\n const actions = useMemo(() => {\n return data?.bar?.actions?.filter((item: any) => item?.pcShow)\n }, [data])\n\n const profileAction = useMemo(() => {\n return actions?.find((item: any) => item?.blockType === HeaderNavigationActionBlockType.Profile)\n }, [actions])\n\n const handleProfileClick = useCallback(() => {\n setUserProfileOpen(prev => !prev)\n }, [])\n\n useEffect(() => {\n if (profileRef?.current) {\n const profileRefElement = profileRef.current as HTMLButtonElement\n profileRefElement.addEventListener('click', handleProfileClick)\n\n return () => {\n profileRefElement.removeEventListener('click', handleProfileClick)\n }\n }\n }, [handleProfileClick])\n\n useGSAP(() => {\n if (currentNavItem?.open) {\n gsap.fromTo(\n dropdownRef?.current,\n {\n height: 0,\n },\n {\n height: 'auto',\n }\n )\n }\n }, [currentNavItem?.open])\n\n return (\n <Container className={cn('relative h-[96px]', className)}>\n <div ref={headerRef} onClick={handleNavMenuClose} className=\"flex h-full flex-col justify-end gap-4\">\n <div className=\"flex items-center justify-between\">\n <Logo />\n <Actions ref={profileRef} actions={actions} activeStatus={userProfileOpen} />\n </div>\n <nav className=\"flex justify-between\" role=\"navigation\" aria-label=\"Primary navigation\">\n {groupCategories?.map((groupItem: any, groupIndex: number) => {\n return (\n <div key={`groupCategory-${groupIndex}`} className=\"flex gap-3\">\n {groupItem?.map((item: any, index: number) => {\n const isExpanded = currentNavItem?.groupIndex === groupIndex && currentNavItem?.index === index\n return (\n <div\n key={item.id}\n ref={(el: HTMLDivElement) => {\n navItemRefs.current[groupIndex][index] = el\n }}\n className=\"group\"\n >\n <div className=\"relative\">\n <button\n className=\"flex cursor-pointer items-center gap-1 border-0 bg-transparent pb-4\"\n onClick={e => handleNavItemClick(e, groupIndex, index)}\n onKeyDown={e => handleNavItemKeyDown(e, groupIndex, index)}\n aria-expanded={isExpanded}\n aria-haspopup=\"true\"\n aria-label={item.text}\n >\n <Text html={item.text} className=\"text-sm font-bold leading-[1.4]\" />\n {/* <DownArrow\n aria-hidden=\"true\"\n className={cn('size-4 opacity-0 transition-opacity duration-500 group-hover:opacity-100', {\n ['rotate-180']: isExpanded,\n ['opacity-100']: downdownHover && isExpanded,\n })}\n /> */}\n <DownArrow\n className={cn('size-4 opacity-0 transition-opacity duration-500 group-hover:opacity-100', {\n ['rotate-180']:\n currentNavItem?.groupIndex === groupIndex && currentNavItem?.index === index,\n ['opacity-100']:\n downdownHover &&\n currentNavItem?.groupIndex === groupIndex &&\n currentNavItem?.index === index,\n ['invisible']:\n !item?.components?.length ||\n item?.components?.[0]?.blockType === HeaderNavigationBlockType.Links,\n })}\n />\n </button>\n <div\n className={cn(\n 'absolute bottom-0 left-0 h-[2px] w-0 transition-all duration-500',\n {\n 'w-[calc(100%-20px)]': isExpanded,\n },\n theme === 'dark' ? 'bg-white' : 'bg-[#080A0F]'\n )}\n aria-hidden=\"true\"\n />\n </div>\n </div>\n )\n })}\n </div>\n )\n })}\n </nav>\n </div>\n <div\n role=\"menu\"\n aria-hidden={!(currentNavItem?.open && categoriesItem)}\n className={cn(\n 'absolute left-0 top-full z-[999] flex w-full flex-col overflow-hidden border-t border-b-[#E4E5E6] bg-black/70 text-black',\n {\n hidden: !(currentNavItem?.open && categoriesItem),\n }\n )}\n onMouseEnter={() => setDowndownHover(true)}\n onMouseLeave={() => setDowndownHover(false)}\n style={{ height: `calc(100dvh - ${headerRef?.current?.getBoundingClientRect()?.bottom}px)` }}\n >\n <div\n ref={dropdownRef}\n className={cn('relative z-50', {\n 'overflow-hidden': currentBlockTypeCategories !== HeaderNavigationBlockType.Supports,\n })}\n >\n {DropdownComp}\n </div>\n <div\n className=\"flex-1 bg-transparent\"\n onClick={handleNavMenuClose}\n role=\"button\"\n tabIndex={0}\n aria-label=\"Close menu\"\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ' || e.key === 'Escape') {\n e.preventDefault()\n handleNavMenuClose()\n }\n }}\n />\n </div>\n {userProfileOpen && (\n <div\n className=\"absolute left-0 top-full z-[999] flex h-dvh w-full bg-black/70\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"User profile menu\"\n // style={{\n // height: `calc(100dvh - ${profileRef?.current?.getBoundingClientRect()?.bottom}px)`,\n // top: `calc(96px)`,\n // }}\n >\n <div\n className=\"rounded-box absolute w-[272px] overflow-hidden bg-white p-4\"\n style={{\n right: `calc(100% - ${profileRef?.current?.getBoundingClientRect()?.right}px)`,\n top: '-36px',\n }}\n >\n {profile?.email ? (\n <>\n <Text html={profile?.nick_name || profileAction?.welcome} className=\"text-sm font-bold\" />\n <div className=\"mt-2 h-px bg-[#D9D9D9]\" aria-hidden=\"true\" />\n <nav className=\"mt-2\" role=\"navigation\" aria-label=\"Profile navigation\">\n {profileAction?.profiles?.map((item: any) => (\n <MenuItem\n className=\"py-2\"\n key={item.id}\n label={item?.title}\n href={getLocalizedPath(item?.url, locale)}\n />\n ))}\n </nav>\n </>\n ) : (\n <>\n <Polygon className=\"absolute -top-2 right-[46px] z-30 text-white\" aria-hidden=\"true\" />\n <Text html={profileAction?.benefits_title} className=\"text-sm font-bold leading-[1.4]\" />\n <div className=\"mt-2 flex flex-col gap-1\">\n {profileAction?.benefits?.map((item: any) => (\n <div key={item.id} className=\"flex items-center gap-[6px]\">\n <Picture\n source={item.benefitIcon?.url}\n className=\"size-4 shrink-0\"\n alt={item.benefit}\n width={16}\n height={16}\n />\n <Text html={item.benefit} className=\"text-sm font-bold leading-[1.4]\" />\n </div>\n ))}\n </div>\n <div className=\"mt-4 flex flex-wrap gap-2\">\n <Button className=\"grow\" variant=\"secondary\" size=\"lg\" onClick={() => event?.join?.()}>\n <Text html={profileAction?.primaryButton || 'Join Now'} className=\"font-bold\" />\n </Button>\n <Button className=\"grow\" variant=\"primary\" size=\"lg\" onClick={() => event?.login?.()}>\n <Text html={profileAction?.secondaryButton || 'Log In'} className=\"font-bold\" />\n </Button>\n </div>\n </>\n )}\n </div>\n <div\n className=\"flex-1 bg-transparent\"\n onClick={() => setUserProfileOpen(false)}\n role=\"button\"\n tabIndex={0}\n aria-label=\"Close profile menu\"\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ' || e.key === 'Escape') {\n e.preventDefault()\n setUserProfileOpen(false)\n }\n }}\n />\n </div>\n )}\n </Container>\n )\n})\n\nconst MobileNavigation = forwardRef<HTMLDivElement, MobileNavigationProps>(\n ({ data, menuData, className, onPrimaryNavClick, onMobileMenuToggle }, ref) => {\n const groupCategories = useMemo(() => {\n return WithGroupCategory(data?.categories?.filter((item: any) => item?.mobileShow))\n }, [data])\n\n const { currentMenu, setCurrentMenu, subSubCategory } = useNavContext()\n const [mobileMenuOpen, setMobileMenuOpen] = useState(false)\n const [menuInnerHeight, setMenuInnerHeight] = useState(0)\n const [categoriesItem, setCategoriesItem] = useState<any>(null)\n\n const mobileMenuRef = useRef<HTMLDivElement>(null)\n // resize \u89E6\u53D1\u7684\u9AD8\u5EA6\u66F4\u65B0\u53EA\u9700\u76F4\u63A5\u540C\u6B65\uFF0C\u4E0D\u9700\u8981\u91CD\u653E\u5C55\u5F00\u52A8\u753B\n const skipOpenAnimationRef = useRef(false)\n\n useEffect(() => {\n if (mobileMenuRef?.current && mobileMenuOpen) {\n const rect = mobileMenuRef?.current?.getBoundingClientRect()\n setMenuInnerHeight(window?.innerHeight - (rect?.top || 0))\n }\n\n onMobileMenuToggle?.({ open: mobileMenuOpen })\n }, [mobileMenuOpen, onMobileMenuToggle])\n\n // \u79FB\u52A8\u7AEF\u83DC\u5355\u5C55\u5F00\u65F6\uFF0C\u76D1\u542C\u7A97\u53E3\u5C3A\u5BF8\u53D8\u5316\uFF0C\u9632\u6B62\u7528\u6237\u8C03\u6574\u6D4F\u89C8\u5668\u7A97\u53E3\u5927\u5C0F\u540E\u83DC\u5355\u9AD8\u5EA6\u4E0D\u540C\u6B65\n useEffect(() => {\n if (!mobileMenuOpen) return\n\n const handleResize = throttle(() => {\n if (mobileMenuRef?.current) {\n const rect = mobileMenuRef.current.getBoundingClientRect()\n skipOpenAnimationRef.current = true\n setMenuInnerHeight(window?.innerHeight - (rect?.top || 0))\n }\n }, 100)\n\n window.addEventListener('resize', handleResize)\n return () => window.removeEventListener('resize', handleResize)\n }, [mobileMenuOpen])\n\n useGSAP(() => {\n if (skipOpenAnimationRef.current) {\n // resize \u5F15\u8D77\u7684\u9AD8\u5EA6\u53D8\u5316\uFF1A\u76F4\u63A5\u540C\u6B65\u9AD8\u5EA6\uFF0C\u4E0D\u64AD\u653E\u5C55\u5F00\u52A8\u753B\n gsap.set(mobileMenuRef.current, { height: menuInnerHeight })\n skipOpenAnimationRef.current = false\n return\n }\n\n gsap.fromTo(\n mobileMenuRef.current,\n {\n height: 0,\n },\n {\n height: menuInnerHeight,\n duration: 0.3,\n }\n )\n }, [menuInnerHeight])\n\n useScrollLock(mobileMenuOpen)\n\n const currentBlockTypeCategories = useMemo(() => {\n return categoriesItem?.components?.[0]?.blockType\n }, [categoriesItem])\n\n const MobileSupportMenuComp = WithSupports(MobileSupportMenu, {\n categoriesItem,\n })\n\n const MobileSidebarMenuComp = WithSidebar(MobileSidebarMenu, categoriesItem)\n const MobileResourceSidebarMenuComp = WithResource(MobileResourceSidebarMenu, categoriesItem)\n const MobileMulticolMenuComp = WithMulticol(MobileMulticolMenu, categoriesItem)\n\n const MobileCategoriesMenuComp = useMemo(() => {\n switch (currentBlockTypeCategories) {\n case HeaderNavigationBlockType.Sidebar:\n return <MobileSidebarMenuComp />\n case HeaderNavigationBlockType.Resource:\n return <MobileResourceSidebarMenuComp />\n case HeaderNavigationBlockType.Supports:\n return <MobileSupportMenuComp />\n case HeaderNavigationBlockType.Multicol:\n return <MobileMulticolMenuComp />\n default:\n return null\n }\n }, [currentBlockTypeCategories, categoriesItem, MobileSupportMenuComp])\n\n const handleSecondaryMenuClose = useCallback(() => {\n setMobileMenuOpen(false)\n setMenuInnerHeight(0)\n setCurrentMenu && setCurrentMenu(HeaderNavigationMenu.Primary)\n }, [setMobileMenuOpen, setMenuInnerHeight, setCurrentMenu])\n\n const menuActions = useMemo(() => {\n return data?.bar?.actions?.filter(\n (item: any) => item?.mobileShow && item?.blockType !== HeaderNavigationActionBlockType.Profile // \u79FB\u52A8\u7AEF\u4E0D\u663E\u793Aprofile\u6309\u94AE\n )\n }, [data])\n\n const profileAction = useMemo(() => {\n return (\n data?.bar?.actions?.find(\n (item: any) => item?.mobileShow && item?.blockType === HeaderNavigationActionBlockType.Profile\n ) || {}\n )\n }, [data])\n\n const MobileCategoriesHeaderComp = useMemo(() => {\n switch (currentMenu) {\n case HeaderNavigationMenu.Primary:\n return (\n <PrimaryHeader\n actions={menuActions}\n menuOpen={mobileMenuOpen}\n onMenuOpenClose={() => {\n setMobileMenuOpen(false)\n setMenuInnerHeight(0)\n }}\n onMenuOpenClick={() => setMobileMenuOpen(true)}\n />\n )\n case HeaderNavigationMenu.Secondary:\n return (\n <SecondaryHeader\n title={categoriesItem?.text}\n onMenuOpenClose={handleSecondaryMenuClose}\n onMenuBackClick={() => setCurrentMenu?.(HeaderNavigationMenu.Primary)}\n />\n )\n case HeaderNavigationMenu.Third:\n return (\n <SecondaryHeader\n title={subSubCategory?.label}\n onMenuOpenClose={handleSecondaryMenuClose}\n onMenuBackClick={() => setCurrentMenu?.(HeaderNavigationMenu.Secondary)}\n />\n )\n default:\n return null\n }\n }, [\n mobileMenuOpen,\n currentMenu,\n setCurrentMenu,\n categoriesItem,\n menuActions,\n subSubCategory,\n handleSecondaryMenuClose,\n ])\n\n const handlePrimaryMenuClick = useCallback(\n (groupIndex: number, index: number) => {\n const categoriesItem = Array.isArray(groupCategories)\n ? Array.isArray(groupCategories[groupIndex])\n ? // @ts-ignore\n groupCategories[groupIndex][index]\n : {}\n : {}\n setCategoriesItem(categoriesItem)\n if (categoriesItem?.components?.[0]?.blockType === HeaderNavigationBlockType.Links) {\n // link\u6A21\u5757\u7279\u6B8A\u5904\u7406\n categoriesItem?.components?.[0]?.url &&\n window.open(categoriesItem?.components?.[0]?.url, categoriesItem?.components?.[0]?.target ?? '_blank')\n } else {\n setCurrentMenu?.(HeaderNavigationMenu.Secondary)\n }\n },\n [groupCategories, setCurrentMenu]\n )\n\n return (\n <Container className={cn('relative h-[52px]', className)}>\n {/* \u79FB\u52A8\u7AEF\u5206\u7C7B\u83DC\u5355 */}\n {MobileCategoriesHeaderComp}\n {mobileMenuOpen && (\n <nav\n ref={mobileMenuRef}\n className=\"absolute left-0 top-full z-[999] w-full overflow-y-auto border-t border-[#E4E5E6] bg-white text-black\"\n style={{ height: menuInnerHeight }}\n role=\"navigation\"\n aria-label=\"Mobile navigation menu\"\n >\n {currentMenu === HeaderNavigationMenu.Primary && menuData ? (\n <div className=\"pt-4\">\n <BrandStrip data={menuData} />\n </div>\n ) : null}\n {currentMenu === HeaderNavigationMenu.Primary ? (\n <MobilePrimaryMenu\n categories={groupCategories}\n onPrimaryMenuClick={handlePrimaryMenuClick}\n onPrimaryNavClick={onPrimaryNavClick}\n profileAction={profileAction}\n />\n ) : (\n MobileCategoriesMenuComp\n )}\n </nav>\n )}\n </Container>\n )\n }\n)\n\n/**\n * \u79FB\u52A8\u7AEF\u4E00\u7EA7\u83DC\u5355\n * @param categories \u5206\u7C7B\n * @param onPrimaryMenuClick \u4E00\u7EA7\u83DC\u5355\u70B9\u51FB\n */\nconst MobilePrimaryMenu = ({\n categories,\n onPrimaryMenuClick,\n profileAction,\n onPrimaryNavClick,\n}: {\n categories: any\n onPrimaryMenuClick: (groupIndex: number, index: number) => void\n profileAction: any\n onPrimaryNavClick?: (category: any, position: number) => void\n}) => {\n return (\n <div className=\"flex h-full flex-col justify-between\">\n <div className=\"tablet:px-8 laptop:px-16 p-4\">\n {categories?.map((groupItem: any, groupIndex: number) => (\n <div key={`groupCategory-${groupIndex}`} className=\"\">\n <div className={cn('my-2 h-px w-full bg-[#E5E5E7]')} />\n {groupItem?.map((item: any, index: number) => (\n <MenuItem\n key={item.id}\n label={item.text}\n onClick={() => {\n const flatCategories = categories?.flat() || []\n const position = flatCategories?.findIndex(\n (item: any) => item?.id === categories[groupIndex][index]?.id\n )\n onPrimaryMenuClick(groupIndex, index)\n onPrimaryNavClick?.(item, position)\n }}\n icon={item.components?.[0]?.icon}\n />\n ))}\n </div>\n ))}\n </div>\n <ProfileComp profileAction={profileAction} />\n </div>\n )\n}\n\n/**\n * \u79FB\u52A8\u7AEF\u4FA7\u8FB9\u680F\u4E0B\u62C9\n * @param sidebarCategoriesMetadata \u4FA7\u8FB9\u680F\u5206\u7C7B\u5143\u6570\u636E\n * @param seriesMetadata \u4FA7\u8FB9\u680F\u7CFB\u5217\u5143\u6570\u636E\n */\nconst ProfileComp = ({ profileAction }: { profileAction: any }) => {\n const [profileOpen, setProfileOpen] = useState(false)\n const { profile, event } = useNavContext()\n const { locale = 'us' } = useAiuiContext()\n return (\n <div\n className={cn('tablet:px-8 laptop:px-16 bg-[#F5F5F7] px-4 py-6', {\n 'p-4': profileOpen,\n })}\n >\n <button\n className=\"flex w-full cursor-pointer items-center justify-between border-0 bg-transparent\"\n onClick={() => setProfileOpen(!profileOpen)}\n aria-expanded={profileOpen}\n aria-label={profile?.nick_name || profileAction?.welcome}\n >\n <div className=\"flex items-center gap-[14px]\">\n <div className=\"flex size-[40px] shrink-0 items-center justify-center rounded-full bg-white\">\n <User aria-hidden=\"true\" />\n </div>\n <Text html={profile?.nick_name || profileAction?.welcome} className=\"text-base font-bold leading-[1.4]\" />\n </div>\n {!profile?.email && (\n <DownArrow aria-hidden=\"true\" className={cn('laptop:size-4 size-5', { 'rotate-180': profileOpen })} />\n )}\n </button>\n {profile?.email && (\n <nav className=\"mt-4\" role=\"navigation\" aria-label=\"Profile menu\">\n {profileAction?.profiles?.map((item: any) => (\n <MenuItem key={item.id} label={item?.title} href={getLocalizedPath(item?.url, locale)} />\n ))}\n </nav>\n )}\n {profileOpen && !profile?.email && (\n <div className=\"mt-4\">\n <Text html={profileAction?.benefits_title} className=\"text-sm font-bold leading-[1.4]\" />\n <div className=\"mt-2 flex flex-col gap-1\">\n {profileAction?.benefits?.map((item: any) => (\n <div key={item.id} className=\"flex items-center gap-[6px]\">\n <Picture source={item.benefitIcon?.url} className=\"size-4\" alt={item.benefit} width={16} height={16} />\n <Text html={item.benefit} className=\"text-sm font-bold leading-[1.4]\" />\n </div>\n ))}\n </div>\n </div>\n )}\n {!profile?.email && (\n <div className=\"mt-4 flex items-center gap-3\">\n <Button className=\"tablet:flex-none flex-1\" variant=\"secondary\" size=\"base\" onClick={() => event?.join?.()}>\n <Text html={profileAction?.primaryButton || 'Join Now'} className=\"text-sm font-bold leading-[1.4]\" />\n </Button>\n <Button className=\"tablet:flex-none flex-1\" variant=\"primary\" size=\"base\" onClick={() => event?.login?.()}>\n <Text html={profileAction?.secondaryButton || 'Log In'} className=\"text-sm font-bold leading-[1.4]\" />\n </Button>\n </div>\n )}\n </div>\n )\n}\n\nconst PrimaryHeader = ({ menuOpen, onMenuOpenClose, onMenuOpenClick, actions }: MobilePrimaryNavigationData) => {\n return (\n <div className=\"flex h-full items-center justify-between gap-4\">\n <Logo />\n <div className=\"desktop:gap-6 flex items-center gap-4\">\n <Actions actions={actions} />\n {menuOpen ? (\n <button\n className=\"cursor-pointer border-0 bg-transparent p-0\"\n onClick={() => onMenuOpenClose()}\n aria-label=\"Close menu\"\n aria-expanded=\"true\"\n >\n <Close className=\"size-5\" aria-hidden=\"true\" />\n </button>\n ) : (\n <button\n className=\"cursor-pointer border-0 bg-transparent p-0\"\n onClick={() => onMenuOpenClick()}\n aria-label=\"Open menu\"\n aria-expanded=\"false\"\n aria-haspopup=\"true\"\n >\n <Menu className=\"size-5\" aria-hidden=\"true\" />\n </button>\n )}\n </div>\n </div>\n )\n}\n\nconst Logo = () => {\n const { payloadData, isMobile } = useNavContext()\n const { locale = 'us' } = useAiuiContext()\n return (\n <a\n href={getLocalizedPath('/', locale)}\n className=\"hover:text-brand-0 [&>svg]:w-full\"\n aria-label=\"Home\"\n dangerouslySetInnerHTML={{\n __html: isMobile ? payloadData?.bar?.mobileLogo : payloadData?.bar?.desktopLogo,\n }}\n />\n )\n}\n\nconst Actions = forwardRef<HTMLButtonElement, { actions: any; activeStatus?: boolean }>(\n ({ actions, activeStatus = false }, ref) => {\n const { event, cartCount } = useNavContext()\n const [activeAction, setActiveAction] = useState<any>(null)\n\n const getActionLabel = (blockType: string) => {\n switch (blockType) {\n case HeaderNavigationActionBlockType.Search:\n return 'Search'\n case HeaderNavigationActionBlockType.Cart:\n return `Shopping cart${cartCount > 0 ? ` (${cartCount} items)` : ''}`\n case HeaderNavigationActionBlockType.Profile:\n return 'User profile'\n case HeaderNavigationActionBlockType.Livestream:\n return 'Livestream'\n default:\n return 'Action'\n }\n }\n\n const handleActionClick = useCallback(\n (action: any, index: number) => {\n setActiveAction(index)\n switch (action?.blockType) {\n case HeaderNavigationActionBlockType.Search:\n event?.search?.()\n break\n case HeaderNavigationActionBlockType.Cart:\n event?.cart?.()\n break\n case HeaderNavigationActionBlockType.Profile:\n event?.profile?.()\n break\n case HeaderNavigationActionBlockType.Livestream:\n event?.livestream?.()\n break\n default:\n return () => {}\n }\n },\n [event]\n )\n\n return (\n <div className=\"desktop:gap-6 flex items-center gap-4\">\n {Array.isArray(actions) &&\n actions?.map((action: any, index: number) => (\n <button\n className=\"relative cursor-pointer border-0 bg-transparent p-0\"\n key={action.id}\n data-tag={action?.tag || ''}\n ref={action.blockType === HeaderNavigationActionBlockType.Profile ? ref : null}\n onClick={() => handleActionClick(action, index)}\n aria-label={getActionLabel(action.blockType)}\n aria-pressed={activeStatus && activeAction === index}\n >\n <Text\n html={action.icon}\n className={cn('size-5', { 'text-brand-0': activeStatus && activeAction === index })}\n aria-hidden=\"true\"\n />\n {action.blockType === HeaderNavigationActionBlockType.Cart && cartCount > 0 && (\n <div\n className=\"bg-brand-0 absolute right-[-12px] top-[calc(100%-16px)] z-[1] flex min-h-5 min-w-5 items-center justify-center rounded-full px-[2px]\"\n aria-hidden=\"true\"\n >\n <Text html={cartCount?.toString()} className=\"text-sm font-bold leading-[1.2] text-white\" />\n </div>\n )}\n </button>\n ))}\n </div>\n )\n }\n)\n\nconst SecondaryHeader = ({ title, onMenuOpenClose, onMenuBackClick }: MobileSecondaryNavigationData) => {\n return (\n <div className=\"flex h-full items-center gap-3\">\n <button\n className=\"cursor-pointer border-0 bg-transparent p-0\"\n onClick={() => onMenuBackClick()}\n aria-label=\"Back to previous menu\"\n >\n <LeftArrow className=\"size-5\" aria-hidden=\"true\" />\n </button>\n <Text html={title} className=\"flex-1 text-center text-base font-bold leading-[1.4]\" />\n <button\n className=\"cursor-pointer border-0 bg-transparent p-0\"\n onClick={() => onMenuOpenClose()}\n aria-label=\"Close menu\"\n >\n <Close className=\"size-5\" aria-hidden=\"true\" />\n </button>\n </div>\n )\n}\n\nMobileNavigation.displayName = 'MobileNavigation'\nActions.displayName = 'Actions'\nHeaderNavigation.displayName = 'HeaderNavigation'\nDesktopNavigation.displayName = 'DesktopNavigation'\n\nexport default withLayout(HeaderNavigation)\n"],
|
|
5
|
+
"mappings": "aA+NU,OA4VI,YAAAA,GA5VJ,OAAAC,EAwBE,QAAAC,MAxBF,oBA9NV,OAAgB,cAAAC,GAAY,eAAAC,GAAa,aAAAC,EAAW,uBA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AU,iCACb,UAAAD,EAAC,UACC,UAAU,6CACV,QAAS,IAAMoL,EAAgB,EAC/B,aAAW,wBAEX,SAAApL,EAACiC,GAAA,CAAU,UAAU,SAAS,cAAY,OAAO,EACnD,EACAjC,EAACU,EAAA,CAAK,KAAMyK,EAAO,UAAU,uDAAuD,EACpFnL,EAAC,UACC,UAAU,6CACV,QAAS,IAAMyK,EAAgB,EAC/B,aAAW,aAEX,SAAAzK,EAAC+B,GAAA,CAAM,UAAU,SAAS,cAAY,OAAO,EAC/C,GACF,EAIJiE,GAAiB,YAAc,mBAC/B0C,GAAQ,YAAc,UACtBzF,GAAiB,YAAc,mBAC/B8C,GAAkB,YAAc,oBAEhC,IAAOsF,GAAQvK,GAAWmC,EAAgB",
|
|
6
6
|
"names": ["Fragment", "jsx", "jsxs", "forwardRef", "useCallback", "useEffect", "useImperativeHandle", "useMemo", "useRef", "useState", "Picture", "Text", "Button", "Container", "BrandStrip", "withLayout", "cn", "getLocalizedPath", "NavProvider", "useNavContext", "HeaderNavigationMenu", "HeaderNavigationBlockType", "HeaderNavigationActionBlockType", "jump", "useGSAP", "gsap", "WithSidebar", "WithSupports", "WithMulticol", "WithGroupCategory", "WithResource", "Menu", "Close", "User", "LeftArrow", "DownArrow", "Polygon", "NavigationSearch", "ResourceSidebarDropdown", "MobileResourceSidebarMenu", "SidebarDropdown", "useScrollLock", "MulticolDropdown", "SupportsDropdown", "MobileSidebarMenu", "MobileSupportMenu", "MobileMulticolMenu", "MenuItem", "useAiuiContext", "throttle", "HeaderNavigation", "props", "ref", "header", "buildProps", "event", "profile", "theme", "isTop", "searchResult", "onSearch", "isSearching", "keywords", "onPrimaryNavClick", "onSeriesProductClick", "onSidebarNavClick", "onMobileMenuToggle", "headerId", "cartCount", "menuData", "render", "componentOverrides", "rest", "searchOpen", "setSearchOpen", "headerHidden", "setHeaderHidden", "changeHeaderBackground", "setChangeHeaderBackground", "isMobile", "setIsMobile", "searchRef", "headerRef", "resizeWindow", "offsetWidth", "lastScrollY", "upwardDistance", "downwardDistance", "getScrollTop", "initialScrollTop", "handleScroll", "currentScrollY", "delta", "searchPage", "item", "CustomMobileHeaderNavigation", "DesktopNavigation", "MobileNavigation", "value", "e", "data", "onNavItemClick", "className", "downdownHover", "setDowndownHover", "locale", "groupCategories", "categoriesItem", "setCategoriesItem", "navStatusArray", "setNavStatusArray", "profileRef", "userProfileOpen", "setUserProfileOpen", "dropdownRef", "navItemRefs", "categories", "groupItem", "groupIndex", "_", "index", "currentNavItem", "handleNavItemClick", "currentCategoriesItem", "position", "prev", "handleNavItemKeyDown", "handleNavMenuClose", "currentBlockTypeCategories", "SidebarDropdownComp", "ResourceSidebarDropdownComp", "MulticolDropdownComp", "SupportsDropdownComp", "DropdownComp", "actions", "profileAction", "handleProfileClick", "profileRefElement", "Logo", "Actions", "isExpanded", "el", "currentMenu", "setCurrentMenu", "subSubCategory", "mobileMenuOpen", "setMobileMenuOpen", "menuInnerHeight", "setMenuInnerHeight", "mobileMenuRef", "skipOpenAnimationRef", "rect", "handleResize", "MobileSupportMenuComp", "MobileSidebarMenuComp", "MobileResourceSidebarMenuComp", "MobileMulticolMenuComp", "MobileCategoriesMenuComp", "handleSecondaryMenuClose", "menuActions", "MobileCategoriesHeaderComp", "PrimaryHeader", "SecondaryHeader", "handlePrimaryMenuClick", "MobilePrimaryMenu", "onPrimaryMenuClick", "ProfileComp", "profileOpen", "setProfileOpen", "menuOpen", "onMenuOpenClose", "onMenuOpenClick", "payloadData", "activeStatus", "activeAction", "setActiveAction", "getActionLabel", "blockType", "handleActionClick", "action", "title", "onMenuBackClick", "HeaderNavigation_default"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{Fragment as D,jsx as
|
|
1
|
+
"use client";import{Fragment as D,jsx as a,jsxs as d}from"react/jsx-runtime";import*as r from"react";import{cn as t}from"../../helpers/utils.js";import T from"../../components/badge.js";import{Text as u}from"../../components/text.js";import y from"../../components/button.js";import _ from"../../components/picture.js";import{Heading as B}from"../../components/heading.js";const R={center:"object-center",top:"object-top",bottom:"object-bottom",left:"object-left",right:"object-right","top-left":"object-left-top","top-right":"object-right-top","bottom-left":"object-left-bottom","bottom-right":"object-right-bottom"},p=r.forwardRef(({product:e,className:k,showTags:w=!0,showOriginalPrice:P=!0,onLearnMore:j,onShopNow:C,onAddToCart:L,onProductImageClick:f,classNames:o,secondaryButtonText:m,secondaryButtonFun:x,primaryButtonText:c,primaryButtonFun:g,copy:S},O)=>{const[N,$]=r.useState(!1),[z,I]=r.useState(!1),b=!e.availableForSale,h=async(i,s)=>{if(!i)return;const v=s==="primary"?$:I;v(!0);try{switch(i){case"buyNow":await C?.(e);break;case"addCart":await L?.(e);break;case"learnMore":await j?.(e);break;default:break}}finally{v(!1)}},l=e.custom_name||e.name,n=e.custom_description||e.description,M=e.custom_theme??"dark";return a("div",{ref:O,className:t("rounded-box relative box-border w-full cursor-pointer overflow-hidden duration-300","desktop:h-[384px] lg-desktop:h-[480px] h-[360px]","tablet:min-w-[auto] min-w-[276px] max-w-[824px]",{"aiui-dark":M==="dark"},k,o?.productCard),children:d("div",{className:"box-border flex h-full flex-col justify-between overflow-hidden",children:[a("a",{onClick:()=>f?.(e),...!f&&e.listingLink&&{href:e.listingLink},rel:"noreferrer",className:t("absolute inset-0",o?.productImage),children:a(_,{alt:e.name,source:e.custom_image??e.image,className:t("rounded-box h-full overflow-hidden object-cover transition-all duration-300 [&_img]:size-full"),imgClassName:t("object-cover",R[e.imageObjectPosition??"center"])})}),d("div",{className:t("desktop:p-6 collection-shelves-product-content pointer-events-none z-10 box-border flex flex-1 flex-col justify-end overflow-hidden p-4",o?.productContent),children:[w&&e.tags?.length?a("div",{className:t("mb-2 box-border flex flex-wrap gap-1 overflow-visible",o?.tagsContainer),children:e.tags.map((i,s)=>i.label?a(T,{size:"sm",variant:i.variant||"outline",promotionalType:i.promotionalType,children:i.label},s):r.isValidElement(i)&&a(r.Fragment,{children:i},s))}):null,l?a(B,{as:"h3",title:l,html:l,className:t("lg-desktop:text-2xl lg-desktop:leading-7 tablet:text-xl text-info-primary tablet:leading-6 line-clamp-2 text-base font-bold",o?.productTitle)}):null,n?a(u,{size:2,html:n,className:t("lg-desktop:text-lg desktop:text-base text-info-primary line-clamp-1 text-sm font-bold",o?.productDescription)}):null,a("div",{className:t("mb-1 mt-4 flex items-center",o?.priceContainer),children:b?a("div",{className:t("tablet:text-xl text-info-primary text-xl font-bold",o?.productPrice),children:S?.outOfStockLabel??"Sold Out"}):d(D,{children:[a("div",{className:t("tablet:text-xl text-info-primary text-xl font-bold",o?.productPrice),children:e.price}),P&&e.originalPrice&&a("div",{className:t("tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through",o?.originalPrice),children:e.originalPrice})]})}),e?.priceLabel&&a(u,{size:4,className:t("text-marketing-1 desktop:text-[16px] lg-desktop:text-[18px] mt-2 text-[14px]",o?.productPriceLabel),children:e.priceLabel}),d("div",{className:t("lg-desktop:gap-3 pointer-events-auto flex items-stretch gap-2",o?.buttonGroup),children:[m&&a(y,{variant:"secondary",onClick:()=>h(x,"secondary"),disabled:b&&x!=="learnMore",loading:z,className:t("min-w-0 whitespace-normal text-center",o?.secondaryButton),"data-headless-type-name":"ImageOverlayShelf#ProductCard","data-headless-title-desc-button":`${l}#${n||""}#${m}`,"data-headless-sku":e.sku,children:m}),c&&a(y,{variant:"primary",onClick:()=>h(g,"primary"),disabled:b&&g!=="learnMore",loading:N,className:t("min-w-0 whitespace-normal text-center",o?.primaryButton),"data-headless-type-name":"ImageOverlayShelf#ProductCard","data-headless-title-desc-button":`${l}#${n||""}#${c}`,"data-headless-sku":e.sku,children:c})]})]})]})})});p.displayName="ImageOverlayShelf.ProductCard";var A=p;export{p as ProductCard,A as default};
|
|
2
2
|
//# sourceMappingURL=ProductCard.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/ImageOverlayShelf/ProductCard.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../../helpers/utils.js'\n\nimport Badge from '../../components/badge.js'\nimport { Text } from '../../components/text.js'\nimport Button from '../../components/button.js'\nimport Picture from '../../components/picture.js'\nimport { Heading } from '../../components/heading.js'\nimport type { ProductCardProps, ButtonFunctionType, ImageObjectPosition } from './types.js'\n\n/**\n * \u56FE\u7247\u88C1\u5207\u4F4D\u7F6E\u6620\u5C04\n */\nconst objectPositionClassMap: Record<ImageObjectPosition, string> = {\n center: 'object-center',\n top: 'object-top',\n bottom: 'object-bottom',\n left: 'object-left',\n right: 'object-right',\n 'top-left': 'object-left-top',\n 'top-right': 'object-right-top',\n 'bottom-left': 'object-left-bottom',\n 'bottom-right': 'object-right-bottom',\n}\n\n/**\n * ProductCard - ImageOverlayShelf \u7684\u5355\u4E2A\u4EA7\u54C1\u5361\u7247\n * \u56FE\u6587\u53E0\u52A0\u6837\u5F0F\uFF0C\u80CC\u666F\u56FE\u5B8C\u5168\u8986\u76D6\u5361\u7247\n */\nconst ProductCard = React.forwardRef<HTMLDivElement, ProductCardProps>(\n (\n {\n product,\n className,\n showTags = true,\n showOriginalPrice = true,\n onLearnMore,\n onShopNow,\n onAddToCart,\n onProductImageClick,\n classNames,\n secondaryButtonText,\n secondaryButtonFun,\n primaryButtonText,\n primaryButtonFun,\n copy,\n },\n ref\n ) => {\n const [primaryLoading, setPrimaryLoading] = React.useState(false)\n const [secondaryLoading, setSecondaryLoading] = React.useState(false)\n\n const isSoldOut = !product.availableForSale\n\n // \u6839\u636E\u6309\u94AE\u529F\u80FD\u7C7B\u578B\u8C03\u7528\u76F8\u5E94\u7684\u56DE\u8C03\u51FD\u6570\n const handleButtonClick = async (buttonFun?: ButtonFunctionType, buttonType?: 'primary' | 'secondary') => {\n if (!buttonFun) return\n\n const setLoading = buttonType === 'primary' ? setPrimaryLoading : setSecondaryLoading\n setLoading(true)\n\n try {\n switch (buttonFun) {\n case 'buyNow':\n await onShopNow?.(product)\n break\n case 'addCart':\n await onAddToCart?.(product)\n break\n case 'learnMore':\n await onLearnMore?.(product)\n break\n default:\n break\n }\n } finally {\n setLoading(false)\n }\n }\n\n const displayTitle = product.custom_name || product.name\n const displayDescription = product.custom_description || product.description\n const theme = product.custom_theme ?? 'dark'\n\n return (\n <div\n ref={ref}\n className={cn(\n 'rounded-box relative box-border w-full cursor-pointer overflow-hidden duration-300',\n 'desktop:h-[384px] lg-desktop:h-[480px] h-[360px]',\n 'tablet:min-w-[auto] min-w-[276px] max-w-[824px]',\n {\n 'aiui-dark': theme === 'dark',\n },\n className,\n classNames?.productCard\n )}\n >\n <div className=\"box-border flex h-full flex-col justify-between overflow-hidden\">\n {/* \u80CC\u666F\u56FE */}\n <a\n onClick={() => onProductImageClick?.(product)}\n {...(!onProductImageClick &&\n product.listingLink && {\n href: product.listingLink,\n })}\n rel=\"noreferrer\"\n className={cn('absolute inset-0', classNames?.productImage)}\n >\n <Picture\n alt={product.name}\n source={product.custom_image ?? product.image}\n className={cn(\n 'rounded-box h-full overflow-hidden object-cover transition-all duration-300 [&_img]:size-full'\n )}\n imgClassName={cn('object-cover', objectPositionClassMap[product.imageObjectPosition ?? 'center'])}\n />\n </a>\n {/* \u5185\u5BB9\u533A\u57DF */}\n <div\n className={cn(\n 'desktop:p-6 collection-shelves-product-content pointer-events-none z-10 box-border flex flex-1 flex-col justify-end overflow-hidden p-4',\n classNames?.productContent\n )}\n >\n {/* \u6807\u7B7E */}\n {showTags && product.tags?.length ? (\n <div className={cn('mb-2 box-border flex flex-wrap gap-1 overflow-visible', classNames?.tagsContainer)}>\n {product.tags.map((tag: any, index: number) =>\n (tag as any).label ? (\n <Badge\n key={index}\n size=\"sm\"\n variant={(tag.variant as any) || 'outline'}\n promotionalType={tag.promotionalType}\n >\n {tag.label}\n </Badge>\n ) : (\n React.isValidElement(tag) && <React.Fragment key={index}>{tag}</React.Fragment>\n )\n )}\n </div>\n ) : null}\n\n {/* \u4EA7\u54C1\u6807\u9898 */}\n {displayTitle ? (\n <Heading\n as=\"h3\"\n title={displayTitle}\n html={displayTitle}\n className={cn(\n 'lg-desktop:text-2xl lg-desktop:leading-7 tablet:text-xl text-info-primary tablet:leading-6 line-clamp-2 text-base font-bold',\n classNames?.productTitle\n )}\n />\n ) : null}\n\n {/* \u4EA7\u54C1\u63CF\u8FF0 */}\n {displayDescription ? (\n <Text\n size={2}\n html={displayDescription}\n className={cn(\n 'lg-desktop:text-lg desktop:text-base text-info-primary line-clamp-1 text-sm font-bold',\n classNames?.productDescription\n )}\n />\n ) : null}\n\n {/* \u4EF7\u683C\u533A\u57DF */}\n <div className={cn('mb-1 mt-4 flex items-center', classNames?.priceContainer)}>\n {isSoldOut ? (\n <div className={cn('tablet:text-xl text-info-primary text-xl font-bold', classNames?.productPrice)}>\n {copy?.outOfStockLabel ?? 'Sold Out'}\n </div>\n ) : (\n <>\n <div className={cn('tablet:text-xl text-info-primary text-xl font-bold', classNames?.productPrice)}>\n {product.price}\n </div>\n {showOriginalPrice && product.originalPrice && (\n <div\n className={cn(\n 'tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through',\n classNames?.originalPrice\n )}\n >\n {product.originalPrice}\n </div>\n )}\n </>\n )}\n </div>\n\n {/** \u4EF7\u683C\u6807\u7B7E */}\n {product?.priceLabel && (\n <Text\n size={4}\n className={cn(\n 'text-marketing-1 desktop:text-[16px] lg-desktop:text-[18px] mt-2 text-[14px]',\n classNames?.productPriceLabel\n )}\n >\n {product.priceLabel}\n </Text>\n )}\n\n {/* \u6309\u94AE\u533A\u57DF */}\n <div\n className={cn('lg-desktop:gap-3 pointer-events-auto flex items-
|
|
5
|
-
"mappings": "aA+GY,OAoEI,YAAAA,EApEJ,OAAAC,EAoEI,QAAAC,MApEJ,oBA7GZ,UAAYC,MAAW,QACvB,OAAS,MAAAC,MAAU,yBAEnB,OAAOC,MAAW,4BAClB,OAAS,QAAAC,MAAY,2BACrB,OAAOC,MAAY,6BAC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WG,EACT,yEACAgB,GAAY,aACd,EAEC,SAAAR,EAAQ,cACX,GAEJ,EAEJ,EAGCA,GAAS,YACRX,EAACK,EAAA,CACC,KAAM,EACN,UAAWF,EACT,+EACAgB,GAAY,iBACd,EAEC,SAAAR,EAAQ,WACX,EAIFV,EAAC,OACC,UAAWE,EAAG
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../../helpers/utils.js'\n\nimport Badge from '../../components/badge.js'\nimport { Text } from '../../components/text.js'\nimport Button from '../../components/button.js'\nimport Picture from '../../components/picture.js'\nimport { Heading } from '../../components/heading.js'\nimport type { ProductCardProps, ButtonFunctionType, ImageObjectPosition } from './types.js'\n\n/**\n * \u56FE\u7247\u88C1\u5207\u4F4D\u7F6E\u6620\u5C04\n */\nconst objectPositionClassMap: Record<ImageObjectPosition, string> = {\n center: 'object-center',\n top: 'object-top',\n bottom: 'object-bottom',\n left: 'object-left',\n right: 'object-right',\n 'top-left': 'object-left-top',\n 'top-right': 'object-right-top',\n 'bottom-left': 'object-left-bottom',\n 'bottom-right': 'object-right-bottom',\n}\n\n/**\n * ProductCard - ImageOverlayShelf \u7684\u5355\u4E2A\u4EA7\u54C1\u5361\u7247\n * \u56FE\u6587\u53E0\u52A0\u6837\u5F0F\uFF0C\u80CC\u666F\u56FE\u5B8C\u5168\u8986\u76D6\u5361\u7247\n */\nconst ProductCard = React.forwardRef<HTMLDivElement, ProductCardProps>(\n (\n {\n product,\n className,\n showTags = true,\n showOriginalPrice = true,\n onLearnMore,\n onShopNow,\n onAddToCart,\n onProductImageClick,\n classNames,\n secondaryButtonText,\n secondaryButtonFun,\n primaryButtonText,\n primaryButtonFun,\n copy,\n },\n ref\n ) => {\n const [primaryLoading, setPrimaryLoading] = React.useState(false)\n const [secondaryLoading, setSecondaryLoading] = React.useState(false)\n\n const isSoldOut = !product.availableForSale\n\n // \u6839\u636E\u6309\u94AE\u529F\u80FD\u7C7B\u578B\u8C03\u7528\u76F8\u5E94\u7684\u56DE\u8C03\u51FD\u6570\n const handleButtonClick = async (buttonFun?: ButtonFunctionType, buttonType?: 'primary' | 'secondary') => {\n if (!buttonFun) return\n\n const setLoading = buttonType === 'primary' ? setPrimaryLoading : setSecondaryLoading\n setLoading(true)\n\n try {\n switch (buttonFun) {\n case 'buyNow':\n await onShopNow?.(product)\n break\n case 'addCart':\n await onAddToCart?.(product)\n break\n case 'learnMore':\n await onLearnMore?.(product)\n break\n default:\n break\n }\n } finally {\n setLoading(false)\n }\n }\n\n const displayTitle = product.custom_name || product.name\n const displayDescription = product.custom_description || product.description\n const theme = product.custom_theme ?? 'dark'\n\n return (\n <div\n ref={ref}\n className={cn(\n 'rounded-box relative box-border w-full cursor-pointer overflow-hidden duration-300',\n 'desktop:h-[384px] lg-desktop:h-[480px] h-[360px]',\n 'tablet:min-w-[auto] min-w-[276px] max-w-[824px]',\n {\n 'aiui-dark': theme === 'dark',\n },\n className,\n classNames?.productCard\n )}\n >\n <div className=\"box-border flex h-full flex-col justify-between overflow-hidden\">\n {/* \u80CC\u666F\u56FE */}\n <a\n onClick={() => onProductImageClick?.(product)}\n {...(!onProductImageClick &&\n product.listingLink && {\n href: product.listingLink,\n })}\n rel=\"noreferrer\"\n className={cn('absolute inset-0', classNames?.productImage)}\n >\n <Picture\n alt={product.name}\n source={product.custom_image ?? product.image}\n className={cn(\n 'rounded-box h-full overflow-hidden object-cover transition-all duration-300 [&_img]:size-full'\n )}\n imgClassName={cn('object-cover', objectPositionClassMap[product.imageObjectPosition ?? 'center'])}\n />\n </a>\n {/* \u5185\u5BB9\u533A\u57DF */}\n <div\n className={cn(\n 'desktop:p-6 collection-shelves-product-content pointer-events-none z-10 box-border flex flex-1 flex-col justify-end overflow-hidden p-4',\n classNames?.productContent\n )}\n >\n {/* \u6807\u7B7E */}\n {showTags && product.tags?.length ? (\n <div className={cn('mb-2 box-border flex flex-wrap gap-1 overflow-visible', classNames?.tagsContainer)}>\n {product.tags.map((tag: any, index: number) =>\n (tag as any).label ? (\n <Badge\n key={index}\n size=\"sm\"\n variant={(tag.variant as any) || 'outline'}\n promotionalType={tag.promotionalType}\n >\n {tag.label}\n </Badge>\n ) : (\n React.isValidElement(tag) && <React.Fragment key={index}>{tag}</React.Fragment>\n )\n )}\n </div>\n ) : null}\n\n {/* \u4EA7\u54C1\u6807\u9898 */}\n {displayTitle ? (\n <Heading\n as=\"h3\"\n title={displayTitle}\n html={displayTitle}\n className={cn(\n 'lg-desktop:text-2xl lg-desktop:leading-7 tablet:text-xl text-info-primary tablet:leading-6 line-clamp-2 text-base font-bold',\n classNames?.productTitle\n )}\n />\n ) : null}\n\n {/* \u4EA7\u54C1\u63CF\u8FF0 */}\n {displayDescription ? (\n <Text\n size={2}\n html={displayDescription}\n className={cn(\n 'lg-desktop:text-lg desktop:text-base text-info-primary line-clamp-1 text-sm font-bold',\n classNames?.productDescription\n )}\n />\n ) : null}\n\n {/* \u4EF7\u683C\u533A\u57DF */}\n <div className={cn('mb-1 mt-4 flex items-center', classNames?.priceContainer)}>\n {isSoldOut ? (\n <div className={cn('tablet:text-xl text-info-primary text-xl font-bold', classNames?.productPrice)}>\n {copy?.outOfStockLabel ?? 'Sold Out'}\n </div>\n ) : (\n <>\n <div className={cn('tablet:text-xl text-info-primary text-xl font-bold', classNames?.productPrice)}>\n {product.price}\n </div>\n {showOriginalPrice && product.originalPrice && (\n <div\n className={cn(\n 'tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through',\n classNames?.originalPrice\n )}\n >\n {product.originalPrice}\n </div>\n )}\n </>\n )}\n </div>\n\n {/** \u4EF7\u683C\u6807\u7B7E */}\n {product?.priceLabel && (\n <Text\n size={4}\n className={cn(\n 'text-marketing-1 desktop:text-[16px] lg-desktop:text-[18px] mt-2 text-[14px]',\n classNames?.productPriceLabel\n )}\n >\n {product.priceLabel}\n </Text>\n )}\n\n {/* \u6309\u94AE\u533A\u57DF */}\n <div\n className={cn('lg-desktop:gap-3 pointer-events-auto flex items-stretch gap-2', classNames?.buttonGroup)}\n >\n {secondaryButtonText && (\n <Button\n variant=\"secondary\"\n onClick={() => handleButtonClick(secondaryButtonFun, 'secondary')}\n disabled={isSoldOut && secondaryButtonFun !== 'learnMore'}\n loading={secondaryLoading}\n className={cn('min-w-0 whitespace-normal text-center', classNames?.secondaryButton)}\n data-headless-type-name=\"ImageOverlayShelf#ProductCard\"\n data-headless-title-desc-button={`${displayTitle}#${displayDescription || ''}#${secondaryButtonText}`}\n data-headless-sku={product.sku}\n >\n {secondaryButtonText}\n </Button>\n )}\n {primaryButtonText && (\n <Button\n variant=\"primary\"\n onClick={() => handleButtonClick(primaryButtonFun, 'primary')}\n disabled={isSoldOut && primaryButtonFun !== 'learnMore'}\n loading={primaryLoading}\n className={cn('min-w-0 whitespace-normal text-center', classNames?.primaryButton)}\n data-headless-type-name=\"ImageOverlayShelf#ProductCard\"\n data-headless-title-desc-button={`${displayTitle}#${displayDescription || ''}#${primaryButtonText}`}\n data-headless-sku={product.sku}\n >\n {primaryButtonText}\n </Button>\n )}\n </div>\n </div>\n </div>\n </div>\n )\n }\n)\n\nProductCard.displayName = 'ImageOverlayShelf.ProductCard'\n\nexport { ProductCard }\nexport default ProductCard\n"],
|
|
5
|
+
"mappings": "aA+GY,OAoEI,YAAAA,EApEJ,OAAAC,EAoEI,QAAAC,MApEJ,oBA7GZ,UAAYC,MAAW,QACvB,OAAS,MAAAC,MAAU,yBAEnB,OAAOC,MAAW,4BAClB,OAAS,QAAAC,MAAY,2BACrB,OAAOC,MAAY,6BACnB,OAAOC,MAAa,8BACpB,OAAS,WAAAC,MAAe,8BAMxB,MAAMC,EAA8D,CAClE,OAAQ,gBACR,IAAK,aACL,OAAQ,gBACR,KAAM,cACN,MAAO,eACP,WAAY,kBACZ,YAAa,mBACb,cAAe,qBACf,eAAgB,qBAClB,EAMMC,EAAcR,EAAM,WACxB,CACE,CACE,QAAAS,EACA,UAAAC,EACA,SAAAC,EAAW,GACX,kBAAAC,EAAoB,GACpB,YAAAC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,EAAkBV,EAAoB,WAAW,EAChE,SAAUS,GAAaT,IAAuB,YAC9C,QAASO,EACT,UAAWzB,EAAG,wCAAyCgB,GAAY,eAAe,EAClF,0BAAwB,gCACxB,kCAAiC,GAAGgB,CAAY,IAAIC,GAAsB,EAAE,IAAIhB,CAAmB,GACnG,oBAAmBT,EAAQ,IAE1B,SAAAS,EACH,EAEDE,GACCtB,EAACM,EAAA,CACC,QAAQ,UACR,QAAS,IAAMyB,EAAkBR,EAAkB,SAAS,EAC5D,SAAUO,GAAaP,IAAqB,YAC5C,QAASG,EACT,UAAWvB,EAAG,wCAAyCgB,GAAY,aAAa,EAChF,0BAAwB,gCACxB,kCAAiC,GAAGgB,CAAY,IAAIC,GAAsB,EAAE,IAAId,CAAiB,GACjG,oBAAmBX,EAAQ,IAE1B,SAAAW,EACH,GAEJ,GACF,GACF,EACF,CAEJ,CACF,EAEAZ,EAAY,YAAc,gCAG1B,IAAO8B,EAAQ9B",
|
|
6
6
|
"names": ["Fragment", "jsx", "jsxs", "React", "cn", "Badge", "Text", "Button", "Picture", "Heading", "objectPositionClassMap", "ProductCard", "product", "className", "showTags", "showOriginalPrice", "onLearnMore", "onShopNow", "onAddToCart", "onProductImageClick", "classNames", "secondaryButtonText", "secondaryButtonFun", "primaryButtonText", "primaryButtonFun", "copy", "ref", "primaryLoading", "setPrimaryLoading", "secondaryLoading", "setSecondaryLoading", "isSoldOut", "handleButtonClick", "buttonFun", "buttonType", "setLoading", "displayTitle", "displayDescription", "theme", "tag", "index", "ProductCard_default"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{Fragment as O,jsx as a,jsxs as
|
|
1
|
+
"use client";import{Fragment as O,jsx as a,jsxs as l}from"react/jsx-runtime";import*as o from"react";import{cn as t}from"../../helpers/index.js";import{Button as k,Badge as A,Card as q,CardContent as $,Picture as E,Text as y,Heading as c,Progress as H}from"../../components/index.js";const R=5;function I(e,r,d,f){if(e===void 0)return!0;switch(e){case"always":return!0;case"never":return!1;case"below-quantity":return r===void 0?!0:d<=r;case"below-percentage":return r===void 0?!0:d/f*100<=r;default:return!0}}const g=o.forwardRef(({product:e,className:r,stockDisplayMode:d,stockThresholdValue:f,onLearnMore:C,onShopNow:S,onAddToCart:P,classNames:i,secondaryButtonText:b,secondaryButtonFun:v,primaryButtonText:u,primaryButtonFun:h,showOriginalPrice:N,copy:p,onProductImageClick:s,showTags:M=!0},F)=>{const[L,B]=o.useState(!1),[D,T]=o.useState(!1),z=o.useMemo(()=>e?.availableForSale&&e?.quantityAvailable<=0?R:e?.availableForSale?(e?.quantityAvailable??0)/(e?.totalInventory??1)*100:0,[e?.availableForSale,e?.quantityAvailable,e?.totalInventory]),x=async(n,m)=>{if(!n)return;const w=m==="primary"?B:T;w(!0);try{switch(n){case"buyNow":await S?.(e);break;case"addCart":await P?.(e);break;case"learnMore":await C?.(e);break;default:break}}finally{w(!1)}},_=e.availableForSale&&e.quantityAvailable<=0;return l(q,{ref:F,className:t("tablet:min-w-[auto] hover:bg-container-secondary-0 flex h-full min-w-[296px] flex-col overflow-hidden border-none",e.custom_link?"cursor-pointer":"",r,i?.productCard),children:[l("div",{className:t("media-shelf-product-card-image-wrapper desktop:h-[240px] relative h-[200px] shrink-0 overflow-hidden",i?.productCardImageWrapper),children:[a("div",{className:t("media-shelf-product-card-image-bg absolute inset-0 ",i?.productCardImageBg),children:a("a",{onClick:()=>s?.(e),...!s&&{href:e.custom_link||e.listingLink},className:"cursor-pointer",children:a(E,{source:e.custom_image||e.image,alt:e.name,className:t("h-full",i?.productCardImage),imgClassName:"h-full object-contain"})})}),M&&e.tags&&e.tags.length>0&&a("div",{className:"lg-desktop:h-[28px] absolute left-4 top-4 flex h-[24px]",children:e.tags.map((n,m)=>n.label?a(A,{size:"sm",variant:n.variant||"outline",className:t("mr-1"),promotionalType:n.promotionalType,children:n.label},m):a(o.Fragment,{children:n},m))})]}),l($,{className:"desktop:p-6 bg-container-primary laptop:gap-6 flex h-[calc(100%-240px)] grow flex-col justify-between gap-4 p-4",children:[l("div",{className:"flex-0",children:[a(c,{as:"h3",size:2,className:t("text-info-primary mb-1 line-clamp-2 tracking-tight",s?"cursor-pointer":"",i?.productTitle),onClick:s?()=>s(e):void 0,children:e.custom_name||e.name}),(e.custom_description||e?.description)&&a(y,{size:2,className:t("text-info-primary line-clamp-1",i?.productDescription),html:e.custom_description||e.description})]}),I(d,f,e?.quantityAvailable??0,e?.totalInventory??0)&&l("div",{"data-total":e?.totalInventory??0,"data-available":e?.quantityAvailable??0,className:"space-y-2",children:[a(H,{value:z,max:100,min:0,size:"base",variant:"default","aria-label":"stock progress",classNames:{progressBar:"transition-all duration-300 ease-in-out"}}),a(y,{size:3,className:"text-info-tertiary desktop:text-[16px] lg-desktop:text-[18px] text-[12px]",children:_?p?.limitedStock:p?.stockDisplayText?.replace("{count}",`${e.availableForSale?e.quantityAvailable:0}`)})]}),l("div",{children:[a("div",{className:t("mb-2",i?.productPrice),children:a("div",{className:"flex items-baseline gap-2",children:e.availableForSale?l(O,{children:[a(c,{size:2,className:"text-info-primary",as:"h6",children:e.price}),N&&e.originalPrice&&a(c,{size:2,className:t("text-info-tertiary line-through",i?.originalPrice),as:"h6",children:e.originalPrice})]}):a(c,{size:2,className:"text-info-tertiary",children:p?.outOfStockLabel??"Sold Out"})})}),e?.priceLabel&&e?.availableForSale&&a(y,{size:4,className:t("text-marketing-1 desktop:text-[16px] lg-desktop:text-[18px] mt-2 text-[12px]",i?.productPriceLabel),children:e.priceLabel}),l("div",{className:t("lg-desktop:gap-3 tablet:flex-nowrap flex flex-wrap gap-2",i?.buttonGroup),children:[b&&a(k,{variant:"secondary",size:"base",className:t("tablet:w-fit tablet:min-w-0 tablet:whitespace-normal tablet:text-center w-full whitespace-nowrap",i?.secondaryButton),onClick:()=>x(v,"secondary"),disabled:!e.availableForSale&&v!=="learnMore",loading:D,"data-headless-type-name":"MediaShelf#ProductCard","data-headless-title-desc-button":`${e.custom_name||e.name}#${e.description||""}#${b}`,"data-headless-sku":e.sku,children:b}),u&&a(k,{variant:"primary",size:"base",className:t("tablet:w-fit tablet:min-w-0 tablet:whitespace-normal tablet:text-center w-full whitespace-nowrap",i?.primaryButton),onClick:()=>x(h,"primary"),disabled:!e.availableForSale&&h!=="learnMore",loading:L,"data-headless-type-name":"MediaShelf#ProductCard","data-headless-title-desc-button":`${e.custom_name||e.name}#${e.description||""}#${u}`,"data-headless-sku":e.sku,children:u})]})]})]})]})});g.displayName="MediaShelf.ProductCard";var K=g;export{g as ProductCard,K as default};
|
|
2
2
|
//# sourceMappingURL=ProductCard.js.map
|