yt-uikit 0.9.4 → 0.9.5
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/esm/index.js +2 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -1925,6 +1925,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
1925
1925
|
border-width: 2px !important;
|
|
1926
1926
|
border-color: lightgray !important;
|
|
1927
1927
|
// box-shadow: 0px 0px 2px 2px rgb(193, 193, 193);
|
|
1928
|
+
cursor: pointer;
|
|
1928
1929
|
`,Ca=c.span`
|
|
1929
1930
|
display: flex;
|
|
1930
1931
|
flex-direction: row;
|
|
@@ -1946,7 +1947,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
1946
1947
|
font-size: 12px;
|
|
1947
1948
|
margin-top: 5px;
|
|
1948
1949
|
padding: 0 20px;
|
|
1949
|
-
`,Ta=e=>{if("string"!=typeof e)return e;const t=e.match(/^gid:\/\/shopify\/\w+\/(\d+)$/);return t?t[1]:e};function Sa({themeColor:o,id:r,showPrice:i,detail:a,errorText:l,customText:c,showGiftIcon:s,showProductImage:d,addCartItem:p,removeCartItem:u}){const[m,g]=ie(ba),[x,f]=t(null),[y,b]=t(!1),[h,v]=t(null),{setLoading:w}=Jt();n(()=>{a?.availableForSale&&b(!0),a?.variants?.nodes&&a?.variants?.nodes.length>0&&f(a?.variants?.nodes[0])},[a]);const C=x?.price?.amount,
|
|
1950
|
+
`,Ta=e=>{if("string"!=typeof e)return e;const t=e.match(/^gid:\/\/shopify\/\w+\/(\d+)$/);return t?t[1]:e};function Sa({themeColor:o,id:r,showPrice:i,detail:a,errorText:l,customText:c,showGiftIcon:s,showProductImage:d,addCartItem:p,removeCartItem:u}){const[m,g]=ie(ba),[x,f]=t(null),[y,b]=t(!1),[h,v]=t(null),{setLoading:w}=Jt();n(()=>{a?.availableForSale&&b(!0),a?.variants?.nodes&&a?.variants?.nodes.length>0&&f(a?.variants?.nodes[0])},[a]);const C=async()=>{try{w(!0,!0),v(null),g(!m),!m&&p&&x?await p(Ta(x?.id),1):m&&u&&x&&await u(Ta(x?.id),"giftWrap"),w(!1,!1)}catch(e){w(!1,!1),v("Failed to add to cart"),g(m),console.error("Error updating gift wrap:",e)}},E=x?.price?.amount,k=x?.image?.url||a?.featuredImage?.url;return y?e.createElement(va,{className:"yt-cart-gift-wrap-container"},e.createElement(wa,{className:"yt-cart-gift-wrap-row",onClick:C},e.createElement(Ca,{className:"yt-cart-gift-wrap-text-container"},d&&k?e.createElement(ha,{className:"yt-cart-gift-wrap-product-image",src:k,alt:"Gift wrap"}):s?e.createElement(W,{className:"yt-cart-gift-wrap-icon",size:24,color:o,style:{height:"24px",width:"24px"}}):null,c||"+ Gift-Wrap",i?e.createElement("span",{className:"yt-cart-gift-wrap-price",style:{color:o}},"₹",Number(E).toFixed(0)):""),e.createElement(Ea,{className:"yt-cart-gift-wrap-checkbox",type:"checkbox",checked:m,onChange:C,onClick:e=>e.stopPropagation(),$themeColor:o,disabled:!y})),h&&e.createElement(ka,{className:"yt-cart-gift-wrap-error-message"},h)):null}const $a=c.div`
|
|
1950
1951
|
margin-top: 10px;
|
|
1951
1952
|
margin-bottom: 5px;
|
|
1952
1953
|
margin-left: 1rem;
|