@anker-in/headless-ui 1.3.73 → 1.3.75
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/AiuiProvider/index.d.ts +9 -0
- package/dist/cjs/biz-components/AiuiProvider/index.js +1 -1
- package/dist/cjs/biz-components/CreditsShelf/ProductCard.js +1 -1
- package/dist/cjs/biz-components/FooterNavigation/index.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/MobileMenuComponents.d.ts +2 -1
- package/dist/cjs/biz-components/HeaderNavigation/MobileMenuComponents.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/MobileResourceSidebarMenu.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/MobileSidebarMenu.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/MobileSupportMenu.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/MulticolDropdown.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/ResourceItem.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/ResourceSidebarDropdown.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/SidebarDropdown.d.ts +2 -1
- package/dist/cjs/biz-components/HeaderNavigation/SidebarDropdown.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/SupportsDropdown.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/index.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/types.d.ts +1 -0
- package/dist/cjs/biz-components/HeaderNavigation/types.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/useNavCollapse.d.ts +30 -0
- package/dist/cjs/biz-components/HeaderNavigation/useNavCollapse.js +1 -0
- package/dist/cjs/biz-components/HeaderNavigation/useScrollLock.d.ts +2 -1
- package/dist/cjs/biz-components/HeaderNavigation/useScrollLock.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/withCategory.js +1 -1
- package/dist/cjs/biz-components/ProductNav/ProductNav.js +1 -1
- package/dist/cjs/biz-components/SceneShelf/ProductCard.js +1 -1
- package/dist/cjs/biz-components/SceneShelfV3/ProductCard.js +1 -1
- package/dist/cjs/biz-components/SearchPage/index.js +1 -1
- package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js +1 -1
- package/dist/cjs/biz-components/ShelfDisplayHorizontal/shelfDisplayHorizontalItem.js +1 -1
- package/dist/cjs/biz-components/Specs/dropdown.d.ts +2 -1
- package/dist/cjs/biz-components/Specs/dropdown.js +2 -2
- package/dist/cjs/biz-components/Specs/index.js +1 -1
- package/dist/cjs/components/badge.d.ts +1 -1
- package/dist/cjs/components/badge.js +1 -1
- package/dist/cjs/components/board.js +1 -1
- package/dist/esm/biz-components/AiuiProvider/index.d.ts +9 -0
- package/dist/esm/biz-components/AiuiProvider/index.js +1 -1
- package/dist/esm/biz-components/CreditsShelf/ProductCard.js +1 -1
- package/dist/esm/biz-components/FooterNavigation/index.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/MobileMenuComponents.d.ts +2 -1
- package/dist/esm/biz-components/HeaderNavigation/MobileMenuComponents.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/MobileResourceSidebarMenu.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/MobileSidebarMenu.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/MobileSupportMenu.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/MulticolDropdown.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/ResourceItem.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/ResourceSidebarDropdown.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/SidebarDropdown.d.ts +2 -1
- package/dist/esm/biz-components/HeaderNavigation/SidebarDropdown.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/SupportsDropdown.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/index.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/types.d.ts +1 -0
- package/dist/esm/biz-components/HeaderNavigation/useNavCollapse.d.ts +30 -0
- package/dist/esm/biz-components/HeaderNavigation/useNavCollapse.js +1 -0
- package/dist/esm/biz-components/HeaderNavigation/useScrollLock.d.ts +2 -1
- package/dist/esm/biz-components/HeaderNavigation/useScrollLock.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/withCategory.js +1 -1
- package/dist/esm/biz-components/ProductNav/ProductNav.js +1 -1
- package/dist/esm/biz-components/SceneShelf/ProductCard.js +1 -1
- package/dist/esm/biz-components/SceneShelfV3/ProductCard.js +1 -1
- package/dist/esm/biz-components/SearchPage/index.js +1 -1
- package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js +1 -1
- package/dist/esm/biz-components/ShelfDisplayHorizontal/shelfDisplayHorizontalItem.js +1 -1
- package/dist/esm/biz-components/Specs/dropdown.d.ts +2 -1
- package/dist/esm/biz-components/Specs/dropdown.js +2 -2
- package/dist/esm/biz-components/Specs/index.js +1 -1
- package/dist/esm/components/badge.d.ts +1 -1
- package/dist/esm/components/badge.js +1 -1
- package/dist/esm/components/board.js +1 -1
- package/dist/tokens/oneAnker.css +22 -0
- package/package.json +1 -1
- package/style.css +29 -2
- package/tailwind.config.js +5 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as a,jsxs as d}from"react/jsx-runtime";import*as T from"react";import{cn as t}from"../../helpers/index.js";import{Checkbox as L,Badge as j,Heading as D,Text as n,Picture as c}from"../../components/index.js";import{useSceneShelfContext as O}from"./context.js";import{LocalizedLink as q}from"../../shared/LocalizedLink.js";const p=T.forwardRef(({className:x,classNames:
|
|
1
|
+
"use client";import{jsx as a,jsxs as d}from"react/jsx-runtime";import*as T from"react";import{cn as t}from"../../helpers/index.js";import{Checkbox as L,Badge as j,Heading as D,Text as n,Picture as c}from"../../components/index.js";import{useSceneShelfContext as O}from"./context.js";import{LocalizedLink as q}from"../../shared/LocalizedLink.js";const p=T.forwardRef(({className:x,classNames:h,product:e,selected:f,onSelectChange:b,showTags:k,showOriginalPrice:C,onProductImageClick:P,...u},N)=>{const i=O(),S=k??i?.showTags??!0,v=C??i?.showOriginalPrice??!0,s=h??i?.classNames??{},r=f??(i?i.selectedIds.has(e.id):!1),m=b??i?.onSelectChange,g=P??i?.onProductImageClick,l=e.soldOut??!1,w=o=>{l||typeof o=="boolean"&&m?.(o,e)},y=()=>{l||m?.(!r,e)};return d("div",{ref:N,className:t("lg-desktop:gap-2 lg-desktop:h-[362px] lg-desktop:px-6 lg-desktop:pb-6 lg-desktop:pt-4 rounded-box box-border flex h-[284px] flex-col justify-between gap-2 border-2 border-solid p-4 pb-6 transition-colors",l?"cursor-not-allowed opacity-50":"cursor-pointer",r?t("border-brand-0 bg-container-secondary-0",s?.cardSelected):t("border-lines bg-container-primary",s?.card),x),onClick:y,"data-headless-type-name":"SceneShelf#ProductCard","data-headless-title-desc-button":`${e.custom_name??e.title}##Select`,"data-headless-sku":e.id,...u,children:[a("div",{className:t("lg-desktop:left-6 lg-desktop:top-6 flex max-h-[24px] min-h-[24px] flex-wrap gap-1 overflow-visible pr-9",s?.tags),children:S&&e.tags?.map((o,z)=>a(j,{variant:o.variant||"outline",size:"sm",children:o.label},z))}),a(L,{checked:r,disabled:l,onCheckedChange:w,onClick:o=>o.stopPropagation(),className:t("text-brand-0 border-brand-0 lg-desktop:right-6 lg-desktop:top-6 absolute right-4 top-4 size-5 shrink-0",s?.checkbox)}),a("div",{className:t("flex flex-1 grow-0 items-center justify-center",s?.image),children:g?a("a",{onClick:()=>g(e),role:"button",children:a(c,{source:e.imageUrl,alt:e.imageAlt||e.title,className:"lg-desktop:size-[175px] aspect-square size-[124px] ",imgClassName:"object-contain"})}):e?.href?a(q,{href:e.href,children:a(c,{source:e.imageUrl,alt:e.imageAlt||e.title,className:"lg-desktop:size-[175px] aspect-square size-[124px] ",imgClassName:"object-contain"})}):a(c,{source:e.imageUrl,alt:e.imageAlt||e.title,className:"lg-desktop:size-[175px] aspect-square size-[124px] ",imgClassName:"object-contain"})}),d("div",{className:"flex grow flex-col justify-start gap-4",children:[a(D,{as:"h3",size:2,className:t("text-info-primary line-clamp-2 h-[2.2em]",s?.title),html:e.custom_name??e.title}),d("div",{className:t("flex flex-wrap items-center gap-1",s?.priceWrapper),children:[a(n,{as:"span",size:2,className:t("text-info-primary lg-desktop:text-[24px] whitespace-nowrap text-[20px]",s?.currentPrice),children:e.currentPrice.formatted}),v&&e.originalPrice&&e.originalPrice.value>e.currentPrice.value&&a(n,{as:"span",size:2,className:t("text-info-quaternary lg-desktop:text-[24px] whitespace-nowrap text-[20px] line-through",s?.originalPrice),children:e.originalPrice.formatted})]}),e?.priceLabel&&a(n,{size:4,className:t("text-marketing-1 desktop:text-[16px] lg-desktop:text-[18px] mt-2 text-[14px]",s?.productPriceLabel),children:e.priceLabel})]})]})});p.displayName="SceneShelf.ProductCard";export{p as SceneProductCard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{Fragment as Q,jsx as t,jsxs as l}from"react/jsx-runtime";import*as n from"react";import{cn as a,getLocalizedPath as F}from"../../helpers/index.js";import{Button as N,Badge as V,Card as q,CardContent as K,Picture as W,Text as T,Heading as p}from"../../components/index.js";import{trackUrlRef as I}from"../../shared/trackUrlRef.js";import{gaTrack as u}from"../../shared/track.js";import{useAiuiContext as J}from"../AiuiProvider/index.js";const B=n.forwardRef(({product:e,className:L,showTags:z=!0,onLearnMore:f,onShopNow:y,onAddToCart:v,classNames:o,secondaryButtonText:c,secondaryButtonFun:
|
|
1
|
+
"use client";import{Fragment as Q,jsx as t,jsxs as l}from"react/jsx-runtime";import*as n from"react";import{cn as a,getLocalizedPath as F}from"../../helpers/index.js";import{Button as N,Badge as V,Card as q,CardContent as K,Picture as W,Text as T,Heading as p}from"../../components/index.js";import{trackUrlRef as I}from"../../shared/trackUrlRef.js";import{gaTrack as u}from"../../shared/track.js";import{useAiuiContext as J}from"../AiuiProvider/index.js";const B=n.forwardRef(({product:e,className:L,showTags:z=!0,onLearnMore:f,onShopNow:y,onAddToCart:v,classNames:o,secondaryButtonText:c,secondaryButtonFun:x,primaryButtonText:m,primaryButtonFun:b,showOriginalPrice:_,renderOriginalPrice:h,copy:D,onProductImageClick:d,theme:M="light",locale:P="us",index:s=0,tabName:k},H)=>{const[O,j]=n.useState(!1),[R,A]=n.useState(!1),{trackingData:G}=J(),r=G?.pageGroup,w=!e.soldOut,C=n.useCallback(async(i,g)=>{if(!i)return;const S=g==="primary"?j:A;S(!0);try{switch(i){case"buyNow":await y?.(e);break;case"addCart":await v?.(e);break;case"learnMore":await f?.(e.href);break}}finally{S(!1)}},[e,y,v,f]),U=n.useMemo(()=>F(I(e.href,r+"_shelf_scene_shelf_v3"),P),[e.href,r,P]),E=n.useCallback(()=>{d?.(e),u({event:"ga4Event",event_name:"select_item",item_list_name:"Scene_Shelf_3_Products",page_group:r,items:[{item_id:e.sku,item_name:e.title,item_variant:e.id,price:e.currentPrice,index:s}],tab_name:k,position:s})},[d,e,r,s,k]);return t(q,{ref:H,className:a("bg-container-primary flex h-full flex-col overflow-hidden border-none hover:bg-white",L,o?.productCard,{"hover:bg-container-secondary-0 ":M==="dark"}),children:l(K,{className:"desktop:p-6 relative flex flex-1 flex-col justify-between p-4",children:[t("div",{className:"product-image-wrapper lg-desktop:size-[196px] mx-auto size-[138px] cursor-pointer overflow-hidden",children:t("a",{onClick:E,...!d&&{href:U},rel:"noreferrer",children:t(W,{source:e.imageUrl,alt:e.imageAlt,className:"aspect-square size-full object-contain",imgClassName:"w-full h-full object-contain"})})}),t("div",{className:"lg-desktop:h-[28px] mb-1 flex h-[24px] gap-1",children:z&&e.tags?.map((i,g)=>t(V,{size:"sm",variant:i.variant||"outline",className:a(i.variant==="promotional"?"ml-2":""),promotionalType:i.promotionalType,children:i.label},g))}),l("div",{className:"flex h-full flex-1 grow flex-col justify-between",children:[l("div",{className:"mb-4",children:[t(p,{as:"h3",size:2,className:a("text-info-primary laptop:line-clamp-2 mb-2 line-clamp-3 min-h-[2.4em]",o?.productTitle),html:e.custom_name||e.title}),(e?.custom_description||e?.description)&&t(T,{size:2,className:a("text-info-secondary desktop:text-[16px] lg-desktop:text-[18px] line-clamp-1 text-[14px]",o?.productDescription),html:e.custom_description||e.description})]}),l("div",{children:[t("div",{className:a("mb-2",o?.productPrice),children:t("div",{className:a("laptop:gap-1 flex flex-wrap items-baseline gap-[2px]",o?.priceWrapper),children:w?l(Q,{children:[t(p,{size:2,className:"text-info-primary",as:"h6",children:e.currentPrice}),h?h(e,{showOriginalPrice:_}):_&&e.originalPrice&&t(p,{size:2,className:a("text-info-tertiary line-through",o?.originalPrice),as:"h6",children:e.originalPrice})]}):t(p,{size:2,className:"text-info-tertiary",children:D?.outOfStockLabel??"Sold Out"})})}),e?.priceLabel&&w&&t(T,{size:4,className:a("text-marketing-1 desktop:text-[16px] lg-desktop:text-[18px] mt-2 text-[14px]",o?.productPriceLabel),children:e.priceLabel}),l("div",{className:a("lg-desktop:gap-3 laptop:flex-row laptop:flex-nowrap flex flex-col flex-wrap gap-2",o?.buttonGroup),children:[c&&t(N,{variant:"secondary",size:"base",className:a("laptop:flex-1 laptop:min-w-0 laptop:whitespace-normal laptop:text-center w-full min-w-0 whitespace-normal text-center",o?.secondaryButton),onClick:()=>{C(x,"secondary"),u({event:"ga4Event",event_name:"component_click",event_parameters:{page_group:r||"Home Page",component_type:"copy",component_name:"scene_shelf_product",component_title:e.custom_name||e.title,component_description:e.custom_description||"",button_name:c,SKU:e.sku||"",position:s}})},disabled:e.soldOut&&x!=="learnMore",loading:R,children:c}),m&&t(N,{variant:"primary",size:"base",className:a("laptop:flex-1 laptop:min-w-0 laptop:whitespace-normal laptop:text-center w-full min-w-0 whitespace-normal text-center",o?.primaryButton),onClick:()=>{C(b,"primary"),u({event:"ga4Event",event_name:"component_click",event_parameters:{page_group:r||"Home Page",component_type:"copy",component_name:"scene_shelf_product",component_title:e.custom_name||e.title,component_description:e.custom_description||"",button_name:m,SKU:e.sku||"",position:s}})},disabled:e.soldOut&&b!=="learnMore",loading:O,children:m})]})]})]})]})})});B.displayName="SceneShelfV3.ProductCard";var te=B;export{B as ProductCard,te as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Fragment as I,jsx as e,jsxs as i}from"react/jsx-runtime";import{Heading as S,Tabs as q,TabsList as J,TabsTrigger as Q,TabsContent as A,Text as N,Picture as C,Link as X,Button as L,DropdownMenu as Y,DropdownMenuTrigger as Z,DropdownMenuContent as ee,DropdownMenuItem as te,LoadingDots as M,Badge as ae}from"../../components/index.js";import{DownArrow as se}from"../HeaderNavigation/icons/index.js";import{useMemo as u,useState as O}from"react";import{cn as _,atobID as ie,highlightSearchWord as T,replaceTemplate as le}from"../../helpers/utils.js";import{useAiuiContext as j}from"../AiuiProvider/index.js";import{formatVariantPrice as oe}from"../ShelfDisplay/shelfDisplay.js";import{SearchPageTabType as v}from"./types.js";import{getLocalizedPath as B}from"../../helpers/utils.js";const F=({product:t,onSecondaryButton:o,onPrimaryButton:s,searchValue:n,variantData:m,shopNowLoadingProductId:y,badgeVariant:b})=>{const l=u(()=>m||t?.variants?.[0],[t,m]),{locale:g="us",copyWriting:c,currencyCode:x}=j(),f=y===t?.id,D=u(()=>B(`/products/${t?.handle}?variant=${ie(l?.id)}?ref=search_result_${n?.toLowerCase()}`,g),[t?.handle,l?.id,n,g]),P=l?.coupons?.[0],{price:k,basePrice:r}=oe({locale:x==="CAD"?"us":g||"us",amount:P?P.variant_price4wscode:l?.price?.amount??l?.price,baseAmount:P?l?.price?.amount??l?.price:0,currencyCode:t?.price?.currencyCode||"USD"}),z=u(()=>t?.tags?.filter?.(d=>d?.startsWith?.("CLtag"))?.map?.(d=>d?.replace?.("CLtag:",""))?.slice?.(0,2),[t?.tags]);return e("div",{className:"rounded-image-text ipc_search_product_item lg-desktop:h-[480px] desktop:h-[384px] laptop:h-[360px] relative h-auto overflow-hidden",children:t?.type==="advertising"&&t?.advertisingLink?i(X,{href:B(t?.advertisingLink,g),className:"h-full",children:[e(C,{source:`${t?.advertisingBgImg}`,className:"size-full",imgClassName:"size-full object-cover"}),i("div",{className:"desktop:p-6 absolute inset-0 z-[2] p-4 [&_img]:hover:scale-110 [&_img]:hover:transition-all [&_img]:hover:duration-500",children:[e(N,{html:t?.advertisingTitle,className:_("desktop:text-base text-sm font-bold leading-[1.2]",{"text-white":t?.advertisingTheme==="light","text-info-primary":t?.advertisingTheme==="dark"})}),t?.advertisingSubtitle&&e(S,{size:3,html:t?.advertisingSubtitle,className:_("laptop:line-clamp-3 mt-2 line-clamp-4 font-bold",{"text-white":t?.advertisingTheme==="light","text-info-primary":t?.advertisingTheme==="dark"})})]})]}):i("a",{href:D,className:"tablet:hover:bg-info-white desktop:p-6 desktop:pt-4 tablet:p-4 flex h-full flex-col bg-[#EAEAEC] px-2 py-4 no-underline duration-300",children:[e("div",{className:"ipc_search_product_item_image",children:e(C,{className:"lg-desktop:size-[196px] mx-auto size-[138px]",source:l?.image?.url||t?.images?.[0]?.url,alt:t?.title,imgClassName:"object-cover size-full"})}),i("div",{className:"ipc_search_product_item_content desktop:mt-2 lg-desktop:mt-3 desktop:gap-6 mt-1 flex flex-1 flex-col justify-between gap-4",children:[i("div",{className:"flex-1",children:[e("div",{className:"lg-desktop:h-[28px] mb-2 flex h-[24px] gap-2",children:z?.map((d,E)=>e(ae,{size:"lg",variant:b,children:d},E))}),e(N,{className:"lg-desktop:text-2xl tablet:line-clamp-2 line-clamp-3 text-xl font-bold !leading-[1.2]",weight:"bold",html:T(t?.title||"",n||"")}),e(N,{as:"p",className:"lg-desktop:text-[18px] tablet:line-clamp-1 mt-1 line-clamp-2 text-sm font-bold",html:T(t?.description,n||"")})]}),i("div",{children:[e("div",{className:"mb-2 flex items-center",children:l?.availableForSale?i(I,{children:[e("div",{className:"final-price text-info-primary tablet:text-xl lg-desktop:text-2xl text-[18px] font-bold",children:l?.availableForSale&&k||""}),e("div",{className:"origin-price tablet:text-xl lg-desktop:text-2xl text-info-secondary ml-1 text-[18px] font-bold line-through",children:l?.availableForSale&&r||""})]}):e("div",{className:"text-info-primary tablet:text-xl lg-desktop:text-2xl text-[18px] font-bold",children:c?.soldOutText||"Sold Out"})}),i("div",{className:_("ipc_search_product_item_button_group","lg-desktop:gap-3 laptop:flex-row flex flex-col items-center gap-2"),children:[c?.learnMoreText&&e(L,{variant:"secondary",className:"laptop:w-auto w-full",size:"lg",onClick:d=>{d.preventDefault(),d.stopPropagation(),o?.()},children:c?.learnMoreText}),c?.shopNowText&&e(L,{variant:"primary",className:"laptop:w-auto w-full",size:"lg",disabled:!l?.availableForSale,loading:f,onClick:d=>{d.preventDefault(),d.stopPropagation(),s?.()},children:c?.shopNowText})]})]})]})]})})},re=({blog:t,searchValue:o})=>{const{copyWriting:s,locale:n="us"}=j(),m=u(()=>B(`/blogs/${t?.blog?.handle}/${t?.handle.replace("storefront-","")}`,n),[t,n]);return e("div",{className:"ipc_search_blog_item border-b border-[#E4E5E6] py-6",children:i("div",{className:"ipc_search_blog_item_content laptop:flex-row-reverse laptop:gap-8 desktop:gap-16 flex flex-col gap-4",children:[e("div",{className:"rounded-image-text laptop:flex-[440] desktop:flex-[540] desktop:h-[280px] h-[240px] overflow-hidden",children:e(C,{source:t?.image?.url,className:"size-full",imgClassName:"size-full object-cover",alt:t?.title})}),i("div",{className:"laptop:flex-[424] desktop:flex-[704] lg-desktop:flex-[1056] flex flex-col justify-center",children:[e(S,{size:3,html:T(t?.title,o)}),e(N,{html:T(t?.content,o),className:"lg-desktop:text-[18px] desktop:text-[16px] mt-1 line-clamp-2 text-sm font-bold leading-[1.4]"}),e("div",{className:"desktop:mt-6 mt-4",children:e(L,{as:"a",href:m,variant:"secondary",size:"lg",children:s?.learnMoreText||"Learn More"})})]})]})})},ne=({searchValue:t,page:o})=>{const{copyWriting:s,locale:n="us"}=j(),m=u(()=>B(`/${o?.handle}`,n),[o,n]);return i("div",{className:"ipc_search_page_items border-b border-[#E4E5E6] py-6",children:[e(S,{size:3,html:T(o?.name,t)}),e(N,{as:"p",html:T(o?.bodySummary||"",t),className:"lg-desktop:text-[18px] desktop:text-[16px] mt-1 text-sm font-bold leading-[1.4]"}),e(L,{as:"a",href:m,variant:"secondary",size:"lg",className:"desktop:mt-6 mt-4",children:s?.learnMoreText||"Learn More"})]})},R=({url:t,label:o})=>i("div",{className:"flex flex-col items-center justify-center gap-4",children:[e(C,{source:t,className:"h-[180px] w-[240px]",imgClassName:"object-cover"}),e(N,{html:o,className:"desktop:text-[18px] text-sm font-bold leading-[1.4]"})]}),$=({products:t,title:o,buildProps:s,onSecondaryButton:n,onPrimaryButton:m,badgeVariant:y})=>{const{products:b}=s||{};return console.log(b,"buildProducts"),i("div",{className:"ipc_search_recommend_product tablet:pt-[80px] laptop:pt-[96px] desktop:pt-[112px] lg-desktop:pt-[128px] pt-[64px]",children:[e(S,{size:4,weight:"bold",html:o}),e("div",{className:" tablet:grid-cols-3 desktop:grid-cols-4 desktop:gap-4 mt-6 grid grid-cols-2 gap-x-3 gap-y-4",children:t?.map((l,g)=>{const c=b?.find(f=>f.handle===l.handle);if(!c)return null;const x=c?.variants?.find(f=>f.sku===l.sku);return e(F,{product:c,variantData:x,badgeVariant:y,onSecondaryButton:()=>n?.(),onPrimaryButton:()=>m?.()},l.sku+g)})})]})},de=({searchResult:t,searchValue:o,data:s,onSecondaryButton:n,onPrimaryButton:m,onChangeSort:y,loading:b,shopNowLoadingProductId:l,searchResultCount:g,onChangeTab:c,buildProps:x,componentOverrides:f,className:D,...P})=>{const k=f?.badge?.variant,[r,z]=O(s?.tabs?.[0]),[d,E]=O(!1),[V,G]=O({[v.PRODUCTS]:s?.tabs?.find(a=>a.tabType===v.PRODUCTS)?.sortKeys?.[0],[v.BLOGS]:s?.tabs?.find(a=>a.tabType===v.BLOGS)?.sortKeys?.[0],[v.PAGES]:s?.tabs?.find(a=>a.tabType===v.PAGES)?.sortKeys?.[0]}),w=u(()=>t?.products||[],[t]),K=u(()=>t?.blogs||[],[t]),W=u(()=>t?.pages||[],[t]),U=u(()=>Object.values(g||{}).reduce((a,p)=>a+p,0),[g]),H=u(()=>{const a={advertisingBgImg:`${r?.advertisingBgImg?.url}, ${r?.advertisingMobBgImg?.url} 768`,advertisingTitle:r?.advertisingTitle,advertisingSubtitle:r?.advertisingSubtitle,advertisingLink:r?.advertisingLink,advertisingTheme:r?.advertisingTheme,type:"advertising"};if(!!r?.advertisingBgImg?.url||!!r?.advertisingTitle||!!r?.advertisingLink){const h=[...w||[]];return h.length>=8?h.splice(7,0,a):h.length>0&&h.push(a),h}else return w},[r,w]);return i("div",{...P,className:_("ipc_search_page desktop:py-[128px] tablet:px-8 laptop:px-16 desktop:px-16 lg-desktop:px-[calc(50%-832px)] px-4 py-16",D),children:[e(S,{size:4,weight:"bold",html:le(s?.title,{totalCount:U?.toString(),inputValue:`"${o}"`})}),e("div",{className:"mt-6",children:i(q,{className:"ipc_search_page_tabs",defaultValue:"products",children:[i("div",{className:" desktop:flex desktop:items-center desktop:flex-row desktop:gap-6 desktop:justify-between",children:[e(J,{children:s?.tabs?.map(a=>i(Q,{onClick:()=>{z(a);const p=a?.sortKeys?.[0];p&&(G(h=>({...h,[a?.tabType]:p})),y?.(a?.tabType,p)),c?.(a?.tabType)},defaultValue:"products",value:a.tabType,children:[a.label," (",g?.[a.tabType],")"]},a.id))}),i(Y,{onOpenChange:E,children:[e(Z,{asChild:!0,children:i("button",{className:"desktop:mt-0 mt-6 flex items-center text-base font-bold leading-[1.2] focus-visible:!outline-none",children:[r?.sortLabel," ",V?.[r?.tabType]?.label," ",e(se,{className:_("inline-block size-4",{"rotate-180":d})})]})}),e(ee,{align:"start",sideOffset:8,className:"rounded-sidebar-shelf bg-white !px-0 py-2 focus-visible:!outline-none",children:r?.sortKeys?.map(a=>e(te,{className:_("laptop:px-4 laptop:text-base px-3 py-4 text-sm font-bold hover:bg-[#EAEAEC] hover:text-current hover:!outline-none",{"bg-[#EAEAEC]":V?.[r?.tabType]?.value===a.value}),onClick:()=>{y?.(r?.tabType,a),G(p=>({...p,[r?.tabType]:a}))},children:a.label},a.id))})]})]}),i(A,{value:v.PRODUCTS,className:"ipc_search_page_tabs_products_content mt-6",children:[e("div",{className:" tablet:grid-cols-3 desktop:grid-cols-4 desktop:gap-4 grid grid-cols-2 gap-x-3 gap-y-4",children:H?.map((a,p)=>e(F,{searchValue:o,product:a,shopNowLoadingProductId:l,badgeVariant:k,onSecondaryButton:()=>n?.(a),onPrimaryButton:()=>m?.(a)},(a.id||"")+p))}),b?e("div",{className:"mt-6 flex w-full justify-center",children:e(M,{})}):!w?.length&&i(I,{children:[e(R,{url:s?.noResultImage?.url,label:s?.noResultLabel}),e($,{products:s?.recommendProducts||[],buildProps:x,title:s?.recommendProductsTitle,shopNowLoadingProductId:l,badgeVariant:k})]})]}),e(A,{value:v.BLOGS,className:"ipc_search_page_tabs_blogs_content",children:i("div",{children:[K?.map(a=>e(re,{blog:a,searchValue:o},a.id)),b?e("div",{className:"mt-6 flex justify-center",children:e(M,{})}):!K?.length&&i(I,{children:[e(R,{url:s?.noResultImage?.url,label:s?.noResultLabel}),e($,{products:s?.recommendProducts||[],buildProps:x,title:s?.recommendProductsTitle,badgeVariant:k})]})]})}),i(A,{value:v.PAGES,className:"ipc_search_page_tabs_pages_content",children:[e("div",{children:W?.map((a,p)=>e(ne,{page:a,searchValue:o},(a.global_id||a.id)+p))}),b?e("div",{className:"mt-6 flex justify-center",children:e(M,{})}):!W?.length&&i(I,{children:[e(R,{url:s?.noResultImage?.url,label:s?.noResultLabel}),e($,{products:s?.recommendProducts||[],buildProps:x,title:s?.recommendProductsTitle,shopNowLoadingProductId:l,badgeVariant:k})]})]})]})})]})};var fe=de;export{fe as default};
|
|
1
|
+
import{Fragment as I,jsx as e,jsxs as i}from"react/jsx-runtime";import{Heading as S,Tabs as q,TabsList as J,TabsTrigger as Q,TabsContent as A,Text as N,Picture as C,Link as X,Button as L,DropdownMenu as Y,DropdownMenuTrigger as Z,DropdownMenuContent as ee,DropdownMenuItem as te,LoadingDots as M,Badge as ae}from"../../components/index.js";import{DownArrow as se}from"../HeaderNavigation/icons/index.js";import{useMemo as u,useState as O}from"react";import{cn as _,atobID as ie,highlightSearchWord as T,replaceTemplate as le}from"../../helpers/utils.js";import{useAiuiContext as j}from"../AiuiProvider/index.js";import{formatVariantPrice as oe}from"../ShelfDisplay/shelfDisplay.js";import{SearchPageTabType as v}from"./types.js";import{getLocalizedPath as B}from"../../helpers/utils.js";const F=({product:t,onSecondaryButton:o,onPrimaryButton:s,searchValue:n,variantData:m,shopNowLoadingProductId:y,badgeVariant:b})=>{const l=u(()=>m||t?.variants?.[0],[t,m]),{locale:g="us",copyWriting:c,currencyCode:x}=j(),f=y===t?.id,D=u(()=>B(`/products/${t?.handle}`,g,`variant=${ie(l?.id)}&ref=search_result_${n?.toLowerCase()}`),[t?.handle,l?.id,n,g]),P=l?.coupons?.[0],{price:k,basePrice:r}=oe({locale:x==="CAD"?"us":g||"us",amount:P?P.variant_price4wscode:l?.price?.amount??l?.price,baseAmount:P?l?.price?.amount??l?.price:0,currencyCode:t?.price?.currencyCode||"USD"}),z=u(()=>t?.tags?.filter?.(d=>d?.startsWith?.("CLtag"))?.map?.(d=>d?.replace?.("CLtag:",""))?.slice?.(0,2),[t?.tags]);return e("div",{className:"rounded-image-text ipc_search_product_item lg-desktop:h-[480px] desktop:h-[384px] laptop:h-[360px] relative h-auto overflow-hidden",children:t?.type==="advertising"&&t?.advertisingLink?i(X,{href:B(t?.advertisingLink,g),className:"h-full",children:[e(C,{source:`${t?.advertisingBgImg}`,className:"size-full",imgClassName:"size-full object-cover"}),i("div",{className:"desktop:p-6 absolute inset-0 z-[2] p-4 [&_img]:hover:scale-110 [&_img]:hover:transition-all [&_img]:hover:duration-500",children:[e(N,{html:t?.advertisingTitle,className:_("desktop:text-base text-sm font-bold leading-[1.2]",{"text-white":t?.advertisingTheme==="light","text-info-primary":t?.advertisingTheme==="dark"})}),t?.advertisingSubtitle&&e(S,{size:3,html:t?.advertisingSubtitle,className:_("laptop:line-clamp-3 mt-2 line-clamp-4 font-bold",{"text-white":t?.advertisingTheme==="light","text-info-primary":t?.advertisingTheme==="dark"})})]})]}):i("a",{href:D,className:"tablet:hover:bg-info-white desktop:p-6 desktop:pt-4 tablet:p-4 flex h-full flex-col bg-[#EAEAEC] px-2 py-4 no-underline duration-300",children:[e("div",{className:"ipc_search_product_item_image",children:e(C,{className:"lg-desktop:size-[196px] mx-auto size-[138px]",source:l?.image?.url||t?.images?.[0]?.url,alt:t?.title,imgClassName:"object-cover size-full"})}),i("div",{className:"ipc_search_product_item_content desktop:mt-2 lg-desktop:mt-3 desktop:gap-6 mt-1 flex flex-1 flex-col justify-between gap-4",children:[i("div",{className:"flex-1",children:[e("div",{className:"lg-desktop:h-[28px] mb-2 flex h-[24px] gap-2",children:z?.map((d,E)=>e(ae,{size:"lg",variant:b,children:d},E))}),e(N,{className:"lg-desktop:text-2xl tablet:line-clamp-2 line-clamp-3 text-xl font-bold !leading-[1.2]",weight:"bold",html:T(t?.title||"",n||"")}),e(N,{as:"p",className:"lg-desktop:text-[18px] tablet:line-clamp-1 mt-1 line-clamp-2 text-sm font-bold",html:T(t?.description,n||"")})]}),i("div",{children:[e("div",{className:"mb-2 flex items-center",children:l?.availableForSale?i(I,{children:[e("div",{className:"final-price text-info-primary tablet:text-xl lg-desktop:text-2xl text-[18px] font-bold",children:l?.availableForSale&&k||""}),e("div",{className:"origin-price tablet:text-xl lg-desktop:text-2xl text-info-secondary ml-1 text-[18px] font-bold line-through",children:l?.availableForSale&&r||""})]}):e("div",{className:"text-info-primary tablet:text-xl lg-desktop:text-2xl text-[18px] font-bold",children:c?.soldOutText||"Sold Out"})}),i("div",{className:_("ipc_search_product_item_button_group","lg-desktop:gap-3 laptop:flex-row flex flex-col items-center gap-2"),children:[c?.learnMoreText&&e(L,{variant:"secondary",className:"laptop:w-auto w-full",size:"lg",onClick:d=>{d.preventDefault(),d.stopPropagation(),o?.()},children:c?.learnMoreText}),c?.shopNowText&&e(L,{variant:"primary",className:"laptop:w-auto w-full",size:"lg",disabled:!l?.availableForSale,loading:f,onClick:d=>{d.preventDefault(),d.stopPropagation(),s?.()},children:c?.shopNowText})]})]})]})]})})},re=({blog:t,searchValue:o})=>{const{copyWriting:s,locale:n="us"}=j(),m=u(()=>B(`/blogs/${t?.blog?.handle}/${t?.handle.replace("storefront-","")}`,n),[t,n]);return e("div",{className:"ipc_search_blog_item border-b border-[#E4E5E6] py-6",children:i("div",{className:"ipc_search_blog_item_content laptop:flex-row-reverse laptop:gap-8 desktop:gap-16 flex flex-col gap-4",children:[e("div",{className:"rounded-image-text laptop:flex-[440] desktop:flex-[540] desktop:h-[280px] h-[240px] overflow-hidden",children:e(C,{source:t?.image?.url,className:"size-full",imgClassName:"size-full object-cover",alt:t?.title})}),i("div",{className:"laptop:flex-[424] desktop:flex-[704] lg-desktop:flex-[1056] flex flex-col justify-center",children:[e(S,{size:3,html:T(t?.title,o)}),e(N,{html:T(t?.content,o),className:"lg-desktop:text-[18px] desktop:text-[16px] mt-1 line-clamp-2 text-sm font-bold leading-[1.4]"}),e("div",{className:"desktop:mt-6 mt-4",children:e(L,{as:"a",href:m,variant:"secondary",size:"lg",children:s?.learnMoreText||"Learn More"})})]})]})})},ne=({searchValue:t,page:o})=>{const{copyWriting:s,locale:n="us"}=j(),m=u(()=>B(`/${o?.handle}`,n),[o,n]);return i("div",{className:"ipc_search_page_items border-b border-[#E4E5E6] py-6",children:[e(S,{size:3,html:T(o?.name,t)}),e(N,{as:"p",html:T(o?.bodySummary||"",t),className:"lg-desktop:text-[18px] desktop:text-[16px] mt-1 text-sm font-bold leading-[1.4]"}),e(L,{as:"a",href:m,variant:"secondary",size:"lg",className:"desktop:mt-6 mt-4",children:s?.learnMoreText||"Learn More"})]})},R=({url:t,label:o})=>i("div",{className:"flex flex-col items-center justify-center gap-4",children:[e(C,{source:t,className:"h-[180px] w-[240px]",imgClassName:"object-cover"}),e(N,{html:o,className:"desktop:text-[18px] text-sm font-bold leading-[1.4]"})]}),$=({products:t,title:o,buildProps:s,onSecondaryButton:n,onPrimaryButton:m,badgeVariant:y})=>{const{products:b}=s||{};return console.log(b,"buildProducts"),i("div",{className:"ipc_search_recommend_product tablet:pt-[80px] laptop:pt-[96px] desktop:pt-[112px] lg-desktop:pt-[128px] pt-[64px]",children:[e(S,{size:4,weight:"bold",html:o}),e("div",{className:" tablet:grid-cols-3 desktop:grid-cols-4 desktop:gap-4 mt-6 grid grid-cols-2 gap-x-3 gap-y-4",children:t?.map((l,g)=>{const c=b?.find(f=>f.handle===l.handle);if(!c)return null;const x=c?.variants?.find(f=>f.sku===l.sku);return e(F,{product:c,variantData:x,badgeVariant:y,onSecondaryButton:()=>n?.(),onPrimaryButton:()=>m?.()},l.sku+g)})})]})},de=({searchResult:t,searchValue:o,data:s,onSecondaryButton:n,onPrimaryButton:m,onChangeSort:y,loading:b,shopNowLoadingProductId:l,searchResultCount:g,onChangeTab:c,buildProps:x,componentOverrides:f,className:D,...P})=>{const k=f?.badge?.variant,[r,z]=O(s?.tabs?.[0]),[d,E]=O(!1),[V,G]=O({[v.PRODUCTS]:s?.tabs?.find(a=>a.tabType===v.PRODUCTS)?.sortKeys?.[0],[v.BLOGS]:s?.tabs?.find(a=>a.tabType===v.BLOGS)?.sortKeys?.[0],[v.PAGES]:s?.tabs?.find(a=>a.tabType===v.PAGES)?.sortKeys?.[0]}),w=u(()=>t?.products||[],[t]),K=u(()=>t?.blogs||[],[t]),W=u(()=>t?.pages||[],[t]),U=u(()=>Object.values(g||{}).reduce((a,p)=>a+p,0),[g]),H=u(()=>{const a={advertisingBgImg:`${r?.advertisingBgImg?.url}, ${r?.advertisingMobBgImg?.url} 768`,advertisingTitle:r?.advertisingTitle,advertisingSubtitle:r?.advertisingSubtitle,advertisingLink:r?.advertisingLink,advertisingTheme:r?.advertisingTheme,type:"advertising"};if(!!r?.advertisingBgImg?.url||!!r?.advertisingTitle||!!r?.advertisingLink){const h=[...w||[]];return h.length>=8?h.splice(7,0,a):h.length>0&&h.push(a),h}else return w},[r,w]);return i("div",{...P,className:_("ipc_search_page desktop:py-[128px] tablet:px-8 laptop:px-16 desktop:px-16 lg-desktop:px-[calc(50%-832px)] px-4 py-16",D),children:[e(S,{size:4,weight:"bold",html:le(s?.title,{totalCount:U?.toString(),inputValue:`"${o}"`})}),e("div",{className:"mt-6",children:i(q,{className:"ipc_search_page_tabs",defaultValue:"products",children:[i("div",{className:" desktop:flex desktop:items-center desktop:flex-row desktop:gap-6 desktop:justify-between",children:[e(J,{children:s?.tabs?.map(a=>i(Q,{onClick:()=>{z(a);const p=a?.sortKeys?.[0];p&&(G(h=>({...h,[a?.tabType]:p})),y?.(a?.tabType,p)),c?.(a?.tabType)},defaultValue:"products",value:a.tabType,children:[a.label," (",g?.[a.tabType],")"]},a.id))}),i(Y,{onOpenChange:E,children:[e(Z,{asChild:!0,children:i("button",{className:"desktop:mt-0 mt-6 flex items-center text-base font-bold leading-[1.2] focus-visible:!outline-none",children:[r?.sortLabel," ",V?.[r?.tabType]?.label," ",e(se,{className:_("inline-block size-4",{"rotate-180":d})})]})}),e(ee,{align:"start",sideOffset:8,className:"rounded-sidebar-shelf bg-white !px-0 py-2 focus-visible:!outline-none",children:r?.sortKeys?.map(a=>e(te,{className:_("laptop:px-4 laptop:text-base px-3 py-4 text-sm font-bold hover:bg-[#EAEAEC] hover:text-current hover:!outline-none",{"bg-[#EAEAEC]":V?.[r?.tabType]?.value===a.value}),onClick:()=>{y?.(r?.tabType,a),G(p=>({...p,[r?.tabType]:a}))},children:a.label},a.id))})]})]}),i(A,{value:v.PRODUCTS,className:"ipc_search_page_tabs_products_content mt-6",children:[e("div",{className:" tablet:grid-cols-3 desktop:grid-cols-4 desktop:gap-4 grid grid-cols-2 gap-x-3 gap-y-4",children:H?.map((a,p)=>e(F,{searchValue:o,product:a,shopNowLoadingProductId:l,badgeVariant:k,onSecondaryButton:()=>n?.(a),onPrimaryButton:()=>m?.(a)},(a.id||"")+p))}),b?e("div",{className:"mt-6 flex w-full justify-center",children:e(M,{})}):!w?.length&&i(I,{children:[e(R,{url:s?.noResultImage?.url,label:s?.noResultLabel}),e($,{products:s?.recommendProducts||[],buildProps:x,title:s?.recommendProductsTitle,shopNowLoadingProductId:l,badgeVariant:k})]})]}),e(A,{value:v.BLOGS,className:"ipc_search_page_tabs_blogs_content",children:i("div",{children:[K?.map(a=>e(re,{blog:a,searchValue:o},a.id)),b?e("div",{className:"mt-6 flex justify-center",children:e(M,{})}):!K?.length&&i(I,{children:[e(R,{url:s?.noResultImage?.url,label:s?.noResultLabel}),e($,{products:s?.recommendProducts||[],buildProps:x,title:s?.recommendProductsTitle,badgeVariant:k})]})]})}),i(A,{value:v.PAGES,className:"ipc_search_page_tabs_pages_content",children:[e("div",{children:W?.map((a,p)=>e(ne,{page:a,searchValue:o},(a.global_id||a.id)+p))}),b?e("div",{className:"mt-6 flex justify-center",children:e(M,{})}):!W?.length&&i(I,{children:[e(R,{url:s?.noResultImage?.url,label:s?.noResultLabel}),e($,{products:s?.recommendProducts||[],buildProps:x,title:s?.recommendProductsTitle,shopNowLoadingProductId:l,badgeVariant:k})]})]})]})})]})};var fe=de;export{fe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Fragment as Ae,jsx as s,jsxs as f}from"react/jsx-runtime";import{useAiuiContext as Ne}from"../AiuiProvider/index.js";import{formatVariantPrice as Ce}from"./shelfDisplay.js";import _e from"../../components/picture.js";import Se from"../../components/badge.js";import{cn as w}from"../../helpers/utils.js";import{Text as Te}from"../../components/text.js";import fe from"../../components/button.js";import{gaTrack as Be}from"../../shared/track.js";import{trackUrlRef as Pe}from"../../shared/trackUrlRef.js";import{Heading as Le}from"../../components/heading.js";import{useExposure as $e}from"../../hooks/useExposure.js";import{useRef as De,useEffect as Ie,useMemo as ye,useState as j}from"react";const ge="image",he="product_shelf",xe=999999999e-2,ze=e=>{const t=e?.sku,_=e?.variants,E=_?.find(O=>O?.sku===t),K=E?.image?.url||_?.[0]?.image?.url||"",re=E?.image?.altText||_?.[0]?.image?.altText||e?.custom_name||e?.title||"";return{imageUrl:K,altText:re}},Fe=({items:e})=>e?.length?s("div",{className:"shelf-display-social-endorsements desktop:gap-2 absolute right-0 top-0 z-10 flex flex-col items-center gap-1",children:e.map((t,_)=>typeof t.icon=="string"?s("img",{src:t.icon,alt:t.label||"",loading:"lazy",className:"desktop:size-10 lg-desktop:size-12 size-8 object-contain"},_):s(Te,{"aria-label":t.label,className:"desktop:size-10 lg-desktop:size-12 size-8 [&_img]:size-full [&_svg]:size-full",children:t.icon},_))}):null,Ke=({data:e,configuration:t})=>{const{isDisplayBackImage:_=!1,itemShape:E,metafields:K,isTopTag:re=!1,isShowTag:O,isShowOriginalPrice:$,isShowShortTitle:ve=!1,isShowPricesTag:D=!1,pricesTagTextColor:W,pricesTagBgColor:H,itemsTagTextColor:v,itemsTagBgColor:Q,formatPrice:ie,renderOriginalPrice:X,renderPriceLabel:be,renderPrice:U}=t||{},{locale:T="es",copyWriting:oe,currencyDisplay:Y}=Ne(),{discounts:Z,discountsCopy:le}=K||{},ne=De(null),[n,ae]=j([]),[ce,I]=j(""),[pe,z]=j(!1),[b,R]=j(!1),me=(i,p,m,d)=>{const{primaryFun:x,onAddCart:S,onBuyNow:te,onLearnMore:se,event:we}=t||{};if(x){if(x==="AddCart"&&S)return S(i,p+1,m,d);if(x==="BuyNow"&&te)return te(i,p+1,m,d);if(x==="LearnMore"&&se)return se(i,p+1,m,d)}we?.primaryButton?.(i,p+1,m,d)},ke=(i,p,m,d)=>{const{secondaryFun:x,onAddCart:S,onBuyNow:te,onLearnMore:se,event:we}=t||{};if(x){if(x==="AddCart"&&S)return S(i,p+1,m,d);if(x==="BuyNow"&&te)return te(i,p+1,m,d);if(x==="LearnMore"&&se)return se(i,p+1,m,d)}we?.secondaryButton?.(i,p+1,m,d)},o=ye(()=>{const i=e?.variants||[];if(i.length)return e?.sku?i?.find?.(p=>p?.sku===e?.sku)||i[0]:i?.[0]},[e?.sku,e?.variants]),A=o?.id?.split?.("/")||[],N=A?.[A?.length-1],y=!o?.availableForSale||o?.price?.amount===xe||o?.price===xe,k=o?.coupons?.[0],de=e?.price?.currencyCode||"USD",q=ye(()=>Ce({locale:T,amount:k?k?.variant_price4wscode:o?.price,baseAmount:k?o?.price:0,currencyCode:de,currencyDisplay:Y,customFormatPrice:ie}),[de,T,k,Y,o,ie]),{price:F,basePrice:C,discount:B,discountAmount:M}=q,{imageUrl:V,altText:ue}=ze(e),G=e?.custom_name||e?.title,P=ve&&o?.metafields?.infos?.page_short_title||G,ee=e?.custom_description||e?.description,r=()=>{if(k?.value_type==="fixed_amount"){const i=M||"",p=i.match(/^(.*?)(\d[\d.,]*)(.*)$/);if(p){const[,m,d,x]=p;let S=d;return d.endsWith(".00")?S=d.replace(/\.00$/,""):d.endsWith(",00")&&(S=d.replace(/,00$/,"")),`${m}${S}${x}`}return i}return B||""};Ie(()=>{let i=[];if(B||M){const m=`${r()} ${Z?.off||le?.off||""}`;I(m)}const p=e?.tags?.filter?.(m=>m?.startsWith?.("CLtag"))?.map?.(m=>m?.replace?.("CLtag:",""))?.slice?.(0,B&&D?1:2)||[];ae(i.concat(p))},[e?.tags,B,M,D,Z?.off,le?.off]),$e(ne,{componentType:ge,componentName:he,componentTitle:G,componentDescription:ee,position:t?.index+1});const l=async()=>{if(!pe&&!e?.custom_primary_link){z(!0);try{await me(e,t?.index,t,k)}finally{z(!1)}}},a=async()=>{if(!b&&!e?.custom_secondary_link){R(!0);try{await ke(e,t?.index,t,k)}finally{R(!1)}}},c=()=>f("div",{className:"shelf-display-product-content desktop:gap-6 lg-desktop:flex-[221] desktop:flex-[190] flex flex-[178] flex-col justify-between gap-4",children:[f("div",{className:"shelf-display-product-content-title-desc",children:[P?s(Le,{as:"h3",title:P||"",size:2,className:"shelf-display-product-title text-info-primary mb-1 line-clamp-2",html:P||""}):null,s(Te,{size:2,className:w("lg-desktop:text-lg desktop:text-base shelf-display-product-description text-info-primary line-clamp-2 text-sm !leading-[1.4]"),html:ee||""})]}),f("div",{className:"shelf-display-product-content-price-button",children:[s("div",{className:"mb-2 flex items-center",children:U?U(e,{price:F,basePrice:C,discount:B,discountAmount:M,variant:o,coupon:k,isSoldOut:y,isShowOriginalPrice:$}):y?s("div",{className:"lg-desktop:text-2xl text-info-primary text-xl font-bold",children:oe?.soldOutText}):f(Ae,{children:[s("div",{className:"final-price lg-desktop:text-2xl text-info-primary text-xl font-bold !leading-[1.2]",children:o?.availableForSale&&F||""}),X?X(e,{price:F,basePrice:C,discount:B,discountAmount:M,isShowOriginalPrice:$}):C&&$&&s("div",{className:"origin-price lg-desktop:text-2xl text-info-quaternary ml-1 text-xl font-bold !leading-[1.2] line-through",children:o?.availableForSale&&C||""})]})}),!U&&be?.(e,o,{isShowOriginalPrice:$}),f("div",{className:w("shelf-flex-button-group","lg-desktop:gap-3 flex items-center gap-2",t.direction==="vertical"?"flex-col":""),children:[t?.secondaryButton&&!y?s(fe,{disabled:y&&t?.secondaryFun!=="LearnMore",variant:"secondary",href:e?.custom_secondary_link,as:e?.custom_secondary_link?"a":"button",onClick:a,loading:b,className:t.direction==="vertical"?"w-full":"",children:t?.secondaryButton||""}):null,t?.primaryButton?s(fe,{disabled:y&&t?.primaryFun!=="LearnMore",variant:"primary",href:e?.custom_primary_link,as:e?.custom_primary_link?"a":"button",onClick:l,loading:pe,className:t.direction==="vertical"?"w-full":"",children:t?.primaryButton||""}):null]})]})]}),u={...W?{color:W}:{},...H?{backgroundColor:H,backgroundImage:"none"}:{},...W||H?{outline:"none"}:{}},g={...v?{color:v}:{},...Q?{backgroundColor:Q,backgroundImage:"none"}:{},...v||Q?{outlineColor:v}:{}},L=()=>f("div",{className:"lg-desktop:min-h-[28px] lg-desktop:flex-[28] box-border flex min-h-6 flex-[24] flex-wrap gap-1 overflow-hidden",children:[D&&ce&&s(Se,{className:"shelf-prices-tag",variant:"fill",style:u,children:ce||""}),O&&n?.length>0&&n?.map?.((i,p)=>s(Se,{className:"shelf-items-tag",variant:"outline",style:g,children:i},p))]}),h=e?.custom_bg_image,J=e?.custom_theme;return s("div",{ref:ne,className:w("box-border w-full cursor-pointer overflow-hidden duration-300","rounded-box","lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[545] desktop:aspect-w-[316] desktop:aspect-h-[450]","laptop:aspect-w-[288] laptop:aspect-h-[422] aspect-w-[296] aspect-h-[422] relative","md-tablet:h-[422px] shelf-display-item",h?"bg-cover bg-center bg-no-repeat":"bg-background tablet:hover:bg-info-white",{"aiui-dark":J==="dark","aiui-light":J==="light"}),style:h?{backgroundImage:`url(${h})`}:void 0,children:_?s("div",{className:"absolute inset-0 box-border overflow-hidden",children:f("div",{className:"relative inset-0 size-full",children:[s(L,{}),s(_e,{source:V,alt:ue,className:w("flex h-full justify-center object-cover [&_img]:w-auto",{"opacity-0":h})}),s("div",{className:"desktop:p-6 absolute inset-x-0 bottom-0 box-border overflow-hidden p-4",children:c()})]})}):f("div",{className:"desktop:p-6 desktop:pt-4 desktop:gap-2 absolute inset-0 box-border flex flex-col justify-between gap-1 overflow-hidden p-4",children:[s(L,{}),f("div",{className:w("shelf-display-item-image lg-desktop:flex-[240] relative inline-block w-full flex-[180] overflow-hidden",{"opacity-0":h}),children:[s("a",{"aria-label":G,target:t?.target,href:Pe(`${T==="us"||!T?"":`/${T}`}/products/${e?.handle}?variant=${N}`,`${ge}_${he}`),onClick:()=>{Be({event:"ga4Event",event_name:"select_item",event_parameters:{page_group:"Home Page",item_list_name:"Home_Page_Bundle",items:[{item_id:e?.sku||o?.sku,item_name:e?.name,item_variant:o?.name,price:o?.price,index:t?.index+1}]}})},children:s(_e,{source:V,alt:ue,className:"flex h-full justify-center object-cover [&_img]:w-auto"})}),s(Fe,{items:e?.socialEndorsements})]}),c()]})},e?.id||e?.handle)},Qe=({data:e,configuration:t})=>{const{itemShape:_,itemLength:E,metafields:K,isShowShortTitle:re,formatPrice:O,renderOriginalPrice:$,renderPriceLabel:ve,renderPrice:D}=t||{},{discounts:W,discountsCopy:H}=K||{},{locale:v="us",copyWriting:Q,currencyDisplay:ie}=Ne(),[X,be]=j([]),U=De(null),[T,oe]=j(!1),[Y,Z]=j(!1),le=(r,l,a,c)=>{const{primaryFun:u,onAddCart:g,onBuyNow:L,onLearnMore:h,event:J}=t||{};if(u){if(u==="AddCart"&&g)return g(r,l+1,a,c);if(u==="BuyNow"&&L)return L(r,l+1,a,c);if(u==="LearnMore"&&h)return h(r,l+1,a,c)}J?.primaryButton?.(r,l+1,a,c)},ne=(r,l,a,c)=>{const{secondaryFun:u,onAddCart:g,onBuyNow:L,onLearnMore:h,event:J}=t||{};if(u){if(u==="AddCart"&&g)return g(r,l+1,a,c);if(u==="BuyNow"&&L)return L(r,l+1,a,c);if(u==="LearnMore"&&h)return h(r,l+1,a,c)}J?.secondaryButton?.(r,l+1,a,c)},n=ye(()=>{const r=e?.variants||[];if(r.length)return e?.sku&&r.find(l=>l?.sku===e?.sku)||r[0]},[e?.sku,e?.variants]),ae=n?.id?.split?.("/")||[],ce=ae?.[ae?.length-1],I=!n?.availableForSale||n?.price?.amount===xe||n?.price===xe,pe=t?.isShowTag,z=t?.isShowOriginalPrice,b=n?.coupons?.[0],R=!!(z&&b),me=e?.price?.currencyCode||"USD",ke=ye(()=>Ce({locale:v,amount:R?b?.variant_price4wscode:n?.price,baseAmount:R?n?.price:0,currencyCode:me,currencyDisplay:ie,customFormatPrice:O}),[me,v,R,b?.variant_price4wscode,n,O]),{price:o,basePrice:A,discount:N,discountAmount:y}=ke,{imageUrl:k,altText:de}=ze(e),q=e?.custom_name||e?.title,F=re&&n?.metafields?.infos?.page_short_title||q,C=e?.custom_description||e?.description;$e(U,{componentType:ge,componentName:he,componentTitle:q,componentDescription:C,position:t?.index+1});const B=async()=>{if(!T&&!e?.custom_primary_link){oe(!0);try{await le(e,t?.index,t,b)}finally{oe(!1)}}},M=async()=>{if(!Y&&!e?.custom_secondary_link){Z(!0);try{await ne(e,t?.index,t,b)}finally{Z(!1)}}},V=()=>E>=2?{boxItem:"lg-desktop:max-w-[401px] desktop:max-w-[292px] max-w-full",imgItem:"m-tablet:m-auto lg-desktop:max-w-[330px] lg-desktop:max-h-[330px] desktop:max-w-[260px] desktop:max-h-[260px] max-w-[138px] max-h-[138px]",wrap:"lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480] desktop:aspect-w-[648] desktop:aspect-h-[380] laptop:aspect-w-[440] laptop:aspect-h-[356] tablet:aspect-w-[346] tablet:aspect-h-[360] md-tablet:w-full"}:{boxItem:"lg-desktop:max-w-[401px] desktop:max-w-[292px] laptop:max-w-[289px] max-w-[262px]",imgItem:"md-tablet:m-auto lg-desktop:max-w-[450px] lg-desktop:max-h-[450px] desktop:max-w-[332px] desktop:max-h-[332px] max-w-[312px] max-h-[312px]",wrap:"lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[480] desktop:aspect-w-[1312] desktop:aspect-h-[380] laptop:aspect-w-[896] laptop:aspect-h-[356] tablet:aspect-w-[704] tablet:aspect-h-[360] md-tablet:w-full"},ue=()=>E>=2?"flex flex-col justify-between desktop:gap-12 desktop:flex-row desktop:justify-center desktop:items-center":"flex justify-center items-center gap-6 md-tablet:flex-col",G=()=>{if(b?.value_type==="fixed_amount"){const r=y||"",l=r.match(/^(.*?)(\d[\d.,]*)(.*)$/);if(l){const[,a,c,u]=l;let g=c;return c.endsWith(".00")?g=c.replace(/\.00$/,""):c.endsWith(",00")&&(g=c.replace(/,00$/,"")),`${a}${g}${u}`}return r}return N||""};Ie(()=>{let r=[];if(N||y){const a=`${G()} ${W?.off||H?.off||""}`;r.push(a)}const l=e?.tags?.filter?.(a=>a?.startsWith?.("CLtag"))?.map?.(a=>a?.replace?.("CLtag:",""))?.slice?.(0,N?1:2)||[];be(r.concat(l))},[e?.tags,N,y,W?.off,H?.off]);const P=e?.custom_bg_image,ee=e?.custom_theme;return s("div",{ref:U,className:w(V().wrap,"rounded-box","shelf-display-item","duration-300","md-tablet:h-[360px] relative box-border w-full cursor-pointer overflow-hidden",P?"bg-cover bg-center bg-no-repeat":"bg-container-secondary-1 tablet:hover:bg-info-white",{"aiui-dark":ee==="dark","aiui-light":ee==="light"}),style:P?{backgroundImage:`url(${P})`}:void 0,children:f("div",{className:w(ue(),"desktop:p-6 absolute inset-0 box-border overflow-hidden p-4"),children:[s("div",{className:w(V().imgItem,"desktop:mb-0 relative mb-1 overflow-hidden",{"opacity-0":P}),children:s("a",{"aria-label":q,target:t?.target,href:Pe(`${v==="us"||!v?"":`/${v}`}/products/${e?.handle}?variant=${ce}`,`${ge}_${he}`),onClick:()=>{Be({event:"ga4Event",event_name:"select_item",event_parameters:{page_group:"Home Page",item_list_name:"Home_Page_Bundle",items:[{item_id:e?.sku||n?.sku,item_name:e?.name,item_variant:n?.name,price:n?.price,index:t?.index+1}]}})},children:s(_e,{source:k,alt:de,className:"flex h-full justify-center object-cover [&_img]:w-auto"})})}),f("div",{className:w("flex flex-col items-start justify-center",V().boxItem),children:[pe&&s("div",{className:"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden",children:X?.length>0&&X?.map?.((r,l)=>s(Se,{className:"shelf-items-tag",variant:"fill",children:r},l))}),F?s(Le,{as:"h3",title:F||"",size:2,className:"shelf-display-product-title lg-desktop:h-[58px] text-info-primary mb-1 line-clamp-2 h-[48px]",html:F||""}):null,C?s(Te,{size:2,className:"lg-desktop:text-lg lg-desktop:h-[26px] desktop:text-base desktop:h-6 shelf-display-product-description text-info-primary line-clamp-1 h-5 text-sm",html:C||""}):null,s("div",{className:"mb-2 mt-5 flex items-center",children:D?D(e,{price:o,basePrice:A,discount:N,discountAmount:y,variant:n,coupon:b,isSoldOut:I,isShowOriginalPrice:z}):I?s("div",{className:"lg-desktop:text-2xl text-info-primary text-xl font-bold",children:Q?.soldOutText}):f(Ae,{children:[s("div",{className:"final-price tablet:text-xl text-info-primary text-xl font-bold",children:n?.availableForSale&&o||""}),$?$(e,{price:o,basePrice:A,discount:N,discountAmount:y,isShowOriginalPrice:z}):A&&s("div",{className:"origin-price tablet:text-xl text-info-quaternary ml-1 text-lg font-bold line-through",children:n?.availableForSale&&A||""})]})}),!D&&ve?.(e,n,{isShowOriginalPrice:z}),f("div",{className:w("shelf-flex-button-group","lg-desktop:gap-3 flex items-center gap-2",t.direction==="vertical"?"flex-col":""),children:[t?.secondaryButton&&!I?s(fe,{disabled:I&&t?.secondaryFun!=="LearnMore",variant:"secondary",href:e?.custom_secondary_link,as:e?.custom_secondary_link?"a":"button",onClick:M,loading:Y,className:t.direction==="vertical"?"w-full":"",children:t?.secondaryButton||""}):null,t?.primaryButton?s(fe,{disabled:I&&t?.primaryFun!=="LearnMore",variant:"primary",href:e?.custom_primary_link,as:e?.custom_primary_link?"a":"button",onClick:B,loading:T,className:t.direction==="vertical"?"w-full":"",children:t?.primaryButton||""}):null]})]})]})},e?.id||e?.handle)};export{Qe as ShelfDisplayHorizontalItem,Ke as ShelfDisplayWrapItem,ze as getProductImage};
|
|
1
|
+
import{Fragment as Ae,jsx as s,jsxs as f}from"react/jsx-runtime";import{useAiuiContext as Ne}from"../AiuiProvider/index.js";import{formatVariantPrice as Ce}from"./shelfDisplay.js";import _e from"../../components/picture.js";import Se from"../../components/badge.js";import{cn as w}from"../../helpers/utils.js";import{Text as Te}from"../../components/text.js";import fe from"../../components/button.js";import{gaTrack as Be}from"../../shared/track.js";import{trackUrlRef as Pe}from"../../shared/trackUrlRef.js";import{Heading as Le}from"../../components/heading.js";import{useExposure as $e}from"../../hooks/useExposure.js";import{useRef as De,useEffect as Ie,useMemo as ye,useState as j}from"react";const ge="image",he="product_shelf",xe=999999999e-2,ze=e=>{const t=e?.sku,_=e?.variants,E=_?.find(O=>O?.sku===t),K=E?.image?.url||_?.[0]?.image?.url||"",re=E?.image?.altText||_?.[0]?.image?.altText||e?.custom_name||e?.title||"";return{imageUrl:K,altText:re}},Fe=({items:e})=>e?.length?s("div",{className:"shelf-display-social-endorsements desktop:gap-2 absolute right-0 top-0 z-10 flex flex-col items-center gap-1",children:e.map((t,_)=>typeof t.icon=="string"?s("img",{src:t.icon,alt:t.label||"",loading:"lazy",className:"desktop:size-10 lg-desktop:size-12 size-8 object-contain"},_):s(Te,{"aria-label":t.label,className:"desktop:size-10 lg-desktop:size-12 size-8 [&_img]:size-full [&_svg]:size-full",children:t.icon},_))}):null,Ke=({data:e,configuration:t})=>{const{isDisplayBackImage:_=!1,itemShape:E,metafields:K,isTopTag:re=!1,isShowTag:O,isShowOriginalPrice:$,isShowShortTitle:ve=!1,isShowPricesTag:D=!1,pricesTagTextColor:W,pricesTagBgColor:H,itemsTagTextColor:v,itemsTagBgColor:Q,formatPrice:ie,renderOriginalPrice:X,renderPriceLabel:be,renderPrice:U}=t||{},{locale:T="es",copyWriting:oe,currencyDisplay:Y}=Ne(),{discounts:Z,discountsCopy:le}=K||{},ne=De(null),[n,ae]=j([]),[ce,I]=j(""),[pe,z]=j(!1),[b,R]=j(!1),me=(i,p,m,d)=>{const{primaryFun:x,onAddCart:S,onBuyNow:te,onLearnMore:se,event:we}=t||{};if(x){if(x==="AddCart"&&S)return S(i,p+1,m,d);if(x==="BuyNow"&&te)return te(i,p+1,m,d);if(x==="LearnMore"&&se)return se(i,p+1,m,d)}we?.primaryButton?.(i,p+1,m,d)},ke=(i,p,m,d)=>{const{secondaryFun:x,onAddCart:S,onBuyNow:te,onLearnMore:se,event:we}=t||{};if(x){if(x==="AddCart"&&S)return S(i,p+1,m,d);if(x==="BuyNow"&&te)return te(i,p+1,m,d);if(x==="LearnMore"&&se)return se(i,p+1,m,d)}we?.secondaryButton?.(i,p+1,m,d)},o=ye(()=>{const i=e?.variants||[];if(i.length)return e?.sku?i?.find?.(p=>p?.sku===e?.sku)||i[0]:i?.[0]},[e?.sku,e?.variants]),A=o?.id?.split?.("/")||[],N=A?.[A?.length-1],y=!o?.availableForSale||o?.price?.amount===xe||o?.price===xe,k=o?.coupons?.[0],de=e?.price?.currencyCode||"USD",q=ye(()=>Ce({locale:T,amount:k?k?.variant_price4wscode:o?.price,baseAmount:k?o?.price:0,currencyCode:de,currencyDisplay:Y,customFormatPrice:ie}),[de,T,k,Y,o,ie]),{price:F,basePrice:C,discount:B,discountAmount:M}=q,{imageUrl:V,altText:ue}=ze(e),G=e?.custom_name||e?.title,P=ve&&o?.metafields?.infos?.page_short_title||G,ee=e?.custom_description||e?.description,r=()=>{if(k?.value_type==="fixed_amount"){const i=M||"",p=i.match(/^(.*?)(\d[\d.,]*)(.*)$/);if(p){const[,m,d,x]=p;let S=d;return d.endsWith(".00")?S=d.replace(/\.00$/,""):d.endsWith(",00")&&(S=d.replace(/,00$/,"")),`${m}${S}${x}`}return i}return B||""};Ie(()=>{let i=[];if(B||M){const m=`${r()} ${Z?.off||le?.off||""}`;I(m)}const p=e?.tags?.filter?.(m=>m?.startsWith?.("CLtag"))?.map?.(m=>m?.replace?.("CLtag:",""))?.slice?.(0,B&&D?1:2)||[];ae(i.concat(p))},[e?.tags,B,M,D,Z?.off,le?.off]),$e(ne,{componentType:ge,componentName:he,componentTitle:G,componentDescription:ee,position:t?.index+1});const l=async()=>{if(!pe&&!e?.custom_primary_link){z(!0);try{await me(e,t?.index,t,k)}finally{z(!1)}}},a=async()=>{if(!b&&!e?.custom_secondary_link){R(!0);try{await ke(e,t?.index,t,k)}finally{R(!1)}}},c=()=>f("div",{className:"shelf-display-product-content desktop:gap-6 lg-desktop:flex-[221] desktop:flex-[190] flex flex-[178] flex-col justify-between gap-4",children:[f("div",{className:"shelf-display-product-content-title-desc",children:[P?s(Le,{as:"h3",title:P||"",size:2,className:"shelf-display-product-title text-info-primary mb-1 line-clamp-2",html:P||""}):null,s(Te,{size:2,className:w("lg-desktop:text-lg desktop:text-base shelf-display-product-description text-info-primary line-clamp-2 text-sm !leading-[1.4]"),html:ee||""})]}),f("div",{className:"shelf-display-product-content-price-button",children:[s("div",{className:"mb-2 flex flex-wrap items-center",children:U?U(e,{price:F,basePrice:C,discount:B,discountAmount:M,variant:o,coupon:k,isSoldOut:y,isShowOriginalPrice:$}):y?s("div",{className:"lg-desktop:text-2xl text-info-primary text-xl font-bold",children:oe?.soldOutText}):f(Ae,{children:[s("div",{className:"final-price lg-desktop:text-2xl text-info-primary whitespace-nowrap text-xl font-bold !leading-[1.2]",children:o?.availableForSale&&F||""}),X?X(e,{price:F,basePrice:C,discount:B,discountAmount:M,isShowOriginalPrice:$}):C&&$&&s("div",{className:"origin-price lg-desktop:text-2xl text-info-quaternary ml-1 whitespace-nowrap text-xl font-bold !leading-[1.2] line-through",children:o?.availableForSale&&C||""})]})}),!U&&be?.(e,o,{isShowOriginalPrice:$}),f("div",{className:w("shelf-flex-button-group","lg-desktop:gap-3 flex items-center gap-2",t.direction==="vertical"?"flex-col":""),children:[t?.secondaryButton&&!y?s(fe,{disabled:y&&t?.secondaryFun!=="LearnMore",variant:"secondary",href:e?.custom_secondary_link,as:e?.custom_secondary_link?"a":"button",onClick:a,loading:b,className:t.direction==="vertical"?"w-full":"",children:t?.secondaryButton||""}):null,t?.primaryButton?s(fe,{disabled:y&&t?.primaryFun!=="LearnMore",variant:"primary",href:e?.custom_primary_link,as:e?.custom_primary_link?"a":"button",onClick:l,loading:pe,className:t.direction==="vertical"?"w-full":"",children:t?.primaryButton||""}):null]})]})]}),u={...W?{color:W}:{},...H?{backgroundColor:H,backgroundImage:"none"}:{},...W||H?{outline:"none"}:{}},g={...v?{color:v}:{},...Q?{backgroundColor:Q,backgroundImage:"none"}:{},...v||Q?{outlineColor:v}:{}},L=()=>f("div",{className:"lg-desktop:min-h-[28px] lg-desktop:flex-[28] box-border flex min-h-6 flex-[24] flex-wrap gap-1 overflow-hidden",children:[D&&ce&&s(Se,{className:"shelf-prices-tag",variant:"fill",style:u,children:ce||""}),O&&n?.length>0&&n?.map?.((i,p)=>s(Se,{className:"shelf-items-tag",variant:"outline",style:g,children:i},p))]}),h=e?.custom_bg_image,J=e?.custom_theme;return s("div",{ref:ne,className:w("box-border w-full cursor-pointer overflow-hidden duration-300","rounded-box","lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[545] desktop:aspect-w-[316] desktop:aspect-h-[450]","laptop:aspect-w-[288] laptop:aspect-h-[422] aspect-w-[296] aspect-h-[422] relative","md-tablet:h-[422px] shelf-display-item",h?"bg-cover bg-center bg-no-repeat":"bg-background tablet:hover:bg-info-white",{"aiui-dark":J==="dark","aiui-light":J==="light"}),style:h?{backgroundImage:`url(${h})`}:void 0,children:_?s("div",{className:"absolute inset-0 box-border overflow-hidden",children:f("div",{className:"relative inset-0 size-full",children:[s(L,{}),s(_e,{source:V,alt:ue,className:w("flex h-full justify-center object-cover [&_img]:w-auto",{"opacity-0":h})}),s("div",{className:"desktop:p-6 absolute inset-x-0 bottom-0 box-border overflow-hidden p-4",children:c()})]})}):f("div",{className:"desktop:p-6 desktop:pt-4 desktop:gap-2 absolute inset-0 box-border flex flex-col justify-between gap-1 overflow-hidden p-4",children:[s(L,{}),f("div",{className:w("shelf-display-item-image lg-desktop:flex-[240] relative inline-block w-full flex-[180] overflow-hidden",{"opacity-0":h}),children:[s("a",{"aria-label":G,target:t?.target,href:Pe(`${T==="us"||!T?"":`/${T}`}/products/${e?.handle}?variant=${N}`,`${ge}_${he}`),onClick:()=>{Be({event:"ga4Event",event_name:"select_item",event_parameters:{page_group:"Home Page",item_list_name:"Home_Page_Bundle",items:[{item_id:e?.sku||o?.sku,item_name:e?.name,item_variant:o?.name,price:o?.price,index:t?.index+1}]}})},children:s(_e,{source:V,alt:ue,className:"flex h-full justify-center object-cover [&_img]:w-auto"})}),s(Fe,{items:e?.socialEndorsements})]}),c()]})},e?.id||e?.handle)},Qe=({data:e,configuration:t})=>{const{itemShape:_,itemLength:E,metafields:K,isShowShortTitle:re,formatPrice:O,renderOriginalPrice:$,renderPriceLabel:ve,renderPrice:D}=t||{},{discounts:W,discountsCopy:H}=K||{},{locale:v="us",copyWriting:Q,currencyDisplay:ie}=Ne(),[X,be]=j([]),U=De(null),[T,oe]=j(!1),[Y,Z]=j(!1),le=(r,l,a,c)=>{const{primaryFun:u,onAddCart:g,onBuyNow:L,onLearnMore:h,event:J}=t||{};if(u){if(u==="AddCart"&&g)return g(r,l+1,a,c);if(u==="BuyNow"&&L)return L(r,l+1,a,c);if(u==="LearnMore"&&h)return h(r,l+1,a,c)}J?.primaryButton?.(r,l+1,a,c)},ne=(r,l,a,c)=>{const{secondaryFun:u,onAddCart:g,onBuyNow:L,onLearnMore:h,event:J}=t||{};if(u){if(u==="AddCart"&&g)return g(r,l+1,a,c);if(u==="BuyNow"&&L)return L(r,l+1,a,c);if(u==="LearnMore"&&h)return h(r,l+1,a,c)}J?.secondaryButton?.(r,l+1,a,c)},n=ye(()=>{const r=e?.variants||[];if(r.length)return e?.sku&&r.find(l=>l?.sku===e?.sku)||r[0]},[e?.sku,e?.variants]),ae=n?.id?.split?.("/")||[],ce=ae?.[ae?.length-1],I=!n?.availableForSale||n?.price?.amount===xe||n?.price===xe,pe=t?.isShowTag,z=t?.isShowOriginalPrice,b=n?.coupons?.[0],R=!!(z&&b),me=e?.price?.currencyCode||"USD",ke=ye(()=>Ce({locale:v,amount:R?b?.variant_price4wscode:n?.price,baseAmount:R?n?.price:0,currencyCode:me,currencyDisplay:ie,customFormatPrice:O}),[me,v,R,b?.variant_price4wscode,n,O]),{price:o,basePrice:A,discount:N,discountAmount:y}=ke,{imageUrl:k,altText:de}=ze(e),q=e?.custom_name||e?.title,F=re&&n?.metafields?.infos?.page_short_title||q,C=e?.custom_description||e?.description;$e(U,{componentType:ge,componentName:he,componentTitle:q,componentDescription:C,position:t?.index+1});const B=async()=>{if(!T&&!e?.custom_primary_link){oe(!0);try{await le(e,t?.index,t,b)}finally{oe(!1)}}},M=async()=>{if(!Y&&!e?.custom_secondary_link){Z(!0);try{await ne(e,t?.index,t,b)}finally{Z(!1)}}},V=()=>E>=2?{boxItem:"lg-desktop:max-w-[401px] desktop:max-w-[292px] max-w-full",imgItem:"m-tablet:m-auto lg-desktop:max-w-[330px] lg-desktop:max-h-[330px] desktop:max-w-[260px] desktop:max-h-[260px] max-w-[138px] max-h-[138px]",wrap:"lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480] desktop:aspect-w-[648] desktop:aspect-h-[380] laptop:aspect-w-[440] laptop:aspect-h-[356] tablet:aspect-w-[346] tablet:aspect-h-[360] md-tablet:w-full"}:{boxItem:"lg-desktop:max-w-[401px] desktop:max-w-[292px] laptop:max-w-[289px] max-w-[262px]",imgItem:"md-tablet:m-auto lg-desktop:max-w-[450px] lg-desktop:max-h-[450px] desktop:max-w-[332px] desktop:max-h-[332px] max-w-[312px] max-h-[312px]",wrap:"lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[480] desktop:aspect-w-[1312] desktop:aspect-h-[380] laptop:aspect-w-[896] laptop:aspect-h-[356] tablet:aspect-w-[704] tablet:aspect-h-[360] md-tablet:w-full"},ue=()=>E>=2?"flex flex-col justify-between desktop:gap-12 desktop:flex-row desktop:justify-center desktop:items-center":"flex justify-center items-center gap-6 md-tablet:flex-col",G=()=>{if(b?.value_type==="fixed_amount"){const r=y||"",l=r.match(/^(.*?)(\d[\d.,]*)(.*)$/);if(l){const[,a,c,u]=l;let g=c;return c.endsWith(".00")?g=c.replace(/\.00$/,""):c.endsWith(",00")&&(g=c.replace(/,00$/,"")),`${a}${g}${u}`}return r}return N||""};Ie(()=>{let r=[];if(N||y){const a=`${G()} ${W?.off||H?.off||""}`;r.push(a)}const l=e?.tags?.filter?.(a=>a?.startsWith?.("CLtag"))?.map?.(a=>a?.replace?.("CLtag:",""))?.slice?.(0,N?1:2)||[];be(r.concat(l))},[e?.tags,N,y,W?.off,H?.off]);const P=e?.custom_bg_image,ee=e?.custom_theme;return s("div",{ref:U,className:w(V().wrap,"rounded-box","shelf-display-item","duration-300","md-tablet:h-[360px] relative box-border w-full cursor-pointer overflow-hidden",P?"bg-cover bg-center bg-no-repeat":"bg-container-secondary-1 tablet:hover:bg-info-white",{"aiui-dark":ee==="dark","aiui-light":ee==="light"}),style:P?{backgroundImage:`url(${P})`}:void 0,children:f("div",{className:w(ue(),"desktop:p-6 absolute inset-0 box-border overflow-hidden p-4"),children:[s("div",{className:w(V().imgItem,"desktop:mb-0 relative mb-1 overflow-hidden",{"opacity-0":P}),children:s("a",{"aria-label":q,target:t?.target,href:Pe(`${v==="us"||!v?"":`/${v}`}/products/${e?.handle}?variant=${ce}`,`${ge}_${he}`),onClick:()=>{Be({event:"ga4Event",event_name:"select_item",event_parameters:{page_group:"Home Page",item_list_name:"Home_Page_Bundle",items:[{item_id:e?.sku||n?.sku,item_name:e?.name,item_variant:n?.name,price:n?.price,index:t?.index+1}]}})},children:s(_e,{source:k,alt:de,className:"flex h-full justify-center object-cover [&_img]:w-auto"})})}),f("div",{className:w("flex flex-col items-start justify-center",V().boxItem),children:[pe&&s("div",{className:"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden",children:X?.length>0&&X?.map?.((r,l)=>s(Se,{className:"shelf-items-tag",variant:"fill",children:r},l))}),F?s(Le,{as:"h3",title:F||"",size:2,className:"shelf-display-product-title lg-desktop:h-[58px] text-info-primary mb-1 line-clamp-2 h-[48px]",html:F||""}):null,C?s(Te,{size:2,className:"lg-desktop:text-lg lg-desktop:h-[26px] desktop:text-base desktop:h-6 shelf-display-product-description text-info-primary line-clamp-1 h-5 text-sm",html:C||""}):null,s("div",{className:"mb-2 mt-5 flex flex-wrap items-center",children:D?D(e,{price:o,basePrice:A,discount:N,discountAmount:y,variant:n,coupon:b,isSoldOut:I,isShowOriginalPrice:z}):I?s("div",{className:"lg-desktop:text-2xl text-info-primary text-xl font-bold",children:Q?.soldOutText}):f(Ae,{children:[s("div",{className:"final-price tablet:text-xl text-info-primary whitespace-nowrap text-xl font-bold",children:n?.availableForSale&&o||""}),$?$(e,{price:o,basePrice:A,discount:N,discountAmount:y,isShowOriginalPrice:z}):A&&s("div",{className:"origin-price tablet:text-xl text-info-quaternary ml-1 whitespace-nowrap text-lg font-bold line-through",children:n?.availableForSale&&A||""})]})}),!D&&ve?.(e,n,{isShowOriginalPrice:z}),f("div",{className:w("shelf-flex-button-group","lg-desktop:gap-3 flex items-center gap-2",t.direction==="vertical"?"flex-col":""),children:[t?.secondaryButton&&!I?s(fe,{disabled:I&&t?.secondaryFun!=="LearnMore",variant:"secondary",href:e?.custom_secondary_link,as:e?.custom_secondary_link?"a":"button",onClick:M,loading:Y,className:t.direction==="vertical"?"w-full":"",children:t?.secondaryButton||""}):null,t?.primaryButton?s(fe,{disabled:I&&t?.primaryFun!=="LearnMore",variant:"primary",href:e?.custom_primary_link,as:e?.custom_primary_link?"a":"button",onClick:B,loading:T,className:t.direction==="vertical"?"w-full":"",children:t?.primaryButton||""}):null]})]})]})},e?.id||e?.handle)};export{Qe as ShelfDisplayHorizontalItem,Ke as ShelfDisplayWrapItem,ze as getProductImage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Fragment as $e,jsx as s,jsxs as m}from"react/jsx-runtime";import{useAiuiContext as _e}from"../AiuiProvider/index.js";import{formatVariantPrice as Se}from"../ShelfDisplay/shelfDisplay.js";import{getProductImage as
|
|
1
|
+
import{Fragment as $e,jsx as s,jsxs as m}from"react/jsx-runtime";import{useAiuiContext as _e}from"../AiuiProvider/index.js";import{formatVariantPrice as Se}from"../ShelfDisplay/shelfDisplay.js";import{getProductImage as we}from"../ShelfDisplay/shelfDisplayItem.js";import Te from"../../components/picture.js";import X from"../../components/badge.js";import{cn as S}from"../../helpers/utils.js";import{Text as Y}from"../../components/text.js";import Z from"../../components/button.js";import{gaTrack as Ce}from"../../shared/track.js";import{trackUrlRef as Ne}from"../../shared/trackUrlRef.js";import{Heading as Pe}from"../../components/heading.js";import{useExposure as Be}from"../../hooks/useExposure.js";import{useRef as ze,useEffect as De,useMemo as ee,useState as w}from"react";const te="image",oe="product_shelf",se=999999999e-2,Le=({items:e})=>e?.length?s("div",{className:"shelf-display-horizontal-social-endorsements desktop:gap-2 desktop:top-2 absolute right-0 top-0 flex flex-none flex-col items-center gap-1 self-center",children:e.map((t,T)=>typeof t.icon=="string"?s("img",{src:t.icon,alt:t.label||"",loading:"lazy",className:"desktop:size-10 lg-desktop:size-12 size-8 object-contain"},T):s(Y,{"aria-label":t.label,className:"desktop:size-10 lg-desktop:size-12 size-8 [&_img]:size-full [&_svg]:size-full",children:t.icon},T))}):null,Ke=({data:e,configuration:t})=>{const{isDisplayBackImage:T=!1,itemShape:Ie,metafields:I,isTopTag:Ee=!1,isShowTag:re,isShowOriginalPrice:v,isShowShortTitle:ie=!1,isShowPricesTag:C=!1,pricesTagTextColor:N,pricesTagBgColor:P,itemsTagTextColor:k,itemsTagBgColor:B,formatPrice:E,renderOriginalPrice:A,renderPriceLabel:le,renderPrice:z}=t||{},{locale:f="es",copyWriting:ne,currencyDisplay:F}=_e(),{discounts:M,discountsCopy:H}=I||{},O=ze(null),[j,ae]=w([]),[U,ce]=w(""),[W,R]=w(!1),[q,V]=w(!1),pe=(o,r,i,n)=>{const{primaryFun:a,onAddCart:c,onBuyNow:y,onLearnMore:h,event:$}=t||{};if(a){if(a==="AddCart"&&c)return c(o,r+1,i,n);if(a==="BuyNow"&&y)return y(o,r+1,i,n);if(a==="LearnMore"&&h)return h(o,r+1,i,n)}$?.primaryButton?.(o,r+1,i,n)},me=(o,r,i,n)=>{const{secondaryFun:a,onAddCart:c,onBuyNow:y,onLearnMore:h,event:$}=t||{};if(a){if(a==="AddCart"&&c)return c(o,r+1,i,n);if(a==="BuyNow"&&y)return y(o,r+1,i,n);if(a==="LearnMore"&&h)return h(o,r+1,i,n)}$?.secondaryButton?.(o,r+1,i,n)},l=ee(()=>{const o=e?.variants||[];if(o.length)return e?.sku?o?.find?.(r=>r?.sku===e?.sku)||o[0]:o?.[0]},[e?.sku,e?.variants]),G=l?.id?.split?.("/")||[],de=G?.[G?.length-1],u=!l?.availableForSale||l?.price?.amount===se||l?.price===se,p=l?.coupons?.[0],J=e?.price?.currencyCode||"USD",fe=ee(()=>Se({locale:f,amount:p?p?.variant_price4wscode:l?.price,baseAmount:p?l?.price:0,currencyCode:J,currencyDisplay:F,customFormatPrice:E}),[J,f,F,p,l,E]),{price:D,basePrice:x,discount:d,discountAmount:g}=fe,{imageUrl:ue,altText:ge}=we(e),b=e?.custom_name||e?.title,L=ie&&l?.metafields?.infos?.page_short_title||b,K=e?.custom_description||e?.description,ye=()=>{if(p?.value_type==="fixed_amount"){const o=g||"",r=o.match(/^(.*?)(\d[\d.,]*)(.*)$/);if(r){const[,i,n,a]=r;let c=n;return n.endsWith(".00")?c=n.replace(/\.00$/,""):n.endsWith(",00")&&(c=n.replace(/,00$/,"")),`${i}${c}${a}`}return o}return d||""};De(()=>{let o=[];if(d||g){const i=`${ye()} ${M?.off||H?.off||""}`;ce(i)}const r=e?.tags?.filter?.(i=>i?.startsWith?.("CLtag"))?.map?.(i=>i?.replace?.("CLtag:",""))?.slice?.(0,d&&C?1:2)||[];ae(o.concat(r))},[e?.tags,d,g,M?.off,H?.off,C]),Be(O,{componentType:te,componentName:oe,componentTitle:b,componentDescription:K,position:t?.index+1});const he=async()=>{if(!W&&!e?.custom_primary_link){R(!0);try{await pe(e,t?.index,t,p)}finally{R(!1)}}},ve=async()=>{if(!q&&!e?.custom_secondary_link){V(!0);try{await me(e,t?.index,t,p)}finally{V(!1)}}},ke={...N?{color:N}:{},...P?{backgroundColor:P,backgroundImage:"none"}:{},...N||P?{outline:"none"}:{}},xe={...k?{color:k}:{},...B?{backgroundColor:B,backgroundImage:"none"}:{},...k||B?{outlineColor:k}:{}},be=()=>m("div",{className:"lg-desktop:h-[28px] absolute left-0 top-0 z-10 box-border flex h-6 flex-wrap gap-1 overflow-hidden",children:[C&&U&&s(X,{className:"shelf-prices-tag",variant:"fill",style:ke,children:U||""}),re&&j?.length>0&&j?.map?.((o,r)=>s(X,{className:"shelf-items-tag",variant:"outline",style:xe,children:o},r))]}),_=e?.custom_bg_image,Q=e?.custom_theme;return s("div",{ref:O,className:S("box-border w-full cursor-pointer overflow-hidden duration-300","rounded-box","shelf-display-horizontal-item","lg-desktop:aspect-[824/269] desktop:aspect-[648/238] laptop:aspect-[440/256] relative",_?"bg-cover bg-center bg-no-repeat":"bg-background tablet:hover:bg-info-white",{"aiui-dark":Q==="dark","aiui-light":Q==="light"}),style:_?{backgroundImage:`url(${_})`}:void 0,children:m("div",{className:"desktop:p-6 desktop:pt-4 absolute inset-0 box-border flex overflow-hidden p-4",children:[m("div",{className:"shelf-display-horizontal-left laptop:flex-[196] desktop:flex-[292] lg-desktop:flex-[380] relative flex h-full flex-none flex-col items-center justify-center gap-2",children:[s(be,{}),s("div",{className:S("shelf-display-horizontal-item-image desktop:h-[92.3%] lg-desktop:h-[89.5%] relative inline-block aspect-[1] h-[63.6%] min-h-0 overflow-hidden",{"opacity-0":_}),children:s("a",{"aria-label":b,target:t?.target,href:Ne(`${f==="us"||!f?"":`/${f}`}/products/${e?.handle}?variant=${de}`,`${te}_${oe}`),onClick:()=>{Ce({event:"ga4Event",event_name:"select_item",event_parameters:{page_group:"Home Page",item_list_name:"Home_Page_Bundle",items:[{item_id:e?.sku||l?.sku,item_name:e?.name,item_variant:l?.name,price:l?.price,index:t?.index+1}]}})},children:s(Te,{source:ue,alt:ge,className:"flex h-full justify-center object-cover [&_img]:w-auto"})})}),s(Le,{items:e?.socialEndorsements||I?.socialEndorsements})]}),m("div",{className:"shelf-display-horizontal-content desktop:flex-[332] desktop:pl-6 desktop:pt-2 lg-desktop:flex-[420] desktop:gap-6 flex min-w-0 flex-[224] flex-col justify-between gap-4 pl-4",children:[m("div",{className:"shelf-display-horizontal-content-title-desc",children:[L?s(Pe,{as:"h3",title:L||"",size:2,className:"shelf-display-product-title text-info-primary mb-1 line-clamp-2",html:L||""}):null,s(Y,{size:2,className:S("lg-desktop:text-lg desktop:text-base shelf-display-product-description text-info-primary line-clamp-2 text-sm !leading-[1.4]"),html:K||""})]}),m("div",{className:"shelf-display-horizontal-content-price-button",children:[s("div",{className:"mb-2 flex flex-wrap items-center",children:z?z(e,{price:D,basePrice:x,discount:d,discountAmount:g,variant:l,coupon:p,isSoldOut:u,isShowOriginalPrice:v}):u?s("div",{className:"lg-desktop:text-2xl text-info-primary text-xl font-bold",children:ne?.soldOutText}):m($e,{children:[s("div",{className:"final-price lg-desktop:text-2xl text-info-primary whitespace-nowrap text-xl font-bold !leading-[1.2]",children:l?.availableForSale&&D||""}),A?A(e,{price:D,basePrice:x,discount:d,discountAmount:g,isShowOriginalPrice:v}):x&&v&&s("div",{className:"origin-price lg-desktop:text-2xl text-info-quaternary ml-1 whitespace-nowrap text-xl font-bold !leading-[1.2] line-through",children:l?.availableForSale&&x||""})]})}),!z&&le?.(e,l,{isShowOriginalPrice:v}),m("div",{className:S("shelf-flex-button-group","lg-desktop:gap-3 desktop:flex-row flex flex-col items-center gap-2",t.direction==="vertical"?"flex-col":""),children:[t?.secondaryButton&&!u?s(Z,{disabled:u&&t?.secondaryFun!=="LearnMore",variant:"secondary",href:e?.custom_secondary_link,as:e?.custom_secondary_link?"a":"button",onClick:ve,loading:q,className:"laptop:w-full desktop:w-auto",children:t?.secondaryButton||""}):null,t?.primaryButton?s(Z,{disabled:u&&t?.primaryFun!=="LearnMore",variant:"primary",href:e?.custom_primary_link,as:e?.custom_primary_link?"a":"button",onClick:he,loading:W,className:"laptop:w-full desktop:w-auto",children:t?.primaryButton||""}):null]})]})]})]})},e?.id||e?.handle)};export{Ke as ShelfDisplayHorizontalCardItem};
|
|
@@ -5,6 +5,7 @@ export type DropDownProps = {
|
|
|
5
5
|
setActive: any;
|
|
6
6
|
setVisible: any;
|
|
7
7
|
visible: any;
|
|
8
|
+
resolveName?: (item: any, sku?: string) => string;
|
|
8
9
|
};
|
|
9
|
-
declare const DropDown: ({ index, active, list, setActive, setVisible, visible }: DropDownProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare const DropDown: ({ index, active, list, setActive, setVisible, visible, resolveName }: DropDownProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
11
|
export default DropDown;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as
|
|
2
|
-
${e?.handle===a?.handle?"bg-[#EAEAEC]":""}`,children:
|
|
1
|
+
import{jsx as s}from"react/jsx-runtime";import{useEffect as f,useRef as b}from"react";const m="openDropDown",v=({index:n,active:a,list:u,setActive:p,setVisible:d,visible:l,resolveName:c})=>{const i=b(null);return f(()=>{const e=o=>{const t=o?.target?.getAttribute?.("class");!i?.current?.contains(o?.target)&&!t?.includes(m)&&d({...l,[n]:!1})};return document.addEventListener("click",e),()=>document.removeEventListener("click",e)},[]),s("div",{ref:i,className:`absolute left-0 top-[104%] z-30 box-border max-h-[340px] w-full overflow-auto rounded-lg bg-white ${l?.[n]?"block":"hidden"}`,children:s("div",{className:"dropdown-wrapper m-0 box-border h-full flex-1 overflow-hidden p-0 [&:last-child]:border-r-0",children:u?.map((e,o)=>{const t=e?.sku||e?.variants?.[0]?.sku,r=c?c(e,t):e?.name||e?.title;return s("div",{onClick:()=>{p({...a,[n]:{sku:t,name:r,handle:e?.handle}}),d({...l,[n]:!1})},title:r,className:`openDropDown min-xl:text-lg min-xxl:text-lg box-border cursor-pointer truncate px-6 py-4 text-base font-bold [&:hover]:bg-[#EAEAEC]
|
|
2
|
+
${e?.handle===a?.handle?"bg-[#EAEAEC]":""}`,children:r},o)})})})};var k=v;export{k as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{Fragment as
|
|
1
|
+
"use client";import{Fragment as P,jsx as n,jsxs as i}from"react/jsx-runtime";import X from"./dropdown.js";import{useAiuiContext as Y}from"../AiuiProvider/index.js";import{useMediaQuery as Z}from"react-responsive";import{useMemo as j,useState as b,useEffect as H,useCallback as ee}from"react";import{withLayout as te}from"../../shared/Styles.js";import{formatVariantPrice as se}from"../ShelfDisplay/shelfDisplay.js";import{Picture as C,Text as ne,Button as oe,Heading as M}from"../../components/index.js";import{cn as ae}from"../../helpers/index.js";import re,{useImperativeHandle as le,useRef as ce}from"react";const F=re.forwardRef(({data:u,buildData:d,onChange:R,onSecondaryChange:ie,className:_,...I},$)=>{const m=Z({query:"(max-width: 768px)"}),[l,g]=b({}),[h,O]=b([]),[S,L]=b(!1),[v,D]=b({}),A=ce(null),{locale:U="us",currencyDisplay:V,trackingData:B,currencyCode:z}=Y(),q=B?.showComparePrice??!0,{LeftMenu:E,RightMenu:y,DefaultSelectMenu:x}=j(()=>u?.data||{},[u?.data]),w=j(()=>{const e={};return(Array.isArray(u?.items)?u?.items:[]).forEach(t=>{t?.custom_name&&(t?.sku&&(e[t.sku]=t.custom_name),t?.handle&&(e[t.handle]=t.custom_name))}),e},[u?.items]),k=ee((e,s)=>w[s||""]||w[e?.handle||""]||e?.name||e?.title||"",[w]),Q=e=>{try{const t=new URL(e).pathname.toLowerCase();return/\.(jpeg|jpg|gif|png|webp|bmp|svg|tiff)$/.test(t)}catch{return/\.(jpeg|jpg|gif|png|webp|bmp|svg|tiff)$/i.test(e)}},W=(e,s)=>{const t=e?.variants?.find?.(c=>c?.sku===e?.sku),o=t?.coupons?.[0],{price:a,basePrice:r}=se({locale:z==="CAD"?"us":U||"us",amount:o?o?.variant_price4wscode:t?.price,baseAmount:o?t?.price:0,currencyDisplay:V,currencyCode:e?.price?.currencyCode||"USD"}),p=typeof x?.buttonText=="string"?x?.buttonText:x?.buttonText?.[String(s)]||"";return i("div",{className:"specs-sku-node-wrap box-border",children:[i(ne,{as:"div",className:"md-tablet:p-2 l-tablet:mb-4 l-tablet:text-sm desktop:px-6 lg-desktop:mb-8 lg-desktop:text-lg openDropDown specs-sku-node-text relative mb-6 box-border block rounded-[50px] border border-[#E4E5E6] bg-[#F5F5F7] px-6 py-4 text-base font-bold",onClick:()=>{if(h?.length<=1)return null;D({...v,[s]:!v?.[s]})},children:[i("div",{className:"flex items-center justify-between overflow-hidden",children:[n("div",{className:"openDropDown md-tablet:text-sm lg-desktop:text-lg specs-sku-node-title flex-1 truncate text-base",title:l?.[s]?.name||"",children:l?.[s]?.name||""}),h?.length>1?n("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",className:"openDropDown",children:n("path",{d:"M6 9.5L12 15.5L18 9.5",stroke:"#1D1D1F",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}):null]}),n(X,{index:s,list:h,active:l,setActive:g,visible:v,setVisible:D,resolveName:k})]}),n("div",{className:"lg-desktop:max-h-[196px] lg-desktop:max-w-[196px] max-h-[138px] max-w-[138px]",children:n(C,{source:t?.image?.url||"",className:"aspect-h-[280] aspect-w-[280]",imgClassName:"w-full h-full object-cover hover:scale-105 transition-all duration-300"})}),n("div",{className:"lg-desktop:text-2xl mb-2 mt-6 text-xl font-bold",children:n("div",{className:"lg-desktop:min-h-[32px] flex min-h-[28px] flex-wrap items-center gap-1",children:t?.availableForSale?i(P,{children:[n("div",{className:"specs-sku-node-price whitespace-nowrap text-[#080A0F]",children:a||""}),q&&r&&n("div",{className:"lg-desktop:text-2xl specs-sku-node-base-price whitespace-nowrap text-xl text-[#86868C] line-through",children:r})]}):null})}),p?n(oe,{onClick:()=>{R?.(e,s)},className:"specs-sku-node-button",children:p}):null]})},G=e=>e&&typeof e!="string"?i("div",{className:"size-full",children:[n("p",{className:"min-xxl:text-lg specs-normal-node-text text-base font-bold text-[#080A0F] md:text-sm",dangerouslySetInnerHTML:{__html:e?.text||""}}),n(C,{source:e?.imgUrl,className:"l:max-h-[174px] l:max-w-[174px] m-auto max-h-[360px] max-w-[360px]",imgClassName:"w-full h-full object-cover"})]}):n("div",{className:"break-all",children:Q(e)?n(C,{source:e,className:"l:max-h-[174px] l:max-w-[174px] m-auto max-h-[360px] max-w-[360px]",imgClassName:"w-full h-full object-cover"}):n("p",{className:"min-xxl:text-lg specs-normal-node-text text-base font-bold text-[#080A0F] md:text-sm",dangerouslySetInnerHTML:{__html:e||""}})}),T=e=>e.map((s,t)=>{const o=t===0;return i("div",{className:"l-tablet:flex l-tablet:flex-col box-border grid w-full cursor-pointer grid-cols-3 overflow-hidden border-t border-t-[#E4E5E6] specs-product-node-wrap",children:[n(M,{as:"h3",html:s||"",className:"tablet:py-6 l-tablet:text-[#86868C] desktop:p-6 lg-desktop:text-lg specs-product-node-title mr-4 flex-1 pt-4 text-base font-bold md:text-sm"}),n("div",{className:`l-tablet:w-full l-tablet:gap-4 laptop:gap-8 desktop:gap-12 desktop:p-6 lg-desktop:gap-16 grid-cols-${S?3:2} specs-product-node-body col-span-2 grid flex-1 py-6`,children:Object.keys(l)?.map?.(a=>{const r=l?.[a],p=y?.menus?.find?.(c=>c?.handle===r?.handle)?.subTitle;return G(p?.[s])})})]},s)}),J=e=>{if(!l)return;const{subTitle:s,isProduct:t}=e;return t?i(P,{children:[i("div",{className:"l-tablet:flex l-tablet:flex-col specs-content-item-product box-border grid w-full cursor-pointer grid-cols-3 border-t-0 border-t-[#E4E5E6]",children:[e?.title&&n(M,{as:"h3",html:e?.title||"",className:"lg-desktop:text-lg desktop:px-6 specs-product-node-title l:hidden specs-item-product-title py-4 text-base font-bold md:text-sm"}),n("div",{className:`l-tablet:w-full l-tablet:gap-4 laptop:gap-8 desktop:gap-12 desktop:px-6 desktop:pb-6 lg-desktop:gap-16 grid-cols-${S?3:2} specs-item-product-body col-span-2 grid flex-1 pb-4 pr-0`,children:Object.keys(l)?.map((o,a)=>{const r=l?.[o],p=d?.products?.find?.(c=>c?.handle===r?.handle);return n("div",{children:W({...p,item:o,sku:r?.sku},a)},o)})})]}),e?.categoryLabel&&n(M,{size:2,as:"h4",html:e?.categoryLabel||"",className:"desktop:p-6 specs-item-product-category py-6"}),s?.length?T(s):null]}):T(s)};return le($,()=>A.current),H(()=>{if(!d?.products?.length)return;const e=x?.sku?.split?.(",")||[],s=m&&e?.length>2?e?.slice(0,2):e;let t={};s?.forEach?.((a,r)=>{const c=y?.menus?.find?.(f=>f?.sku===a)?.handle,N=c?d?.products?.find?.(f=>f?.handle===c):d?.products?.find?.(f=>{if(f?.variants?.find?.(K=>K?.sku===a))return!0});N&&(t={...t,[r]:{sku:a,name:k(N,a),handle:N?.handle}})});const o=d?.products?.filter(a=>y?.menus?.find(r=>r?.handle===a?.handle));g(t),O(o),L(e?.length>2&&!m)},[d,m,k]),H(()=>{if(m){const e=Object.keys(l||{});if(e?.length>2){const s=e?.slice?.(0,2);let t={};s?.forEach?.(o=>{t={...t,[o]:l?.[o]}}),L(!1),g(t)}}},[m]),n("div",{...I,className:ae("specs-wrapper w-full overflow-hidden",_),ref:A,children:E?.data?n("div",{className:"specs-wrapper-content box-border w-full overflow-hidden",children:E?.data?.map?.((e,s)=>n("div",{className:"specs-wrapper-content-item w-full overflow-hidden pt-10 [&:first-child]:pt-0",children:J(e)},s))}):null})});F.displayName="Specs";var ye=te(F);export{ye as default};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type VariantProps } from 'class-variance-authority';
|
|
3
3
|
declare const badgeVariants: (props?: ({
|
|
4
|
-
size?: "lg" | "sm" | null | undefined;
|
|
4
|
+
size?: "lg" | "sm" | "xs" | null | undefined;
|
|
5
5
|
variant?: "fill" | "outline" | "promotional" | null | undefined;
|
|
6
6
|
promotionalType?: "plus-member" | "regular-member" | "regular-discount" | "time-limited-discount" | null | undefined;
|
|
7
7
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t,jsxs as e}from"react/jsx-runtime";import"react";import{cva as p}from"class-variance-authority";import{cn as C}from"../helpers/index.js";const d=p("text-
|
|
1
|
+
import{jsx as t,jsxs as e}from"react/jsx-runtime";import"react";import{cva as p}from"class-variance-authority";import{cn as C}from"../helpers/index.js";const d=p("text-badge-outline-text outline-badge-outline-color inline-flex items-center justify-center whitespace-nowrap rounded-[16px] border-none text-xs font-bold outline outline-[1.6px] outline-offset-[-1.6px] transition-colors focus:outline-none",{variants:{size:{xs:"h-[20px] px-[4px] pb-[2px] pt-1 text-[12px] leading-normal",sm:"h-[24px] px-[6px] pb-[3px] pt-[4px] text-[14px] leading-tight",lg:"lg-desktop:px-[8px] lg-desktop:pb-[4px] lg-desktop:pt-[5px] lg-desktop:text-[16px] lg-desktop:h-[28px] h-[24px] p-[6px] pb-[3px] pt-[4px] text-[14px] leading-tight"},variant:{outline:"bg-transparent",fill:"bg-badge-fill-color bg-badge-fill-gradient text-badge-fill-text",promotional:"bg-gradient-brand text-badge-foreground relative !border-none !outline-none"},promotionalType:{"plus-member":"bg-gradient-to-r from-[#6E6754] via-[#4A453A] to-[#070708] ","regular-member":"bg-brand-0 bg-gradient-brand ","regular-discount":"bg-brand-0 bg-gradient-brand ","time-limited-discount":"bg-brand-0 bg-gradient-brand "}},compoundVariants:[{variant:"promotional",size:"sm",class:"!pl-[24px]"},{variant:"promotional",size:"lg",class:"lg-desktop:!pl-[28px] !pl-[24px]"}],defaultVariants:{size:"lg",variant:"outline"}}),g=()=>e("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 28",fill:"none",className:"h-full w-auto",children:[t("path",{d:"M23.2222 0C24.2096 0 25.1341 0.501396 25.6903 1.34106L31.4814 10.0846C32.283 11.2948 32.1429 12.9193 31.1474 13.9659L19.0336 26.6998C17.3854 28.4319 14.6772 28.4335 13.0264 26.7039L0.855644 13.9536C-0.130438 12.9204 -0.281462 11.3186 0.492455 10.1091L6.07548 1.38199C6.6279 0.518743 7.56576 0 8.57008 0H23.2222Z",fill:"url(#paint0_linear_22508_6946)"}),t("path",{d:"M22.4084 10.2119C22.9545 9.66492 23.8409 9.66346 24.3881 10.2092C24.9351 10.7553 24.9366 11.6416 24.3908 12.1889L17.451 19.1397C16.8776 19.714 15.9474 19.7155 15.3729 19.1424L8.41114 12.1916C7.86414 11.6455 7.86268 10.7592 8.40841 10.2119C8.95451 9.66492 9.84087 9.66346 10.3881 10.2092L16.4092 16.2193L22.4084 10.2119Z",fill:"url(#paint1_linear_22508_6946)"}),e("defs",{children:[e("linearGradient",{id:"paint0_linear_22508_6946",x1:"2.1318",y1:"0.390243",x2:"33.6892",y2:"7.35765",gradientUnits:"userSpaceOnUse",children:[t("stop",{offset:"0.0865385",stopColor:"#FFF5E0"}),t("stop",{offset:"1",stopColor:"#E8C08A"})]}),e("linearGradient",{id:"paint1_linear_22508_6946",x1:"7.79513",y1:"9.80078",x2:"25.937",y2:"13.8215",gradientUnits:"userSpaceOnUse",children:[t("stop",{offset:"0.9999",stopColor:"#6E6754"}),t("stop",{offset:"1",stopColor:"#050608"})]})]})]}),u=()=>e("svg",{width:"32",height:"28",viewBox:"0 0 32 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"h-full w-auto",children:[t("path",{d:"M23.2222 0C24.2096 0 25.1341 0.501396 25.6903 1.34106L31.4814 10.0846C32.283 11.2948 32.1429 12.9193 31.1474 13.9659L19.0336 26.6998C17.3854 28.4319 14.6772 28.4335 13.0264 26.7039L0.855644 13.9536C-0.130438 12.9204 -0.281462 11.3186 0.492455 10.1091L6.07548 1.38199C6.6279 0.518743 7.56576 0 8.57008 0H23.2222Z",fill:"#B5E5F9"}),t("path",{d:"M22.4084 10.2119C22.9545 9.66492 23.8409 9.66346 24.3881 10.2092C24.9351 10.7553 24.9366 11.6416 24.3908 12.1889L17.451 19.1397C16.8776 19.714 15.9474 19.7155 15.3729 19.1424L8.41114 12.1916C7.86414 11.6455 7.86268 10.7592 8.40841 10.2119C8.95451 9.66492 9.84087 9.66346 10.3881 10.2092L16.4092 16.2193L22.4084 10.2119Z",fill:"white"})]}),c=()=>e("svg",{width:"32",height:"28",viewBox:"0 0 32 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"h-full w-auto",children:[e("g",{clipPath:"url(#clip0_20420_244316)",children:[t("path",{opacity:"0.4",d:"M3.90567 7.45107C4.19697 6.0806 5.21359 4.9787 6.55622 4.57818L13.8699 2.39643C15.1173 2.02431 16.4683 2.31148 17.4565 3.15879L23.2505 8.12665C24.3141 9.03864 24.7946 10.4588 24.5033 11.8292L21.3938 26.4587C20.9541 28.527 18.921 29.8474 16.8527 29.4077L3.74508 26.6216C1.67675 26.182 0.356442 24.1489 0.796078 22.0805L3.90567 7.45107Z",fill:"#B5E5F9"}),t("path",{d:"M5 7.9615C5 6.50843 5.78799 5.16965 7.05839 4.46433L14.0584 0.57797C15.266 -0.0924777 16.734 -0.0924768 17.9416 0.577971L24.9416 4.46434C26.212 5.16966 27 6.50844 27 7.9615V24C27 26.2091 25.2091 28 23 28H9C6.79086 28 5 26.2091 5 24V7.9615Z",fill:"#B5E5F9"}),t("path",{d:"M20.3094 17.6141C21.0396 17.6143 21.7533 17.8311 22.3603 18.2371C22.9672 18.6431 23.4402 19.22 23.7194 19.8949C23.9986 20.5698 24.0715 21.3124 23.9288 22.0287C23.7861 22.745 23.4343 23.4029 22.9178 23.9192C22.4013 24.4355 21.7434 24.787 21.0272 24.9293C20.311 25.0715 19.5687 24.9982 18.8942 24.7184C18.2197 24.4387 17.6433 23.9652 17.2378 23.3577C16.8324 22.7503 16.6161 22.0362 16.6163 21.3058C16.6163 19.2667 18.2697 17.6141 20.3094 17.6141ZM10.8221 20.5232L19.527 11.8217C19.7491 11.6041 20.0454 11.4786 20.3562 11.4704C20.667 11.4622 20.9695 11.5719 21.2028 11.7776C21.4361 11.9832 21.583 12.2695 21.6139 12.579C21.6449 12.8885 21.5577 13.1983 21.3698 13.4461L21.2677 13.5618L12.5628 22.2632C12.3407 22.4808 12.0444 22.6064 11.7336 22.6145C11.4228 22.6227 11.1203 22.513 10.887 22.3074C10.6537 22.1017 10.5068 21.8154 10.4759 21.5059C10.4449 21.1964 10.5321 20.8867 10.72 20.6388L10.8221 20.5232ZM20.3094 20.0752C19.9831 20.0752 19.6702 20.2049 19.4395 20.4356C19.2088 20.6664 19.0792 20.9794 19.0792 21.3058C19.0792 21.6322 19.2088 21.9452 19.4395 22.176C19.6702 22.4067 19.9831 22.5364 20.3094 22.5364C20.6357 22.5364 20.9486 22.4067 21.1793 22.176C21.41 21.9452 21.5396 21.6322 21.5396 21.3058C21.5396 20.9794 21.41 20.6664 21.1793 20.4356C20.9486 20.2049 20.6357 20.0752 20.3094 20.0752ZM11.6931 9C12.4232 9.00024 13.1369 9.21707 13.7439 9.62306C14.3509 10.0291 14.8239 10.606 15.1031 11.2809C15.3823 11.9558 15.4552 12.6983 15.3125 13.4146C15.1698 14.131 14.818 14.7889 14.3015 15.3052C13.785 15.8215 13.1271 16.173 12.4109 16.3152C11.6947 16.4575 10.9524 16.3841 10.2779 16.1044C9.60339 15.8246 9.02696 15.3511 8.6215 14.7437C8.21604 14.1362 7.99976 13.4221 8 12.6917C8 10.6527 9.65339 9 11.6931 9ZM11.6931 11.4612C11.5315 11.4611 11.3715 11.4928 11.2222 11.5546C11.073 11.6164 10.9373 11.7069 10.823 11.8212C10.5922 12.0518 10.4624 12.3648 10.4622 12.6911C10.4621 13.0175 10.5915 13.3306 10.8221 13.5615C11.0527 13.7923 11.3656 13.9222 11.6918 13.9223C12.0181 13.9223 12.331 13.7927 12.5617 13.5619C12.7924 13.3311 12.922 13.0181 12.922 12.6917C12.922 12.3654 12.7924 12.0524 12.5617 11.8216C12.331 11.5908 12.0181 11.4612 11.6918 11.4612H11.6931Z",fill:"white"})]}),t("defs",{children:t("clipPath",{id:"clip0_20420_244316",children:t("rect",{width:"32",height:"28",fill:"white"})})})]}),x=()=>e("svg",{width:"24",height:"28",viewBox:"0 0 24 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"h-full w-auto",children:[t("path",{d:"M0.112855 14.5991L6.23786 0.599179C6.3971 0.235193 6.75672 0 7.15401 0H19.4534C20.1791 0 20.6631 0.74862 20.3653 1.41036L16.5 10H22.5443C23.36 10 23.8326 10.9242 23.3549 11.5855L11.5 28.0001L9.6547 16L1.029 15.9999C0.307853 15.9999 -0.176196 15.2598 0.112855 14.5991Z",fill:"#B5E5F9"}),t("path",{d:"M0.112855 14.5991L6.23786 0.599179C6.3971 0.235193 6.75672 0 7.15401 0H19.4534C20.1791 0 20.6631 0.74862 20.3653 1.41036L16.5 10H22.5443C23.36 10 23.8326 10.9242 23.3549 11.5855L11.5 28.0001L9.6547 16L1.029 15.9999C0.307853 15.9999 -0.176196 15.2598 0.112855 14.5991Z",fill:"#B5E5F9"})]}),m={"plus-member":()=>t(g,{}),"regular-member":()=>t(u,{}),"regular-discount":()=>t(c,{}),"time-limited-discount":()=>t(x,{})};function f({className:r,size:s,variant:o="outline",promotionalType:l,...n}){const i=o==="promotional",a=i?m[l||"regular-discount"]:null;return e("div",{className:C(d({size:s,variant:o,promotionalType:i?l:void 0}),r),...n,children:[i&&a&&t("div",{className:"absolute inset-y-0 left-0 flex -translate-x-1/3 items-center",children:t(a,{})}),t("span",{className:i?"relative z-10":"",children:n.children})]})}var w=f;export{w as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
"use client";import{jsx as a,jsxs as c}from"react/jsx-runtime";import{Fragment as s}from"react";import{cn as o}from"../helpers/utils.js";import{Container as m}from"./container.js";import d from"./link.js";import{Text as n}from"./text.js";import{useAiuiContext as f}from"../biz-components/AiuiProvider/index.js";const g=({data:l,sizeClass:t})=>{const{navCollapsed:i}=f();return a("div",{className:"aiui-dark relative z-[46] box-border h-[30px]",children:c(m,{childClassName:"flex !bg-container-primary items-center justify-between",className:"h-full",children:[a("div",{className:o("h-full items-center gap-3",i===void 0?"desktop:flex hidden":i?"hidden":"flex"),children:l?.leftIcon?.map?.((e,r)=>c(s,{children:[r>0&&a("span",{className:"bg-lines h-3 w-px","aria-hidden":"true"}),e?.link?a(d,{href:e?.link,variant:"secondary","aria-label":e?.label||e?.title,className:o("text-sm leading-[1.4] no-underline",t),children:a(n,{className:"board-left-icon","aria-hidden":"true",html:e?.logo||""})}):a(n,{className:"board-left-icon",html:e?.logo||""})]},r))}),a("div",{className:"flex h-full flex-1 items-center justify-end gap-2",children:l?.rightIcon?.map?.((e,r)=>a(s,{children:e?.link?a(d,{href:e?.link,variant:"secondary","aria-label":e?.label||e?.title,className:o("flex items-center text-sm leading-[1.4] no-underline",t),children:a(n,{className:"board-right-icon","aria-hidden":"true",html:e?.logo||""})}):a(n,{className:"board-right-icon",html:e?.logo||""})},r))})]})})};var k=g;export{k as default};
|
package/dist/tokens/oneAnker.css
CHANGED
|
@@ -14,6 +14,13 @@
|
|
|
14
14
|
--brand-color-0: #00cbeb;
|
|
15
15
|
--tabs-radius: 28px;
|
|
16
16
|
--badge-text-color: #080a0f;
|
|
17
|
+
/* Badge 描边型(outline):描边色 + 文字色(oneanker 专属) */
|
|
18
|
+
--badge-outline-color: #93e0ec;
|
|
19
|
+
--badge-outline-text-color: #004966;
|
|
20
|
+
/* Badge 填充型(fill):填充纯色 + 渐变 + 文字色(oneanker 专属) */
|
|
21
|
+
--badge-fill-color: #93e0ec;
|
|
22
|
+
--badge-fill-gradient: linear-gradient(90deg, #93e0ec 0%, #93e0ec 100%);
|
|
23
|
+
--badge-fill-text-color: #004966;
|
|
17
24
|
|
|
18
25
|
/* 侧边栏选中状态和货架组件圆角:<=1024px 为 6px */
|
|
19
26
|
--sidebar-shelf-radius: 6px;
|
|
@@ -39,5 +46,20 @@
|
|
|
39
46
|
--tabs-hover-foreground-color: #004966;
|
|
40
47
|
--brand-gradient-color-0: linear-gradient(90deg, var(--brand-color-0) 0%, var(--brand-color-0) 100%);
|
|
41
48
|
--badge-text-color: #080a0f;
|
|
49
|
+
--badge-outline-color: #93e0ec;
|
|
50
|
+
--badge-outline-text-color: #004966;
|
|
51
|
+
--badge-fill-color: #93e0ec;
|
|
52
|
+
--badge-fill-gradient: linear-gradient(90deg, #93e0ec 0%, #93e0ec 100%);
|
|
53
|
+
--badge-fill-text-color: #004966;
|
|
42
54
|
--btn-text-active-color: #1E2024;
|
|
43
55
|
}
|
|
56
|
+
|
|
57
|
+
/* link 按钮 hover 颜色覆盖(oneAnker 专属) */
|
|
58
|
+
:root .link-btn:hover,
|
|
59
|
+
.aiui-light .link-btn:hover {
|
|
60
|
+
color: #004966;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.aiui-dark .link-btn:hover {
|
|
64
|
+
color: #93E0EC;
|
|
65
|
+
}
|
package/package.json
CHANGED
package/style.css
CHANGED
|
@@ -499,6 +499,9 @@ video {
|
|
|
499
499
|
.invisible {
|
|
500
500
|
visibility: hidden;
|
|
501
501
|
}
|
|
502
|
+
.collapse {
|
|
503
|
+
visibility: collapse;
|
|
504
|
+
}
|
|
502
505
|
.static {
|
|
503
506
|
position: static;
|
|
504
507
|
}
|
|
@@ -659,6 +662,9 @@ video {
|
|
|
659
662
|
.right-0 {
|
|
660
663
|
right: 0px;
|
|
661
664
|
}
|
|
665
|
+
.right-1 {
|
|
666
|
+
right: 0.25rem;
|
|
667
|
+
}
|
|
662
668
|
.right-4 {
|
|
663
669
|
right: 1rem;
|
|
664
670
|
}
|
|
@@ -677,6 +683,9 @@ video {
|
|
|
677
683
|
.top-0 {
|
|
678
684
|
top: 0px;
|
|
679
685
|
}
|
|
686
|
+
.top-1 {
|
|
687
|
+
top: 0.25rem;
|
|
688
|
+
}
|
|
680
689
|
.top-1\/2 {
|
|
681
690
|
top: 50%;
|
|
682
691
|
}
|
|
@@ -3111,6 +3120,9 @@ video {
|
|
|
3111
3120
|
.bg-background {
|
|
3112
3121
|
background-color: var(--container-primary-color);
|
|
3113
3122
|
}
|
|
3123
|
+
.bg-badge-fill-color {
|
|
3124
|
+
background-color: var(--badge-fill-color, var(--brand-color-0));
|
|
3125
|
+
}
|
|
3114
3126
|
.bg-bg-0 {
|
|
3115
3127
|
background-color: var(--bg-color-0);
|
|
3116
3128
|
}
|
|
@@ -3249,6 +3261,9 @@ video {
|
|
|
3249
3261
|
.\!bg-none {
|
|
3250
3262
|
background-image: none !important;
|
|
3251
3263
|
}
|
|
3264
|
+
.bg-badge-fill-gradient {
|
|
3265
|
+
background-image: var(--badge-fill-gradient, var(--brand-gradient-color-0));
|
|
3266
|
+
}
|
|
3252
3267
|
.bg-gradient-brand {
|
|
3253
3268
|
background-image: var(--brand-gradient-color-0);
|
|
3254
3269
|
}
|
|
@@ -3686,6 +3701,9 @@ video {
|
|
|
3686
3701
|
.pb-\[24px\] {
|
|
3687
3702
|
padding-bottom: 24px;
|
|
3688
3703
|
}
|
|
3704
|
+
.pb-\[2px\] {
|
|
3705
|
+
padding-bottom: 2px;
|
|
3706
|
+
}
|
|
3689
3707
|
.pb-\[3px\] {
|
|
3690
3708
|
padding-bottom: 3px;
|
|
3691
3709
|
}
|
|
@@ -4175,9 +4193,15 @@ video {
|
|
|
4175
4193
|
.text-\[var\(--brand-2\2c \#005d8e\)\] {
|
|
4176
4194
|
color: var(--brand-2,#005d8e);
|
|
4177
4195
|
}
|
|
4196
|
+
.text-badge-fill-text {
|
|
4197
|
+
color: var(--badge-fill-text-color, var(--badge-text-color, #ffffff));
|
|
4198
|
+
}
|
|
4178
4199
|
.text-badge-foreground {
|
|
4179
4200
|
color: var(--badge-text-color, #ffffff);
|
|
4180
4201
|
}
|
|
4202
|
+
.text-badge-outline-text {
|
|
4203
|
+
color: var(--badge-outline-text-color, var(--brand-color-0));
|
|
4204
|
+
}
|
|
4181
4205
|
.text-black {
|
|
4182
4206
|
--tw-text-opacity: 1;
|
|
4183
4207
|
color: rgb(0 0 0 / var(--tw-text-opacity, 1));
|
|
@@ -4377,8 +4401,8 @@ video {
|
|
|
4377
4401
|
.outline-offset-\[-1\.6px\] {
|
|
4378
4402
|
outline-offset: -1.6px;
|
|
4379
4403
|
}
|
|
4380
|
-
.outline-
|
|
4381
|
-
outline-color: var(--brand-color-0);
|
|
4404
|
+
.outline-badge-outline-color {
|
|
4405
|
+
outline-color: var(--badge-outline-color, var(--brand-color-0));
|
|
4382
4406
|
}
|
|
4383
4407
|
.outline-btn-primary {
|
|
4384
4408
|
outline-color: var(--info-primary-color);
|
|
@@ -7959,6 +7983,9 @@ video {
|
|
|
7959
7983
|
.desktop\:gap-y-3 {
|
|
7960
7984
|
row-gap: 0.75rem;
|
|
7961
7985
|
}
|
|
7986
|
+
.desktop\:text-pretty {
|
|
7987
|
+
text-wrap: pretty;
|
|
7988
|
+
}
|
|
7962
7989
|
.desktop\:border-none {
|
|
7963
7990
|
border-style: none;
|
|
7964
7991
|
}
|
package/tailwind.config.js
CHANGED
|
@@ -167,6 +167,10 @@ module.exports = {
|
|
|
167
167
|
badge: {
|
|
168
168
|
DEFAULT: 'var(--secondary-brand-color-2)',
|
|
169
169
|
foreground: 'var(--badge-text-color, #ffffff)',
|
|
170
|
+
'outline-color': 'var(--badge-outline-color, var(--brand-color-0))',
|
|
171
|
+
'outline-text': 'var(--badge-outline-text-color, var(--brand-color-0))',
|
|
172
|
+
'fill-color': 'var(--badge-fill-color, var(--brand-color-0))',
|
|
173
|
+
'fill-text': 'var(--badge-fill-text-color, var(--badge-text-color, #ffffff))',
|
|
170
174
|
},
|
|
171
175
|
skeleton: {
|
|
172
176
|
DEFAULT: 'var(--info-tertiary-color)',
|
|
@@ -180,6 +184,7 @@ module.exports = {
|
|
|
180
184
|
},
|
|
181
185
|
backgroundImage: {
|
|
182
186
|
'gradient-brand': 'var(--brand-gradient-color-0)',
|
|
187
|
+
'badge-fill-gradient': 'var(--badge-fill-gradient, var(--brand-gradient-color-0))',
|
|
183
188
|
},
|
|
184
189
|
borderRadius: {
|
|
185
190
|
btn: 'var(--btn-radius)',
|