@gem-sdk/plugin-cart-drawer 17.0.0-dev.9 → 17.0.0-staging.20

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("@gem-sdk/core"),a=require("react"),r=require("./DiscountCodeItem.js"),l=require("./LoadingIcon.js");exports.default=()=>{let t=a.useRef(null),{cartId:p}=s.useCartId(),{trigger:i,isMutating:d}=s.useCartDiscountCodesUpdate({onSuccess:()=>{t.current&&(t.current.value="")}}),{data:o}=s.useCartData(),u=a.useMemo(()=>o?.discounts?.map(e=>e.code).filter(s.isDefined)??[],[o?.discounts]),c=a.useCallback(()=>{p&&t.current?.value&&!u.some(e=>e.toLowerCase()===t.current?.value.trim().toLowerCase())&&i({cartId:p,discountCodes:[t.current.value,...u]})},[p,i,u]);return e.jsxs("div",{className:"gp-flex gp-flex-col gp-gap-2 gp-border-t gp-p-4 ",children:[e.jsxs("div",{className:"gp-flex gp-gap-4",children:[e.jsx("input",{className:"gp-flex-1 gp-border gp-p-2 gp-outline-none",placeholder:"Discount Code",style:{...s.composeRadius({normal:{radiusType:"small"}})},ref:t}),e.jsxs("button",{disabled:d,onClick:c,className:"gp-relative gp-bg-g-brand gp-px-2 gp-text-g-text-3 disabled:gp-opacity-80",style:{...s.composeRadius({normal:{radiusType:"small"}})},children:[e.jsx("div",{className:s.cls("gp-absolute gp-left-1/2 gp-top-1/2 -gp-translate-x-1/2 -gp-translate-y-1/2",{"gp-hidden":!d}),children:e.jsx(l.default,{})}),e.jsx("span",{className:s.cls("gp-g-paragraph-1",{"gp-invisible":d}),children:"Apply Code"})]})]}),e.jsx("div",{className:"gp-inline-flex gp-flex-wrap gp-gap-2",children:o?.discounts?.map(s=>e.jsx(r.default,{item:s},s.code))})]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),react=require("react"),DiscountCodeItem=require("./DiscountCodeItem.js"),LoadingIcon=require("./LoadingIcon.js");const CartDiscountCode=()=>{let e=react.useRef(null),{cartId:s}=core.useCartId(),{trigger:t,isMutating:r}=core.useCartDiscountCodesUpdate({onSuccess:()=>{e.current&&(e.current.value="")}}),{data:a}=core.useCartData(),o=react.useMemo(()=>a?.discounts?.map(e=>e.code).filter(core.isDefined)??[],[a?.discounts]),i=react.useCallback(()=>{s&&e.current?.value&&!o.some(s=>s.toLowerCase()===e.current?.value.trim().toLowerCase())&&t({cartId:s,discountCodes:[e.current.value,...o]})},[s,t,o]);return jsxRuntime.jsxs("div",{className:"gp-flex gp-flex-col gp-gap-2 gp-border-t gp-p-4 ",children:[jsxRuntime.jsxs("div",{className:"gp-flex gp-gap-4",children:[jsxRuntime.jsx("input",{className:"gp-flex-1 gp-border gp-p-2 gp-outline-none",placeholder:"Discount Code",style:{...core.composeRadius({normal:{radiusType:"small"}})},ref:e}),jsxRuntime.jsxs("button",{disabled:r,onClick:i,className:"gp-relative gp-bg-g-brand gp-px-2 gp-text-g-text-3 disabled:gp-opacity-80",style:{...core.composeRadius({normal:{radiusType:"small"}})},children:[jsxRuntime.jsx("div",{className:core.cls("gp-absolute gp-left-1/2 gp-top-1/2 -gp-translate-x-1/2 -gp-translate-y-1/2",{"gp-hidden":!r}),children:jsxRuntime.jsx(LoadingIcon.default,{})}),jsxRuntime.jsx("span",{className:core.cls("gp-g-paragraph-1",{"gp-invisible":r}),children:"Apply Code"})]})]}),jsxRuntime.jsx("div",{className:"gp-inline-flex gp-flex-wrap gp-gap-2",children:a?.discounts?.map(e=>jsxRuntime.jsx(DiscountCodeItem.default,{item:e},e.code))})]})};exports.default=CartDiscountCode;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("react-transition-group"),l=require("@gem-sdk/components"),s=require("@gem-sdk/core"),i=require("./CartDiscountCode.js"),a=require("./CartFooter.js"),p=require("./CartLineItem.js"),g=require("./CartOrderNote.js");const n={transition:"opacity 300ms ease-in-out",opacity:0},o={entering:{opacity:1},entered:{opacity:1},exiting:{opacity:0},exited:{opacity:0},unmounted:{opacity:0}},c=({className:c,style:d,setting:u})=>{let{data:x,isLoading:m,error:h}=s.useCartData(),{closeCart:b,isCartOpen:f}=s.useCartUI(),j=r.useRef(null);return e.jsx(t.Transition,{in:f,timeout:300,nodeRef:j,children:r=>e.jsxs("div",{ref:j,className:s.cls("gp-fixed gp-inset-0 gp-z-90",c,{"gp-invisible":!f,"gp-visible":f}),style:{...d,...n,...o[r],zIndex:l.ELEMENT_Z_INDEX.CART_DRAWER},children:[e.jsx("div",{"aria-hidden":!0,onClick:()=>b(),className:"gp-fixed gp-inset-0 gp-z-80 gp-bg-slate-600/40"}),e.jsx("div",{className:"gp-fixed gp-inset-y-0 gp-right-0 gp-z-90 gp-flex gp-w-full gp-max-w-[400px] gp-flex-col gp-bg-white gp-text-g-text-1 gp-shadow-2xl mobile:gp-w-full",children:m?e.jsx("div",{className:"gp-w-full gp-pt-10 gp-text-center",children:"Loading..."}):h?e.jsxs("div",{className:"gp-w-full gp-pt-10 gp-text-center gp-text-g-error",children:["Error: ",h?.[0]?.message]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"gp-flex gp-items-center gp-justify-between gp-border-b-g-line-3 gp-px-6 gp-py-3 border-b",children:[e.jsx("span",{className:"gp-font-g-heading gp-text-xl gp-font-semibold",children:u?.title}),e.jsx("button",{onClick:b,title:"Close cart drawer",children:e.jsx("svg",{className:"gp-w-5",fill:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"m4.397 4.554.073-.084a.75.75 0 0 1 .976-.073l.084.073L12 10.939l6.47-6.47a.75.75 0 1 1 1.06 1.061L13.061 12l6.47 6.47a.75.75 0 0 1 .072.976l-.073.084a.75.75 0 0 1-.976.073l-.084-.073L12 13.061l-6.47 6.47a.75.75 0 0 1-1.06-1.061L10.939 12l-6.47-6.47a.75.75 0 0 1-.072-.976l.073-.084-.073.084Z"})})})]}),e.jsx("div",{className:"gp-group gp-h-full gp-overflow-y-auto gp-px-6 gp-pb-4 scrollbar:!gp-h-1.5 scrollbar:!gp-w-1.5 scrollbar:gp-bg-transparent scrollbar-track:!gp-rounded scrollbar-track:!gp-bg-slate-100 scrollbar-thumb:!gp-rounded scrollbar-thumb:!gp-bg-slate-300",children:x&&x.lineItems.length?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"gp-flex gp-flex-col",children:x.lineItems.map(r=>r?e.jsx(s.CartLineProvider,{line:r,children:e.jsx(p.default,{})},r.id):null)}),e.jsx(g.default,{placeholder:"Leave your order note here...",triggerUpdate:"blur"})]}):e.jsx("div",{className:"gp-w-full gp-pt-10 gp-text-center",children:u?.emptyLabel})}),e.jsx(i.default,{}),!!x&&!!x.lineItems.length&&e.jsx(a.default,{openMode:u?.openMode,checkoutUrl:x.checkoutUrl,price:x?.totalPrice,currencyCode:x?.currency.code})]})})]})})};c.defaultProps={setting:{title:"Your Cart",emptyLabel:"Your cart is empty",openMode:"page"}},exports.default=c;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),react=require("react"),reactTransitionGroup=require("react-transition-group"),components=require("@gem-sdk/components"),core=require("@gem-sdk/core"),CartDiscountCode=require("./CartDiscountCode.js"),CartFooter=require("./CartFooter.js"),CartLineItem=require("./CartLineItem.js"),CartOrderNote=require("./CartOrderNote.js");const duration=300,defaultStyle={transition:"opacity 300ms ease-in-out",opacity:0},transitionStyles={entering:{opacity:1},entered:{opacity:1},exiting:{opacity:0},exited:{opacity:0},unmounted:{opacity:0}},CartDrawer=({className:e,style:t,setting:r})=>{let{data:s,isLoading:i,error:n}=core.useCartData(),{closeCart:a,isCartOpen:l}=core.useCartUI(),o=react.useRef(null);return jsxRuntime.jsx(reactTransitionGroup.Transition,{in:l,timeout:300,nodeRef:o,children:p=>jsxRuntime.jsxs("div",{ref:o,className:core.cls("gp-fixed gp-inset-0 gp-z-90",e,{"gp-invisible":!l,"gp-visible":l}),style:{...t,...defaultStyle,...transitionStyles[p],zIndex:components.ELEMENT_Z_INDEX.CART_DRAWER},children:[jsxRuntime.jsx("div",{"aria-hidden":!0,onClick:()=>a(),className:"gp-fixed gp-inset-0 gp-z-80 gp-bg-slate-600/40"}),jsxRuntime.jsx("div",{className:"gp-fixed gp-inset-y-0 gp-right-0 gp-z-90 gp-flex gp-w-full gp-max-w-[400px] gp-flex-col gp-bg-white gp-text-g-text-1 gp-shadow-2xl mobile:gp-w-full",children:i?jsxRuntime.jsx("div",{className:"gp-w-full gp-pt-10 gp-text-center",children:"Loading..."}):n?jsxRuntime.jsxs("div",{className:"gp-w-full gp-pt-10 gp-text-center gp-text-g-error",children:["Error: ",n?.[0]?.message]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"gp-flex gp-items-center gp-justify-between gp-border-b-g-line-3 gp-px-6 gp-py-3 border-b",children:[jsxRuntime.jsx("span",{className:"gp-font-g-heading gp-text-xl gp-font-semibold",children:r?.title}),jsxRuntime.jsx("button",{onClick:a,title:"Close cart drawer",children:jsxRuntime.jsx("svg",{className:"gp-w-5",fill:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"m4.397 4.554.073-.084a.75.75 0 0 1 .976-.073l.084.073L12 10.939l6.47-6.47a.75.75 0 1 1 1.06 1.061L13.061 12l6.47 6.47a.75.75 0 0 1 .072.976l-.073.084a.75.75 0 0 1-.976.073l-.084-.073L12 13.061l-6.47 6.47a.75.75 0 0 1-1.06-1.061L10.939 12l-6.47-6.47a.75.75 0 0 1-.072-.976l.073-.084-.073.084Z"})})})]}),jsxRuntime.jsx("div",{className:"gp-group gp-h-full gp-overflow-y-auto gp-px-6 gp-pb-4 scrollbar:!gp-h-1.5 scrollbar:!gp-w-1.5 scrollbar:gp-bg-transparent scrollbar-track:!gp-rounded scrollbar-track:!gp-bg-slate-100 scrollbar-thumb:!gp-rounded scrollbar-thumb:!gp-bg-slate-300",children:s&&s.lineItems.length?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"gp-flex gp-flex-col",children:s.lineItems.map(e=>e?jsxRuntime.jsx(core.CartLineProvider,{line:e,children:jsxRuntime.jsx(CartLineItem.default,{})},e.id):null)}),jsxRuntime.jsx(CartOrderNote.default,{placeholder:"Leave your order note here...",triggerUpdate:"blur"})]}):jsxRuntime.jsx("div",{className:"gp-w-full gp-pt-10 gp-text-center",children:r?.emptyLabel})}),jsxRuntime.jsx(CartDiscountCode.default,{}),!!s&&!!s.lineItems.length&&jsxRuntime.jsx(CartFooter.default,{openMode:r?.openMode,checkoutUrl:s.checkoutUrl,price:s?.totalPrice,currencyCode:s?.currency.code})]})})]})})};CartDrawer.defaultProps={setting:{title:"Your Cart",emptyLabel:"Your cart is empty",openMode:"page"}},exports.default=CartDrawer;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("@gem-sdk/core"),t=require("react");exports.default=({checkoutUrl:i,price:r,openMode:o})=>{let d=n.useCheckoutUrl(i),l=t.useRef(null),s=n.useMoney(r??0),c=(e,n)=>{if("popup"===o){let t=void 0!==window.screenLeft?window.screenLeft:window.screenX,i=void 0!==window.screenTop?window.screenTop:window.screenY,r=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,o=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height,s=r/window.screen.availWidth,c=(r-e)/2/s+t,p=(o-n)/2/s+i;l.current=window.open(d,"checkout",`scrollbars=yes, width=${e/s}, height=${n/s}, top=${p}, left=${c}`),l.current?.focus()}else d&&window.open(d)};return e.jsxs("div",{className:"gp-flex gp-flex-col gp-gap-4 gp-border-t gp-border-t-g-line-3 gp-bg-g-bg-2 gp-px-6 gp-pb-8 gp-pt-4",children:[e.jsxs("div",{className:"gp-g-paragraph-1 gp-flex gp-justify-between gp-font-semibold",children:[e.jsx("span",{children:"Subtotal:"}),e.jsx("span",{"aria-label":"Total price",children:s.localizedString})]}),e.jsxs("div",{"aria-label":"Checkout",role:"button","aria-hidden":"true",className:"gp-g-paragraph-1 gp-flex gp-justify-between gp-bg-g-brand gp-px-4 gp-py-3 gp-font-semibold gp-text-g-text-3",onClick:()=>c(600,600),style:{...n.composeRadius({normal:{radiusType:"small"}})},children:[e.jsx("span",{children:s.localizedString}),e.jsx("span",{children:"Checkout"})]})]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),react=require("react");const CartFooter=({checkoutUrl:e,price:t,openMode:n})=>{let i=core.useCheckoutUrl(e),r=react.useRef(null),o=core.useMoney(t??0),s=(e,t)=>{if("popup"===n){let n=void 0!==window.screenLeft?window.screenLeft:window.screenX,o=void 0!==window.screenTop?window.screenTop:window.screenY,s=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,c=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height,d=s/window.screen.availWidth,l=(s-e)/2/d+n,p=(c-t)/2/d+o;r.current=window.open(i,"checkout",`scrollbars=yes, width=${e/d}, height=${t/d}, top=${p}, left=${l}`),r.current?.focus()}else i&&window.open(i)};return jsxRuntime.jsxs("div",{className:"gp-flex gp-flex-col gp-gap-4 gp-border-t gp-border-t-g-line-3 gp-bg-g-bg-2 gp-px-6 gp-pb-8 gp-pt-4",children:[jsxRuntime.jsxs("div",{className:"gp-g-paragraph-1 gp-flex gp-justify-between gp-font-semibold",children:[jsxRuntime.jsx("span",{children:"Subtotal:"}),jsxRuntime.jsx("span",{"aria-label":"Total price",children:o.localizedString})]}),jsxRuntime.jsxs("div",{"aria-label":"Checkout",role:"button","aria-hidden":"true",className:"gp-g-paragraph-1 gp-flex gp-justify-between gp-bg-g-brand gp-px-4 gp-py-3 gp-font-semibold gp-text-g-text-3",onClick:()=>s(600,600),style:{...core.composeRadius({normal:{radiusType:"small"}})},children:[jsxRuntime.jsx("span",{children:o.localizedString}),jsxRuntime.jsx("span",{children:"Checkout"})]})]})};exports.default=CartFooter;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("@gem-sdk/core"),t=require("@gem-sdk/components"),a=require("./CartLineItemQuantity.js"),r=require("./icons/Trash.js"),l=require("./LoadingIcon.js");exports.default=()=>{let i=s.useCartLine(),{cartId:n}=s.useCartId(),{isMutating:g,trigger:p}=s.useRemoveCartItem(),c=s.useMoney(i.variant?.price?i.variant?.price:0),o=s.useMoney(i.variant?.listPrice?i.variant?.listPrice:0);return e.jsxs("div",{className:"gp-flex gp-items-center gp-gap-4 gp-border-b gp-border-b-g-line-2 gp-py-4 last:gp-border-b-transparent",children:[e.jsx("div",{className:"gp-aspect-square gp-w-16",children:i.variant?.image?.url&&e.jsx("img",{className:"gp-h-full gp-w-full gp-object-cover",src:i.variant.image.url,alt:i.variant?.image?.altText??""})}),e.jsxs("div",{className:"gp-flex-1",children:[e.jsxs("p",{className:"gp-line-clamp-2",children:[i.productTitle," ","Default Title"!==i.variant.name&&` - ${i.variant.name}`]}),e.jsxs("div",{className:"gp-flex gp-flex-col gp-gap-1 gp-text-sm",children:[e.jsxs("div",{className:"gp-flex gp-gap-2",children:[e.jsx("span",{className:"gp-font-semibold",children:c.localizedString}),i.variant?.listPrice>0&&e.jsx("span",{className:"gp-text-[#B4B4B4] gp-line-through",children:o.localizedString})]}),i.attributes?.map(s=>e.jsxs("div",{children:[s.key,": ",s.value]},s.key))]}),e.jsxs("div",{className:"gp-flex gp-items-center gp-justify-between",children:[e.jsx(a.default,{size:"medium"}),e.jsx("button",{onClick:()=>{t.openConfirm({title:e.jsxs("div",{className:"gp-flex gp-w-full gp-flex-col gp-items-center gp-gap-4",children:[e.jsx(r.default,{}),e.jsx("p",{className:"gp-font-g-body gp-text-xl gp-font-semibold",children:"Are you sure ?"})]}),content:e.jsxs("div",{className:"gp-text-center",children:[e.jsx("p",{children:"Do you really want to delete these items?"}),e.jsx("p",{children:"This process cannot be undone."})]}),className:"gp-w-full gp-max-w-[572px] gp-gap-4 gp-rounded",buttons:[{label:"Cancel",className:"gp-w-[130px] !gp-bg-g-bg-1"},{label:"Delete",className:"!gp-bg-g-error !gp-text-g-text-3 !font-g-body gp-w-[130px]",onClick:()=>{n&&i.id&&p({cartId:n,lineId:i.id})}}]})},"aria-label":"Remove item from cart",title:"Remove item from cart",type:"button",children:g?e.jsx(l.default,{className:"gp-text-g-brand"}):e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"gp-w-4 gp-text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})]})]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),components=require("@gem-sdk/components"),CartLineItemQuantity=require("./CartLineItemQuantity.js"),Trash=require("./icons/Trash.js"),LoadingIcon=require("./LoadingIcon.js");const CartLineItem=()=>{let e=core.useCartLine(),{cartId:t}=core.useCartId(),{isMutating:s,trigger:i}=core.useRemoveCartItem(),a=core.useMoney(e.variant?.price?e.variant?.price:0),n=core.useMoney(e.variant?.listPrice?e.variant?.listPrice:0);return jsxRuntime.jsxs("div",{className:"gp-flex gp-items-center gp-gap-4 gp-border-b gp-border-b-g-line-2 gp-py-4 last:gp-border-b-transparent",children:[jsxRuntime.jsx("div",{className:"gp-aspect-square gp-w-16",children:e.variant?.image?.url&&jsxRuntime.jsx("img",{className:"gp-h-full gp-w-full gp-object-cover",src:e.variant.image.url,alt:e.variant?.image?.altText??""})}),jsxRuntime.jsxs("div",{className:"gp-flex-1",children:[jsxRuntime.jsxs("p",{className:"gp-line-clamp-2",children:[e.productTitle," ","Default Title"!==e.variant.name&&` - ${e.variant.name}`]}),jsxRuntime.jsxs("div",{className:"gp-flex gp-flex-col gp-gap-1 gp-text-sm",children:[jsxRuntime.jsxs("div",{className:"gp-flex gp-gap-2",children:[jsxRuntime.jsx("span",{className:"gp-font-semibold",children:a.localizedString}),e.variant?.listPrice>0&&jsxRuntime.jsx("span",{className:"gp-text-[#B4B4B4] gp-line-through",children:n.localizedString})]}),e.attributes?.map(e=>jsxRuntime.jsxs("div",{children:[e.key,": ",e.value]},e.key))]}),jsxRuntime.jsxs("div",{className:"gp-flex gp-items-center gp-justify-between",children:[jsxRuntime.jsx(CartLineItemQuantity.default,{size:"medium"}),jsxRuntime.jsx("button",{onClick:()=>{components.openConfirm({title:jsxRuntime.jsxs("div",{className:"gp-flex gp-w-full gp-flex-col gp-items-center gp-gap-4",children:[jsxRuntime.jsx(Trash.default,{}),jsxRuntime.jsx("p",{className:"gp-font-g-body gp-text-xl gp-font-semibold",children:"Are you sure ?"})]}),content:jsxRuntime.jsxs("div",{className:"gp-text-center",children:[jsxRuntime.jsx("p",{children:"Do you really want to delete these items?"}),jsxRuntime.jsx("p",{children:"This process cannot be undone."})]}),className:"gp-w-full gp-max-w-[572px] gp-gap-4 gp-rounded",buttons:[{label:"Cancel",className:"gp-w-[130px] !gp-bg-g-bg-1"},{label:"Delete",className:"!gp-bg-g-error !gp-text-g-text-3 !font-g-body gp-w-[130px]",onClick:()=>{t&&e.id&&i({cartId:t,lineId:e.id})}}]})},"aria-label":"Remove item from cart",title:"Remove item from cart",type:"button",children:s?jsxRuntime.jsx(LoadingIcon.default,{className:"gp-text-g-brand"}):jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"gp-w-4 gp-text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})]})]})};exports.default=CartLineItem;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("@gem-sdk/core"),s=require("./CartLineQuantityAdjustButton.js");const r=({size:r})=>{let l=t.useCartLine();return e.jsxs("div",{className:t.cls("gp-mt-2 gp-inline-flex gp-items-center gp-overflow-auto gp-rounded gp-border gp-border-g-line-3 gp-text-g-text-1",{"gp-h-12":"large"===r,"gp-h-10":"medium"===r,"gp-h-8":"small"===r}),children:[e.jsx(s.default,{adjust:"decrease","aria-label":"Decrease quantity",className:"gp-flex gp-aspect-square gp-h-full gp-items-center gp-justify-center",children:e.jsx("svg",{className:"gp-h-4",fill:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M3.755 12.5h16.492a.75.75 0 0 0 0-1.5H3.755a.75.75 0 0 0 0 1.5Z"})})}),e.jsx("div",{className:"gp-flex gp-h-full gp-min-w-[50px] gp-select-none gp-items-center gp-justify-center gp-border-x gp-border-g-line-3 gp-px-2 gp-text-center gp-text-base gp-font-semibold",children:l.quantity}),e.jsx(s.default,{adjust:"increase","aria-label":"Increase quantity",className:"gp-flex gp-aspect-square gp-h-full gp-items-center gp-justify-center",children:e.jsx("svg",{className:"gp-h-4",fill:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M11.75 3a.75.75 0 0 1 .743.648l.007.102.001 7.25h7.253a.75.75 0 0 1 .102 1.493l-.102.007h-7.253l.002 7.25a.75.75 0 0 1-1.493.101l-.007-.102-.002-7.249H3.752a.75.75 0 0 1-.102-1.493L3.752 11h7.25L11 3.75a.75.75 0 0 1 .75-.75Z"})})})]})};r.defaultProps={size:"medium"},exports.default=r;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),CartLineQuantityAdjustButton=require("./CartLineQuantityAdjustButton.js");const CartLineItemQuantity=({size:e})=>{let t=core.useCartLine();return jsxRuntime.jsxs("div",{className:core.cls("gp-mt-2 gp-inline-flex gp-items-center gp-overflow-auto gp-rounded gp-border gp-border-g-line-3 gp-text-g-text-1",{"gp-h-12":"large"===e,"gp-h-10":"medium"===e,"gp-h-8":"small"===e}),children:[jsxRuntime.jsx(CartLineQuantityAdjustButton.default,{adjust:"decrease","aria-label":"Decrease quantity",className:"gp-flex gp-aspect-square gp-h-full gp-items-center gp-justify-center",children:jsxRuntime.jsx("svg",{className:"gp-h-4",fill:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M3.755 12.5h16.492a.75.75 0 0 0 0-1.5H3.755a.75.75 0 0 0 0 1.5Z"})})}),jsxRuntime.jsx("div",{className:"gp-flex gp-h-full gp-min-w-[50px] gp-select-none gp-items-center gp-justify-center gp-border-x gp-border-g-line-3 gp-px-2 gp-text-center gp-text-base gp-font-semibold",children:t.quantity}),jsxRuntime.jsx(CartLineQuantityAdjustButton.default,{adjust:"increase","aria-label":"Increase quantity",className:"gp-flex gp-aspect-square gp-h-full gp-items-center gp-justify-center",children:jsxRuntime.jsx("svg",{className:"gp-h-4",fill:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M11.75 3a.75.75 0 0 1 .743.648l.007.102.001 7.25h7.253a.75.75 0 0 1 .102 1.493l-.102.007h-7.253l.002 7.25a.75.75 0 0 1-1.493.101l-.007-.102-.002-7.249H3.752a.75.75 0 0 1-.102-1.493L3.752 11h7.25L11 3.75a.75.75 0 0 1 .75-.75Z"})})})]})};CartLineItemQuantity.defaultProps={size:"medium"},exports.default=CartLineItemQuantity;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("@gem-sdk/core"),s=require("@gem-sdk/components"),a=require("./icons/Trash.js");const l=({children:l,adjust:n,className:g,style:p})=>{let{isMutating:r,trigger:i}=t.useUpdateCartItem(),{isMutating:d,trigger:o}=t.useRemoveCartItem(),{cartId:c}=t.useCartId(),u=t.useCartLine(),x=r||d;return e.jsx("button",{"aria-label":"Adjust quantity",className:g,style:p,disabled:x,onClick:()=>{if(c&&u.id){if("remove"===n){s.openConfirm({title:e.jsxs("div",{className:"gp-flex gp-w-full gp-flex-col gp-items-center gp-gap-4",children:[e.jsx(a.default,{}),e.jsx("p",{className:"gp-font-g-body gp-text-xl gp-font-semibold",children:"Are you sure ?"})]}),content:e.jsxs("div",{className:"gp-text-center",children:[e.jsx("p",{children:"Do you really want to delete this item?"}),e.jsx("p",{children:"This process cannot be undone."})]}),className:"gp-w-full gp-max-w-[572px] gp-gap-4 gp-rounded",buttons:[{label:"Cancel",className:"gp-w-[130px] !gp-bg-g-bg-1"},{label:"Delete",className:"!gp-bg-g-error !gp-text-g-text-3 !font-g-body gp-w-[130px]",onClick:()=>{u.id&&o({cartId:c,lineId:u.id})}}]});return}let t="decrease"===n?u.quantity-1:u.quantity+1;if(t<=0){s.openConfirm({title:e.jsxs("div",{className:"gp-flex gp-w-full gp-flex-col gp-items-center gp-gap-4",children:[e.jsx(a.default,{}),e.jsx("p",{className:"gp-font-g-body gp-text-xl gp-font-semibold",children:"Are you sure ?"})]}),content:e.jsxs("div",{className:"gp-text-center",children:[e.jsx("p",{children:"Do you really want to delete this item?"}),e.jsx("p",{children:"This process cannot be undone."})]}),className:"gp-w-full gp-max-w-[572px] gp-gap-4 gp-rounded",buttons:[{label:"Cancel",className:"gp-w-[130px] !gp-bg-g-bg-1"},{label:"Delete",className:"!gp-bg-g-error !gp-text-g-text-3 !font-g-body gp-w-[130px]",onClick:()=>{u.id&&o({cartId:c,lineId:u.id})}}]});return}i({cartId:c,line:{id:u.id,variantId:u.variant.id,quantity:t,productId:u.productId}})}},children:x?e.jsxs("div",{className:"gp-flex gp-gap-1",children:[e.jsx("span",{className:"gp-aspect-square gp-h-1 gp-animate-[flashing_500ms_infinite_alternate] gp-rounded-full gp-bg-g-brand"}),e.jsx("span",{className:"gp-aspect-square gp-h-1 gp-animate-[flashing_500ms_infinite_200ms_linear_alternate] gp-rounded-full gp-bg-g-brand"}),e.jsx("span",{className:"gp-aspect-square gp-h-1 gp-animate-[flashing_500ms_infinite_500ms_alternate] gp-rounded-full gp-bg-g-brand"})]}):l})};l.defaultProps={adjust:"increase"},exports.default=l;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),components=require("@gem-sdk/components"),Trash=require("./icons/Trash.js");const CartLineQuantityAdjustButton=({children:e,adjust:t,className:s,style:n})=>{let{isMutating:a,trigger:i}=core.useUpdateCartItem(),{isMutating:r,trigger:l}=core.useRemoveCartItem(),{cartId:g}=core.useCartId(),p=core.useCartLine(),u=a||r;return jsxRuntime.jsx("button",{"aria-label":"Adjust quantity",className:s,style:n,disabled:u,onClick:()=>{if(g&&p.id){if("remove"===t){components.openConfirm({title:jsxRuntime.jsxs("div",{className:"gp-flex gp-w-full gp-flex-col gp-items-center gp-gap-4",children:[jsxRuntime.jsx(Trash.default,{}),jsxRuntime.jsx("p",{className:"gp-font-g-body gp-text-xl gp-font-semibold",children:"Are you sure ?"})]}),content:jsxRuntime.jsxs("div",{className:"gp-text-center",children:[jsxRuntime.jsx("p",{children:"Do you really want to delete this item?"}),jsxRuntime.jsx("p",{children:"This process cannot be undone."})]}),className:"gp-w-full gp-max-w-[572px] gp-gap-4 gp-rounded",buttons:[{label:"Cancel",className:"gp-w-[130px] !gp-bg-g-bg-1"},{label:"Delete",className:"!gp-bg-g-error !gp-text-g-text-3 !font-g-body gp-w-[130px]",onClick:()=>{p.id&&l({cartId:g,lineId:p.id})}}]});return}let e="decrease"===t?p.quantity-1:p.quantity+1;if(e<=0){components.openConfirm({title:jsxRuntime.jsxs("div",{className:"gp-flex gp-w-full gp-flex-col gp-items-center gp-gap-4",children:[jsxRuntime.jsx(Trash.default,{}),jsxRuntime.jsx("p",{className:"gp-font-g-body gp-text-xl gp-font-semibold",children:"Are you sure ?"})]}),content:jsxRuntime.jsxs("div",{className:"gp-text-center",children:[jsxRuntime.jsx("p",{children:"Do you really want to delete this item?"}),jsxRuntime.jsx("p",{children:"This process cannot be undone."})]}),className:"gp-w-full gp-max-w-[572px] gp-gap-4 gp-rounded",buttons:[{label:"Cancel",className:"gp-w-[130px] !gp-bg-g-bg-1"},{label:"Delete",className:"!gp-bg-g-error !gp-text-g-text-3 !font-g-body gp-w-[130px]",onClick:()=>{p.id&&l({cartId:g,lineId:p.id})}}]});return}i({cartId:g,line:{id:p.id,variantId:p.variant.id,quantity:e,productId:p.productId}})}},children:u?jsxRuntime.jsxs("div",{className:"gp-flex gp-gap-1",children:[jsxRuntime.jsx("span",{className:"gp-aspect-square gp-h-1 gp-animate-[flashing_500ms_infinite_alternate] gp-rounded-full gp-bg-g-brand"}),jsxRuntime.jsx("span",{className:"gp-aspect-square gp-h-1 gp-animate-[flashing_500ms_infinite_200ms_linear_alternate] gp-rounded-full gp-bg-g-brand"}),jsxRuntime.jsx("span",{className:"gp-aspect-square gp-h-1 gp-animate-[flashing_500ms_infinite_500ms_alternate] gp-rounded-full gp-bg-g-brand"})]}):e})};CartLineQuantityAdjustButton.defaultProps={adjust:"increase"},exports.default=CartLineQuantityAdjustButton;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("@gem-sdk/core"),t=require("react");exports.default=({triggerUpdate:l,debounce:a,placeholder:u})=>{let n=t.useRef(null),o=t.useRef(null),s=t.useRef(new AbortController),{data:c}=r.useCartData(),{cartId:d}=r.useCartId(),{trigger:p}=r.useCartNoteUpdate(),g=t.useCallback(e=>{d&&c?.note!==e&&p({cartId:d,note:e})},[c?.note,d,p]),i="blur"===l?{onBlur:e=>{s.current.signal.aborted&&(s.current=new AbortController),g(e.target.value)}}:{onChange:()=>{o.current&&(s.current.signal.aborted||s.current.abort(),clearTimeout(o.current)),o.current=setTimeout(()=>{s.current=new AbortController,g(n.current?.value??"")},a??1e3)}};return e.jsxs("div",{className:"gp-flex gp-flex-col",children:[e.jsx("div",{className:"gp-mb-4 gp-border-b gp-border-b-[#F1F3F4] gp-pb-3",children:e.jsx("span",{className:"gp-font-semibold gp-text-[#424242]",children:"Order Note"})}),e.jsx("textarea",{defaultValue:c?.note,placeholder:u,ref:n,className:"gp-w-full gp-rounded gp-border gp-p-4 gp-outline-none",...i})]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),react=require("react");const CartOrderNote=({triggerUpdate:e,debounce:r,placeholder:t})=>{let a=react.useRef(null),u=react.useRef(null),o=react.useRef(new AbortController),{data:l}=core.useCartData(),{cartId:n}=core.useCartId(),{trigger:s}=core.useCartNoteUpdate(),c=react.useCallback(e=>{n&&l?.note!==e&&s({cartId:n,note:e})},[l?.note,n,s]),d=e=>{o.current.signal.aborted&&(o.current=new AbortController),c(e.target.value)},i=()=>{u.current&&(o.current.signal.aborted||o.current.abort(),clearTimeout(u.current)),u.current=setTimeout(()=>{o.current=new AbortController,c(a.current?.value??"")},r??1e3)},p="blur"===e?{onBlur:d}:{onChange:i};return jsxRuntime.jsxs("div",{className:"gp-flex gp-flex-col",children:[jsxRuntime.jsx("div",{className:"gp-mb-4 gp-border-b gp-border-b-[#F1F3F4] gp-pb-3",children:jsxRuntime.jsx("span",{className:"gp-font-semibold gp-text-[#424242]",children:"Order Note"})}),jsxRuntime.jsx("textarea",{defaultValue:l?.note,placeholder:t,ref:a,className:"gp-w-full gp-rounded gp-border gp-p-4 gp-outline-none",...p})]})};exports.default=CartOrderNote;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("@gem-sdk/core"),l=require("@gem-sdk/components"),t=require("react"),a=require("./icons/Trash.js"),r=require("./LoadingIcon.js");exports.default=({item:p})=>{let{cartId:g}=s.useCartId(),{trigger:c,isMutating:o}=s.useCartDiscountCodesUpdate(),{data:i}=s.useCartData(),n=t.useMemo(()=>i?.discounts?.map(e=>e.code).filter(s.isDefined)??[],[i?.discounts]),d=t.useCallback(s=>{l.openConfirm({title:e.jsxs("div",{className:"gp-flex gp-w-full gp-flex-col gp-items-center gp-gap-4",children:[e.jsx(a.default,{}),e.jsx("p",{className:"gp-font-g-body gp-text-xl gp-font-semibold",children:"Are you sure ?"})]}),content:e.jsx("div",{className:"gp-text-center",children:e.jsx("p",{children:"Do you really want to delete this code?"})}),className:"gp-w-full gp-max-w-[572px] gp-gap-4 gp-rounded",buttons:[{label:"Cancel",className:"gp-w-[130px] !gp-bg-g-bg-1"},{label:"Delete",className:"!gp-bg-g-error !gp-text-g-text-3 !font-g-body gp-w-[130px]",onClick:()=>{g&&c({cartId:g,discountCodes:n.filter(e=>e!==s)})}}]})},[g,c,n]);return e.jsxs("div",{className:"gp-flex gp-h-8 gp-items-center gp-gap-2 gp-rounded-sm gp-border gp-pl-2",children:[e.jsx("span",{className:s.cls("gp-flex-1",{"gp-text-g-error gp-line-through":!p.applicable,"gp-text-g-success":p.applicable}),children:p.code}),e.jsx("button",{disabled:o,onClick:()=>d(p.code),className:"gp-flex gp-aspect-square gp-h-full gp-items-center gp-justify-center",children:o?e.jsx(r.default,{className:"gp-text-g-brand"}):e.jsx("svg",{className:"gp-w-4",fill:"none",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"m4.397 4.554.073-.084a.75.75 0 0 1 .976-.073l.084.073L12 10.939l6.47-6.47a.75.75 0 1 1 1.06 1.061L13.061 12l6.47 6.47a.75.75 0 0 1 .072.976l-.073.084a.75.75 0 0 1-.976.073l-.084-.073L12 13.061l-6.47 6.47a.75.75 0 0 1-1.06-1.061L10.939 12l-6.47-6.47a.75.75 0 0 1-.072-.976l.073-.084-.073.084Z",fill:"currentColor"})})})]},p.code)};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),components=require("@gem-sdk/components"),react=require("react"),Trash=require("./icons/Trash.js"),LoadingIcon=require("./LoadingIcon.js");const DiscountCodeItem=({item:e})=>{let{cartId:s}=core.useCartId(),{trigger:t,isMutating:l}=core.useCartDiscountCodesUpdate(),{data:r}=core.useCartData(),a=react.useMemo(()=>r?.discounts?.map(e=>e.code).filter(core.isDefined)??[],[r?.discounts]),n=react.useCallback(e=>{components.openConfirm({title:jsxRuntime.jsxs("div",{className:"gp-flex gp-w-full gp-flex-col gp-items-center gp-gap-4",children:[jsxRuntime.jsx(Trash.default,{}),jsxRuntime.jsx("p",{className:"gp-font-g-body gp-text-xl gp-font-semibold",children:"Are you sure ?"})]}),content:jsxRuntime.jsx("div",{className:"gp-text-center",children:jsxRuntime.jsx("p",{children:"Do you really want to delete this code?"})}),className:"gp-w-full gp-max-w-[572px] gp-gap-4 gp-rounded",buttons:[{label:"Cancel",className:"gp-w-[130px] !gp-bg-g-bg-1"},{label:"Delete",className:"!gp-bg-g-error !gp-text-g-text-3 !font-g-body gp-w-[130px]",onClick:()=>{s&&t({cartId:s,discountCodes:a.filter(s=>s!==e)})}}]})},[s,t,a]);return jsxRuntime.jsxs("div",{className:"gp-flex gp-h-8 gp-items-center gp-gap-2 gp-rounded-sm gp-border gp-pl-2",children:[jsxRuntime.jsx("span",{className:core.cls("gp-flex-1",{"gp-text-g-error gp-line-through":!e.applicable,"gp-text-g-success":e.applicable}),children:e.code}),jsxRuntime.jsx("button",{disabled:l,onClick:()=>n(e.code),className:"gp-flex gp-aspect-square gp-h-full gp-items-center gp-justify-center",children:l?jsxRuntime.jsx(LoadingIcon.default,{className:"gp-text-g-brand"}):jsxRuntime.jsx("svg",{className:"gp-w-4",fill:"none",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"m4.397 4.554.073-.084a.75.75 0 0 1 .976-.073l.084.073L12 10.939l6.47-6.47a.75.75 0 1 1 1.06 1.061L13.061 12l6.47 6.47a.75.75 0 0 1 .072.976l-.073.084a.75.75 0 0 1-.976.073l-.084-.073L12 13.061l-6.47 6.47a.75.75 0 0 1-1.06-1.061L10.939 12l-6.47-6.47a.75.75 0 0 1-.072-.976l.073-.084-.073.084Z",fill:"currentColor"})})})]},e.code)};exports.default=DiscountCodeItem;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("@gem-sdk/core");exports.default=({className:s})=>e.jsxs("svg",{className:r.cls("gp-w-4 gp-animate-spin",s),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"gp-opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"gp-opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]});
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core");const LoadingIcon=({className:e})=>jsxRuntime.jsxs("svg",{className:core.cls("gp-w-4 gp-animate-spin",e),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[jsxRuntime.jsx("circle",{className:"gp-opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsxRuntime.jsx("path",{className:"gp-opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]});exports.default=LoadingIcon;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var C=require("react/jsx-runtime");exports.default=()=>C.jsxs("svg",{className:"gp-text-g-warning",width:"58",height:"66",viewBox:"0 0 58 66",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[C.jsx("path",{d:"M18.0625 24.0625C18.6427 24.0625 19.1991 24.293 19.6093 24.7032C20.0195 25.1134 20.25 25.6698 20.25 26.25V52.5C20.25 53.0802 20.0195 53.6366 19.6093 54.0468C19.1991 54.457 18.6427 54.6875 18.0625 54.6875C17.4823 54.6875 16.9259 54.457 16.5157 54.0468C16.1055 53.6366 15.875 53.0802 15.875 52.5V26.25C15.875 25.6698 16.1055 25.1134 16.5157 24.7032C16.9259 24.293 17.4823 24.0625 18.0625 24.0625ZM29 24.0625C29.5802 24.0625 30.1366 24.293 30.5468 24.7032C30.957 25.1134 31.1875 25.6698 31.1875 26.25V52.5C31.1875 53.0802 30.957 53.6366 30.5468 54.0468C30.1366 54.457 29.5802 54.6875 29 54.6875C28.4198 54.6875 27.8634 54.457 27.4532 54.0468C27.043 53.6366 26.8125 53.0802 26.8125 52.5V26.25C26.8125 25.6698 27.043 25.1134 27.4532 24.7032C27.8634 24.293 28.4198 24.0625 29 24.0625ZM42.125 26.25C42.125 25.6698 41.8945 25.1134 41.4843 24.7032C41.0741 24.293 40.5177 24.0625 39.9375 24.0625C39.3573 24.0625 38.8009 24.293 38.3907 24.7032C37.9805 25.1134 37.75 25.6698 37.75 26.25V52.5C37.75 53.0802 37.9805 53.6366 38.3907 54.0468C38.8009 54.457 39.3573 54.6875 39.9375 54.6875C40.5177 54.6875 41.0741 54.457 41.4843 54.0468C41.8945 53.6366 42.125 53.0802 42.125 52.5V26.25Z",fill:"currentColor"}),C.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M57.4375 13.125C57.4375 14.2853 56.9766 15.3981 56.1561 16.2186C55.3356 17.0391 54.2228 17.5 53.0625 17.5H50.875V56.875C50.875 59.1956 49.9531 61.4212 48.3122 63.0622C46.6712 64.7031 44.4456 65.625 42.125 65.625H15.875C13.5544 65.625 11.3288 64.7031 9.68782 63.0622C8.04687 61.4212 7.125 59.1956 7.125 56.875V17.5H4.9375C3.77718 17.5 2.66438 17.0391 1.84391 16.2186C1.02344 15.3981 0.5625 14.2853 0.5625 13.125V8.75C0.5625 7.58968 1.02344 6.47688 1.84391 5.65641C2.66438 4.83594 3.77718 4.375 4.9375 4.375H20.25C20.25 3.21468 20.7109 2.10188 21.5314 1.28141C22.3519 0.460936 23.4647 0 24.625 0H33.375C34.5353 0 35.6481 0.460936 36.4686 1.28141C37.2891 2.10188 37.75 3.21468 37.75 4.375H53.0625C54.2228 4.375 55.3356 4.83594 56.1561 5.65641C56.9766 6.47688 57.4375 7.58968 57.4375 8.75V13.125ZM12.0163 17.5L11.5 17.7581V56.875C11.5 58.0353 11.9609 59.1481 12.7814 59.9686C13.6019 60.7891 14.7147 61.25 15.875 61.25H42.125C43.2853 61.25 44.3981 60.7891 45.2186 59.9686C46.0391 59.1481 46.5 58.0353 46.5 56.875V17.7581L45.9837 17.5H12.0163ZM4.9375 13.125V8.75H53.0625V13.125H4.9375Z",fill:"currentColor"})]});
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime");const Trash=()=>jsxRuntime.jsxs("svg",{className:"gp-text-g-warning",width:"58",height:"66",viewBox:"0 0 58 66",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("path",{d:"M18.0625 24.0625C18.6427 24.0625 19.1991 24.293 19.6093 24.7032C20.0195 25.1134 20.25 25.6698 20.25 26.25V52.5C20.25 53.0802 20.0195 53.6366 19.6093 54.0468C19.1991 54.457 18.6427 54.6875 18.0625 54.6875C17.4823 54.6875 16.9259 54.457 16.5157 54.0468C16.1055 53.6366 15.875 53.0802 15.875 52.5V26.25C15.875 25.6698 16.1055 25.1134 16.5157 24.7032C16.9259 24.293 17.4823 24.0625 18.0625 24.0625ZM29 24.0625C29.5802 24.0625 30.1366 24.293 30.5468 24.7032C30.957 25.1134 31.1875 25.6698 31.1875 26.25V52.5C31.1875 53.0802 30.957 53.6366 30.5468 54.0468C30.1366 54.457 29.5802 54.6875 29 54.6875C28.4198 54.6875 27.8634 54.457 27.4532 54.0468C27.043 53.6366 26.8125 53.0802 26.8125 52.5V26.25C26.8125 25.6698 27.043 25.1134 27.4532 24.7032C27.8634 24.293 28.4198 24.0625 29 24.0625ZM42.125 26.25C42.125 25.6698 41.8945 25.1134 41.4843 24.7032C41.0741 24.293 40.5177 24.0625 39.9375 24.0625C39.3573 24.0625 38.8009 24.293 38.3907 24.7032C37.9805 25.1134 37.75 25.6698 37.75 26.25V52.5C37.75 53.0802 37.9805 53.6366 38.3907 54.0468C38.8009 54.457 39.3573 54.6875 39.9375 54.6875C40.5177 54.6875 41.0741 54.457 41.4843 54.0468C41.8945 53.6366 42.125 53.0802 42.125 52.5V26.25Z",fill:"currentColor"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M57.4375 13.125C57.4375 14.2853 56.9766 15.3981 56.1561 16.2186C55.3356 17.0391 54.2228 17.5 53.0625 17.5H50.875V56.875C50.875 59.1956 49.9531 61.4212 48.3122 63.0622C46.6712 64.7031 44.4456 65.625 42.125 65.625H15.875C13.5544 65.625 11.3288 64.7031 9.68782 63.0622C8.04687 61.4212 7.125 59.1956 7.125 56.875V17.5H4.9375C3.77718 17.5 2.66438 17.0391 1.84391 16.2186C1.02344 15.3981 0.5625 14.2853 0.5625 13.125V8.75C0.5625 7.58968 1.02344 6.47688 1.84391 5.65641C2.66438 4.83594 3.77718 4.375 4.9375 4.375H20.25C20.25 3.21468 20.7109 2.10188 21.5314 1.28141C22.3519 0.460936 23.4647 0 24.625 0H33.375C34.5353 0 35.6481 0.460936 36.4686 1.28141C37.2891 2.10188 37.75 3.21468 37.75 4.375H53.0625C54.2228 4.375 55.3356 4.83594 56.1561 5.65641C56.9766 6.47688 57.4375 7.58968 57.4375 8.75V13.125ZM12.0163 17.5L11.5 17.7581V56.875C11.5 58.0353 11.9609 59.1481 12.7814 59.9686C13.6019 60.7891 14.7147 61.25 15.875 61.25H42.125C43.2853 61.25 44.3981 60.7891 45.2186 59.9686C46.0391 59.1481 46.5 58.0353 46.5 56.875V17.7581L45.9837 17.5H12.0163ZM4.9375 13.125V8.75H53.0625V13.125H4.9375Z",fill:"currentColor"})]});exports.default=Trash;
package/dist/cjs/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./components/CartDrawer.js");exports.default=e.default;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var CartDrawer=require("./components/CartDrawer.js");exports.default=CartDrawer.default;
@@ -1 +1 @@
1
- import{jsxs as e,jsx as r}from"react/jsx-runtime";import{useCartId as a,useCartDiscountCodesUpdate as t,useCartData as p,isDefined as l,composeRadius as s,cls as o}from"@gem-sdk/core";import{useRef as i,useMemo as n,useCallback as g}from"react";import c from"./DiscountCodeItem.js";import d from"./LoadingIcon.js";let m=()=>{let m=i(null),{cartId:u}=a(),{trigger:f,isMutating:x}=t({onSuccess:()=>{m.current&&(m.current.value="")}}),{data:v}=p(),b=n(()=>v?.discounts?.map(e=>e.code).filter(l)??[],[v?.discounts]),h=g(()=>{u&&m.current?.value&&!b.some(e=>e.toLowerCase()===m.current?.value.trim().toLowerCase())&&f({cartId:u,discountCodes:[m.current.value,...b]})},[u,f,b]);return e("div",{className:"gp-flex gp-flex-col gp-gap-2 gp-border-t gp-p-4 ",children:[e("div",{className:"gp-flex gp-gap-4",children:[r("input",{className:"gp-flex-1 gp-border gp-p-2 gp-outline-none",placeholder:"Discount Code",style:{...s({normal:{radiusType:"small"}})},ref:m}),e("button",{disabled:x,onClick:h,className:"gp-relative gp-bg-g-brand gp-px-2 gp-text-g-text-3 disabled:gp-opacity-80",style:{...s({normal:{radiusType:"small"}})},children:[r("div",{className:o("gp-absolute gp-left-1/2 gp-top-1/2 -gp-translate-x-1/2 -gp-translate-y-1/2",{"gp-hidden":!x}),children:r(d,{})}),r("span",{className:o("gp-g-paragraph-1",{"gp-invisible":x}),children:"Apply Code"})]})]}),r("div",{className:"gp-inline-flex gp-flex-wrap gp-gap-2",children:v?.discounts?.map(e=>r(c,{item:e},e.code))})]})};export{m as default};
1
+ import{jsxs as e,jsx as r}from"react/jsx-runtime";import{useCartId as a,useCartDiscountCodesUpdate as t,useCartData as p,isDefined as l,composeRadius as o,cls as s}from"@gem-sdk/core";import{useRef as i,useMemo as n,useCallback as g}from"react";import c from"./DiscountCodeItem.js";import d from"./LoadingIcon.js";let CartDiscountCode=()=>{let m=i(null),{cartId:u}=a(),{trigger:f,isMutating:x}=t({onSuccess:()=>{m.current&&(m.current.value="")}}),{data:C}=p(),v=n(()=>C?.discounts?.map(e=>e.code).filter(l)??[],[C?.discounts]),b=g(()=>{u&&m.current?.value&&!v.some(e=>e.toLowerCase()===m.current?.value.trim().toLowerCase())&&f({cartId:u,discountCodes:[m.current.value,...v]})},[u,f,v]);return e("div",{className:"gp-flex gp-flex-col gp-gap-2 gp-border-t gp-p-4 ",children:[e("div",{className:"gp-flex gp-gap-4",children:[r("input",{className:"gp-flex-1 gp-border gp-p-2 gp-outline-none",placeholder:"Discount Code",style:{...o({normal:{radiusType:"small"}})},ref:m}),e("button",{disabled:x,onClick:b,className:"gp-relative gp-bg-g-brand gp-px-2 gp-text-g-text-3 disabled:gp-opacity-80",style:{...o({normal:{radiusType:"small"}})},children:[r("div",{className:s("gp-absolute gp-left-1/2 gp-top-1/2 -gp-translate-x-1/2 -gp-translate-y-1/2",{"gp-hidden":!x}),children:r(d,{})}),r("span",{className:s("gp-g-paragraph-1",{"gp-invisible":x}),children:"Apply Code"})]})]}),r("div",{className:"gp-inline-flex gp-flex-wrap gp-gap-2",children:C?.discounts?.map(e=>r(c,{item:e},e.code))})]})};export{CartDiscountCode as default};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as r,Fragment as t}from"react/jsx-runtime";import{useRef as l}from"react";import{Transition as p}from"react-transition-group";import{ELEMENT_Z_INDEX as i}from"@gem-sdk/components";import{useCartData as o,useCartUI as a,CartLineProvider as g,cls as n}from"@gem-sdk/core";import c from"./CartDiscountCode.js";import s from"./CartFooter.js";import d from"./CartLineItem.js";import m from"./CartOrderNote.js";let u={transition:"opacity 300ms ease-in-out",opacity:0},f={entering:{opacity:1},entered:{opacity:1},exiting:{opacity:0},exited:{opacity:0},unmounted:{opacity:0}},h=({className:h,style:b,setting:x})=>{let{data:w,isLoading:y,error:v}=o(),{closeCart:C,isCartOpen:N}=a(),L=l(null);return e(p,{in:N,timeout:300,nodeRef:L,children:l=>r("div",{ref:L,className:n("gp-fixed gp-inset-0 gp-z-90",h,{"gp-invisible":!N,"gp-visible":N}),style:{...b,...u,...f[l],zIndex:i.CART_DRAWER},children:[e("div",{"aria-hidden":!0,onClick:()=>C(),className:"gp-fixed gp-inset-0 gp-z-80 gp-bg-slate-600/40"}),e("div",{className:"gp-fixed gp-inset-y-0 gp-right-0 gp-z-90 gp-flex gp-w-full gp-max-w-[400px] gp-flex-col gp-bg-white gp-text-g-text-1 gp-shadow-2xl mobile:gp-w-full",children:y?e("div",{className:"gp-w-full gp-pt-10 gp-text-center",children:"Loading..."}):v?r("div",{className:"gp-w-full gp-pt-10 gp-text-center gp-text-g-error",children:["Error: ",v?.[0]?.message]}):r(t,{children:[r("div",{className:"gp-flex gp-items-center gp-justify-between gp-border-b-g-line-3 gp-px-6 gp-py-3 border-b",children:[e("span",{className:"gp-font-g-heading gp-text-xl gp-font-semibold",children:x?.title}),e("button",{onClick:C,title:"Close cart drawer",children:e("svg",{className:"gp-w-5",fill:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"m4.397 4.554.073-.084a.75.75 0 0 1 .976-.073l.084.073L12 10.939l6.47-6.47a.75.75 0 1 1 1.06 1.061L13.061 12l6.47 6.47a.75.75 0 0 1 .072.976l-.073.084a.75.75 0 0 1-.976.073l-.084-.073L12 13.061l-6.47 6.47a.75.75 0 0 1-1.06-1.061L10.939 12l-6.47-6.47a.75.75 0 0 1-.072-.976l.073-.084-.073.084Z"})})})]}),e("div",{className:"gp-group gp-h-full gp-overflow-y-auto gp-px-6 gp-pb-4 scrollbar:!gp-h-1.5 scrollbar:!gp-w-1.5 scrollbar:gp-bg-transparent scrollbar-track:!gp-rounded scrollbar-track:!gp-bg-slate-100 scrollbar-thumb:!gp-rounded scrollbar-thumb:!gp-bg-slate-300",children:w&&w.lineItems.length?r(t,{children:[e("div",{className:"gp-flex gp-flex-col",children:w.lineItems.map(r=>r?e(g,{line:r,children:e(d,{})},r.id):null)}),e(m,{placeholder:"Leave your order note here...",triggerUpdate:"blur"})]}):e("div",{className:"gp-w-full gp-pt-10 gp-text-center",children:x?.emptyLabel})}),e(c,{}),!!w&&!!w.lineItems.length&&e(s,{openMode:x?.openMode,checkoutUrl:w.checkoutUrl,price:w?.totalPrice,currencyCode:w?.currency.code})]})})]})})};h.defaultProps={setting:{title:"Your Cart",emptyLabel:"Your cart is empty",openMode:"page"}};export{h as default};
1
+ import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import{useRef as l}from"react";import{Transition as i}from"react-transition-group";import{ELEMENT_Z_INDEX as p}from"@gem-sdk/components";import{useCartData as a,useCartUI as o,cls as g,CartLineProvider as n}from"@gem-sdk/core";import s from"./CartDiscountCode.js";import c from"./CartFooter.js";import d from"./CartLineItem.js";import m from"./CartOrderNote.js";let duration=300,defaultStyle={transition:"opacity 300ms ease-in-out",opacity:0},transitionStyles={entering:{opacity:1},entered:{opacity:1},exiting:{opacity:0},exited:{opacity:0},unmounted:{opacity:0}},CartDrawer=({className:u,style:f,setting:h})=>{let{data:b,isLoading:x,error:y}=a(),{closeCart:w,isCartOpen:v}=o(),C=l(null);return e(i,{in:v,timeout:300,nodeRef:C,children:l=>t("div",{ref:C,className:g("gp-fixed gp-inset-0 gp-z-90",u,{"gp-invisible":!v,"gp-visible":v}),style:{...f,...defaultStyle,...transitionStyles[l],zIndex:p.CART_DRAWER},children:[e("div",{"aria-hidden":!0,onClick:()=>w(),className:"gp-fixed gp-inset-0 gp-z-80 gp-bg-slate-600/40"}),e("div",{className:"gp-fixed gp-inset-y-0 gp-right-0 gp-z-90 gp-flex gp-w-full gp-max-w-[400px] gp-flex-col gp-bg-white gp-text-g-text-1 gp-shadow-2xl mobile:gp-w-full",children:x?e("div",{className:"gp-w-full gp-pt-10 gp-text-center",children:"Loading..."}):y?t("div",{className:"gp-w-full gp-pt-10 gp-text-center gp-text-g-error",children:["Error: ",y?.[0]?.message]}):t(r,{children:[t("div",{className:"gp-flex gp-items-center gp-justify-between gp-border-b-g-line-3 gp-px-6 gp-py-3 border-b",children:[e("span",{className:"gp-font-g-heading gp-text-xl gp-font-semibold",children:h?.title}),e("button",{onClick:w,title:"Close cart drawer",children:e("svg",{className:"gp-w-5",fill:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"m4.397 4.554.073-.084a.75.75 0 0 1 .976-.073l.084.073L12 10.939l6.47-6.47a.75.75 0 1 1 1.06 1.061L13.061 12l6.47 6.47a.75.75 0 0 1 .072.976l-.073.084a.75.75 0 0 1-.976.073l-.084-.073L12 13.061l-6.47 6.47a.75.75 0 0 1-1.06-1.061L10.939 12l-6.47-6.47a.75.75 0 0 1-.072-.976l.073-.084-.073.084Z"})})})]}),e("div",{className:"gp-group gp-h-full gp-overflow-y-auto gp-px-6 gp-pb-4 scrollbar:!gp-h-1.5 scrollbar:!gp-w-1.5 scrollbar:gp-bg-transparent scrollbar-track:!gp-rounded scrollbar-track:!gp-bg-slate-100 scrollbar-thumb:!gp-rounded scrollbar-thumb:!gp-bg-slate-300",children:b&&b.lineItems.length?t(r,{children:[e("div",{className:"gp-flex gp-flex-col",children:b.lineItems.map(t=>t?e(n,{line:t,children:e(d,{})},t.id):null)}),e(m,{placeholder:"Leave your order note here...",triggerUpdate:"blur"})]}):e("div",{className:"gp-w-full gp-pt-10 gp-text-center",children:h?.emptyLabel})}),e(s,{}),!!b&&!!b.lineItems.length&&e(c,{openMode:h?.openMode,checkoutUrl:b.checkoutUrl,price:b?.totalPrice,currencyCode:b?.currency.code})]})})]})})};CartDrawer.defaultProps={setting:{title:"Your Cart",emptyLabel:"Your cart is empty",openMode:"page"}};export{CartDrawer as default};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as n}from"react/jsx-runtime";import{useCheckoutUrl as t,useMoney as i,composeRadius as r}from"@gem-sdk/core";import{useRef as o}from"react";let l=({checkoutUrl:l,price:d,openMode:p})=>{let c=t(l),g=o(null),a=i(d??0),s=(e,n)=>{if("popup"===p){let t=void 0!==window.screenLeft?window.screenLeft:window.screenX,i=void 0!==window.screenTop?window.screenTop:window.screenY,r=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,o=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height,l=r/window.screen.availWidth,d=(r-e)/2/l+t,p=(o-n)/2/l+i;g.current=window.open(c,"checkout",`scrollbars=yes, width=${e/l}, height=${n/l}, top=${p}, left=${d}`),g.current?.focus()}else c&&window.open(c)};return e("div",{className:"gp-flex gp-flex-col gp-gap-4 gp-border-t gp-border-t-g-line-3 gp-bg-g-bg-2 gp-px-6 gp-pb-8 gp-pt-4",children:[e("div",{className:"gp-g-paragraph-1 gp-flex gp-justify-between gp-font-semibold",children:[n("span",{children:"Subtotal:"}),n("span",{"aria-label":"Total price",children:a.localizedString})]}),e("div",{"aria-label":"Checkout",role:"button","aria-hidden":"true",className:"gp-g-paragraph-1 gp-flex gp-justify-between gp-bg-g-brand gp-px-4 gp-py-3 gp-font-semibold gp-text-g-text-3",onClick:()=>s(600,600),style:{...r({normal:{radiusType:"small"}})},children:[n("span",{children:a.localizedString}),n("span",{children:"Checkout"})]})]})};export{l as default};
1
+ import{jsxs as e,jsx as n}from"react/jsx-runtime";import{useCheckoutUrl as t,useMoney as i,composeRadius as r}from"@gem-sdk/core";import{useRef as o}from"react";let CartFooter=({checkoutUrl:l,price:d,openMode:p})=>{let c=t(l),a=o(null),g=i(d??0),s=(e,n)=>{if("popup"===p){let t=void 0!==window.screenLeft?window.screenLeft:window.screenX,i=void 0!==window.screenTop?window.screenTop:window.screenY,r=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,o=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height,l=r/window.screen.availWidth,d=(r-e)/2/l+t,p=(o-n)/2/l+i;a.current=window.open(c,"checkout",`scrollbars=yes, width=${e/l}, height=${n/l}, top=${p}, left=${d}`),a.current?.focus()}else c&&window.open(c)};return e("div",{className:"gp-flex gp-flex-col gp-gap-4 gp-border-t gp-border-t-g-line-3 gp-bg-g-bg-2 gp-px-6 gp-pb-8 gp-pt-4",children:[e("div",{className:"gp-g-paragraph-1 gp-flex gp-justify-between gp-font-semibold",children:[n("span",{children:"Subtotal:"}),n("span",{"aria-label":"Total price",children:g.localizedString})]}),e("div",{"aria-label":"Checkout",role:"button","aria-hidden":"true",className:"gp-g-paragraph-1 gp-flex gp-justify-between gp-bg-g-brand gp-px-4 gp-py-3 gp-font-semibold gp-text-g-text-3",onClick:()=>s(600,600),style:{...r({normal:{radiusType:"small"}})},children:[n("span",{children:g.localizedString}),n("span",{children:"Checkout"})]})]})};export{CartFooter as default};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useCartLine as a,useCartId as r,useRemoveCartItem as l,useMoney as i}from"@gem-sdk/core";import{openConfirm as n}from"@gem-sdk/components";import p from"./CartLineItemQuantity.js";import s from"./icons/Trash.js";import g from"./LoadingIcon.js";let c=()=>{let c=a(),{cartId:o}=r(),{isMutating:m,trigger:d}=l(),u=i(c.variant?.price?c.variant?.price:0),v=i(c.variant?.listPrice?c.variant?.listPrice:0);return e("div",{className:"gp-flex gp-items-center gp-gap-4 gp-border-b gp-border-b-g-line-2 gp-py-4 last:gp-border-b-transparent",children:[t("div",{className:"gp-aspect-square gp-w-16",children:c.variant?.image?.url&&t("img",{className:"gp-h-full gp-w-full gp-object-cover",src:c.variant.image.url,alt:c.variant?.image?.altText??""})}),e("div",{className:"gp-flex-1",children:[e("p",{className:"gp-line-clamp-2",children:[c.productTitle," ","Default Title"!==c.variant.name&&` - ${c.variant.name}`]}),e("div",{className:"gp-flex gp-flex-col gp-gap-1 gp-text-sm",children:[e("div",{className:"gp-flex gp-gap-2",children:[t("span",{className:"gp-font-semibold",children:u.localizedString}),c.variant?.listPrice>0&&t("span",{className:"gp-text-[#B4B4B4] gp-line-through",children:v.localizedString})]}),c.attributes?.map(t=>e("div",{children:[t.key,": ",t.value]},t.key))]}),e("div",{className:"gp-flex gp-items-center gp-justify-between",children:[t(p,{size:"medium"}),t("button",{onClick:()=>{n({title:e("div",{className:"gp-flex gp-w-full gp-flex-col gp-items-center gp-gap-4",children:[t(s,{}),t("p",{className:"gp-font-g-body gp-text-xl gp-font-semibold",children:"Are you sure ?"})]}),content:e("div",{className:"gp-text-center",children:[t("p",{children:"Do you really want to delete these items?"}),t("p",{children:"This process cannot be undone."})]}),className:"gp-w-full gp-max-w-[572px] gp-gap-4 gp-rounded",buttons:[{label:"Cancel",className:"gp-w-[130px] !gp-bg-g-bg-1"},{label:"Delete",className:"!gp-bg-g-error !gp-text-g-text-3 !font-g-body gp-w-[130px]",onClick:()=>{o&&c.id&&d({cartId:o,lineId:c.id})}}]})},"aria-label":"Remove item from cart",title:"Remove item from cart",type:"button",children:m?t(g,{className:"gp-text-g-brand"}):t("svg",{xmlns:"http://www.w3.org/2000/svg",className:"gp-w-4 gp-text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})]})]})};export{c as default};
1
+ import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useCartLine as a,useCartId as r,useRemoveCartItem as i,useMoney as l}from"@gem-sdk/core";import{openConfirm as n}from"@gem-sdk/components";import p from"./CartLineItemQuantity.js";import s from"./icons/Trash.js";import g from"./LoadingIcon.js";let CartLineItem=()=>{let c=a(),{cartId:o}=r(),{isMutating:m,trigger:d}=i(),u=l(c.variant?.price?c.variant?.price:0),v=l(c.variant?.listPrice?c.variant?.listPrice:0);return e("div",{className:"gp-flex gp-items-center gp-gap-4 gp-border-b gp-border-b-g-line-2 gp-py-4 last:gp-border-b-transparent",children:[t("div",{className:"gp-aspect-square gp-w-16",children:c.variant?.image?.url&&t("img",{className:"gp-h-full gp-w-full gp-object-cover",src:c.variant.image.url,alt:c.variant?.image?.altText??""})}),e("div",{className:"gp-flex-1",children:[e("p",{className:"gp-line-clamp-2",children:[c.productTitle," ","Default Title"!==c.variant.name&&` - ${c.variant.name}`]}),e("div",{className:"gp-flex gp-flex-col gp-gap-1 gp-text-sm",children:[e("div",{className:"gp-flex gp-gap-2",children:[t("span",{className:"gp-font-semibold",children:u.localizedString}),c.variant?.listPrice>0&&t("span",{className:"gp-text-[#B4B4B4] gp-line-through",children:v.localizedString})]}),c.attributes?.map(t=>e("div",{children:[t.key,": ",t.value]},t.key))]}),e("div",{className:"gp-flex gp-items-center gp-justify-between",children:[t(p,{size:"medium"}),t("button",{onClick:()=>{n({title:e("div",{className:"gp-flex gp-w-full gp-flex-col gp-items-center gp-gap-4",children:[t(s,{}),t("p",{className:"gp-font-g-body gp-text-xl gp-font-semibold",children:"Are you sure ?"})]}),content:e("div",{className:"gp-text-center",children:[t("p",{children:"Do you really want to delete these items?"}),t("p",{children:"This process cannot be undone."})]}),className:"gp-w-full gp-max-w-[572px] gp-gap-4 gp-rounded",buttons:[{label:"Cancel",className:"gp-w-[130px] !gp-bg-g-bg-1"},{label:"Delete",className:"!gp-bg-g-error !gp-text-g-text-3 !font-g-body gp-w-[130px]",onClick:()=>{o&&c.id&&d({cartId:o,lineId:c.id})}}]})},"aria-label":"Remove item from cart",title:"Remove item from cart",type:"button",children:m?t(g,{className:"gp-text-g-brand"}):t("svg",{xmlns:"http://www.w3.org/2000/svg",className:"gp-w-4 gp-text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})]})]})};export{CartLineItem as default};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useCartLine as r,cls as a}from"@gem-sdk/core";import l from"./CartLineQuantityAdjustButton.js";let p=({size:p})=>{let g=r();return e("div",{className:a("gp-mt-2 gp-inline-flex gp-items-center gp-overflow-auto gp-rounded gp-border gp-border-g-line-3 gp-text-g-text-1",{"gp-h-12":"large"===p,"gp-h-10":"medium"===p,"gp-h-8":"small"===p}),children:[t(l,{adjust:"decrease","aria-label":"Decrease quantity",className:"gp-flex gp-aspect-square gp-h-full gp-items-center gp-justify-center",children:t("svg",{className:"gp-h-4",fill:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M3.755 12.5h16.492a.75.75 0 0 0 0-1.5H3.755a.75.75 0 0 0 0 1.5Z"})})}),t("div",{className:"gp-flex gp-h-full gp-min-w-[50px] gp-select-none gp-items-center gp-justify-center gp-border-x gp-border-g-line-3 gp-px-2 gp-text-center gp-text-base gp-font-semibold",children:g.quantity}),t(l,{adjust:"increase","aria-label":"Increase quantity",className:"gp-flex gp-aspect-square gp-h-full gp-items-center gp-justify-center",children:t("svg",{className:"gp-h-4",fill:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M11.75 3a.75.75 0 0 1 .743.648l.007.102.001 7.25h7.253a.75.75 0 0 1 .102 1.493l-.102.007h-7.253l.002 7.25a.75.75 0 0 1-1.493.101l-.007-.102-.002-7.249H3.752a.75.75 0 0 1-.102-1.493L3.752 11h7.25L11 3.75a.75.75 0 0 1 .75-.75Z"})})})]})};p.defaultProps={size:"medium"};export{p as default};
1
+ import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useCartLine as r,cls as a}from"@gem-sdk/core";import l from"./CartLineQuantityAdjustButton.js";let CartLineItemQuantity=({size:p})=>{let g=r();return e("div",{className:a("gp-mt-2 gp-inline-flex gp-items-center gp-overflow-auto gp-rounded gp-border gp-border-g-line-3 gp-text-g-text-1",{"gp-h-12":"large"===p,"gp-h-10":"medium"===p,"gp-h-8":"small"===p}),children:[t(l,{adjust:"decrease","aria-label":"Decrease quantity",className:"gp-flex gp-aspect-square gp-h-full gp-items-center gp-justify-center",children:t("svg",{className:"gp-h-4",fill:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M3.755 12.5h16.492a.75.75 0 0 0 0-1.5H3.755a.75.75 0 0 0 0 1.5Z"})})}),t("div",{className:"gp-flex gp-h-full gp-min-w-[50px] gp-select-none gp-items-center gp-justify-center gp-border-x gp-border-g-line-3 gp-px-2 gp-text-center gp-text-base gp-font-semibold",children:g.quantity}),t(l,{adjust:"increase","aria-label":"Increase quantity",className:"gp-flex gp-aspect-square gp-h-full gp-items-center gp-justify-center",children:t("svg",{className:"gp-h-4",fill:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M11.75 3a.75.75 0 0 1 .743.648l.007.102.001 7.25h7.253a.75.75 0 0 1 .102 1.493l-.102.007h-7.253l.002 7.25a.75.75 0 0 1-1.493.101l-.007-.102-.002-7.249H3.752a.75.75 0 0 1-.102-1.493L3.752 11h7.25L11 3.75a.75.75 0 0 1 .75-.75Z"})})})]})};CartLineItemQuantity.defaultProps={size:"medium"};export{CartLineItemQuantity as default};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useUpdateCartItem as a,useRemoveCartItem as l,useCartId as n,useCartLine as g}from"@gem-sdk/core";import{openConfirm as p}from"@gem-sdk/components";import i from"./icons/Trash.js";let s=({children:s,adjust:r,className:d,style:o})=>{let{isMutating:c,trigger:m}=a(),{isMutating:u,trigger:f}=l(),{cartId:b}=n(),x=g(),h=c||u;return e("button",{"aria-label":"Adjust quantity",className:d,style:o,disabled:h,onClick:()=>{if(b&&x.id){if("remove"===r){p({title:t("div",{className:"gp-flex gp-w-full gp-flex-col gp-items-center gp-gap-4",children:[e(i,{}),e("p",{className:"gp-font-g-body gp-text-xl gp-font-semibold",children:"Are you sure ?"})]}),content:t("div",{className:"gp-text-center",children:[e("p",{children:"Do you really want to delete this item?"}),e("p",{children:"This process cannot be undone."})]}),className:"gp-w-full gp-max-w-[572px] gp-gap-4 gp-rounded",buttons:[{label:"Cancel",className:"gp-w-[130px] !gp-bg-g-bg-1"},{label:"Delete",className:"!gp-bg-g-error !gp-text-g-text-3 !font-g-body gp-w-[130px]",onClick:()=>{x.id&&f({cartId:b,lineId:x.id})}}]});return}let a="decrease"===r?x.quantity-1:x.quantity+1;if(a<=0){p({title:t("div",{className:"gp-flex gp-w-full gp-flex-col gp-items-center gp-gap-4",children:[e(i,{}),e("p",{className:"gp-font-g-body gp-text-xl gp-font-semibold",children:"Are you sure ?"})]}),content:t("div",{className:"gp-text-center",children:[e("p",{children:"Do you really want to delete this item?"}),e("p",{children:"This process cannot be undone."})]}),className:"gp-w-full gp-max-w-[572px] gp-gap-4 gp-rounded",buttons:[{label:"Cancel",className:"gp-w-[130px] !gp-bg-g-bg-1"},{label:"Delete",className:"!gp-bg-g-error !gp-text-g-text-3 !font-g-body gp-w-[130px]",onClick:()=>{x.id&&f({cartId:b,lineId:x.id})}}]});return}m({cartId:b,line:{id:x.id,variantId:x.variant.id,quantity:a,productId:x.productId}})}},children:h?t("div",{className:"gp-flex gp-gap-1",children:[e("span",{className:"gp-aspect-square gp-h-1 gp-animate-[flashing_500ms_infinite_alternate] gp-rounded-full gp-bg-g-brand"}),e("span",{className:"gp-aspect-square gp-h-1 gp-animate-[flashing_500ms_infinite_200ms_linear_alternate] gp-rounded-full gp-bg-g-brand"}),e("span",{className:"gp-aspect-square gp-h-1 gp-animate-[flashing_500ms_infinite_500ms_alternate] gp-rounded-full gp-bg-g-brand"})]}):s})};s.defaultProps={adjust:"increase"};export{s as default};
1
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useUpdateCartItem as a,useRemoveCartItem as n,useCartId as l,useCartLine as g}from"@gem-sdk/core";import{openConfirm as i}from"@gem-sdk/components";import p from"./icons/Trash.js";let CartLineQuantityAdjustButton=({children:s,adjust:r,className:d,style:o})=>{let{isMutating:c,trigger:u}=a(),{isMutating:m,trigger:f}=n(),{cartId:b}=l(),x=g(),h=c||m;return e("button",{"aria-label":"Adjust quantity",className:d,style:o,disabled:h,onClick:()=>{if(b&&x.id){if("remove"===r){i({title:t("div",{className:"gp-flex gp-w-full gp-flex-col gp-items-center gp-gap-4",children:[e(p,{}),e("p",{className:"gp-font-g-body gp-text-xl gp-font-semibold",children:"Are you sure ?"})]}),content:t("div",{className:"gp-text-center",children:[e("p",{children:"Do you really want to delete this item?"}),e("p",{children:"This process cannot be undone."})]}),className:"gp-w-full gp-max-w-[572px] gp-gap-4 gp-rounded",buttons:[{label:"Cancel",className:"gp-w-[130px] !gp-bg-g-bg-1"},{label:"Delete",className:"!gp-bg-g-error !gp-text-g-text-3 !font-g-body gp-w-[130px]",onClick:()=>{x.id&&f({cartId:b,lineId:x.id})}}]});return}let a="decrease"===r?x.quantity-1:x.quantity+1;if(a<=0){i({title:t("div",{className:"gp-flex gp-w-full gp-flex-col gp-items-center gp-gap-4",children:[e(p,{}),e("p",{className:"gp-font-g-body gp-text-xl gp-font-semibold",children:"Are you sure ?"})]}),content:t("div",{className:"gp-text-center",children:[e("p",{children:"Do you really want to delete this item?"}),e("p",{children:"This process cannot be undone."})]}),className:"gp-w-full gp-max-w-[572px] gp-gap-4 gp-rounded",buttons:[{label:"Cancel",className:"gp-w-[130px] !gp-bg-g-bg-1"},{label:"Delete",className:"!gp-bg-g-error !gp-text-g-text-3 !font-g-body gp-w-[130px]",onClick:()=>{x.id&&f({cartId:b,lineId:x.id})}}]});return}u({cartId:b,line:{id:x.id,variantId:x.variant.id,quantity:a,productId:x.productId}})}},children:h?t("div",{className:"gp-flex gp-gap-1",children:[e("span",{className:"gp-aspect-square gp-h-1 gp-animate-[flashing_500ms_infinite_alternate] gp-rounded-full gp-bg-g-brand"}),e("span",{className:"gp-aspect-square gp-h-1 gp-animate-[flashing_500ms_infinite_200ms_linear_alternate] gp-rounded-full gp-bg-g-brand"}),e("span",{className:"gp-aspect-square gp-h-1 gp-animate-[flashing_500ms_infinite_500ms_alternate] gp-rounded-full gp-bg-g-brand"})]}):s})};CartLineQuantityAdjustButton.defaultProps={adjust:"increase"};export{CartLineQuantityAdjustButton as default};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as r}from"react/jsx-runtime";import{useCartData as t,useCartId as o,useCartNoteUpdate as l}from"@gem-sdk/core";import{useRef as n,useCallback as a}from"react";let u=({triggerUpdate:u,debounce:c,placeholder:p})=>{let d=n(null),g=n(null),i=n(new AbortController),{data:m}=t(),{cartId:s}=o(),{trigger:b}=l(),f=a(e=>{s&&m?.note!==e&&b({cartId:s,note:e})},[m?.note,s,b]),x="blur"===u?{onBlur:e=>{i.current.signal.aborted&&(i.current=new AbortController),f(e.target.value)}}:{onChange:()=>{g.current&&(i.current.signal.aborted||i.current.abort(),clearTimeout(g.current)),g.current=setTimeout(()=>{i.current=new AbortController,f(d.current?.value??"")},c??1e3)}};return e("div",{className:"gp-flex gp-flex-col",children:[r("div",{className:"gp-mb-4 gp-border-b gp-border-b-[#F1F3F4] gp-pb-3",children:r("span",{className:"gp-font-semibold gp-text-[#424242]",children:"Order Note"})}),r("textarea",{defaultValue:m?.note,placeholder:p,ref:d,className:"gp-w-full gp-rounded gp-border gp-p-4 gp-outline-none",...x})]})};export{u as default};
1
+ import{jsxs as e,jsx as r}from"react/jsx-runtime";import{useCartData as t,useCartId as o,useCartNoteUpdate as l}from"@gem-sdk/core";import{useRef as n,useCallback as a}from"react";let CartOrderNote=({triggerUpdate:u,debounce:c,placeholder:d})=>{let p=n(null),g=n(null),i=n(new AbortController),{data:m}=t(),{cartId:s}=o(),{trigger:b}=l(),f=a(e=>{s&&m?.note!==e&&b({cartId:s,note:e})},[m?.note,s,b]),N=e=>{i.current.signal.aborted&&(i.current=new AbortController),f(e.target.value)},x=()=>{g.current&&(i.current.signal.aborted||i.current.abort(),clearTimeout(g.current)),g.current=setTimeout(()=>{i.current=new AbortController,f(p.current?.value??"")},c??1e3)},C="blur"===u?{onBlur:N}:{onChange:x};return e("div",{className:"gp-flex gp-flex-col",children:[r("div",{className:"gp-mb-4 gp-border-b gp-border-b-[#F1F3F4] gp-pb-3",children:r("span",{className:"gp-font-semibold gp-text-[#424242]",children:"Order Note"})}),r("textarea",{defaultValue:m?.note,placeholder:d,ref:p,className:"gp-w-full gp-rounded gp-border gp-p-4 gp-outline-none",...C})]})};export{CartOrderNote as default};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as l}from"react/jsx-runtime";import{useCartId as t,useCartDiscountCodesUpdate as p,useCartData as g,isDefined as o,cls as r}from"@gem-sdk/core";import{openConfirm as s}from"@gem-sdk/components";import{useMemo as a,useCallback as c}from"react";import n from"./icons/Trash.js";import i from"./LoadingIcon.js";let d=({item:d})=>{let{cartId:m}=t(),{trigger:f,isMutating:u}=p(),{data:x}=g(),h=a(()=>x?.discounts?.map(e=>e.code).filter(o)??[],[x?.discounts]),b=c(t=>{s({title:l("div",{className:"gp-flex gp-w-full gp-flex-col gp-items-center gp-gap-4",children:[e(n,{}),e("p",{className:"gp-font-g-body gp-text-xl gp-font-semibold",children:"Are you sure ?"})]}),content:e("div",{className:"gp-text-center",children:e("p",{children:"Do you really want to delete this code?"})}),className:"gp-w-full gp-max-w-[572px] gp-gap-4 gp-rounded",buttons:[{label:"Cancel",className:"gp-w-[130px] !gp-bg-g-bg-1"},{label:"Delete",className:"!gp-bg-g-error !gp-text-g-text-3 !font-g-body gp-w-[130px]",onClick:()=>{m&&f({cartId:m,discountCodes:h.filter(e=>e!==t)})}}]})},[m,f,h]);return l("div",{className:"gp-flex gp-h-8 gp-items-center gp-gap-2 gp-rounded-sm gp-border gp-pl-2",children:[e("span",{className:r("gp-flex-1",{"gp-text-g-error gp-line-through":!d.applicable,"gp-text-g-success":d.applicable}),children:d.code}),e("button",{disabled:u,onClick:()=>b(d.code),className:"gp-flex gp-aspect-square gp-h-full gp-items-center gp-justify-center",children:u?e(i,{className:"gp-text-g-brand"}):e("svg",{className:"gp-w-4",fill:"none",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"m4.397 4.554.073-.084a.75.75 0 0 1 .976-.073l.084.073L12 10.939l6.47-6.47a.75.75 0 1 1 1.06 1.061L13.061 12l6.47 6.47a.75.75 0 0 1 .072.976l-.073.084a.75.75 0 0 1-.976.073l-.084-.073L12 13.061l-6.47 6.47a.75.75 0 0 1-1.06-1.061L10.939 12l-6.47-6.47a.75.75 0 0 1-.072-.976l.073-.084-.073.084Z",fill:"currentColor"})})})]},d.code)};export{d as default};
1
+ import{jsxs as e,jsx as l}from"react/jsx-runtime";import{useCartId as t,useCartDiscountCodesUpdate as p,useCartData as g,isDefined as o,cls as s}from"@gem-sdk/core";import{openConfirm as r}from"@gem-sdk/components";import{useMemo as a,useCallback as c}from"react";import n from"./icons/Trash.js";import i from"./LoadingIcon.js";let DiscountCodeItem=({item:d})=>{let{cartId:m}=t(),{trigger:f,isMutating:u}=p(),{data:x}=g(),h=a(()=>x?.discounts?.map(e=>e.code).filter(o)??[],[x?.discounts]),b=c(t=>{r({title:e("div",{className:"gp-flex gp-w-full gp-flex-col gp-items-center gp-gap-4",children:[l(n,{}),l("p",{className:"gp-font-g-body gp-text-xl gp-font-semibold",children:"Are you sure ?"})]}),content:l("div",{className:"gp-text-center",children:l("p",{children:"Do you really want to delete this code?"})}),className:"gp-w-full gp-max-w-[572px] gp-gap-4 gp-rounded",buttons:[{label:"Cancel",className:"gp-w-[130px] !gp-bg-g-bg-1"},{label:"Delete",className:"!gp-bg-g-error !gp-text-g-text-3 !font-g-body gp-w-[130px]",onClick:()=>{m&&f({cartId:m,discountCodes:h.filter(e=>e!==t)})}}]})},[m,f,h]);return e("div",{className:"gp-flex gp-h-8 gp-items-center gp-gap-2 gp-rounded-sm gp-border gp-pl-2",children:[l("span",{className:s("gp-flex-1",{"gp-text-g-error gp-line-through":!d.applicable,"gp-text-g-success":d.applicable}),children:d.code}),l("button",{disabled:u,onClick:()=>b(d.code),className:"gp-flex gp-aspect-square gp-h-full gp-items-center gp-justify-center",children:u?l(i,{className:"gp-text-g-brand"}):l("svg",{className:"gp-w-4",fill:"none",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:l("path",{d:"m4.397 4.554.073-.084a.75.75 0 0 1 .976-.073l.084.073L12 10.939l6.47-6.47a.75.75 0 1 1 1.06 1.061L13.061 12l6.47 6.47a.75.75 0 0 1 .072.976l-.073.084a.75.75 0 0 1-.976.073l-.084-.073L12 13.061l-6.47 6.47a.75.75 0 0 1-1.06-1.061L10.939 12l-6.47-6.47a.75.75 0 0 1-.072-.976l.073-.084-.073.084Z",fill:"currentColor"})})})]},d.code)};export{DiscountCodeItem as default};
@@ -1 +1 @@
1
- import{jsxs as r,jsx as e}from"react/jsx-runtime";import{cls as o}from"@gem-sdk/core";let t=({className:t})=>r("svg",{className:o("gp-w-4 gp-animate-spin",t),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e("circle",{className:"gp-opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e("path",{className:"gp-opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]});export{t as default};
1
+ import{jsxs as o,jsx as r}from"react/jsx-runtime";import{cls as e}from"@gem-sdk/core";let LoadingIcon=({className:t})=>o("svg",{className:e("gp-w-4 gp-animate-spin",t),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r("circle",{className:"gp-opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r("path",{className:"gp-opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]});export{LoadingIcon as default};
@@ -1 +1 @@
1
- import{jsxs as C,jsx as e}from"react/jsx-runtime";let l=()=>C("svg",{className:"gp-text-g-warning",width:"58",height:"66",viewBox:"0 0 58 66",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e("path",{d:"M18.0625 24.0625C18.6427 24.0625 19.1991 24.293 19.6093 24.7032C20.0195 25.1134 20.25 25.6698 20.25 26.25V52.5C20.25 53.0802 20.0195 53.6366 19.6093 54.0468C19.1991 54.457 18.6427 54.6875 18.0625 54.6875C17.4823 54.6875 16.9259 54.457 16.5157 54.0468C16.1055 53.6366 15.875 53.0802 15.875 52.5V26.25C15.875 25.6698 16.1055 25.1134 16.5157 24.7032C16.9259 24.293 17.4823 24.0625 18.0625 24.0625ZM29 24.0625C29.5802 24.0625 30.1366 24.293 30.5468 24.7032C30.957 25.1134 31.1875 25.6698 31.1875 26.25V52.5C31.1875 53.0802 30.957 53.6366 30.5468 54.0468C30.1366 54.457 29.5802 54.6875 29 54.6875C28.4198 54.6875 27.8634 54.457 27.4532 54.0468C27.043 53.6366 26.8125 53.0802 26.8125 52.5V26.25C26.8125 25.6698 27.043 25.1134 27.4532 24.7032C27.8634 24.293 28.4198 24.0625 29 24.0625ZM42.125 26.25C42.125 25.6698 41.8945 25.1134 41.4843 24.7032C41.0741 24.293 40.5177 24.0625 39.9375 24.0625C39.3573 24.0625 38.8009 24.293 38.3907 24.7032C37.9805 25.1134 37.75 25.6698 37.75 26.25V52.5C37.75 53.0802 37.9805 53.6366 38.3907 54.0468C38.8009 54.457 39.3573 54.6875 39.9375 54.6875C40.5177 54.6875 41.0741 54.457 41.4843 54.0468C41.8945 53.6366 42.125 53.0802 42.125 52.5V26.25Z",fill:"currentColor"}),e("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M57.4375 13.125C57.4375 14.2853 56.9766 15.3981 56.1561 16.2186C55.3356 17.0391 54.2228 17.5 53.0625 17.5H50.875V56.875C50.875 59.1956 49.9531 61.4212 48.3122 63.0622C46.6712 64.7031 44.4456 65.625 42.125 65.625H15.875C13.5544 65.625 11.3288 64.7031 9.68782 63.0622C8.04687 61.4212 7.125 59.1956 7.125 56.875V17.5H4.9375C3.77718 17.5 2.66438 17.0391 1.84391 16.2186C1.02344 15.3981 0.5625 14.2853 0.5625 13.125V8.75C0.5625 7.58968 1.02344 6.47688 1.84391 5.65641C2.66438 4.83594 3.77718 4.375 4.9375 4.375H20.25C20.25 3.21468 20.7109 2.10188 21.5314 1.28141C22.3519 0.460936 23.4647 0 24.625 0H33.375C34.5353 0 35.6481 0.460936 36.4686 1.28141C37.2891 2.10188 37.75 3.21468 37.75 4.375H53.0625C54.2228 4.375 55.3356 4.83594 56.1561 5.65641C56.9766 6.47688 57.4375 7.58968 57.4375 8.75V13.125ZM12.0163 17.5L11.5 17.7581V56.875C11.5 58.0353 11.9609 59.1481 12.7814 59.9686C13.6019 60.7891 14.7147 61.25 15.875 61.25H42.125C43.2853 61.25 44.3981 60.7891 45.2186 59.9686C46.0391 59.1481 46.5 58.0353 46.5 56.875V17.7581L45.9837 17.5H12.0163ZM4.9375 13.125V8.75H53.0625V13.125H4.9375Z",fill:"currentColor"})]});export{l as default};
1
+ import{jsxs as C,jsx as e}from"react/jsx-runtime";let Trash=()=>C("svg",{className:"gp-text-g-warning",width:"58",height:"66",viewBox:"0 0 58 66",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e("path",{d:"M18.0625 24.0625C18.6427 24.0625 19.1991 24.293 19.6093 24.7032C20.0195 25.1134 20.25 25.6698 20.25 26.25V52.5C20.25 53.0802 20.0195 53.6366 19.6093 54.0468C19.1991 54.457 18.6427 54.6875 18.0625 54.6875C17.4823 54.6875 16.9259 54.457 16.5157 54.0468C16.1055 53.6366 15.875 53.0802 15.875 52.5V26.25C15.875 25.6698 16.1055 25.1134 16.5157 24.7032C16.9259 24.293 17.4823 24.0625 18.0625 24.0625ZM29 24.0625C29.5802 24.0625 30.1366 24.293 30.5468 24.7032C30.957 25.1134 31.1875 25.6698 31.1875 26.25V52.5C31.1875 53.0802 30.957 53.6366 30.5468 54.0468C30.1366 54.457 29.5802 54.6875 29 54.6875C28.4198 54.6875 27.8634 54.457 27.4532 54.0468C27.043 53.6366 26.8125 53.0802 26.8125 52.5V26.25C26.8125 25.6698 27.043 25.1134 27.4532 24.7032C27.8634 24.293 28.4198 24.0625 29 24.0625ZM42.125 26.25C42.125 25.6698 41.8945 25.1134 41.4843 24.7032C41.0741 24.293 40.5177 24.0625 39.9375 24.0625C39.3573 24.0625 38.8009 24.293 38.3907 24.7032C37.9805 25.1134 37.75 25.6698 37.75 26.25V52.5C37.75 53.0802 37.9805 53.6366 38.3907 54.0468C38.8009 54.457 39.3573 54.6875 39.9375 54.6875C40.5177 54.6875 41.0741 54.457 41.4843 54.0468C41.8945 53.6366 42.125 53.0802 42.125 52.5V26.25Z",fill:"currentColor"}),e("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M57.4375 13.125C57.4375 14.2853 56.9766 15.3981 56.1561 16.2186C55.3356 17.0391 54.2228 17.5 53.0625 17.5H50.875V56.875C50.875 59.1956 49.9531 61.4212 48.3122 63.0622C46.6712 64.7031 44.4456 65.625 42.125 65.625H15.875C13.5544 65.625 11.3288 64.7031 9.68782 63.0622C8.04687 61.4212 7.125 59.1956 7.125 56.875V17.5H4.9375C3.77718 17.5 2.66438 17.0391 1.84391 16.2186C1.02344 15.3981 0.5625 14.2853 0.5625 13.125V8.75C0.5625 7.58968 1.02344 6.47688 1.84391 5.65641C2.66438 4.83594 3.77718 4.375 4.9375 4.375H20.25C20.25 3.21468 20.7109 2.10188 21.5314 1.28141C22.3519 0.460936 23.4647 0 24.625 0H33.375C34.5353 0 35.6481 0.460936 36.4686 1.28141C37.2891 2.10188 37.75 3.21468 37.75 4.375H53.0625C54.2228 4.375 55.3356 4.83594 56.1561 5.65641C56.9766 6.47688 57.4375 7.58968 57.4375 8.75V13.125ZM12.0163 17.5L11.5 17.7581V56.875C11.5 58.0353 11.9609 59.1481 12.7814 59.9686C13.6019 60.7891 14.7147 61.25 15.875 61.25H42.125C43.2853 61.25 44.3981 60.7891 45.2186 59.9686C46.0391 59.1481 46.5 58.0353 46.5 56.875V17.7581L45.9837 17.5H12.0163ZM4.9375 13.125V8.75H53.0625V13.125H4.9375Z",fill:"currentColor"})]});export{Trash as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/plugin-cart-drawer",
3
- "version": "17.0.0-dev.9",
3
+ "version": "17.0.0-staging.20",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -14,14 +14,14 @@
14
14
  "post:publish": "node ./../../helpers/convert-publish.js",
15
15
  "watch": "rollup -c ./../../helpers/rollup.config.mjs -w",
16
16
  "build": "rollup -c ./../../helpers/rollup.config.mjs --environment NODE_ENV:production",
17
- "lint": "oxlint --format=stylish ./src",
17
+ "lint": "eslint ./src --ext .tsx,.ts",
18
18
  "type-check": "yarn tsc --noEmit",
19
19
  "test": "jest -c ./../../helpers/jest.config.ts"
20
20
  },
21
21
  "devDependencies": {
22
- "@gem-sdk/components": "17.0.0-dev.9",
23
- "@gem-sdk/core": "17.0.0-dev.9",
24
- "@gem-sdk/styles": "17.0.0-dev.9"
22
+ "@gem-sdk/components": "17.0.0-staging.20",
23
+ "@gem-sdk/core": "17.0.0-staging.20",
24
+ "@gem-sdk/styles": "17.0.0-staging.20"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "react": "18.3.1",