@gem-sdk/components 12.0.0-staging.57 → 12.0.0-staging.59
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/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/common/styles.js +1 -1
- package/dist/cjs/post-purchase/product/components/product-subscription/components/SellingPlanDropdown.js +1 -1
- package/dist/cjs/post-purchase/product/components/product-subscription/components/SellingPlanLabel.js +1 -1
- package/dist/cjs/post-purchase/product/components/product-subscription/components/SellingPlanRadio.js +1 -1
- package/dist/cjs/post-purchase/product/components/product-subscription/components/SubscriptionDetail.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/common/styles.js +1 -1
- package/dist/esm/post-purchase/product/components/product-subscription/components/SellingPlanDropdown.js +1 -1
- package/dist/esm/post-purchase/product/components/product-subscription/components/SellingPlanLabel.js +1 -1
- package/dist/esm/post-purchase/product/components/product-subscription/components/SellingPlanRadio.js +1 -1
- package/dist/esm/post-purchase/product/components/product-subscription/components/SubscriptionDetail.js +1 -1
- package/package.json +1 -1
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");const ProductSubscription=({styles:e,setting:
|
|
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 r=core.useProduct(),o=core.usePageStore(e=>e.setSubscriptionVisible),u=core.usePageStore(e=>e.getSubscriptionVisible),{defaultValue:a,selectedSellingPlan:c,setSelectedSellingPlan:p}=useSellingSubscription.useSellingSubscription(s),d=useSellingPlanOptions.useSellingPlanOptions(s),{selectedValue:S,handleSellingPlanChange:g}=useSellingPlanChange.useSellingPlanChange({defaultValue:a,selectedSellingPlan:c,setSelectedSellingPlan:p,sellingPlanOptions:d}),m=React.useRef(null),b=React.useId(),{selectedType:P,shouldShowRadio:j,isOneTimeHidden:y,hasNoSellingPlanOptions:x,setSubscriptionSellingType:R}=useSubscriptionVisibility.useSubscriptionVisibility({setting:s}),h=system.createStyle(styles.getSubscriptionStyles(e)),q=system.createStyle(styles.getSubscriptionWrapperStyles(e?.align)),T=system.createClass(classes.getWrapperClasses()),D=system.createClass(classes.getContainerClasses()),O=system.createStyle({...t}),{isEditMode:C}=core.useRenderMode(),I=`product-subscription-${helpers.extractProductID(r?.baseID??"")}`,f=helpers.extractProductID(r?.baseID??""),E=`subscription-type-selection-${b}`,k=s?.sellingType===index.SubscriptionEnum.ONE_TIME,v=s?.sellingType===index.SubscriptionEnum.SUBSCRIPTION,{isDynamicProduct:N}=useDynamicProduct.useDynamicProduct();if(React.useEffect(()=>{if(!r?.id||!v)return;let e=r?.id,s=`${i?.uid}-${e}`,n=!(x||N),t=u()??{};if(!n){o({...t,[e]:(t[e]??[]).filter(e=>e!==s)});return}o({...t,[e]:[...t[e]??[],s]})},[i?.uid,u,x,N,v,r?.id,o]),y||x||N)return C?jsxRuntime.jsxs("div",{...n,style:O,children:[jsxRuntime.jsx(OneTimePurchaseTooltip.OneTimePurchaseTooltip,{ref:m,setting:s}),core.filterToolbarPreview(l,!0)]}):null;let V=e=>jsxRuntime.jsx(SubscriptionRadio.SubscriptionRadio,{id:`${f}-${e}-radio`,name:E,value:e,checked:P===e,className:"!gp-items-start",onChange:s=>{s.target.checked&&R(e)}}),$=i=>jsxRuntime.jsxs("div",{...n,style:O,children:[jsxRuntime.jsxs("div",{ref:m,"data-selling-type":s?.sellingType,id:I,className:T,style:q,children:[j&&V(i),jsxRuntime.jsxs("div",{"data-component-container":!0,className:D,style:h,children:[jsxRuntime.jsx(SellingPlanLabel.SellingPlanLabel,{setting:s,styles:e,id:`${f}-${i}-radio`}),i===index.SubscriptionEnum.SUBSCRIPTION&&w(),jsxRuntime.jsx(SubscriptionDetail.SubscriptionDetail,{setting:s,styles:e})]})]}),core.filterToolbarPreview(l,!0)]}),w=()=>jsxRuntime.jsx(jsxRuntime.Fragment,{children:s?.sellingStyle==="radio"?jsxRuntime.jsx(SellingPlanRadio.SellingPlanRadio,{setting:s,styles:e,builderProps:i,productId:f??"",sellingPlanOptions:d,selectedValue:S,onChange:g}):jsxRuntime.jsx(SellingPlanDropdown.SellingPlanDropdown,{setting:s,sellingPlanOptions:d,selectedValue:S,onChange:g})});return $(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 s=e?"gp-opacity-50 gp-cursor-not-allowed":"";return core.composeClasses(`gp-flex gp-items-center gp-cursor-pointer gp-gap-2 ${s}`.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-
|
|
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 s=e?"gp-opacity-50 gp-cursor-not-allowed":"";return core.composeClasses(`gp-flex gp-items-center gp-cursor-pointer gp-gap-2 ${s}`.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=()=>core.composeClasses("!gp-max-w-[calc(100%_-_66px)] gp-absolute gp-left-[12px] gp-top-[6px] gp-p-0 gp-text-xs gp-leading-[1.3] gp-text-[#737373] gp-transition-[top]"),getSellingPlanDropdownLabelSpanClasses=()=>core.composeClasses("gp-max-w-full"),getSellingPlanDropdownLabelInnerSpanClasses=()=>core.composeClasses("gp-block gp-overflow-hidden gp-truncate"),getSellingPlanDropdownSelectClasses=({isNoLabel:e=!1})=>core.composeClasses(`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]"}`),getSellingPlanDropdownOptionClasses=()=>core.composeClasses("gp-text-[14px] gp-text-black"),getSellingPlanDropdownIconContainerClasses=()=>core.composeClasses("gp-pointer-events-none gp-absolute gp-right-[2px] gp-top-[50%] gp-flex gp-h-[43%] gp-w-[40px] gp-translate-y-[-50%] gp-items-center gp-justify-center gp-border-l-[1px] gp-bg-white gp-border-[#545454]"),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 core=require("@gem-sdk/core"),helper=require("../../../../common/helper.js");const getSubscriptionStyles=
|
|
1
|
+
"use strict";var core=require("@gem-sdk/core"),helper=require("../../../../common/helper.js");const getSubscriptionStyles=e=>{let{width:t}=e??{},r=core.makeStyle({w:t}),l=core.makeStyle({rg:"8px"});return core.filterTruthyStyles({...r,...l})},getSubscriptionWrapperStyles=e=>core.filterTruthyStyles({...core.makeStyle({jc:e??"left"})}),getSellingPlanRadioOptionsStyles=({sellingPlanItemGap:e,sellingType:t})=>{let r=helper.postPurchaseSpacing[e??"tight"]||"9px",l=core.makeStyle({rg:"subscription"===t?r:"9px"});return core.filterTruthyStyles({...l})};exports.getSellingPlanRadioOptionsStyles=getSellingPlanRadioOptionsStyles,exports.getSubscriptionStyles=getSubscriptionStyles,exports.getSubscriptionWrapperStyles=getSubscriptionWrapperStyles;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var jsxRuntime=require("react/jsx-runtime"),system=require("@gem-sdk/system"),classes=require("../common/classes.js")
|
|
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:a})=>{let{sellingLabel:n}=s??{},t=system.createClass(classes.getSellingPlanDropdownContainerClasses()),r=system.createClass(classes.getSellingPlanDropdownLabelClasses()),i=system.createClass(classes.getSellingPlanDropdownLabelSpanClasses()),c=system.createClass(classes.getSellingPlanDropdownLabelInnerSpanClasses()),o=system.createClass(classes.getSellingPlanDropdownSelectClasses({isNoLabel:""===n})),m=system.createClass(classes.getSellingPlanDropdownOptionClasses()),d=system.createClass(classes.getSellingPlanDropdownIconContainerClasses()),g=system.createClass(classes.getSellingPlanDropdownIconClasses());return jsxRuntime.jsx("div",{className:t,children:jsxRuntime.jsxs("div",{className:"gp-relative",children:[n&&jsxRuntime.jsx("label",{htmlFor:"selling-plan-select",className:r,children:jsxRuntime.jsx("span",{className:i,children:jsxRuntime.jsx("span",{className:c,children:n})})}),jsxRuntime.jsx("select",{autoComplete:"off",name:"Select Option",className:o,value:l,onChange:s=>a(s.target.value),children:e.map(s=>jsxRuntime.jsx("option",{className:m,value:s.value,children:s.label},s.value))}),jsxRuntime.jsx("div",{className:d,children:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",focusable:"false","aria-hidden":"true",role:"presentation",className:g,children:jsxRuntime.jsx("path",{d:"M0 5h20L10 15"})})})]})})};exports.SellingPlanDropdown=SellingPlanDropdown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var jsxRuntime=require("react/jsx-runtime"),Text=require("../../../../text/components/Text.js"),attrs=require("../common/attrs.js"),index=require("../../../constants/index.js")
|
|
1
|
+
"use strict";var jsxRuntime=require("react/jsx-runtime"),Text=require("../../../../text/components/Text.js"),attrs=require("../common/attrs.js"),index=require("../../../constants/index.js");const SellingPlanLabel=({setting:e,styles:t,id:l})=>{let{sellingTitle:s,sellingTitleOneTime:n,sellingType:r}=e??{},i=r===index.SubscriptionEnum.ONE_TIME,a=i?n:s,{typo:x,textAlign:u,direction:g}=attrs.getSellingPlanLabelAttrs({styles:t,sellingType:r});return jsxRuntime.jsx("label",{htmlFor:l,children:jsxRuntime.jsx(Text.default,{className:"gp-flex-1",textClassWrapper:"gp-leading-[24px]",styles:{typo:x,textAlign:u,direction:g},setting:{text:a}})})};exports.SellingPlanLabel=SellingPlanLabel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var jsxRuntime=require("react/jsx-runtime"),system=require("@gem-sdk/system"),SubscriptionRadio=require("./SubscriptionRadio.js"),classes=require("../common/classes.js"),styles=require("../common/styles.js")
|
|
1
|
+
"use strict";var jsxRuntime=require("react/jsx-runtime"),system=require("@gem-sdk/system"),SubscriptionRadio=require("./SubscriptionRadio.js"),classes=require("../common/classes.js"),styles=require("../common/styles.js");const SellingPlanRadio=({setting:s,styles:e,productId:l,sellingPlanOptions:a,builderProps:i,selectedValue:n,onChange:t})=>{let{sellingLabel:r}=s??{},{uid:c}=i??{},o=system.createClass(classes.getSellingPlanRadioContainerClasses()),m=system.createClass(classes.getSellingPlanRadioLabelClasses()),u=system.createClass(classes.getSellingPlanRadioOptionsClasses()),d=system.createClass(classes.getSellingPlanRadioOptionTextClasses()),g=styles.getSellingPlanRadioOptionsStyles({sellingPlanItemGap:e?.sellingPlanItemGap,sellingType:s?.sellingType});return jsxRuntime.jsxs("div",{className:o,style:g,children:[r&&jsxRuntime.jsx("label",{className:m,children:r}),jsxRuntime.jsx("div",{className:u,style:g,children:a.map(s=>jsxRuntime.jsx(SubscriptionRadio.SubscriptionRadio,{id:`${l}-${s.value}-${c??""}`,name:`${l}-selling-plan-options-${c??""}`,value:s.value,checked:n===s.value,onChange:s=>t(s.target.value),children:jsxRuntime.jsx("span",{className:d,children:s.label})},`${l}-${s.value}-${c??""}`))})]})};exports.SellingPlanRadio=SellingPlanRadio;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var jsxRuntime=require("react/jsx-runtime"),Text=require("../../../../text/components/Text.js");const SubscriptionDetail=({setting:t,styles:
|
|
1
|
+
"use strict";var jsxRuntime=require("react/jsx-runtime"),Text=require("../../../../text/components/Text.js");const SubscriptionDetail=({setting:t,styles:e})=>t?.enableSubscriptionDetail?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(Text.default,{styles:{typo:e?.subscriptionDetailTypo??{},textAlign:e?.subscriptionDetailAlign??"left",direction:e?.subscriptionDetailDirection??"ltr"},textClassWrapper:"gp-leading-[24px]",setting:{text:t.subscriptionLabel}})}):null;exports.SubscriptionDetail=SubscriptionDetail;
|
package/dist/esm/post-purchase/product/components/product-subscription/ProductSubscription.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as i,Fragment as
|
|
1
|
+
import{jsxs as e,jsx as i,Fragment as o}from"react/jsx-runtime";import{useProduct as s,usePageStore as t,useRenderMode 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 P}from"./components/OneTimePurchaseTooltip.js";import{SellingPlanDropdown as I}from"./components/SellingPlanDropdown.js";import{SellingPlanLabel as T}from"./components/SellingPlanLabel.js";import{SellingPlanRadio as k}from"./components/SellingPlanRadio.js";import{SubscriptionDetail as O}from"./components/SubscriptionDetail.js";import{SubscriptionRadio as N}from"./components/SubscriptionRadio.js";import{useDynamicProduct as $}from"../../hooks/useDynamicProduct.js";import{extractProductID as C}from"../../../../helpers.js";let ProductSubscription=({styles:v,setting:D,builderProps:R,builderAttrs:V,style:E,children:x})=>{let B=s(),U=t(e=>e.setSubscriptionVisible),M=t(e=>e.getSubscriptionVisible),{defaultValue:_,selectedSellingPlan:w,setSelectedSellingPlan:L}=b(D),q=y(D),{selectedValue:z,handleSellingPlanChange:A}=h({defaultValue:_,selectedSellingPlan:w,setSelectedSellingPlan:L,sellingPlanOptions:q}),F=p(null),G=c(),{selectedType:H,shouldShowRadio:J,isOneTimeHidden:K,hasNoSellingPlanOptions:Q,setSubscriptionSellingType:W}=j({setting:D}),X=l(f(v)),Y=l(S(v?.align)),Z=m(u()),ee=m(g()),ei=l({...E}),{isEditMode:eo}=r(),es=`product-subscription-${C(B?.baseID??"")}`,et=C(B?.baseID??""),er=`subscription-type-selection-${G}`,en=D?.sellingType===d.ONE_TIME,el=D?.sellingType===d.SUBSCRIPTION,{isDynamicProduct:em}=$();if(a(()=>{if(!B?.id||!el)return;let e=B?.id,i=`${R?.uid}-${e}`,o=!(Q||em),s=M()??{};if(!o){U({...s,[e]:(s[e]??[]).filter(e=>e!==i)});return}U({...s,[e]:[...s[e]??[],i]})},[R?.uid,M,Q,em,el,B?.id,U]),K||Q||em)return eo?e("div",{...V,style:ei,children:[i(P,{ref:F,setting:D}),n(x,!0)]}):null;let ep=e=>i(N,{id:`${et}-${e}-radio`,name:er,value:e,checked:H===e,className:"!gp-items-start",onChange:i=>{i.target.checked&&W(e)}}),ec=o=>e("div",{...V,style:ei,children:[e("div",{ref:F,"data-selling-type":D?.sellingType,id:es,className:Z,style:Y,children:[J&&ep(o),e("div",{"data-component-container":!0,className:ee,style:X,children:[i(T,{setting:D,styles:v,id:`${et}-${o}-radio`}),o===d.SUBSCRIPTION&&ea(),i(O,{setting:D,styles:v})]})]}),n(x,!0)]}),ea=()=>i(o,{children:D?.sellingStyle==="radio"?i(k,{setting:D,styles:v,builderProps:R,productId:et??"",sellingPlanOptions:q,selectedValue:z,onChange:A}):i(I,{setting:D,sellingPlanOptions:q,selectedValue:z,onChange:A})});return ec(en?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-
|
|
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=()=>e("!gp-max-w-[calc(100%_-_66px)] gp-absolute gp-left-[12px] gp-top-[6px] gp-p-0 gp-text-xs gp-leading-[1.3] gp-text-[#737373] gp-transition-[top]"),getSellingPlanDropdownLabelSpanClasses=()=>e("gp-max-w-full"),getSellingPlanDropdownLabelInnerSpanClasses=()=>e("gp-block gp-overflow-hidden gp-truncate"),getSellingPlanDropdownSelectClasses=({isNoLabel:p=!1})=>e(`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]"}`),getSellingPlanDropdownOptionClasses=()=>e("gp-text-[14px] gp-text-black"),getSellingPlanDropdownIconContainerClasses=()=>e("gp-pointer-events-none gp-absolute gp-right-[2px] gp-top-[50%] gp-flex gp-h-[43%] gp-w-[40px] gp-translate-y-[-50%] gp-items-center gp-justify-center gp-border-l-[1px] gp-bg-white gp-border-[#545454]"),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{makeStyle as t,filterTruthyStyles as e}from"@gem-sdk/core";import{postPurchaseSpacing as r}from"../../../../common/helper.js";let getSubscriptionStyles=
|
|
1
|
+
import{makeStyle as t,filterTruthyStyles as e}from"@gem-sdk/core";import{postPurchaseSpacing as r}from"../../../../common/helper.js";let getSubscriptionStyles=r=>{let{width:i}=r??{},p=t({w:i}),l=t({rg:"8px"});return e({...p,...l})},getSubscriptionWrapperStyles=r=>e({...t({jc:r??"left"})}),getSellingPlanRadioOptionsStyles=({sellingPlanItemGap:i,sellingType:p})=>{let l=r[i??"tight"]||"9px",o=t({rg:"subscription"===p?l:"9px"});return e({...o})};export{getSellingPlanRadioOptionsStyles,getSubscriptionStyles,getSubscriptionWrapperStyles};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
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 n,getSellingPlanDropdownLabelSpanClasses as r,getSellingPlanDropdownLabelInnerSpanClasses as i,getSellingPlanDropdownSelectClasses as o,getSellingPlanDropdownOptionClasses as t,getSellingPlanDropdownIconContainerClasses as c,getSellingPlanDropdownIconClasses as m}from"../common/classes.js";let SellingPlanDropdown=({setting:d,sellingPlanOptions:p,selectedValue:h,onChange:v})=>{let{sellingLabel:g}=d??{},u=a(s()),N=a(n()),f=a(r()),w=a(i()),b=a(o({isNoLabel:""===g})),x=a(t()),S=a(c()),j=a(m());return e("div",{className:u,children:l("div",{className:"gp-relative",children:[g&&e("label",{htmlFor:"selling-plan-select",className:N,children:e("span",{className:f,children:e("span",{className:w,children:g})})}),e("select",{autoComplete:"off",name:"Select Option",className:b,value:h,onChange:e=>v(e.target.value),children:p.map(l=>e("option",{className:x,value:l.value,children:l.label},l.value))}),e("div",{className:S,children:e("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",focusable:"false","aria-hidden":"true",role:"presentation",className:j,children:e("path",{d:"M0 5h20L10 15"})})})]})})};export{SellingPlanDropdown};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import t from"../../../../text/components/Text.js";import{getSellingPlanLabelAttrs as l}from"../common/attrs.js";import{SubscriptionEnum as r}from"../../../constants/index.js";let SellingPlanLabel=({setting:n,styles:s,id:o})=>{let{sellingTitle:m,sellingTitleOneTime:a,sellingType:i}=n??{},p=i===r.ONE_TIME,x=p?a:m,{typo:g,textAlign:c,direction:f}=l({styles:s,sellingType:i});return e("label",{htmlFor:o,children:e(t,{className:"gp-flex-1",textClassWrapper:"gp-leading-[24px]",styles:{typo:g,textAlign:c,direction:f},setting:{text:x}})})};export{SellingPlanLabel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as l}from"react/jsx-runtime";import{createClass as a}from"@gem-sdk/system";import{SubscriptionRadio as s}from"./SubscriptionRadio.js";import{getSellingPlanRadioContainerClasses as i,getSellingPlanRadioLabelClasses as
|
|
1
|
+
import{jsxs as e,jsx as l}from"react/jsx-runtime";import{createClass as a}from"@gem-sdk/system";import{SubscriptionRadio as s}from"./SubscriptionRadio.js";import{getSellingPlanRadioContainerClasses as i,getSellingPlanRadioLabelClasses as n,getSellingPlanRadioOptionsClasses as m,getSellingPlanRadioOptionTextClasses as o}from"../common/classes.js";import{getSellingPlanRadioOptionsStyles as r}from"../common/styles.js";let SellingPlanRadio=({setting:t,styles:c,productId:p,sellingPlanOptions:d,builderProps:g,selectedValue:u,onChange:v})=>{let{sellingLabel:$}=t??{},{uid:h}=g??{},y=a(i()),f=a(n()),j=a(m()),N=a(o()),P=r({sellingPlanItemGap:c?.sellingPlanItemGap,sellingType:t?.sellingType});return e("div",{className:y,style:P,children:[$&&l("label",{className:f,children:$}),l("div",{className:j,style:P,children:d.map(e=>l(s,{id:`${p}-${e.value}-${h??""}`,name:`${p}-selling-plan-options-${h??""}`,value:e.value,checked:u===e.value,onChange:e=>v(e.target.value),children:l("span",{className:N,children:e.label})},`${p}-${e.value}-${h??""}`))})]})};export{SellingPlanRadio};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import
|
|
1
|
+
import{jsx as t,Fragment as i}from"react/jsx-runtime";import e from"../../../../text/components/Text.js";let SubscriptionDetail=({setting:r,styles:l})=>r?.enableSubscriptionDetail?t(i,{children:t(e,{styles:{typo:l?.subscriptionDetailTypo??{},textAlign:l?.subscriptionDetailAlign??"left",direction:l?.subscriptionDetailDirection??"ltr"},textClassWrapper:"gp-leading-[24px]",setting:{text:r.subscriptionLabel}})}):null;export{SubscriptionDetail};
|