@gem-sdk/components 12.0.0-staging.60 → 12.0.0-staging.61
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/post-purchase/product/components/ProductPriceBreakdown.js +1 -1
- package/dist/cjs/post-purchase/product/components/product-subscription/ProductSubscription.js +1 -1
- package/dist/cjs/post-purchase/product/components/product-subscription/common/classes.js +1 -1
- package/dist/cjs/post-purchase/product/components/product-subscription/components/SellingPlanDropdown.js +1 -1
- package/dist/esm/post-purchase/product/components/ProductPriceBreakdown.js +1 -1
- package/dist/esm/post-purchase/product/components/product-subscription/ProductSubscription.js +1 -1
- package/dist/esm/post-purchase/product/components/product-subscription/common/classes.js +1 -1
- package/dist/esm/post-purchase/product/components/product-subscription/components/SellingPlanDropdown.js +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),React=require("react"),core=require("@gem-sdk/core"),system=require("@gem-sdk/system"),getClasses=require("../helpers/product-price-breakdown/getClasses.js"),getStyles=require("../helpers/product-price-breakdown/getStyles.js"),useGetItemGapPriceBreakdown=require("../hooks/useGetItemGapPriceBreakdown.js"),useSetCollapsePrice=require("../hooks/useSetCollapsePrice.js"),MoneyLine=require("./price-breakdown/MoneyLine.js"),Text=require("../../text/components/Text.js"),useGetMoneyLines=require("../hooks/useGetMoneyLines.js");const PostPurchaseProductPriceBreakdown=({setting:e={},styles:s={},style:t,builderAttrs:r,builderProps:i,children:a})=>{let{labelStyle:l,moneyStyle:n,spacing:o,width:u,align:d,isShowPrice:c,direction:m}=s,p=core.useProduct(),x=p?.baseID?.replace("gid://shopify/Product/",""),{isCollapsePrice:y,onClickLabelPriceBreakdown:j}=useSetCollapsePrice.useSetCollapsePrice(c),{itemGap:C}=useGetItemGapPriceBreakdown.useGetItemGapPriceBreakdown(o),{getMoneyLines:g}=useGetMoneyLines.useGetMoneyLines(s,e),h=system.createStyle({...getStyles.getStyle(t)}),w=system.createAttr({...r}),P=system.createClass(getClasses.getIconCollapseClassesRotate(y)),
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),React=require("react"),core=require("@gem-sdk/core"),system=require("@gem-sdk/system"),getClasses=require("../helpers/product-price-breakdown/getClasses.js"),getStyles=require("../helpers/product-price-breakdown/getStyles.js"),useGetItemGapPriceBreakdown=require("../hooks/useGetItemGapPriceBreakdown.js"),useSetCollapsePrice=require("../hooks/useSetCollapsePrice.js"),MoneyLine=require("./price-breakdown/MoneyLine.js"),Text=require("../../text/components/Text.js"),useGetMoneyLines=require("../hooks/useGetMoneyLines.js");const PostPurchaseProductPriceBreakdown=({setting:e={},styles:s={},style:t,builderAttrs:r,builderProps:i,children:a})=>{let{labelStyle:l,moneyStyle:n,spacing:o,width:u,align:d,isShowPrice:c,direction:m}=s,p=core.useProduct(),x=p?.baseID?.replace("gid://shopify/Product/",""),{isCollapsePrice:y,onClickLabelPriceBreakdown:j}=useSetCollapsePrice.useSetCollapsePrice(c),{itemGap:C}=useGetItemGapPriceBreakdown.useGetItemGapPriceBreakdown(o),{getMoneyLines:g}=useGetMoneyLines.useGetMoneyLines(s,e),h=system.createStyle({...getStyles.getStyle(t)}),w=system.createAttr({...r}),P=system.createClass(getClasses.getIconCollapseClassesRotate(y)),b=system.createClass(getClasses.getContainerPriceBreakdownClasses(d,i?.uid)),R=system.createClass(getClasses.getWrapperLabelClasses(m)),k=system.createClass(getClasses.getLabelClasses()),q=system.createClass(getClasses.getDividerClasses()),L=system.createClass(getClasses.getWrapperMoneyLinesClasses()),I=system.createClass(getClasses.getWrapperBreakdownClasses()),S=system.createStyle({...getStyles.getWrapperMoneyLinesStyles(u,C)}),v=({uniqueId:e})=>"recurringTotalLabel"===e?{...n,fontWeight:"normal"}:n;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:R,onClick:j,role:"button",tabIndex:0,"aria-hidden":"true",children:[jsxRuntime.jsx(Text.default,{className:k,styles:{direction:m},setting:{text:y?e.contentHide||"Hide price breakdown":e.contentShow||"Show price breakdown",options:{isCannotEditing:!0}}}),jsxRuntime.jsx("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:P,children:jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.0187 10.3598C10.7759 10.5853 10.3963 10.5712 10.1708 10.3284L8.01045 8.00191L5.85012 10.3284C5.62464 10.5712 5.245 10.5853 5.00218 10.3598C4.75935 10.1343 4.74529 9.75469 4.97077 9.51187L7.57077 6.71187C7.6843 6.58961 7.84361 6.52014 8.01045 6.52014C8.17729 6.52014 8.3366 6.58961 8.45012 6.71187L11.0501 9.51187C11.2756 9.75469 11.2615 10.1343 11.0187 10.3598Z",fill:"#1879B9"})})]}),jsxRuntime.jsx("div",{className:q}),y?jsxRuntime.jsx("div",{className:I,children:jsxRuntime.jsxs("div",{...w,className:b,style:h,id:`shopify-text-element-${i?.uid}`,"data-product-id":x,children:[jsxRuntime.jsx("div",{className:L,style:S,children:g().map(e=>jsxRuntime.jsxs(React.Fragment,{children:["totalLabel"===e.uniqueId&&g().length>1&&jsxRuntime.jsx("hr",{}),jsxRuntime.jsx("div",{children:jsxRuntime.jsx(MoneyLine.default,{uniqueId:e.uniqueId,direction:m,builderPropsUID:i?.uid,title:"totalLabel"===e.uniqueId?`<b>${e.title}</b>`:e.title,money:e.money,tooltipData:e.tooltip,labelTextStyles:{typo:{...l},direction:m},moneyTextStyles:{typo:v({uniqueId:e.uniqueId})},subTitle:e.subTitle})},e.uniqueId)]},e.uniqueId))}),a]})}):null]})};exports.default=PostPurchaseProductPriceBreakdown;
|
package/dist/cjs/post-purchase/product/components/product-subscription/ProductSubscription.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),system=require("@gem-sdk/system"),React=require("react"),index=require("../../constants/index.js"),classes=require("./common/classes.js"),styles=require("./common/styles.js"),useSellingPlanChange=require("./hooks/useSellingPlanChange.js"),useSellingSubscription=require("./hooks/useSellingSubscription.js"),useSellingPlanOptions=require("./hooks/useSellingPlanOptions.js"),useSubscriptionVisibility=require("./hooks/useSubscriptionVisibility.js"),OneTimePurchaseTooltip=require("./components/OneTimePurchaseTooltip.js"),SellingPlanDropdown=require("./components/SellingPlanDropdown.js"),SellingPlanLabel=require("./components/SellingPlanLabel.js"),SellingPlanRadio=require("./components/SellingPlanRadio.js"),SubscriptionDetail=require("./components/SubscriptionDetail.js"),SubscriptionRadio=require("./components/SubscriptionRadio.js"),useDynamicProduct=require("../../hooks/useDynamicProduct.js"),helpers=require("../../../../helpers.js");const ProductSubscription=({styles:e,setting:s,builderProps:i,builderAttrs:n,style:t,children:l})=>{let{isEditMode:r}=core.useRenderMode(),o=core.useProduct(),u=core.usePageStore(e=>e.setSubscriptionVisible),a=core.usePageStore(e=>e.getSubscriptionVisible),{defaultValue:c,selectedSellingPlan:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),system=require("@gem-sdk/system"),React=require("react"),index=require("../../constants/index.js"),classes=require("./common/classes.js"),styles=require("./common/styles.js"),useSellingPlanChange=require("./hooks/useSellingPlanChange.js"),useSellingSubscription=require("./hooks/useSellingSubscription.js"),useSellingPlanOptions=require("./hooks/useSellingPlanOptions.js"),useSubscriptionVisibility=require("./hooks/useSubscriptionVisibility.js"),OneTimePurchaseTooltip=require("./components/OneTimePurchaseTooltip.js"),SellingPlanDropdown=require("./components/SellingPlanDropdown.js"),SellingPlanLabel=require("./components/SellingPlanLabel.js"),SellingPlanRadio=require("./components/SellingPlanRadio.js"),SubscriptionDetail=require("./components/SubscriptionDetail.js"),SubscriptionRadio=require("./components/SubscriptionRadio.js"),useDynamicProduct=require("../../hooks/useDynamicProduct.js"),helpers=require("../../../../helpers.js");const DEFAULT_DIRECTION="ltr",ProductSubscription=({styles:e,setting:s,builderProps:i,builderAttrs:n,style:t,children:l})=>{let{isEditMode:r}=core.useRenderMode(),o=core.useProduct(),u=core.usePageStore(e=>e.setSubscriptionVisible),a=core.usePageStore(e=>e.getSubscriptionVisible),{defaultValue:c,selectedSellingPlan:d,setSelectedSellingPlan:p}=useSellingSubscription.useSellingSubscription(s),S=useSellingPlanOptions.useSellingPlanOptions(s),{selectedValue:m,handleSellingPlanChange:g}=useSellingPlanChange.useSellingPlanChange({defaultValue:c,selectedSellingPlan:d,setSelectedSellingPlan:p,sellingPlanOptions:S}),b=React.useRef(null),P=React.useId(),{selectedType:j,shouldShowRadio:x,isOneTimeHidden:y,isOnetimeOnly:R,hasNoSellingPlanOptions:h,setSubscriptionSellingType:T}=useSubscriptionVisibility.useSubscriptionVisibility({setting:s}),q=system.createStyle(styles.getSubscriptionStyles(e)),I=system.createStyle(styles.getSubscriptionWrapperStyles(e?.align)),O=system.createClass(classes.getWrapperClasses()),D=system.createClass(classes.getContainerClasses()),C=system.createStyle({...t}),E=`product-subscription-${helpers.extractProductID(o?.baseID??"")}`,f=helpers.extractProductID(o?.baseID??""),N=`subscription-type-selection-${P}`,k=s?.sellingType===index.SubscriptionEnum.ONE_TIME,v=s?.sellingType===index.SubscriptionEnum.SUBSCRIPTION,{isDynamicProduct:V}=useDynamicProduct.useDynamicProduct(),{sellingTitleDirection:$,sellingTitleOneTimeDirection:w}=e??{},_=e=>e===index.SubscriptionEnum.ONE_TIME?w??"ltr":$??"ltr";if(React.useEffect(()=>{if(!o?.id||!v)return;let e=o?.id,s=`${i?.uid}-${e}`,n=!(h||V),t=a()??{};if(!n){u({...t,[e]:(t[e]??[]).filter(e=>e!==s)});return}u({...t,[e]:[...t[e]??[],s]})},[i?.uid,a,h,V,v,o?.id,u]),y||h||V)return r?jsxRuntime.jsxs("div",{...n,style:C,children:[jsxRuntime.jsx(OneTimePurchaseTooltip.OneTimePurchaseTooltip,{ref:b,setting:s}),core.filterToolbarPreview(l,!0)]}):null;let L=e=>jsxRuntime.jsx(SubscriptionRadio.SubscriptionRadio,{id:`${f}-${e}-radio`,name:N,value:e,checked:j===e,className:"!gp-items-start",onChange:s=>{s.target.checked&&T(e)}}),M=i=>jsxRuntime.jsxs("div",{...n,style:C,children:[jsxRuntime.jsxs("div",{ref:b,dir:_(i),"data-selling-type":s?.sellingType,id:E,className:O,style:I,children:[x&&L(i),jsxRuntime.jsxs("div",{"data-component-container":!0,className:D,style:q,children:[jsxRuntime.jsx(SellingPlanLabel.SellingPlanLabel,{setting:s,styles:e,id:`${f}-${i}-radio`}),i===index.SubscriptionEnum.SUBSCRIPTION&&j===i&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[U(),jsxRuntime.jsx(SubscriptionDetail.SubscriptionDetail,{setting:s,styles:e})]})]})]}),core.filterToolbarPreview(l,!0)]}),U=()=>jsxRuntime.jsx(jsxRuntime.Fragment,{children:s?.sellingStyle==="radio"?jsxRuntime.jsx(SellingPlanRadio.SellingPlanRadio,{setting:s,styles:e,builderProps:i,productId:f??"",sellingPlanOptions:S,selectedValue:m,onChange:g}):jsxRuntime.jsx(SellingPlanDropdown.SellingPlanDropdown,{dir:_(index.SubscriptionEnum.SUBSCRIPTION),setting:s,sellingPlanOptions:S,selectedValue:m,onChange:g})});return R&&!r?"":M(k?index.SubscriptionEnum.ONE_TIME:index.SubscriptionEnum.SUBSCRIPTION)};exports.default=ProductSubscription;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var core=require("@gem-sdk/core");const getWrapperClasses=()=>core.composeClasses("gp-flex gp-gap-x-[10px] gap-[10px]"),getContainerClasses=()=>core.composeClasses("gp-flex gp-flex-col"),getSellingPlanRadioContainerClasses=()=>core.composeClasses("gp-relative gp-flex gp-flex-col"),getSellingPlanRadioLabelClasses=()=>core.composeClasses("gp-text-xs gp-leading-[1.3]"),getSellingPlanRadioOptionsClasses=()=>core.composeClasses("gp-flex gp-flex-col"),getSellingPlanRadioOptionTextClasses=()=>core.composeClasses("gp-text-[14px] gp-leading-[1.3] gp-text-[#545454]"),getSubscriptionRadioLabelClasses=e=>{let
|
|
1
|
+
"use strict";var core=require("@gem-sdk/core");const getWrapperClasses=()=>core.composeClasses("gp-flex gp-gap-x-[10px] gap-[10px]"),getContainerClasses=()=>core.composeClasses("gp-flex gp-flex-col"),getSellingPlanRadioContainerClasses=()=>core.composeClasses("gp-relative gp-flex gp-flex-col"),getSellingPlanRadioLabelClasses=()=>core.composeClasses("gp-text-xs gp-leading-[1.3]"),getSellingPlanRadioOptionsClasses=()=>core.composeClasses("gp-flex gp-flex-col"),getSellingPlanRadioOptionTextClasses=()=>core.composeClasses("gp-text-[14px] gp-leading-[1.3] gp-text-[#545454]"),getSubscriptionRadioLabelClasses=e=>{let p=e?"gp-opacity-50 gp-cursor-not-allowed":"";return core.composeClasses(`gp-flex gp-items-center gp-cursor-pointer gp-gap-2 ${p}`.trim())},getSubscriptionRadioInputClasses=()=>core.composeClasses("gp-relative gp-min-h-[18px] gp-min-w-[18px] gp-mt-[3px] gp-w-4 gp-h-4 gp-cursor-pointer gp-appearance-none gp-rounded-full gp-bg-light-100 gp-transition-all gp-border-light-500 gp-border-2 checked:gp-border-[#1879b9] checked:gp-border-[6px] checked:gp-after:gp-content-[''] checked:gp-after:gp-absolute checked:gp-after:gp-top-1/2 checked:gp-after:gp-left-1/2 checked:gp-after:gp-transform checked:gp-after:gp--translate-x-1/2 checked:gp-after:gp--translate-y-1/2 checked:gp-after:gp-h-2 checked:gp-after:gp-w-2 checked:gp-after:gp-rounded-full checked:gp-after:gp-bg-white disabled:gp-cursor-not-allowed"),getSellingPlanDropdownContainerClasses=()=>core.composeClasses("gp-grid gp-w-full gp-gap-y-[9px] gp-leading-[1.3]"),getSellingPlanDropdownLabelClasses=e=>{let p=e?"gp-right-[12px] gp-left-auto":"gp-left-[12px] gp-right-auto";return core.composeClasses(`!gp-max-w-[calc(100%_-_66px)] gp-absolute gp-top-[6px] gp-p-0 gp-text-xs gp-leading-[1.3] gp-text-[#737373] gp-transition-[top] ${p}`)},getSellingPlanDropdownLabelSpanClasses=()=>core.composeClasses("gp-max-w-full"),getSellingPlanDropdownLabelInnerSpanClasses=()=>core.composeClasses("gp-block gp-overflow-hidden gp-truncate"),getSellingPlanDropdownSelectClasses=({isNoLabel:e=!1,isRTL:p=!1})=>{let s=`gp-min-h-[47px] gp-appearance-none gp-bg-transparent gp-w-full gp-whitespace-nowrap gp-rounded-[5px] gp-border gp-border-[#d9d9d9] gp-pl-[11px] gp-pr-[40px] gp-text-[14px] gp-outline-none gp-text-[#545454] gp-leading-[1.3] ${e?"gp-pt-0 gp-pb-0":"gp-pt-[21px] gp-pb-[6px]"}`,l=p?"gp-pr-[11px] gp-pl-[40px]":"gp-pl-[11px] gp-pr-[40px]";return core.composeClasses(`${s} ${l}`)},getSellingPlanDropdownOptionClasses=()=>core.composeClasses("gp-text-[14px] gp-text-black"),getSellingPlanDropdownIconContainerClasses=e=>{let p=e?"gp-left-[2px] gp-border-l-0 gp-border-r-[1px]":"gp-right-[2px] gp-border-r-0 gp-border-l-[1px]";return core.composeClasses(`gp-pointer-events-none gp-absolute gp-top-[50%] gp-flex gp-h-[43%] gp-w-[40px] gp-translate-y-[-50%] gp-items-center gp-justify-center gp-bg-white gp-border-[#545454] ${p}`)},getSellingPlanDropdownIconClasses=()=>core.composeClasses("gp-h-[10px] gp-w-[10px]");exports.getContainerClasses=getContainerClasses,exports.getSellingPlanDropdownContainerClasses=getSellingPlanDropdownContainerClasses,exports.getSellingPlanDropdownIconClasses=getSellingPlanDropdownIconClasses,exports.getSellingPlanDropdownIconContainerClasses=getSellingPlanDropdownIconContainerClasses,exports.getSellingPlanDropdownLabelClasses=getSellingPlanDropdownLabelClasses,exports.getSellingPlanDropdownLabelInnerSpanClasses=getSellingPlanDropdownLabelInnerSpanClasses,exports.getSellingPlanDropdownLabelSpanClasses=getSellingPlanDropdownLabelSpanClasses,exports.getSellingPlanDropdownOptionClasses=getSellingPlanDropdownOptionClasses,exports.getSellingPlanDropdownSelectClasses=getSellingPlanDropdownSelectClasses,exports.getSellingPlanRadioContainerClasses=getSellingPlanRadioContainerClasses,exports.getSellingPlanRadioLabelClasses=getSellingPlanRadioLabelClasses,exports.getSellingPlanRadioOptionTextClasses=getSellingPlanRadioOptionTextClasses,exports.getSellingPlanRadioOptionsClasses=getSellingPlanRadioOptionsClasses,exports.getSubscriptionRadioInputClasses=getSubscriptionRadioInputClasses,exports.getSubscriptionRadioLabelClasses=getSubscriptionRadioLabelClasses,exports.getWrapperClasses=getWrapperClasses;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var jsxRuntime=require("react/jsx-runtime"),system=require("@gem-sdk/system"),classes=require("../common/classes.js");const SellingPlanDropdown=({setting:s,sellingPlanOptions:e,selectedValue:l,onChange:
|
|
1
|
+
"use strict";var jsxRuntime=require("react/jsx-runtime"),system=require("@gem-sdk/system"),classes=require("../common/classes.js");const SellingPlanDropdown=({setting:s,sellingPlanOptions:e,selectedValue:l,dir:a,onChange:n})=>{let{sellingLabel:t}=s??{},r="rtl"===a,i=system.createClass(classes.getSellingPlanDropdownContainerClasses()),c=system.createClass(classes.getSellingPlanDropdownLabelClasses(r)),o=system.createClass(classes.getSellingPlanDropdownLabelSpanClasses()),m=system.createClass(classes.getSellingPlanDropdownLabelInnerSpanClasses()),d=system.createClass(classes.getSellingPlanDropdownSelectClasses({isNoLabel:""===t,isRTL:r})),g=system.createClass(classes.getSellingPlanDropdownOptionClasses()),p=system.createClass(classes.getSellingPlanDropdownIconContainerClasses(r)),u=system.createClass(classes.getSellingPlanDropdownIconClasses());return jsxRuntime.jsx("div",{dir:a,className:i,children:jsxRuntime.jsxs("div",{className:"gp-relative",children:[t&&jsxRuntime.jsx("label",{htmlFor:"selling-plan-select",className:c,children:jsxRuntime.jsx("span",{className:o,children:jsxRuntime.jsx("span",{className:m,children:t})})}),jsxRuntime.jsx("select",{autoComplete:"off",name:"Select Option",className:d,value:l,onChange:s=>n(s.target.value),children:e.map(s=>jsxRuntime.jsx("option",{className:g,value:s.value,children:s.label},s.value))}),jsxRuntime.jsx("div",{className:p,children:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",focusable:"false","aria-hidden":"true",role:"presentation",className:u,children:jsxRuntime.jsx("path",{d:"M0 5h20L10 15"})})})]})})};exports.SellingPlanDropdown=SellingPlanDropdown;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import{jsxs as e,Fragment as t,jsx as o}from"react/jsx-runtime";import{Fragment as i}from"react";import{useProduct as r}from"@gem-sdk/core";import{createStyle as s,createAttr as l,createClass as
|
|
2
|
+
import{jsxs as e,Fragment as t,jsx as o}from"react/jsx-runtime";import{Fragment as i}from"react";import{useProduct as r}from"@gem-sdk/core";import{createStyle as s,createAttr as l,createClass as n}from"@gem-sdk/system";import{getIconCollapseClassesRotate as d,getContainerPriceBreakdownClasses as a,getWrapperLabelClasses as c,getLabelClasses as m,getDividerClasses as u,getWrapperMoneyLinesClasses as p,getWrapperBreakdownClasses as h}from"../helpers/product-price-breakdown/getClasses.js";import{getStyle as f,getWrapperMoneyLinesStyles as b}from"../helpers/product-price-breakdown/getStyles.js";import{useGetItemGapPriceBreakdown as w}from"../hooks/useGetItemGapPriceBreakdown.js";import{useSetCollapsePrice as y}from"../hooks/useSetCollapsePrice.js";import g from"./price-breakdown/MoneyLine.js";import k from"../../text/components/Text.js";import{useGetMoneyLines as I}from"../hooks/useGetMoneyLines.js";let PostPurchaseProductPriceBreakdown=({setting:P={},styles:v={},style:x,builderAttrs:C,builderProps:L,children:j})=>{let{labelStyle:q,moneyStyle:N,spacing:S,width:T,align:B,isShowPrice:D,direction:G}=v,M=r(),H=M?.baseID?.replace("gid://shopify/Product/",""),{isCollapsePrice:R,onClickLabelPriceBreakdown:$}=y(D),{itemGap:E}=w(S),{getMoneyLines:F}=I(v,P),U=s({...f(x)}),W=l({...C}),Z=n(d(R)),z=n(a(B,L?.uid)),A=n(c(G)),J=n(m()),K=n(u()),O=n(p()),Q=n(h()),V=s({...b(T,E)}),X=({uniqueId:e})=>"recurringTotalLabel"===e?{...N,fontWeight:"normal"}:N;return e(t,{children:[e("div",{className:A,onClick:$,role:"button",tabIndex:0,"aria-hidden":"true",children:[o(k,{className:J,styles:{direction:G},setting:{text:R?P.contentHide||"Hide price breakdown":P.contentShow||"Show price breakdown",options:{isCannotEditing:!0}}}),o("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:Z,children:o("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.0187 10.3598C10.7759 10.5853 10.3963 10.5712 10.1708 10.3284L8.01045 8.00191L5.85012 10.3284C5.62464 10.5712 5.245 10.5853 5.00218 10.3598C4.75935 10.1343 4.74529 9.75469 4.97077 9.51187L7.57077 6.71187C7.6843 6.58961 7.84361 6.52014 8.01045 6.52014C8.17729 6.52014 8.3366 6.58961 8.45012 6.71187L11.0501 9.51187C11.2756 9.75469 11.2615 10.1343 11.0187 10.3598Z",fill:"#1879B9"})})]}),o("div",{className:K}),R?o("div",{className:Q,children:e("div",{...W,className:z,style:U,id:`shopify-text-element-${L?.uid}`,"data-product-id":H,children:[o("div",{className:O,style:V,children:F().map(t=>e(i,{children:["totalLabel"===t.uniqueId&&F().length>1&&o("hr",{}),o("div",{children:o(g,{uniqueId:t.uniqueId,direction:G,builderPropsUID:L?.uid,title:"totalLabel"===t.uniqueId?`<b>${t.title}</b>`:t.title,money:t.money,tooltipData:t.tooltip,labelTextStyles:{typo:{...q},direction:G},moneyTextStyles:{typo:X({uniqueId:t.uniqueId})},subTitle:t.subTitle})},t.uniqueId)]},t.uniqueId))}),j]})}):null]})};export{PostPurchaseProductPriceBreakdown as default};
|
package/dist/esm/post-purchase/product/components/product-subscription/ProductSubscription.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as i,Fragment as o}from"react/jsx-runtime";import{useRenderMode as s,useProduct as t,usePageStore as r,filterToolbarPreview as n}from"@gem-sdk/core";import{createStyle as l,createClass as m}from"@gem-sdk/system";import{useRef as p,useId as c,useEffect as a}from"react";import{SubscriptionEnum as d}from"../../constants/index.js";import{getWrapperClasses as u,getContainerClasses as g}from"./common/classes.js";import{getSubscriptionStyles as f,getSubscriptionWrapperStyles as S}from"./common/styles.js";import{useSellingPlanChange as h}from"./hooks/useSellingPlanChange.js";import{useSellingSubscription as b}from"./hooks/useSellingSubscription.js";import{useSellingPlanOptions as y}from"./hooks/useSellingPlanOptions.js";import{useSubscriptionVisibility as j}from"./hooks/useSubscriptionVisibility.js";import{OneTimePurchaseTooltip as
|
|
1
|
+
import{jsxs as e,jsx as i,Fragment as o}from"react/jsx-runtime";import{useRenderMode as s,useProduct as t,usePageStore as r,filterToolbarPreview as n}from"@gem-sdk/core";import{createStyle as l,createClass as m}from"@gem-sdk/system";import{useRef as p,useId as c,useEffect as a}from"react";import{SubscriptionEnum as d}from"../../constants/index.js";import{getWrapperClasses as u,getContainerClasses as g}from"./common/classes.js";import{getSubscriptionStyles as f,getSubscriptionWrapperStyles as S}from"./common/styles.js";import{useSellingPlanChange as h}from"./hooks/useSellingPlanChange.js";import{useSellingSubscription as b}from"./hooks/useSellingSubscription.js";import{useSellingPlanOptions as y}from"./hooks/useSellingPlanOptions.js";import{useSubscriptionVisibility as j}from"./hooks/useSubscriptionVisibility.js";import{OneTimePurchaseTooltip as I}from"./components/OneTimePurchaseTooltip.js";import{SellingPlanDropdown as P}from"./components/SellingPlanDropdown.js";import{SellingPlanLabel as T}from"./components/SellingPlanLabel.js";import{SellingPlanRadio as O}from"./components/SellingPlanRadio.js";import{SubscriptionDetail as N}from"./components/SubscriptionDetail.js";import{SubscriptionRadio as k}from"./components/SubscriptionRadio.js";import{useDynamicProduct as C}from"../../hooks/useDynamicProduct.js";import{extractProductID as E}from"../../../../helpers.js";let DEFAULT_DIRECTION="ltr",ProductSubscription=({styles:$,setting:D,builderProps:R,builderAttrs:v,style:U,children:V})=>{let{isEditMode:B}=s(),_=t(),x=r(e=>e.setSubscriptionVisible),M=r(e=>e.getSubscriptionVisible),{defaultValue:L,selectedSellingPlan:w,setSelectedSellingPlan:A}=b(D),F=y(D),{selectedValue:q,handleSellingPlanChange:z}=h({defaultValue:L,selectedSellingPlan:w,setSelectedSellingPlan:A,sellingPlanOptions:F}),G=p(null),H=c(),{selectedType:J,shouldShowRadio:K,isOneTimeHidden:Q,isOnetimeOnly:W,hasNoSellingPlanOptions:X,setSubscriptionSellingType:Y}=j({setting:D}),Z=l(f($)),ee=l(S($?.align)),ei=m(u()),eo=m(g()),es=l({...U}),et=`product-subscription-${E(_?.baseID??"")}`,er=E(_?.baseID??""),en=`subscription-type-selection-${H}`,el=D?.sellingType===d.ONE_TIME,em=D?.sellingType===d.SUBSCRIPTION,{isDynamicProduct:ep}=C(),{sellingTitleDirection:ec,sellingTitleOneTimeDirection:ea}=$??{},ed=e=>e===d.ONE_TIME?ea??"ltr":ec??"ltr";if(a(()=>{if(!_?.id||!em)return;let e=_?.id,i=`${R?.uid}-${e}`,o=!(X||ep),s=M()??{};if(!o){x({...s,[e]:(s[e]??[]).filter(e=>e!==i)});return}x({...s,[e]:[...s[e]??[],i]})},[R?.uid,M,X,ep,em,_?.id,x]),Q||X||ep)return B?e("div",{...v,style:es,children:[i(I,{ref:G,setting:D}),n(V,!0)]}):null;let eu=e=>i(k,{id:`${er}-${e}-radio`,name:en,value:e,checked:J===e,className:"!gp-items-start",onChange:i=>{i.target.checked&&Y(e)}}),eg=s=>e("div",{...v,style:es,children:[e("div",{ref:G,dir:ed(s),"data-selling-type":D?.sellingType,id:et,className:ei,style:ee,children:[K&&eu(s),e("div",{"data-component-container":!0,className:eo,style:Z,children:[i(T,{setting:D,styles:$,id:`${er}-${s}-radio`}),s===d.SUBSCRIPTION&&J===s&&e(o,{children:[ef(),i(N,{setting:D,styles:$})]})]})]}),n(V,!0)]}),ef=()=>i(o,{children:D?.sellingStyle==="radio"?i(O,{setting:D,styles:$,builderProps:R,productId:er??"",sellingPlanOptions:F,selectedValue:q,onChange:z}):i(P,{dir:ed(d.SUBSCRIPTION),setting:D,sellingPlanOptions:F,selectedValue:q,onChange:z})});return W&&!B?"":eg(el?d.ONE_TIME:d.SUBSCRIPTION)};export{ProductSubscription as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{composeClasses as e}from"@gem-sdk/core";let getWrapperClasses=()=>e("gp-flex gp-gap-x-[10px] gap-[10px]"),getContainerClasses=()=>e("gp-flex gp-flex-col"),getSellingPlanRadioContainerClasses=()=>e("gp-relative gp-flex gp-flex-col"),getSellingPlanRadioLabelClasses=()=>e("gp-text-xs gp-leading-[1.3]"),getSellingPlanRadioOptionsClasses=()=>e("gp-flex gp-flex-col"),getSellingPlanRadioOptionTextClasses=()=>e("gp-text-[14px] gp-leading-[1.3] gp-text-[#545454]"),getSubscriptionRadioLabelClasses=p=>{let g=p?"gp-opacity-50 gp-cursor-not-allowed":"";return e(`gp-flex gp-items-center gp-cursor-pointer gp-gap-2 ${g}`.trim())},getSubscriptionRadioInputClasses=()=>e("gp-relative gp-min-h-[18px] gp-min-w-[18px] gp-mt-[3px] gp-w-4 gp-h-4 gp-cursor-pointer gp-appearance-none gp-rounded-full gp-bg-light-100 gp-transition-all gp-border-light-500 gp-border-2 checked:gp-border-[#1879b9] checked:gp-border-[6px] checked:gp-after:gp-content-[''] checked:gp-after:gp-absolute checked:gp-after:gp-top-1/2 checked:gp-after:gp-left-1/2 checked:gp-after:gp-transform checked:gp-after:gp--translate-x-1/2 checked:gp-after:gp--translate-y-1/2 checked:gp-after:gp-h-2 checked:gp-after:gp-w-2 checked:gp-after:gp-rounded-full checked:gp-after:gp-bg-white disabled:gp-cursor-not-allowed"),getSellingPlanDropdownContainerClasses=()=>e("gp-grid gp-w-full gp-gap-y-[9px] gp-leading-[1.3]"),getSellingPlanDropdownLabelClasses=
|
|
1
|
+
import{composeClasses as e}from"@gem-sdk/core";let getWrapperClasses=()=>e("gp-flex gp-gap-x-[10px] gap-[10px]"),getContainerClasses=()=>e("gp-flex gp-flex-col"),getSellingPlanRadioContainerClasses=()=>e("gp-relative gp-flex gp-flex-col"),getSellingPlanRadioLabelClasses=()=>e("gp-text-xs gp-leading-[1.3]"),getSellingPlanRadioOptionsClasses=()=>e("gp-flex gp-flex-col"),getSellingPlanRadioOptionTextClasses=()=>e("gp-text-[14px] gp-leading-[1.3] gp-text-[#545454]"),getSubscriptionRadioLabelClasses=p=>{let g=p?"gp-opacity-50 gp-cursor-not-allowed":"";return e(`gp-flex gp-items-center gp-cursor-pointer gp-gap-2 ${g}`.trim())},getSubscriptionRadioInputClasses=()=>e("gp-relative gp-min-h-[18px] gp-min-w-[18px] gp-mt-[3px] gp-w-4 gp-h-4 gp-cursor-pointer gp-appearance-none gp-rounded-full gp-bg-light-100 gp-transition-all gp-border-light-500 gp-border-2 checked:gp-border-[#1879b9] checked:gp-border-[6px] checked:gp-after:gp-content-[''] checked:gp-after:gp-absolute checked:gp-after:gp-top-1/2 checked:gp-after:gp-left-1/2 checked:gp-after:gp-transform checked:gp-after:gp--translate-x-1/2 checked:gp-after:gp--translate-y-1/2 checked:gp-after:gp-h-2 checked:gp-after:gp-w-2 checked:gp-after:gp-rounded-full checked:gp-after:gp-bg-white disabled:gp-cursor-not-allowed"),getSellingPlanDropdownContainerClasses=()=>e("gp-grid gp-w-full gp-gap-y-[9px] gp-leading-[1.3]"),getSellingPlanDropdownLabelClasses=p=>{let g=p?"gp-right-[12px] gp-left-auto":"gp-left-[12px] gp-right-auto";return e(`!gp-max-w-[calc(100%_-_66px)] gp-absolute gp-top-[6px] gp-p-0 gp-text-xs gp-leading-[1.3] gp-text-[#737373] gp-transition-[top] ${g}`)},getSellingPlanDropdownLabelSpanClasses=()=>e("gp-max-w-full"),getSellingPlanDropdownLabelInnerSpanClasses=()=>e("gp-block gp-overflow-hidden gp-truncate"),getSellingPlanDropdownSelectClasses=({isNoLabel:p=!1,isRTL:g=!1})=>{let l=`gp-min-h-[47px] gp-appearance-none gp-bg-transparent gp-w-full gp-whitespace-nowrap gp-rounded-[5px] gp-border gp-border-[#d9d9d9] gp-pl-[11px] gp-pr-[40px] gp-text-[14px] gp-outline-none gp-text-[#545454] gp-leading-[1.3] ${p?"gp-pt-0 gp-pb-0":"gp-pt-[21px] gp-pb-[6px]"}`,n=g?"gp-pr-[11px] gp-pl-[40px]":"gp-pl-[11px] gp-pr-[40px]";return e(`${l} ${n}`)},getSellingPlanDropdownOptionClasses=()=>e("gp-text-[14px] gp-text-black"),getSellingPlanDropdownIconContainerClasses=p=>{let g=p?"gp-left-[2px] gp-border-l-0 gp-border-r-[1px]":"gp-right-[2px] gp-border-r-0 gp-border-l-[1px]";return e(`gp-pointer-events-none gp-absolute gp-top-[50%] gp-flex gp-h-[43%] gp-w-[40px] gp-translate-y-[-50%] gp-items-center gp-justify-center gp-bg-white gp-border-[#545454] ${g}`)},getSellingPlanDropdownIconClasses=()=>e("gp-h-[10px] gp-w-[10px]");export{getContainerClasses,getSellingPlanDropdownContainerClasses,getSellingPlanDropdownIconClasses,getSellingPlanDropdownIconContainerClasses,getSellingPlanDropdownLabelClasses,getSellingPlanDropdownLabelInnerSpanClasses,getSellingPlanDropdownLabelSpanClasses,getSellingPlanDropdownOptionClasses,getSellingPlanDropdownSelectClasses,getSellingPlanRadioContainerClasses,getSellingPlanRadioLabelClasses,getSellingPlanRadioOptionTextClasses,getSellingPlanRadioOptionsClasses,getSubscriptionRadioInputClasses,getSubscriptionRadioLabelClasses,getWrapperClasses};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as l}from"react/jsx-runtime";import{createClass as a}from"@gem-sdk/system";import{getSellingPlanDropdownContainerClasses as s,getSellingPlanDropdownLabelClasses as
|
|
1
|
+
import{jsx as e,jsxs as l}from"react/jsx-runtime";import{createClass as a}from"@gem-sdk/system";import{getSellingPlanDropdownContainerClasses as s,getSellingPlanDropdownLabelClasses as r,getSellingPlanDropdownLabelSpanClasses as n,getSellingPlanDropdownLabelInnerSpanClasses as i,getSellingPlanDropdownSelectClasses as t,getSellingPlanDropdownOptionClasses as o,getSellingPlanDropdownIconContainerClasses as c,getSellingPlanDropdownIconClasses as m}from"../common/classes.js";let SellingPlanDropdown=({setting:d,sellingPlanOptions:p,selectedValue:h,dir:v,onChange:g})=>{let{sellingLabel:u}=d??{},N="rtl"===v,f=a(s()),w=a(r(N)),b=a(n()),x=a(i()),S=a(t({isNoLabel:""===u,isRTL:N})),j=a(o()),C=a(c(N)),D=a(m());return e("div",{dir:v,className:f,children:l("div",{className:"gp-relative",children:[u&&e("label",{htmlFor:"selling-plan-select",className:w,children:e("span",{className:b,children:e("span",{className:x,children:u})})}),e("select",{autoComplete:"off",name:"Select Option",className:S,value:h,onChange:e=>g(e.target.value),children:p.map(l=>e("option",{className:j,value:l.value,children:l.label},l.value))}),e("div",{className:C,children:e("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",focusable:"false","aria-hidden":"true",role:"presentation",className:D,children:e("path",{d:"M0 5h20L10 15"})})})]})})};export{SellingPlanDropdown};
|