@anker-in/headless-ui 1.3.9 → 1.3.11
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/BuyOneGetOneShelf/FreeGiftItem.js +1 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/FreeGiftItem.js.map +2 -2
- package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductCard.js +1 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductCard.js.map +2 -2
- package/dist/cjs/biz-components/BuyOneGetOneShelf/index.js +1 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/index.js.map +3 -3
- package/dist/cjs/biz-components/BuyOneGetOneShelf/types.d.ts +14 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/types.js +1 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/types.js.map +1 -1
- package/dist/cjs/biz-components/Graphic/index.d.ts +1 -0
- package/dist/cjs/biz-components/Graphic/index.js +1 -1
- package/dist/cjs/biz-components/Graphic/index.js.map +2 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +2 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js.map +2 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js.map +2 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js.map +2 -2
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.js.map +2 -2
- package/dist/cjs/biz-components/VideoModal/index.js +1 -1
- package/dist/cjs/biz-components/VideoModal/index.js.map +2 -2
- package/dist/esm/biz-components/BuyOneGetOneShelf/FreeGiftItem.js +1 -1
- package/dist/esm/biz-components/BuyOneGetOneShelf/FreeGiftItem.js.map +2 -2
- package/dist/esm/biz-components/BuyOneGetOneShelf/ProductCard.js +1 -1
- package/dist/esm/biz-components/BuyOneGetOneShelf/ProductCard.js.map +2 -2
- package/dist/esm/biz-components/BuyOneGetOneShelf/index.js +1 -1
- package/dist/esm/biz-components/BuyOneGetOneShelf/index.js.map +3 -3
- package/dist/esm/biz-components/BuyOneGetOneShelf/types.d.ts +14 -1
- package/dist/esm/biz-components/BuyOneGetOneShelf/types.js.map +1 -1
- package/dist/esm/biz-components/Graphic/index.d.ts +1 -0
- package/dist/esm/biz-components/Graphic/index.js +1 -1
- package/dist/esm/biz-components/Graphic/index.js.map +2 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +2 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js.map +2 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js.map +2 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js.map +2 -2
- package/dist/esm/biz-components/Listing/components/PurchaseBar/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/PurchaseBar/index.js.map +2 -2
- package/dist/esm/biz-components/VideoModal/index.js +1 -1
- package/dist/esm/biz-components/VideoModal/index.js.map +2 -2
- package/package.json +1 -1
- package/style.css +0 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../../src/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Text, Picture, Checkbox } from '../../../../../../components/index.js'\nimport { cn } from '../../../../../../helpers/index.js'\nimport { useMemo } from 'react'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\nimport { formatPrice } from '../../../../utils/index.js'\nimport { useAiuiContext } from '../../../../../AiuiProvider/index.js'\nimport type { ProductVariant, ProductPrice } from '../../../../types/product'\nimport { withLayout } from '../../../../../../shared/Styles.js'\nimport { useFollowTooltip, FollowTooltip } from '../../../../hooks/useFollowTooltip.js'\n\nconst ProductExchangePurchase = () => {\n const { locale = 'us' } = useAiuiContext()\n const { tooltip, getTooltipProps } = useFollowTooltip()\n const {\n checkedExchangePurchase,\n exchangePurchase,\n setCheckedBundle,\n setJoinedRecommendBuyProducts,\n setSavingDetail,\n setCheckedExchangePurchase,\n joinedRecommendBuyProducts,\n savingDetail,\n setAddOrder,\n } = useBizProductContext()\n const { title, giftList = [], freeLabel } = exchangePurchase || {}\n const availableGifts = useMemo(() => giftList?.filter(item => item.availableForSale), [giftList])\n\n const handleCheckboxClick = (value: ProductVariant) => {\n if (checkedExchangePurchase?.id === value.id) {\n setCheckedExchangePurchase?.(undefined)\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n exchange: {\n value: undefined,\n canOperate: true,\n },\n })\n setSavingDetail?.({ ...savingDetail, exchangePurchase: 0 })\n // \u4ECE\u6DFB\u52A0\u987A\u5E8F\u4E2D\u79FB\u9664\n setAddOrder?.(prev => prev.filter(t => t !== 'exchange'))\n } else {\n setCheckedExchangePurchase?.(value)\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n exchange: {\n value,\n canOperate: false,\n },\n })\n // \u6DFB\u52A0\u5230\u987A\u5E8F\u6570\u7EC4\u7684\u672B\u5C3E\n setAddOrder?.(prev => {\n // \u5982\u679C\u5DF2\u7ECF\u5B58\u5728\uFF0C\u5148\u79FB\u9664\u518D\u6DFB\u52A0\u5230\u672B\u5C3E\n const filtered = prev.filter(t => t !== 'exchange')\n return [...filtered, 'exchange']\n })\n }\n }\n\n if (!availableGifts?.length) return null\n\n return (\n <div className=\"ipc-product-detail-exchange-purchase\">\n <Text className=\"font-bold leading-[1.2] text-[14px] lg-desktop:text-[16px]\" html={title} />\n <div className=\"laptop:grid-cols-2 laptop-md:grid-cols-1 lg-desktop:mt-4 mt-3 grid grid-cols-1 gap-3\">\n {availableGifts.map((gift: ProductVariant & { finalPrice?: ProductPrice }) => (\n <div\n key={gift.id}\n className={cn(\n 'rounded-box h-[80px] laptop:h-[100px] flex items-center gap-2 border-2 border-[#E4E5E6] px-4 text-left font-bold',\n {\n ['border-brand']: checkedExchangePurchase?.id === gift.id,\n }\n )}\n >\n <Checkbox\n onCheckedChange={() => handleCheckboxClick(gift)}\n size=\"lg\"\n className={cn('rounded-full border-2 border-[#E4E5E6]', {\n 'border-brand': checkedExchangePurchase?.id === gift.id,\n })}\n id={gift.id}\n checked={checkedExchangePurchase?.id === gift.id}\n value={gift.id}\n ></Checkbox>\n <label\n htmlFor={gift.id}\n className=\"flex w-full cursor-pointer items-center justify-between gap-4 py-4 lg-desktop:py-6\"\n >\n <div className=\"flex items-center gap-2\">\n <Picture source={gift.image?.url} className=\"size-12 shrink-0\" imgClassName=\"h-full\" />\n <Text\n {...getTooltipProps(gift.product.title)}\n className=\"laptop:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-sm font-bold\"\n html={gift.product.title}\n />\n <FollowTooltip {...tooltip} />\n </div>\n <div className=\"tablet:flex-row flex shrink-0 flex-col items-center gap-1\">\n <Text\n className=\"laptop:text-[20px] lg-desktop:text-2xl !leading-[1.2] text-base font-bold\"\n html={formatPrice({\n amount: gift?.finalPrice?.amount || 0,\n locale,\n currencyCode: gift?.finalPrice?.currencyCode || 'USD',\n })}\n />\n <Text\n className=\"laptop:text-[20px] lg-desktop:text-2xl text-base !leading-[1.2] font-bold text-[#6D6D6F] line-through\"\n html={formatPrice({\n amount: gift.price.amount,\n locale,\n currencyCode: gift.price.currencyCode,\n })}\n />\n </div>\n </label>\n </div>\n ))}\n </div>\n </div>\n )\n}\n\nexport default withLayout(ProductExchangePurchase)\n"],
|
|
5
|
-
"mappings": "AA8DM,cAAAA,EA0BQ,QAAAC,MA1BR,oBA9DN,OAAS,QAAAC,EAAM,WAAAC,EAAS,YAAAC,MAAgB,wCACxC,OAAS,MAAAC,MAAU,qCACnB,OAAS,WAAAC,MAAe,QACxB,OAAS,wBAAAC,MAA4B,oCACrC,OAAS,eAAAC,MAAmB,6BAC5B,OAAS,kBAAAC,MAAsB,uCAE/B,OAAS,cAAAC,MAAkB,qCAC3B,OAAS,oBAAAC,EAAkB,iBAAAC,MAAqB,wCAEhD,MAAMC,EAA0B,IAAM,CACpC,KAAM,CAAE,OAAAC,EAAS,IAAK,EAAIL,EAAe,EACnC,CAAE,QAAAM,EAAS,gBAAAC,CAAgB,EAAIL,EAAiB,EAChD,CACJ,wBAAAM,EACA,iBAAAC,EACA,iBAAAC,EACA,8BAAAC,EACA,gBAAAC,EACA,2BAAAC,EACA,2BAAAC,EACA,aAAAC,EACA,YAAAC,CACF,EAAIlB,EAAqB,EACnB,CAAE,MAAAmB,EAAO,SAAAC,EAAW,CAAC,EAAG,UAAAC,CAAU,EAAIV,GAAoB,CAAC,EAC3DW,EAAiBvB,EAAQ,IAAMqB,GAAU,OAAOG,GAAQA,EAAK,gBAAgB,EAAG,CAACH,CAAQ,CAAC,EAE1FI,EAAuBC,GAA0B,CACjDf,GAAyB,KAAOe,EAAM,IACxCV,IAA6B,MAAS,EACtCF,IAAgC,CAC9B,GAAGG,EACH,SAAU,CACR,MAAO,OACP,WAAY,EACd,CACF,CAAC,EACDF,IAAkB,CAAE,GAAGG,EAAc,iBAAkB,CAAE,CAAC,EAE1DC,IAAcQ,GAAQA,EAAK,OAAOC,GAAKA,IAAM,UAAU,CAAC,IAExDZ,IAA6BU,CAAK,EAClCZ,IAAgC,CAC9B,GAAGG,EACH,SAAU,CACR,MAAAS,EACA,WAAY,EACd,CACF,CAAC,EAEDP,IAAcQ,GAGL,CAAC,GADSA,EAAK,OAAOC,GAAKA,IAAM,UAAU,EAC7B,UAAU,CAChC,EAEL,EAEA,OAAKL,GAAgB,OAGnB5B,EAAC,OAAI,UAAU,uCACb,UAAAD,EAACE,EAAA,CAAK,UAAU,6DAA6D,KAAMwB,EAAO,EAC1F1B,EAAC,OAAI,UAAU,uFACZ,SAAA6B,EAAe,IAAKM,GACnBlC,EAAC,OAEC,UAAWI,EACT,mHACA,CACG,eAAiBY,GAAyB,KAAOkB,EAAK,EACzD,CACF,EAEA,UAAAnC,EAACI,EAAA,CACC,gBAAiB,IAAM2B,EAAoBI,CAAI,EAC/C,KAAK,KACL,UAAW9B,EAAG,yCAA0C,CACtD,
|
|
4
|
+
"sourcesContent": ["import { Text, Picture, Checkbox } from '../../../../../../components/index.js'\nimport { cn } from '../../../../../../helpers/index.js'\nimport { useMemo } from 'react'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\nimport { formatPrice } from '../../../../utils/index.js'\nimport { useAiuiContext } from '../../../../../AiuiProvider/index.js'\nimport type { ProductVariant, ProductPrice } from '../../../../types/product'\nimport { withLayout } from '../../../../../../shared/Styles.js'\nimport { useFollowTooltip, FollowTooltip } from '../../../../hooks/useFollowTooltip.js'\n\nconst ProductExchangePurchase = () => {\n const { locale = 'us' } = useAiuiContext()\n const { tooltip, getTooltipProps } = useFollowTooltip()\n const {\n checkedExchangePurchase,\n exchangePurchase,\n setCheckedBundle,\n setJoinedRecommendBuyProducts,\n setSavingDetail,\n setCheckedExchangePurchase,\n joinedRecommendBuyProducts,\n savingDetail,\n setAddOrder,\n } = useBizProductContext()\n const { title, giftList = [], freeLabel } = exchangePurchase || {}\n const availableGifts = useMemo(() => giftList?.filter(item => item.availableForSale), [giftList])\n\n const handleCheckboxClick = (value: ProductVariant) => {\n if (checkedExchangePurchase?.id === value.id) {\n setCheckedExchangePurchase?.(undefined)\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n exchange: {\n value: undefined,\n canOperate: true,\n },\n })\n setSavingDetail?.({ ...savingDetail, exchangePurchase: 0 })\n // \u4ECE\u6DFB\u52A0\u987A\u5E8F\u4E2D\u79FB\u9664\n setAddOrder?.(prev => prev.filter(t => t !== 'exchange'))\n } else {\n setCheckedExchangePurchase?.(value)\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n exchange: {\n value,\n canOperate: false,\n },\n })\n // \u6DFB\u52A0\u5230\u987A\u5E8F\u6570\u7EC4\u7684\u672B\u5C3E\n setAddOrder?.(prev => {\n // \u5982\u679C\u5DF2\u7ECF\u5B58\u5728\uFF0C\u5148\u79FB\u9664\u518D\u6DFB\u52A0\u5230\u672B\u5C3E\n const filtered = prev.filter(t => t !== 'exchange')\n return [...filtered, 'exchange']\n })\n }\n }\n\n if (!availableGifts?.length) return null\n\n return (\n <div className=\"ipc-product-detail-exchange-purchase\">\n <Text className=\"font-bold leading-[1.2] text-[14px] lg-desktop:text-[16px]\" html={title} />\n <div className=\"laptop:grid-cols-2 laptop-md:grid-cols-1 lg-desktop:mt-4 mt-3 grid grid-cols-1 gap-3\">\n {availableGifts.map((gift: ProductVariant & { finalPrice?: ProductPrice }) => (\n <div\n key={gift.id}\n className={cn(\n 'rounded-box h-[80px] laptop:h-[100px] flex items-center gap-2 border-2 border-[#E4E5E6] px-4 text-left font-bold',\n {\n ['border-brand']: checkedExchangePurchase?.id === gift.id,\n }\n )}\n >\n <Checkbox\n onCheckedChange={() => handleCheckboxClick(gift)}\n size=\"lg\"\n className={cn('rounded-full border-2 border-[#E4E5E6]', {\n 'border-brand-0 data-[state=checked]:bg-brand-0': checkedExchangePurchase?.id === gift.id,\n })}\n id={gift.id}\n checked={checkedExchangePurchase?.id === gift.id}\n value={gift.id}\n ></Checkbox>\n <label\n htmlFor={gift.id}\n className=\"flex w-full cursor-pointer items-center justify-between gap-4 py-4 lg-desktop:py-6\"\n >\n <div className=\"flex items-center gap-2\">\n <Picture source={gift.image?.url} className=\"size-12 shrink-0\" imgClassName=\"h-full\" />\n <Text\n {...getTooltipProps(gift.product.title)}\n className=\"laptop:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-sm font-bold\"\n html={gift.product.title}\n />\n <FollowTooltip {...tooltip} />\n </div>\n <div className=\"tablet:flex-row flex shrink-0 flex-col items-center gap-1\">\n <Text\n className=\"laptop:text-[20px] lg-desktop:text-2xl !leading-[1.2] text-base font-bold\"\n html={formatPrice({\n amount: gift?.finalPrice?.amount || 0,\n locale,\n currencyCode: gift?.finalPrice?.currencyCode || 'USD',\n })}\n />\n <Text\n className=\"laptop:text-[20px] lg-desktop:text-2xl text-base !leading-[1.2] font-bold text-[#6D6D6F] line-through\"\n html={formatPrice({\n amount: gift.price.amount,\n locale,\n currencyCode: gift.price.currencyCode,\n })}\n />\n </div>\n </label>\n </div>\n ))}\n </div>\n </div>\n )\n}\n\nexport default withLayout(ProductExchangePurchase)\n"],
|
|
5
|
+
"mappings": "AA8DM,cAAAA,EA0BQ,QAAAC,MA1BR,oBA9DN,OAAS,QAAAC,EAAM,WAAAC,EAAS,YAAAC,MAAgB,wCACxC,OAAS,MAAAC,MAAU,qCACnB,OAAS,WAAAC,MAAe,QACxB,OAAS,wBAAAC,MAA4B,oCACrC,OAAS,eAAAC,MAAmB,6BAC5B,OAAS,kBAAAC,MAAsB,uCAE/B,OAAS,cAAAC,MAAkB,qCAC3B,OAAS,oBAAAC,EAAkB,iBAAAC,MAAqB,wCAEhD,MAAMC,EAA0B,IAAM,CACpC,KAAM,CAAE,OAAAC,EAAS,IAAK,EAAIL,EAAe,EACnC,CAAE,QAAAM,EAA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K,GACT,QAASlB,GAAyB,KAAOkB,EAAK,GAC9C,MAAOA,EAAK,GACb,EACDlC,EAAC,SACC,QAASkC,EAAK,GACd,UAAU,qFAEV,UAAAlC,EAAC,OAAI,UAAU,0BACb,UAAAD,EAACG,EAAA,CAAQ,OAAQgC,EAAK,OAAO,IAAK,UAAU,mBAAmB,aAAa,SAAS,EACrFnC,EAACE,EAAA,CACE,GAAGc,EAAgBmB,EAAK,QAAQ,KAAK,EACtC,UAAU,2EACV,KAAMA,EAAK,QAAQ,MACrB,EACAnC,EAACY,EAAA,CAAe,GAAGG,EAAS,GAC9B,EACAd,EAAC,OAAI,UAAU,4DACb,UAAAD,EAACE,EAAA,CACC,UAAU,4EACV,KAAMM,EAAY,CAChB,OAAQ2B,GAAM,YAAY,QAAU,EACpC,OAAArB,EACA,aAAcqB,GAAM,YAAY,cAAgB,KAClD,CAAC,EACH,EACAnC,EAACE,EAAA,CACC,UAAU,yGACV,KAAMM,EAAY,CAChB,OAAQ2B,EAAK,MAAM,OACnB,OAAArB,EACA,aAAcqB,EAAK,MAAM,YAC3B,CAAC,EACH,GACF,GACF,IAjDKA,EAAK,EAkDZ,CACD,EACH,GACF,EA7DkC,IA+DtC,EAEA,IAAOC,EAAQ1B,EAAWG,CAAuB",
|
|
6
6
|
"names": ["jsx", "jsxs", "Text", "Picture", "Checkbox", "cn", "useMemo", "useBizProductContext", "formatPrice", "useAiuiContext", "withLayout", "useFollowTooltip", "FollowTooltip", "ProductExchangePurchase", "locale", "tooltip", "getTooltipProps", "checkedExchangePurchase", "exchangePurchase", "setCheckedBundle", "setJoinedRecommendBuyProducts", "setSavingDetail", "setCheckedExchangePurchase", "joinedRecommendBuyProducts", "savingDetail", "setAddOrder", "title", "giftList", "freeLabel", "availableGifts", "item", "handleCheckboxClick", "value", "prev", "t", "gift", "ProductExchangePurchase_default"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as t,jsxs as o}from"react/jsx-runtime";import{Text as r,Picture as P,Checkbox as E}from"../../../../../../components/index.js";import{cn as f}from"../../../../../../helpers/index.js";import{useMemo as w}from"react";import{useBizProductContext as F}from"../../../../BizProductProvider.js";import{formatPrice as G}from"../../../../utils/index.js";import{useAiuiContext as B}from"../../../../../AiuiProvider/index.js";import{withLayout as D}from"../../../../../../shared/Styles.js";import{useFollowTooltip as T,FollowTooltip as z}from"../../../../hooks/useFollowTooltip.js";const L=()=>{const{locale:u="us"}=B(),{tooltip:x,getTooltipProps:b}=T(),{freeGift:h,checkedGift:l,setCheckedGift:
|
|
1
|
+
import{jsx as t,jsxs as o}from"react/jsx-runtime";import{Text as r,Picture as P,Checkbox as E}from"../../../../../../components/index.js";import{cn as f}from"../../../../../../helpers/index.js";import{useMemo as w}from"react";import{useBizProductContext as F}from"../../../../BizProductProvider.js";import{formatPrice as G}from"../../../../utils/index.js";import{useAiuiContext as B}from"../../../../../AiuiProvider/index.js";import{withLayout as D}from"../../../../../../shared/Styles.js";import{useFollowTooltip as T,FollowTooltip as z}from"../../../../hooks/useFollowTooltip.js";const L=()=>{const{locale:u="us"}=B(),{tooltip:x,getTooltipProps:b}=T(),{freeGift:h,checkedGift:l,setCheckedGift:i,setCheckedBundle:O,setSavingDetail:g,savingDetail:k,setJoinedRecommendBuyProducts:a,joinedRecommendBuyProducts:s,setAddOrder:c}=F(),{title:v,giftList:p=[],freeLabel:C}=h||{},n=w(()=>p?.filter(e=>e.availableForSale),[p]),N=e=>{l?.id===e.id?(i?.(void 0),g?.({...k,freeGift:0}),a?.({...s,gift:{value:void 0,canOperate:!0}}),c?.(d=>d.filter(m=>m!=="gift"))):(i?.(e),a?.({...s,gift:{value:e,canOperate:!1}}),c?.(d=>[...d.filter(y=>y!=="gift"),"gift"]))};return n?.length?o("div",{className:"ipc-product-detail-free-gift",children:[t(r,{className:"font-bold leading-[1.2] text-[14px] lg-desktop:text-[16px]",html:v}),t("div",{className:"laptop:grid-cols-2 laptop-md:grid-cols-1 lg-desktop:mt-4 mt-3 grid grid-cols-1 gap-3",children:n.map(e=>o("div",{className:f("rounded-box h-[80px] laptop:h-[100px] flex items-center gap-2 border-2 border-[#E4E5E6] px-4 text-left font-bold",{"border-brand":l?.id===e.id}),children:[t(E,{onCheckedChange:()=>N(e),size:"lg",className:f("rounded-full border-2 border-[#E4E5E6]",{"border-brand-0 data-[state=checked]:bg-brand-0":l?.id===e.id}),id:e.id,checked:l?.id===e.id,value:e.id}),o("label",{htmlFor:e.id,className:"flex w-full cursor-pointer items-center justify-between gap-4 py-4 lg-desktop:py-6",children:[o("div",{className:"flex items-center gap-2",children:[t(P,{source:e.image?.url,className:"size-12 shrink-0",imgClassName:"h-full"}),t(r,{...b(e.product.title),className:"laptop:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-sm font-bold",html:e.product.title}),t(z,{...x})]}),o("div",{className:"tablet:flex-row flex shrink-0 flex-col items-center gap-1",children:[t(r,{className:"laptop:text-[20px] lg-desktop:text-2xl text-base font-bold !leading-[1.2]",html:C}),t(r,{className:"laptop:text-[20px] lg-desktop:text-2xl text-base font-bold text-[#6D6D6F] line-through !leading-[1.2]",html:G({amount:e.price.amount,locale:u,currencyCode:e.price.currencyCode})})]})]})]},e.id))})]}):null};var I=D(L);export{I as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../../src/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Text, Picture, Checkbox } from '../../../../../../components/index.js'\nimport { cn } from '../../../../../../helpers/index.js'\nimport { useEffect, useMemo } from 'react'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\nimport { formatPrice } from '../../../../utils/index.js'\nimport { useAiuiContext } from '../../../../../AiuiProvider/index.js'\nimport type { ProductVariant } from '../../../../types/product'\nimport { withLayout } from '../../../../../../shared/Styles.js'\nimport { useFollowTooltip, FollowTooltip } from '../../../../hooks/useFollowTooltip.js'\n\nconst ProductFreeGift = () => {\n const { locale = 'us' } = useAiuiContext()\n const { tooltip, getTooltipProps } = useFollowTooltip()\n const {\n freeGift,\n checkedGift,\n setCheckedGift,\n setCheckedBundle,\n setSavingDetail,\n savingDetail,\n setJoinedRecommendBuyProducts,\n joinedRecommendBuyProducts,\n setAddOrder,\n } = useBizProductContext()\n const { title, giftList = [], freeLabel } = freeGift || {}\n const availableGifts = useMemo(() => giftList?.filter(item => item.availableForSale), [giftList])\n\n const handleCheckboxClick = (value: ProductVariant) => {\n if (checkedGift?.id === value.id) {\n setCheckedGift?.(undefined)\n setSavingDetail?.({ ...savingDetail, freeGift: 0 })\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n gift: {\n value: undefined,\n canOperate: true,\n },\n })\n // \u4ECE\u6DFB\u52A0\u987A\u5E8F\u4E2D\u79FB\u9664\n setAddOrder?.(prev => prev.filter(t => t !== 'gift'))\n } else {\n setCheckedGift?.(value)\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n gift: {\n value,\n canOperate: false,\n },\n })\n // \u6DFB\u52A0\u5230\u987A\u5E8F\u6570\u7EC4\u7684\u672B\u5C3E\n setAddOrder?.(prev => {\n // \u5982\u679C\u5DF2\u7ECF\u5B58\u5728\uFF0C\u5148\u79FB\u9664\u518D\u6DFB\u52A0\u5230\u672B\u5C3E\n const filtered = prev.filter(t => t !== 'gift')\n return [...filtered, 'gift']\n })\n }\n }\n\n // useEffect(() => {\n // // \u5982\u679C\u7B2C\u4E00\u4E2A\u793C\u7269\u53EF\u7528\uFF0C\u5219\u9009\u4E2D\u5B83\n // availableGifts?.[0] && handleCheckboxClick(availableGifts?.[0])\n // }, [availableGifts])\n\n if (!availableGifts?.length) return null\n\n return (\n <div className=\"ipc-product-detail-free-gift\">\n <Text className=\"font-bold leading-[1.2] text-[14px] lg-desktop:text-[16px]\" html={title} />\n <div className=\"laptop:grid-cols-2 laptop-md:grid-cols-1 lg-desktop:mt-4 mt-3 grid grid-cols-1 gap-3\">\n {availableGifts.map(gift => (\n <div\n key={gift.id}\n className={cn(\n 'rounded-box h-[80px] laptop:h-[100px] flex items-center gap-2 border-2 border-[#E4E5E6] px-4 text-left font-bold',\n {\n ['border-brand']: checkedGift?.id === gift.id,\n }\n )}\n >\n <Checkbox\n onCheckedChange={() => handleCheckboxClick(gift)}\n size=\"lg\"\n className={cn('rounded-full border-2 border-[#E4E5E6]', {\n 'border-brand': checkedGift?.id === gift.id,\n })}\n id={gift.id}\n checked={checkedGift?.id === gift.id}\n value={gift.id}\n ></Checkbox>\n <label\n htmlFor={gift.id}\n className=\"flex w-full cursor-pointer items-center justify-between gap-4 py-4 lg-desktop:py-6\"\n >\n <div className=\"flex items-center gap-2\">\n <Picture source={gift.image?.url} className=\"size-12 shrink-0\" imgClassName=\"h-full\" />\n <Text\n {...getTooltipProps(gift.product.title)}\n className=\"laptop:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-sm font-bold\"\n html={gift.product.title}\n />\n <FollowTooltip {...tooltip} />\n </div>\n <div className=\"tablet:flex-row flex shrink-0 flex-col items-center gap-1\">\n <Text\n className=\"laptop:text-[20px] lg-desktop:text-2xl text-base font-bold !leading-[1.2]\"\n html={freeLabel}\n />\n <Text\n className=\"laptop:text-[20px] lg-desktop:text-2xl text-base font-bold text-[#6D6D6F] line-through !leading-[1.2]\"\n html={formatPrice({\n amount: gift.price.amount,\n locale,\n currencyCode: gift.price.currencyCode,\n })}\n />\n </div>\n </label>\n </div>\n ))}\n </div>\n </div>\n )\n}\n\nexport default withLayout(ProductFreeGift)\n"],
|
|
5
|
-
"mappings": "AAmEM,cAAAA,EA0BQ,QAAAC,MA1BR,oBAnEN,OAAS,QAAAC,EAAM,WAAAC,EAAS,YAAAC,MAAgB,wCACxC,OAAS,MAAAC,MAAU,qCACnB,OAAoB,WAAAC,MAAe,QACnC,OAAS,wBAAAC,MAA4B,oCACr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I,EACT,mHACA,CACG,eAAiBa,GAAa,KAAOiB,EAAK,EAC7C,CACF,EAEA,UAAAnC,EAACI,EAAA,CACC,gBAAiB,IAAM2B,EAAoBI,CAAI,EAC/C,KAAK,KACL,UAAW9B,EAAG,yCAA0C,CACtD,
|
|
4
|
+
"sourcesContent": ["import { Text, Picture, Checkbox } from '../../../../../../components/index.js'\nimport { cn } from '../../../../../../helpers/index.js'\nimport { useEffect, useMemo } from 'react'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\nimport { formatPrice } from '../../../../utils/index.js'\nimport { useAiuiContext } from '../../../../../AiuiProvider/index.js'\nimport type { ProductVariant } from '../../../../types/product'\nimport { withLayout } from '../../../../../../shared/Styles.js'\nimport { useFollowTooltip, FollowTooltip } from '../../../../hooks/useFollowTooltip.js'\n\nconst ProductFreeGift = () => {\n const { locale = 'us' } = useAiuiContext()\n const { tooltip, getTooltipProps } = useFollowTooltip()\n const {\n freeGift,\n checkedGift,\n setCheckedGift,\n setCheckedBundle,\n setSavingDetail,\n savingDetail,\n setJoinedRecommendBuyProducts,\n joinedRecommendBuyProducts,\n setAddOrder,\n } = useBizProductContext()\n const { title, giftList = [], freeLabel } = freeGift || {}\n const availableGifts = useMemo(() => giftList?.filter(item => item.availableForSale), [giftList])\n\n const handleCheckboxClick = (value: ProductVariant) => {\n if (checkedGift?.id === value.id) {\n setCheckedGift?.(undefined)\n setSavingDetail?.({ ...savingDetail, freeGift: 0 })\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n gift: {\n value: undefined,\n canOperate: true,\n },\n })\n // \u4ECE\u6DFB\u52A0\u987A\u5E8F\u4E2D\u79FB\u9664\n setAddOrder?.(prev => prev.filter(t => t !== 'gift'))\n } else {\n setCheckedGift?.(value)\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n gift: {\n value,\n canOperate: false,\n },\n })\n // \u6DFB\u52A0\u5230\u987A\u5E8F\u6570\u7EC4\u7684\u672B\u5C3E\n setAddOrder?.(prev => {\n // \u5982\u679C\u5DF2\u7ECF\u5B58\u5728\uFF0C\u5148\u79FB\u9664\u518D\u6DFB\u52A0\u5230\u672B\u5C3E\n const filtered = prev.filter(t => t !== 'gift')\n return [...filtered, 'gift']\n })\n }\n }\n\n // useEffect(() => {\n // // \u5982\u679C\u7B2C\u4E00\u4E2A\u793C\u7269\u53EF\u7528\uFF0C\u5219\u9009\u4E2D\u5B83\n // availableGifts?.[0] && handleCheckboxClick(availableGifts?.[0])\n // }, [availableGifts])\n\n if (!availableGifts?.length) return null\n\n return (\n <div className=\"ipc-product-detail-free-gift\">\n <Text className=\"font-bold leading-[1.2] text-[14px] lg-desktop:text-[16px]\" html={title} />\n <div className=\"laptop:grid-cols-2 laptop-md:grid-cols-1 lg-desktop:mt-4 mt-3 grid grid-cols-1 gap-3\">\n {availableGifts.map(gift => (\n <div\n key={gift.id}\n className={cn(\n 'rounded-box h-[80px] laptop:h-[100px] flex items-center gap-2 border-2 border-[#E4E5E6] px-4 text-left font-bold',\n {\n ['border-brand']: checkedGift?.id === gift.id,\n }\n )}\n >\n <Checkbox\n onCheckedChange={() => handleCheckboxClick(gift)}\n size=\"lg\"\n className={cn('rounded-full border-2 border-[#E4E5E6]', {\n 'border-brand-0 data-[state=checked]:bg-brand-0': checkedGift?.id === gift.id,\n })}\n id={gift.id}\n checked={checkedGift?.id === gift.id}\n value={gift.id}\n ></Checkbox>\n <label\n htmlFor={gift.id}\n className=\"flex w-full cursor-pointer items-center justify-between gap-4 py-4 lg-desktop:py-6\"\n >\n <div className=\"flex items-center gap-2\">\n <Picture source={gift.image?.url} className=\"size-12 shrink-0\" imgClassName=\"h-full\" />\n <Text\n {...getTooltipProps(gift.product.title)}\n className=\"laptop:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-sm font-bold\"\n html={gift.product.title}\n />\n <FollowTooltip {...tooltip} />\n </div>\n <div className=\"tablet:flex-row flex shrink-0 flex-col items-center gap-1\">\n <Text\n className=\"laptop:text-[20px] lg-desktop:text-2xl text-base font-bold !leading-[1.2]\"\n html={freeLabel}\n />\n <Text\n className=\"laptop:text-[20px] lg-desktop:text-2xl text-base font-bold text-[#6D6D6F] line-through !leading-[1.2]\"\n html={formatPrice({\n amount: gift.price.amount,\n locale,\n currencyCode: gift.price.currencyCode,\n })}\n />\n </div>\n </label>\n </div>\n ))}\n </div>\n </div>\n )\n}\n\nexport default withLayout(ProductFreeGift)\n"],
|
|
5
|
+
"mappings": "AAmEM,cAAAA,EA0BQ,QAAAC,MA1BR,oBAnEN,OAAS,QAAAC,EAAM,WAAAC,EAAS,YAAAC,MAAgB,wCACxC,OAAS,MAAAC,MAAU,qCACnB,OAAoB,WAAAC,MAAe,QACnC,OAAS,wBAAAC,MAA4B,oCACrC,OAAS,eAAAC,MAAmB,6BAC5B,OAAS,kBAAAC,MAAsB,uCAE/B,OAAS,cAAAC,MAAkB,qCAC3B,OAAS,oBAAAC,EAAkB,iBAAAC,MAAqB,wCAEhD,MAAMC,EAAkB,IAAM,CAC5B,KAAM,CAAE,OAAAC,EAAS,IAAK,EAAIL,EAAe,EACnC,CAAE,QAAAM,EAAS,gBAAAC,CAAgB,EAAIL,EAAiB,EAChD,CACJ,SAAAM,EACA,YAAAC,EACA,eAAAC,EACA,iBAAAC,EACA,gBAAAC,EACA,aAAAC,EACA,8BAAAC,EACA,2BAAAC,EACA,YAAAC,CACF,EAAIlB,EAAqB,EACnB,CAAE,MAAAmB,EAAO,SAAAC,EAAW,CAAC,EAAG,UAAAC,CAAU,EAAIX,GAAY,CAAC,EACnDY,EAAiBvB,EAAQ,IAAMqB,GAAU,OAAOG,GAAQA,EAAK,gBAAgB,EAAG,CAACH,CAAQ,CAAC,EAE1FI,EAAuBC,GAA0B,CACjDd,GAAa,KAAOc,EAAM,IAC5Bb,IAAiB,MAAS,EAC1BE,IAAkB,CAAE,GAAGC,EAAc,SAAU,CAAE,CAAC,EAClDC,IAAgC,CAC9B,GAAGC,EACH,KAAM,CACJ,MAAO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nB,OAAArB,EACA,aAAcqB,EAAK,MAAM,YAC3B,CAAC,EACH,GACF,GACF,IA7CKA,EAAK,EA8CZ,CACD,EACH,GACF,EAzDkC,IA2DtC,EAEA,IAAOC,EAAQ1B,EAAWG,CAAe",
|
|
6
6
|
"names": ["jsx", "jsxs", "Text", "Picture", "Checkbox", "cn", "useMemo", "useBizProductContext", "formatPrice", "useAiuiContext", "withLayout", "useFollowTooltip", "FollowTooltip", "ProductFreeGift", "locale", "tooltip", "getTooltipProps", "freeGift", "checkedGift", "setCheckedGift", "setCheckedBundle", "setSavingDetail", "savingDetail", "setJoinedRecommendBuyProducts", "joinedRecommendBuyProducts", "setAddOrder", "title", "giftList", "freeLabel", "availableGifts", "item", "handleCheckboxClick", "value", "prev", "t", "gift", "ProductFreeGift_default"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as t,jsxs as a}from"react/jsx-runtime";import{Heading as m,Container as i}from"../../../../components/index.js";import{ProductActions as n}from"../index.js";import{useBizProductContext as c}from"../../BizProductProvider.js";import{useComponentData as u}from"../../hooks/useComponentData.js";import l from"./ScrollSpyNav/index.js";import{withLayout as f}from"../../../../shared/Styles.js";const b=({onSpyNavItemClick:e,totalSavingsSlot:
|
|
1
|
+
import{jsx as t,jsxs as a}from"react/jsx-runtime";import{Heading as m,Container as i}from"../../../../components/index.js";import{ProductActions as n}from"../index.js";import{useBizProductContext as c}from"../../BizProductProvider.js";import{useComponentData as u}from"../../hooks/useComponentData.js";import l from"./ScrollSpyNav/index.js";import{withLayout as f}from"../../../../shared/Styles.js";const b=({onSpyNavItemClick:e,totalSavingsSlot:s,actionsSlot:p})=>{const{product:d,renderRating:r}=c(),o=u("PurchaseBar")??[];return a("div",{id:"purchase-bar",className:"sticky left-0 top-0 z-[45] w-full border-b border-[#E4E5E6] bg-white",children:[t(i,{children:a("div",{className:"tablet:justify-between laptop-md:gap-16 tablet:gap-0 tablet:w-full flex flex-wrap items-center gap-[10px]",children:[a("div",{className:"laptop-md:pt-6 laptop-md:pb-0 min-w-0 flex-1 py-3",children:[t(m,{as:"h1",size:2,className:"line-clamp-2 text-wrap",html:d?.title}),t("div",{className:"laptop-md:block mt-3 hidden",children:t(l,{tabs:o,className:"",renderRating:r,onSpyNavItemClick:e})})]}),t("div",{className:"laptop-md:block hidden shrink-0",children:p??t(n,{totalSavingsSlot:s})})]})}),a(i,{className:"laptop-md:hidden relative",children:[t("div",{className:"absolute left-0 top-0 h-px w-full bg-[#E4E5E6]"}),t(l,{tabs:o,renderRating:r,onSpyNavItemClick:e})]})]})};var y=f(b);export{y as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/biz-components/Listing/components/PurchaseBar/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Heading, Container } from '../../../../components/index.js'\nimport type { PurchaseBarProps } from './types.js'\nimport { ProductActions } from '../index.js'\nimport { useBizProductContext } from '../../BizProductProvider.js'\nimport { useComponentData } from '../../hooks/useComponentData.js'\nimport ScrollSpyNav from './ScrollSpyNav/index.js'\nimport { withLayout } from '../../../../shared/Styles.js'\n\nconst PurchaseBar = ({ onSpyNavItemClick, totalSavingsSlot, actionsSlot }: PurchaseBarProps) => {\n const { product, renderRating } = useBizProductContext()\n\n const PurchaseBarData = useComponentData('PurchaseBar') ?? []\n\n return (\n <div id=\"purchase-bar\" className=\"sticky left-0 top-0 z-[45] w-full border-b border-[#E4E5E6] bg-white\">\n <Container>\n <div className=\"tablet:justify-between laptop-md:gap-16 tablet:gap-0 tablet:w-full flex flex-wrap items-center gap-[10px]\">\n <div className=\"laptop-md:pt-6 laptop-md:pb-0 min-w-0 flex-1 py-3\">\n <Heading size={2} className=\"line-clamp-2 text-wrap\" html={product?.title} />\n <div className=\"laptop-md:block mt-3 hidden\">\n <ScrollSpyNav\n tabs={PurchaseBarData}\n className=\"\"\n renderRating={renderRating}\n onSpyNavItemClick={onSpyNavItemClick}\n />\n </div>\n </div>\n <div className=\"laptop-md:block hidden shrink-0\">\n {actionsSlot ?? <ProductActions totalSavingsSlot={totalSavingsSlot} />}\n </div>\n </div>\n </Container>\n <Container className=\"laptop-md:hidden relative\">\n <div className=\"absolute left-0 top-0 h-px w-full bg-[#E4E5E6]\"></div>\n <ScrollSpyNav tabs={PurchaseBarData} renderRating={renderRating} onSpyNavItemClick={onSpyNavItemClick} />\n </Container>\n </div>\n )\n}\n\nexport default withLayout(PurchaseBar)\n"],
|
|
5
|
-
"mappings": "AAiBU,OACE,OAAAA,EADF,QAAAC,MAAA,oBAjBV,OAAS,WAAAC,EAAS,aAAAC,MAAiB,kCAEnC,OAAS,kBAAAC,MAAsB,cAC/B,OAAS,wBAAAC,MAA4B,8BACrC,OAAS,oBAAAC,MAAwB,kCACjC,OAAOC,MAAkB,0BACzB,OAAS,cAAAC,MAAkB,+BAE3B,MAAMC,EAAc,CAAC,CAAE,kBAAAC,EAAmB,iBAAAC,EAAkB,YAAAC,CAAY,IAAwB,CAC9F,KAAM,CAAE,QAAAC,EAAS,aAAAC,CAAa,EAAIT,EAAqB,EAEjDU,EAAkBT,EAAiB,aAAa,GAAK,CAAC,EAE5D,OACEL,EAAC,OAAI,GAAG,eAAe,UAAU,uEAC/B,UAAAD,EAACG,EAAA,CACC,SAAAF,EAAC,OAAI,UAAU,4GACb,UAAAA,EAAC,OAAI,UAAU,oDACb,UAAAD,EAACE,EAAA,CAAQ,KAAM,EAAG,UAAU,yBAAyB,KAAMW,GAAS,MAAO,
|
|
4
|
+
"sourcesContent": ["import { Heading, Container } from '../../../../components/index.js'\nimport type { PurchaseBarProps } from './types.js'\nimport { ProductActions } from '../index.js'\nimport { useBizProductContext } from '../../BizProductProvider.js'\nimport { useComponentData } from '../../hooks/useComponentData.js'\nimport ScrollSpyNav from './ScrollSpyNav/index.js'\nimport { withLayout } from '../../../../shared/Styles.js'\n\nconst PurchaseBar = ({ onSpyNavItemClick, totalSavingsSlot, actionsSlot }: PurchaseBarProps) => {\n const { product, renderRating } = useBizProductContext()\n\n const PurchaseBarData = useComponentData('PurchaseBar') ?? []\n\n return (\n <div id=\"purchase-bar\" className=\"sticky left-0 top-0 z-[45] w-full border-b border-[#E4E5E6] bg-white\">\n <Container>\n <div className=\"tablet:justify-between laptop-md:gap-16 tablet:gap-0 tablet:w-full flex flex-wrap items-center gap-[10px]\">\n <div className=\"laptop-md:pt-6 laptop-md:pb-0 min-w-0 flex-1 py-3\">\n <Heading as=\"h1\" size={2} className=\"line-clamp-2 text-wrap\" html={product?.title} />\n <div className=\"laptop-md:block mt-3 hidden\">\n <ScrollSpyNav\n tabs={PurchaseBarData}\n className=\"\"\n renderRating={renderRating}\n onSpyNavItemClick={onSpyNavItemClick}\n />\n </div>\n </div>\n <div className=\"laptop-md:block hidden shrink-0\">\n {actionsSlot ?? <ProductActions totalSavingsSlot={totalSavingsSlot} />}\n </div>\n </div>\n </Container>\n <Container className=\"laptop-md:hidden relative\">\n <div className=\"absolute left-0 top-0 h-px w-full bg-[#E4E5E6]\"></div>\n <ScrollSpyNav tabs={PurchaseBarData} renderRating={renderRating} onSpyNavItemClick={onSpyNavItemClick} />\n </Container>\n </div>\n )\n}\n\nexport default withLayout(PurchaseBar)\n"],
|
|
5
|
+
"mappings": "AAiBU,OACE,OAAAA,EADF,QAAAC,MAAA,oBAjBV,OAAS,WAAAC,EAAS,aAAAC,MAAiB,kCAEnC,OAAS,kBAAAC,MAAsB,cAC/B,OAAS,wBAAAC,MAA4B,8BACrC,OAAS,oBAAAC,MAAwB,kCACjC,OAAOC,MAAkB,0BACzB,OAAS,cAAAC,MAAkB,+BAE3B,MAAMC,EAAc,CAAC,CAAE,kBAAAC,EAAmB,iBAAAC,EAAkB,YAAAC,CAAY,IAAwB,CAC9F,KAAM,CAAE,QAAAC,EAAS,aAAAC,CAAa,EAAIT,EAAqB,EAEjDU,EAAkBT,EAAiB,aAAa,GAAK,CAAC,EAE5D,OACEL,EAAC,OAAI,GAAG,eAAe,UAAU,uEAC/B,UAAAD,EAACG,EAAA,CACC,SAAAF,EAAC,OAAI,UAAU,4GACb,UAAAA,EAAC,OAAI,UAAU,oDACb,UAAAD,EAACE,EAAA,CAAQ,GAAG,KAAK,KAAM,EAAG,UAAU,yBAAyB,KAAMW,GAAS,MAAO,EACnFb,EAAC,OAAI,UAAU,8BACb,SAAAA,EAACO,EAAA,CACC,KAAMQ,EACN,UAAU,GACV,aAAcD,EACd,kBAAmBJ,EACrB,EACF,GACF,EACAV,EAAC,OAAI,UAAU,kCACZ,SAAAY,GAAeZ,EAACI,EAAA,CAAe,iBAAkBO,EAAkB,EACtE,GACF,EACF,EACAV,EAACE,EAAA,CAAU,UAAU,4BACnB,UAAAH,EAAC,OAAI,UAAU,iDAAiD,EAChEA,EAACO,EAAA,CAAa,KAAMQ,EAAiB,aAAcD,EAAc,kBAAmBJ,EAAmB,GACzG,GACF,CAEJ,EAEA,IAAOM,EAAQR,EAAWC,CAAW",
|
|
6
6
|
"names": ["jsx", "jsxs", "Heading", "Container", "ProductActions", "useBizProductContext", "useComponentData", "ScrollSpyNav", "withLayout", "PurchaseBar", "onSpyNavItemClick", "totalSavingsSlot", "actionsSlot", "product", "renderRating", "PurchaseBarData", "PurchaseBar_default"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as o,jsxs as u}from"react/jsx-runtime";import{Dialog as a,DialogContent as
|
|
1
|
+
import{jsx as o,jsxs as u}from"react/jsx-runtime";import{Dialog as a,DialogContent as r}from"../../components/dialog.js";import{YouTubePlayer as s}from"../VideoModal/YouTubePlayer.js";const d=l=>{const{visible:n,youTubeId:e,videoUrl:t,onCloseModal:i,className:p,...c}=l;return o(a,{open:n,onOpenChange:()=>i(),children:u(r,{className:"max-h-3/4 h-3/4 w-4/5 max-w-[1200px] border-none bg-transparent p-0 [&_button]:hidden",children:[e?o(s,{youTubeId:e}):t?o("video",{className:"size-full overflow-hidden rounded-2xl object-contain",src:t,muted:!0,loop:!0,autoPlay:!0,controls:!0}):null,o("div",{onClick:()=>i(),className:"tablet:size-8 tablet:-right-8 tablet:-top-8 absolute -right-6 -top-6 size-6 cursor-pointer overflow-hidden text-white",children:o("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon",className:"HomeCharger_closeWrap__Z7aBo",children:o("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"})})})]})})};export{d as VideoModal};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/VideoModal/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Dialog, DialogContent } from '../../components/dialog.js'\nimport { YouTubePlayer } from '../VideoModal/YouTubePlayer.js'\n\nexport interface VideoModalType extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {\n visible: boolean\n youTubeId?: string\n videoUrl?: string\n onCloseModal: () => void\n}\n\nconst VideoModal = (props: VideoModalType) => {\n const { visible, youTubeId, videoUrl, onCloseModal, className, ...rest } = props\n\n return (\n <Dialog open={visible} onOpenChange={() => onCloseModal()}>\n <DialogContent className=\"max-h-3/4 h-3/4 w-4/5 max-w-[1200px] border-none bg-transparent p-0 [&_button]:hidden\">\n {youTubeId ? (\n <YouTubePlayer youTubeId={youTubeId} />\n ) : videoUrl ? (\n <video\n className=\"size-full overflow-hidden rounded-2xl object-
|
|
5
|
-
"mappings": "AAeM,OAEI,OAAAA,EAFJ,QAAAC,MAAA,oBAfN,OAAS,UAAAC,EAAQ,iBAAAC,MAAqB,6BACtC,OAAS,iBAAAC,MAAqB,iCAS9B,MAAMC,EAAcC,GAA0B,CAC5C,KAAM,CAAE,QAAAC,EAAS,UAAAC,EAAW,SAAAC,EAAU,aAAAC,EAAc,UAAAC,EAAW,GAAGC,CAAK,EAAIN,EAE3E,OACEN,EAACE,EAAA,CAAO,KAAMK,EAAS,aAAc,IAAMG,EAAa,EACtD,SAAAT,EAACE,EAAA,CAAc,UAAU,wFACtB,UAAAK,EACCR,EAACI,EAAA,CAAc,UAAWI,EAAW,EACnCC,EACFT,EAAC,SACC,UAAU,
|
|
4
|
+
"sourcesContent": ["import { Dialog, DialogContent } from '../../components/dialog.js'\nimport { YouTubePlayer } from '../VideoModal/YouTubePlayer.js'\n\nexport interface VideoModalType extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {\n visible: boolean\n youTubeId?: string\n videoUrl?: string\n onCloseModal: () => void\n}\n\nconst VideoModal = (props: VideoModalType) => {\n const { visible, youTubeId, videoUrl, onCloseModal, className, ...rest } = props\n\n return (\n <Dialog open={visible} onOpenChange={() => onCloseModal()}>\n <DialogContent className=\"max-h-3/4 h-3/4 w-4/5 max-w-[1200px] border-none bg-transparent p-0 [&_button]:hidden\">\n {youTubeId ? (\n <YouTubePlayer youTubeId={youTubeId} />\n ) : videoUrl ? (\n <video\n className=\"size-full overflow-hidden rounded-2xl object-contain\"\n src={videoUrl}\n muted\n loop\n autoPlay\n controls\n />\n ) : null}\n <div\n onClick={() => onCloseModal()}\n className=\"tablet:size-8 tablet:-right-8 tablet:-top-8 absolute -right-6 -top-6 size-6 cursor-pointer overflow-hidden text-white\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n data-slot=\"icon\"\n className=\"HomeCharger_closeWrap__Z7aBo\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M6 18 18 6M6 6l12 12\"></path>\n </svg>\n </div>\n </DialogContent>\n </Dialog>\n )\n}\n\nexport { VideoModal }\n"],
|
|
5
|
+
"mappings": "AAeM,OAEI,OAAAA,EAFJ,QAAAC,MAAA,oBAfN,OAAS,UAAAC,EAAQ,iBAAAC,MAAqB,6BACtC,OAAS,iBAAAC,MAAqB,iCAS9B,MAAMC,EAAcC,GAA0B,CAC5C,KAAM,CAAE,QAAAC,EAAS,UAAAC,EAAW,SAAAC,EAAU,aAAAC,EAAc,UAAAC,EAAW,GAAGC,CAAK,EAAIN,EAE3E,OACEN,EAACE,EAAA,CAAO,KAAMK,EAAS,aAAc,IAAMG,EAAa,EACtD,SAAAT,EAACE,EAAA,CAAc,UAAU,wFACtB,UAAAK,EACCR,EAACI,EAAA,CAAc,UAAWI,EAAW,EACnCC,EACFT,EAAC,SACC,UAAU,uDACV,IAAKS,EACL,MAAK,GACL,KAAI,GACJ,SAAQ,GACR,SAAQ,GACV,EACE,KACJT,EAAC,OACC,QAAS,IAAMU,EAAa,EAC5B,UAAU,wHAEV,SAAAV,EAAC,OACC,MAAM,6BACN,KAAK,OACL,QAAQ,YACR,YAAY,MACZ,OAAO,eACP,cAAY,OACZ,YAAU,OACV,UAAU,+BAEV,SAAAA,EAAC,QAAK,cAAc,QAAQ,eAAe,QAAQ,EAAE,uBAAuB,EAC9E,EACF,GACF,EACF,CAEJ",
|
|
6
6
|
"names": ["jsx", "jsxs", "Dialog", "DialogContent", "YouTubePlayer", "VideoModal", "props", "visible", "youTubeId", "videoUrl", "onCloseModal", "className", "rest"]
|
|
7
7
|
}
|
package/package.json
CHANGED