@gem-sdk/components 2.0.0-staging.1017 → 2.0.0-staging.1019

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,2 +1,2 @@
1
1
  'use client';
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),system=require("@gem-sdk/system"),useProductQuantity=require("./hooks/useProductQuantity.js"),attrs=require("./common/attrs.js"),classes=require("./common/classes.js"),styles=require("./common/styles.js"),helpers=require("./common/helpers.js");const ProductQuantity=e=>{let{setting:s={},styles:t={},builderProps:r,advanced:a}=e,l=core.useCurrentVariant(),{quantity:n}=core.useQuantity(),{isInStock:u,ref:c,onClickIncrement:o,onClickDecrement:y,onChangeInput:i,onFocusInput:m}=useProductQuantity.useProductQuantity(e),{plusIcon:d,minusIcon:g}=s,j=s.defaultQtyValue||1,{inputHeight:p,buttonBackgroundColor:C,backgroundColor:h,iconColor:x,inputBackgroundColor:S,textColor:b,align:B,borderBtn:I,buttonWidth:f,iconSizeCustom:q,corner:v}=t,A=s?.hasButton,P=system.createAttr({...attrs.getContainerAttrs({isDisabled:!u,uid:r?.uid||""})}),Q=system.createClass({...classes.getContainerClasses(a?.cssClass)}),R=system.createStyle({...styles.getContainerStyles({align:B,inputHeight:p})}),N=system.createClass({...classes.getWrapperClasses()}),H=system.createStyle({...styles.getWrapperStyles({backgroundColor:h,styles:t,setting:s})}),_=system.createAttr({...attrs.getInputAttr({hasButton:A,quantity:n,currentVariant:l,defaultQty:j})}),k=system.createClass({...classes.getInputClasses({styles:t,borderBtn:I,inputBackgroundColor:S,textColor:b,isDisabled:!u})}),D=system.createStyle({...styles.getInputStyle(e)}),M=system.createClass({...classes.getButtonClass({borderBtn:I,buttonBackgroundColor:C,iconColor:x,buttonSide:"left",isDisabled:!u})}),W=system.createStyle({...styles.getButtonStyle({borderBtn:I,buttonWidth:f,buttonBackgroundColor:C,iconColor:x,corner:v,enableHoverButton:s?.enableHoverButton})}),L=system.createAttr({...attrs.getButtonAttrs({buttonSide:"left"})}),T=system.createClass({...classes.getButtonClass({borderBtn:I,buttonBackgroundColor:C,iconColor:x,buttonSide:"right",isDisabled:!u})}),V=system.createStyle({...styles.getButtonStyle({borderBtn:I,buttonWidth:f,buttonBackgroundColor:C,iconColor:x,corner:v,enableHoverButton:s?.enableHoverButton})}),F=system.createAttr({...attrs.getButtonAttrs({buttonSide:"right"})}),O=system.createClass({...classes.getIconWrapperClasses()}),w=system.createStyle({...helpers.getIconWidth(q)});return jsxRuntime.jsx("div",{ref:c,...P,className:Q,style:R,children:jsxRuntime.jsxs("div",{className:N,style:H,children:[system.If(A,jsxRuntime.jsx("button",{...L,onClick:y,className:M,style:W,children:jsxRuntime.jsx("span",{className:O,style:w,dangerouslySetInnerHTML:{__html:helpers.getMinusIcon(g)}})})),jsxRuntime.jsx("input",{..._,className:k,style:D,onChange:e=>i(e),onFocus:e=>m(e)}),system.If(A,jsxRuntime.jsx("button",{...F,onClick:o,className:T,style:V,children:jsxRuntime.jsx("span",{className:O,style:w,dangerouslySetInnerHTML:{__html:helpers.getPlusIcon(d)}})}))]})})};exports.default=ProductQuantity;
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),system=require("@gem-sdk/system"),useProductQuantity=require("./hooks/useProductQuantity.js"),attrs=require("./common/attrs.js"),classes=require("./common/classes.js"),styles=require("./common/styles.js"),helpers=require("./common/helpers.js");const ProductQuantity=e=>{let{setting:s={},styles:t={},builderProps:r,advanced:a}=e,l=core.useCurrentVariant(),{quantity:n}=core.useQuantity(),{isInStock:u,ref:c,onClickIncrement:o,onClickDecrement:y,onChangeInput:i,onFocusInput:m}=useProductQuantity.useProductQuantity(e),{plusIcon:d,minusIcon:g}=s,j=s.defaultQtyValue||1,{inputHeight:p,buttonBackgroundColor:C,backgroundColor:h,iconColor:x,inputBackgroundColor:S,textColor:b,align:B,borderBtn:I,buttonWidth:f,iconSizeCustom:q,corner:v}=t,A=s?.hasButton,P=system.createAttr({...attrs.getContainerAttrs({isDisabled:!u,uid:r?.uid||""})}),Q=system.createClass({...classes.getContainerClasses(a?.cssClass)}),R=system.createStyle({...styles.getContainerStyles({align:B,inputHeight:p})}),N=system.createClass({...classes.getWrapperClasses()}),H=system.createStyle({...styles.getWrapperStyles({backgroundColor:h,styles:t})}),_=system.createAttr({...attrs.getInputAttr({hasButton:A,quantity:n,currentVariant:l,defaultQty:j})}),k=system.createClass({...classes.getInputClasses({styles:t,borderBtn:I,inputBackgroundColor:S,textColor:b,isDisabled:!u})}),D=system.createStyle({...styles.getInputStyle(e)}),M=system.createClass({...classes.getButtonClass({borderBtn:I,buttonBackgroundColor:C,iconColor:x,buttonSide:"left",isDisabled:!u})}),W=system.createStyle({...styles.getButtonStyle({borderBtn:I,buttonWidth:f,buttonBackgroundColor:C,iconColor:x,corner:v,enableHoverButton:s?.enableHoverButton})}),L=system.createAttr({...attrs.getButtonAttrs({buttonSide:"left"})}),T=system.createClass({...classes.getButtonClass({borderBtn:I,buttonBackgroundColor:C,iconColor:x,buttonSide:"right",isDisabled:!u})}),V=system.createStyle({...styles.getButtonStyle({borderBtn:I,buttonWidth:f,buttonBackgroundColor:C,iconColor:x,corner:v,enableHoverButton:s?.enableHoverButton})}),F=system.createAttr({...attrs.getButtonAttrs({buttonSide:"right"})}),O=system.createClass({...classes.getIconWrapperClasses()}),w=system.createStyle({...helpers.getIconWidth(q)});return jsxRuntime.jsx("div",{ref:c,...P,className:Q,style:R,children:jsxRuntime.jsxs("div",{className:N,style:H,children:[system.If(A,jsxRuntime.jsx("button",{...L,onClick:y,className:M,style:W,children:jsxRuntime.jsx("span",{className:O,style:w,dangerouslySetInnerHTML:{__html:helpers.getMinusIcon(g)}})})),jsxRuntime.jsx("input",{..._,className:k,style:D,onChange:e=>i(e),onFocus:e=>m(e)}),system.If(A,jsxRuntime.jsx("button",{...F,onClick:o,className:T,style:V,children:jsxRuntime.jsx("span",{className:O,style:w,dangerouslySetInnerHTML:{__html:helpers.getPlusIcon(d)}})}))]})})};exports.default=ProductQuantity;
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),helpers$1=require("../../../helpers.js"),system=require("@gem-sdk/system"),attrs=require("./common/attrs.js"),classes=require("./common/classes.js"),styles=require("./common/styles.js"),helpers=require("./common/helpers.js");const ProductQuantity=({setting:e={},styles:t={},advanced:s,builderProps:a})=>{let{plusIcon:r,minusIcon:l,updatePrice:n}=e,i=e.defaultQtyValue??1,{inputHeight:c,buttonBackgroundColor:o,iconColor:u,inputBackgroundColor:y,textColor:d,align:p,borderBtn:g,buttonWidth:m,iconSizeCustom:$,corner:f,backgroundColor:b,dividerColor:S,dividerStroke:v}=t,C=e?.hasButton,h=system.createAttr({...attrs.getContainerAttrs({uid:a?.uid||"",isDisableByLiquid:!0})}),q=system.createClass({...classes.getContainerClasses(s?.cssClass)}),B=system.createStyle({...styles.getContainerStyles({align:p,inputHeight:c})}),A=system.createClass({...classes.getWrapperClasses()}),I=system.createStyle({...styles.getWrapperStyles({backgroundColor:b,styles:t,setting:e})}),_=system.createAttr({...attrs.getInputAttr({isLiquid:!0,hasButton:C,defaultQty:i})}),j=system.createClass({...classes.getInputClasses({styles:t,borderBtn:g,inputBackgroundColor:y,textColor:d})}),P=system.createStyle({...styles.getInputStyle({setting:e,styles:{...t,borderBtn:g,inputBackgroundColor:y,textColor:d,dividerColor:S,dividerStroke:v}})}),E=system.createClass({...classes.getButtonClass({borderBtn:g,buttonBackgroundColor:o,iconColor:u,buttonSide:"left"})}),R=system.createStyle({...styles.getButtonStyle({borderBtn:g,buttonWidth:m,buttonBackgroundColor:o,iconColor:u,corner:f,enableHoverButton:e?.enableHoverButton})}),k=system.createAttr({...attrs.getButtonAttrs({buttonSide:"left"})}),H=system.createClass({...classes.getButtonClass({borderBtn:g,buttonBackgroundColor:o,iconColor:u,buttonSide:"right"})}),L=system.createStyle({...styles.getButtonStyle({borderBtn:g,buttonWidth:m,buttonBackgroundColor:o,iconColor:u,corner:f,enableHoverButton:e?.enableHoverButton})}),M=system.createAttr({...attrs.getButtonAttrs({buttonSide:"right"})}),W=system.createClass({...classes.getIconWrapperClasses()}),D=helpers.getIconWidth($);return core.template`
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),helpers$1=require("../../../helpers.js"),system=require("@gem-sdk/system"),attrs=require("./common/attrs.js"),classes=require("./common/classes.js"),styles=require("./common/styles.js"),helpers=require("./common/helpers.js");const ProductQuantity=({setting:e={},styles:t={},advanced:s,builderProps:a})=>{let{plusIcon:r,minusIcon:l,updatePrice:n}=e,i=e.defaultQtyValue??1,{inputHeight:c,buttonBackgroundColor:o,iconColor:u,inputBackgroundColor:y,textColor:d,align:p,borderBtn:g,buttonWidth:m,iconSizeCustom:$,corner:f,backgroundColor:b,dividerColor:S,dividerStroke:v}=t,C=e?.hasButton,h=system.createAttr({...attrs.getContainerAttrs({uid:a?.uid||"",isDisableByLiquid:!0})}),q=system.createClass({...classes.getContainerClasses(s?.cssClass)}),B=system.createStyle({...styles.getContainerStyles({align:p,inputHeight:c})}),A=system.createClass({...classes.getWrapperClasses()}),I=system.createStyle({...styles.getWrapperStyles({backgroundColor:b,styles:t})}),_=system.createAttr({...attrs.getInputAttr({isLiquid:!0,hasButton:C,defaultQty:i})}),j=system.createClass({...classes.getInputClasses({styles:t,borderBtn:g,inputBackgroundColor:y,textColor:d})}),P=system.createStyle({...styles.getInputStyle({setting:e,styles:{...t,borderBtn:g,inputBackgroundColor:y,textColor:d,dividerColor:S,dividerStroke:v}})}),E=system.createClass({...classes.getButtonClass({borderBtn:g,buttonBackgroundColor:o,iconColor:u,buttonSide:"left"})}),R=system.createStyle({...styles.getButtonStyle({borderBtn:g,buttonWidth:m,buttonBackgroundColor:o,iconColor:u,corner:f,enableHoverButton:e?.enableHoverButton})}),k=system.createAttr({...attrs.getButtonAttrs({buttonSide:"left"})}),H=system.createClass({...classes.getButtonClass({borderBtn:g,buttonBackgroundColor:o,iconColor:u,buttonSide:"right"})}),L=system.createStyle({...styles.getButtonStyle({borderBtn:g,buttonWidth:m,buttonBackgroundColor:o,iconColor:u,corner:f,enableHoverButton:e?.enableHoverButton})}),M=system.createAttr({...attrs.getButtonAttrs({buttonSide:"right"})}),W=system.createClass({...classes.getIconWrapperClasses()}),D=helpers.getIconWidth($);return core.template`
2
2
  {%- liquid
3
3
  assign current_variant = product.selected_or_first_available_variant
4
4
  assign available = current_variant.available | default: false
@@ -1 +1 @@
1
- "use strict";var core=require("@gem-sdk/core");const getInputClasses=({styles:e,borderBtn:s,inputBackgroundColor:t,textColor:o,isDisabled:l})=>{let r="gp-flex gp-w-full gp-px-1 gp-min-w-[45px] gp-shrink-[99999] gp-appearance-none gp-items-center gp-text-center gp-outline-none gp-transition-all gp-duration-150 hover:gp-text-black disabled:gp-cursor-not-allowed",p=core.composeTypographyClassName(e?.typo,e?.typography),a=core.handleConvertClassColor(s),g=core.getGlobalColorStateClass("bg",t),n=core.getGlobalColorStateClass("text",o);return a&&(r+=` ${a} `),p&&(r+=` ${p} `),g&&(r+=` ${g} `),n&&(r+=` ${n} `),l&&(r+="gp-cursor-not-allowed"),{...core.composeClasses(r)}},getButtonClass=({borderBtn:e,buttonBackgroundColor:s,iconColor:t,buttonSide:o,isDisabled:l})=>{let r=`gp-flex gp-aspect-square gp-h-full disabled:gp-cursor-not-allowed ${l?"gp-cursor-not-allowed":"gp-cursor-pointer"} gp-items-center gp-justify-center gp-outline-none ${"left"===o?"gp-minus":"gp-plus"} `,p=core.handleConvertClassColor(e),a=core.getGlobalColorStateClass("bg",s),g=core.getGlobalColorStateClass("text",t);return p&&(r+=` ${p} `),a&&(r+=` ${a} `),g&&(r+=` ${g} `),{...core.composeClasses(r)}},getContainerClasses=e=>({...core.composeClasses(`quantityClass gp-relative gp-inline-flex gp-h-12 gp-w-full gp-bg-transparent gp-transition-all gp-duration-150 data-[disabled=true]:gp-opacity-60 ${e??""}`)}),getWrapperClasses=()=>({...core.composeClasses("gp-inline-flex gp-w-full gp-overflow-hidden")}),getIconWrapperClasses=()=>({...core.composeClasses("gp-inline-flex gp-items-center gp-justify-center [&>*]:gp-h-full [&>*]:gp-w-full")});exports.getButtonClass=getButtonClass,exports.getContainerClasses=getContainerClasses,exports.getIconWrapperClasses=getIconWrapperClasses,exports.getInputClasses=getInputClasses,exports.getWrapperClasses=getWrapperClasses;
1
+ "use strict";var core=require("@gem-sdk/core");const getInputClasses=({styles:e,borderBtn:s,inputBackgroundColor:t,textColor:o,isDisabled:l})=>{let p="gp-flex gp-w-full gp-px-1 gp-min-w-[45px] gp-shrink-[99999] gp-appearance-none gp-items-center gp-text-center gp-outline-none focus-visible:gp-shadow-none focus-visible:gp-outline-none gp-transition-all gp-duration-150 hover:gp-text-black disabled:gp-cursor-not-allowed",r=core.composeTypographyClassName(e?.typo,e?.typography),a=core.handleConvertClassColor(s),g=core.getGlobalColorStateClass("bg",t),n=core.getGlobalColorStateClass("text",o);return a&&(p+=` ${a} `),r&&(p+=` ${r} `),g&&(p+=` ${g} `),n&&(p+=` ${n} `),l&&(p+="gp-cursor-not-allowed"),{...core.composeClasses(p)}},getButtonClass=({borderBtn:e,buttonBackgroundColor:s,iconColor:t,buttonSide:o,isDisabled:l})=>{let p=`gp-flex gp-aspect-square gp-h-full disabled:gp-cursor-not-allowed ${l?"gp-cursor-not-allowed":"gp-cursor-pointer"} gp-items-center gp-justify-center gp-outline-none ${"left"===o?"gp-minus":"gp-plus"} `,r=core.handleConvertClassColor(e),a=core.getGlobalColorStateClass("bg",s),g=core.getGlobalColorStateClass("text",t);return r&&(p+=` ${r} `),a&&(p+=` ${a} `),g&&(p+=` ${g} `),{...core.composeClasses(p)}},getContainerClasses=e=>({...core.composeClasses(`quantityClass gp-relative gp-inline-flex gp-h-12 gp-w-full gp-bg-transparent gp-transition-all gp-duration-150 data-[disabled=true]:gp-opacity-60 ${e??""}`)}),getWrapperClasses=()=>({...core.composeClasses("gp-inline-flex gp-w-full")}),getIconWrapperClasses=()=>({...core.composeClasses("gp-inline-flex gp-items-center gp-justify-center [&>*]:gp-h-full [&>*]:gp-w-full")});exports.getButtonClass=getButtonClass,exports.getContainerClasses=getContainerClasses,exports.getIconWrapperClasses=getIconWrapperClasses,exports.getInputClasses=getInputClasses,exports.getWrapperClasses=getWrapperClasses;
@@ -1 +1 @@
1
- "use strict";var core=require("@gem-sdk/core");const addPxToValues=e=>Object.fromEntries(Object.entries(e).map(([e,t])=>[e,`${t}px`])),getDividerWidth=(e,t)=>{if(!e||!t)return{};let o=addPxToValues(e),r={...core.makeStyleState("brw",o),...core.makeStyleState("blw",o)};return r},getDividerColorStyle=e=>{if(!e)return{};let t={...e,normal:e?.normal??"transparent"},o={...core.getGlobalColorStateStyle("brc",t),...core.getGlobalColorStateStyle("blc",t)},r=Object.fromEntries(Object.entries(o).filter(([e,t])=>void 0!==t));return r},getInputStyle=e=>{let{styles:t,setting:o}=e,{inputBackgroundColor:r,textColor:l,dividerColor:a,dividerStroke:s,inputBoxShadow:n}=t??{},{enableHoverInput:S,hasButton:d}=o??{},c=core.composeTypographyStyle(t?.typo,t?.typography),i=core.getStyleShadowState(n,"box-shadow",{normal:!!n?.normal,hover:!!n?.hover}),p={...getDividerWidth(s,a),...getDividerColorStyle(a)},y={...core.getGlobalColorStateStyle("bg",{...r,normal:r?.normal??"transparent"}),...i,...core.getGlobalColorStateStyle("c",{...l,hover:l?.hover??l?.normal}),...d?p:{}},h={...core.makeStyle({}),...c,...y,...core.getStyleShadow({value:t?.typo?.custom?.textShadow,styleAppliedFor:"text-shadow",isEnableShadow:t?.typo?.custom?.hasShadowText})};return S?h:core.filterHoverVariables(h)},getButtonStyle=({borderBtn:e,buttonWidth:t,buttonBackgroundColor:o,iconColor:r,corner:l,enableHoverButton:a})=>{let s={...core.makeStyleResponsive("w",t),...core.handleConvertBorderStyle(e),...core.handleConvertBorderWidth(e),...core.handleConvertBorderColor(e),...core.getGlobalColorStateStyle("bg",o),...core.getGlobalColorStateStyle("c",r),...core.composeRadius(l)};return a?s:core.filterHoverVariables(s)},getContainerStyles=({inputHeight:e,align:t})=>({...core.makeStyleResponsive("h",e),...core.makeStyleResponsive("jc",t)}),getWrapperStyles=({backgroundColor:e,styles:t,setting:o})=>{let{enableHoverInput:r,hasButton:l}=o??{},a=t?.shapeShadow,s=core.getResponsiveStyleShadowWithoutState(a,"box-shadow",{desktop:a?.desktop??{},tablet:a?.tablet??a?.desktop??{},mobile:a?.mobile??a?.tablet??a?.desktop??{}}),n=t?.inputBorder,S=r&&!l,d={...core.handleConvertBorderStyle(n),...core.handleConvertBorderWidth(n),...core.handleConvertBorderColor(n)};return{...S?d:{},...core.getGlobalColorResponsiveStyle("bg",e),...core.makeStyleResponsive("maxw",t?.quantityWidth),...core.composeBorderResponsive(t?.shapeBorder),...core.composeRadiusResponsive(t?.shapeRounded),...s}};exports.getButtonStyle=getButtonStyle,exports.getContainerStyles=getContainerStyles,exports.getInputStyle=getInputStyle,exports.getWrapperStyles=getWrapperStyles;
1
+ "use strict";var core=require("@gem-sdk/core");const addPxToValues=e=>Object.fromEntries(Object.entries(e).map(([e,t])=>[e,`${t}px`])),getDividerWidth=(e,t)=>{if(!e||!t)return{};let o=addPxToValues(e),r={...core.makeStyleState("brw",o),...core.makeStyleState("blw",o)};return r},getDividerColorStyle=e=>{if(!e)return{};let t={...e,normal:e?.normal??"transparent"},o={...core.getGlobalColorStateStyle("brc",t),...core.getGlobalColorStateStyle("blc",t)},r=Object.fromEntries(Object.entries(o).filter(([e,t])=>void 0!==t));return r},getInputStyle=e=>{let{styles:t,setting:o}=e,{inputBackgroundColor:r,textColor:l,dividerColor:a,dividerStroke:s,inputBoxShadow:n}=t??{},{enableHoverInput:d,hasButton:S}=o??{},c=core.composeTypographyStyle(t?.typo,t?.typography),i=core.getStyleShadowState(n,"box-shadow",{normal:!!n?.normal,hover:!!n?.hover}),p={...getDividerWidth(s,a),...getDividerColorStyle(a)},y={...core.getGlobalColorStateStyle("bg",{...r,normal:r?.normal??"transparent"}),...i,...core.getGlobalColorStateStyle("c",{...l,hover:l?.hover??l?.normal}),...S?p:{}},h=t?.inputBorder,g={...core.handleConvertBorderStyle(h),...core.handleConvertBorderWidth(h),...core.handleConvertBorderColor(h)},b={...S?{}:g,...S?{}:core.composeRadiusResponsive(t?.shapeRounded),...core.makeStyle({}),...c,...y,...core.getStyleShadow({value:t?.typo?.custom?.textShadow,styleAppliedFor:"text-shadow",isEnableShadow:t?.typo?.custom?.hasShadowText})};return d?b:core.filterHoverVariables(b)},getButtonStyle=({borderBtn:e,buttonWidth:t,buttonBackgroundColor:o,iconColor:r,corner:l,enableHoverButton:a})=>{let s={...core.makeStyleResponsive("w",t),...core.handleConvertBorderStyle(e),...core.handleConvertBorderWidth(e),...core.handleConvertBorderColor(e),...core.getGlobalColorStateStyle("bg",o),...core.getGlobalColorStateStyle("c",r),...core.composeRadius(l)};return a?s:core.filterHoverVariables(s)},getContainerStyles=({inputHeight:e,align:t})=>({...core.makeStyleResponsive("h",e),...core.makeStyleResponsive("jc",t)}),getWrapperStyles=({backgroundColor:e,styles:t})=>{let o=t?.shapeShadow,r=core.getResponsiveStyleShadowWithoutState(o,"box-shadow",{desktop:o?.desktop??{},tablet:o?.tablet??o?.desktop??{},mobile:o?.mobile??o?.tablet??o?.desktop??{}});return{...core.getGlobalColorResponsiveStyle("bg",e),...core.makeStyleResponsive("maxw",t?.quantityWidth),...core.composeBorderResponsive(t?.shapeBorder),...core.composeRadiusResponsive(t?.shapeRounded),...r}};exports.getButtonStyle=getButtonStyle,exports.getContainerStyles=getContainerStyles,exports.getInputStyle=getInputStyle,exports.getWrapperStyles=getWrapperStyles;
@@ -1,3 +1,3 @@
1
1
  "use strict";const ProductQuantitySettings=[{id:"setting",controls:[{id:"updatePrice",label:"Update price",type:"toggle",default:!0},{id:"hasButton",label:"Button",type:"toggle",default:!0},{id:"defaultQtyValue",label:"Text",type:"input:stepper",min:1,default:1},{id:"plusIcon",type:"icon",isHideClear:!0,customLabel:"Plus",info:"Choose from list or paste any SVG icon",default:`<svg height="20px" width="20px" data-name="plus-regular" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor" data-id="508817698760687976">
2
2
  <path fill="currentColor" strokelinecap="round" strokelinejoin="round" d="M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"></path></svg>`},{id:"minusIcon",type:"icon",isHideClear:!0,customLabel:"Minus",info:"Choose from list or paste any SVG icon",default:`<svg height="20px" width="20px" data-name="minus-regular" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor" data-id="508817690725712232">
3
- <path fill="currentColor" strokelinecap="round" strokelinejoin="round" d="M224,128a8,8,0,0,1-8,8H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128Z"></path></svg>`},{id:"enableHoverInput",label:"Enable hover input",type:"toggle",default:!1},{id:"enableHoverButton",label:"Enable hover input",type:"toggle",default:!1}]},{id:"style",controls:[{id:"quantityLayout",label:"Style",type:"layout-selector",popoverLabel:{en:"Style"},iconViewBox:"0 0 80 48",enableItemBackground:!0,itemPerRow:2,itemSpacing:"large",options:[{label:"Square",value:"product-quantity-square",type:"p-quantity-layout",iconName:"gp-product-quantity-square"},{label:"Square with divider",value:"product-quantity-square-divider",type:"p-quantity-layout",iconName:"gp-product-quantity-square-divider"},{label:"Rounded",value:"product-quantity-rounded",type:"p-quantity-layout",iconName:"gp-product-quantity-rounded"},{label:"Rounded with divider",value:"product-quantity-rounded-divider",type:"p-quantity-layout",iconName:"gp-product-quantity-rounded-divider"},{label:"Square input only",value:"product-quantity-square-input-only",type:"p-quantity-layout",iconName:"gp-product-quantity-square-input-only"},{label:"Rounded input only",value:"product-quantity-rounded-input-only",type:"p-quantity-layout",iconName:"gp-product-quantity-rounded-input-only"}],default:"product-quantity-square"},{id:"dimensions",type:"group",label:"Dimensions",controls:[{id:"fullWidth",label:"Full Width",type:"toggle",devices:{desktop:{default:!1}}},{id:"quantityWidth",type:"dropdown:input",label:"Width",inputType:"number",units:["px","%"],hideUnit:!1,displayOptions:[{label:"Full",value:"100%",showValue:!0}],devices:{desktop:{default:"160px"}}},{id:"inputHeight",type:"dropdown:input",label:"Width",inputType:"number",units:["px","%"],hideUnit:!1,displayOptions:[{label:"Full",value:"100%",showValue:!0}],devices:{desktop:{default:"45px"}}},{id:"buttonWidth",type:"dropdown:input",label:"Button Width",inputType:"number",units:["px","%"],hideUnit:!1,displayOptions:[{label:"Full",value:"100%",showValue:!0}],devices:{desktop:{default:"45px"}}},{id:"iconSizeCustom",type:"input:stepper",includeUnit:"px",min:1,devices:{desktop:{default:"16px"}}}]},{id:"inputStyle",type:"group",label:"Input Style",controls:[{id:"typo",type:"typography-combo",default:{type:"paragraph-1",attrs:{color:"#121212"},custom:{fontSize:{desktop:"16px",tablet:"16px",mobile:"14px"},lineHeight:{desktop:"120%",tablet:"180%",mobile:"180%"},fontWeight:"400",fontFamily:{value:"Assistant",type:"google"},hasShadowText:!1,textShadow:{enable:!1}}},ignoreReRender:!0,hiddenSetting:{transform:!0,textAlign:!0}},{id:"align",label:"Alignment",type:"option:value",options:[{label:"Left",value:"left",type:"align",tooltip:"Align left",iconName:"gp-align-left"},{label:"Center",value:"center",type:"align",tooltip:"Align center",iconName:"gp-align-center"},{label:"Right",value:"right",type:"align",tooltip:"Align right",iconName:"gp-align-right"}],devices:{desktop:{default:"left"}}}]},{id:"button-behavior-state",type:"behavior-state",label:"Button Style",hide:!0,controls:[{id:"textColor",type:"color-picker-v2",label:"Text Color",default:{normal:"text-2"},compoDefaultValue:{hover:"text-2"},state:{hover:!0,normal:!0},enableGradient:!0},{id:"inputBackgroundColor",type:"color-picker-v2",label:"Background Color",state:{hover:!0,normal:!0},compoDefaultValue:{normal:"highlight",hover:"highlight"},enableGradient:!0},{id:"buttonBackgroundColor",type:"color-picker-v2",label:"Button Background Color",state:{hover:!0,normal:!0},enableGradient:!0,compoDefaultValue:{normal:"brand",hover:"highlight"}},{id:"iconColor",type:"color-picker-v2",label:"Icon Color",default:{normal:"#121212"},compoDefaultValue:{hover:"text-2"},state:{hover:!0,normal:!0},enableGradient:!0}]},{id:"borderBtn",label:"Border",type:"border-v2",default:{normal:{}},compoDefaultValue:{normal:{border:"solid",color:"#212121",width:"1px",borderWidth:"1px"},hover:{border:"solid",color:"#212121",width:"1px",borderWidth:"1px"}},state:{hover:!0,normal:!0}},{id:"corner",label:"Corner",type:"corner-v2",default:{normal:{btrr:"0px",bblr:"0px",bbrr:"0px",btlr:"0px",radiusType:"none"}}},{id:"inputBoxShadow",type:"shadow-v2",default:{normal:{}},compoDefaultValue:{normal:{type:"shadow-1",distance:"4px",blur:"4px",spread:"0px",color:"#121212",angle:90}}},{id:"backgroundColor",type:"color-picker-v2",label:"Background Color",devices:{desktop:{default:"#FFFFFF"}},enableGradient:!0},{id:"dividerColor",type:"color-picker-v2",label:"Divider Color",default:{normal:"line-3"},compoDefaultValue:{normal:"line-3"},state:{hover:!0,normal:!0},enableGradient:!0},{id:"dividerStroke",label:"Thickness",type:"input:stepper",min:1,default:{normal:1},state:{hover:!0,normal:!0}},{id:"inputBorder",label:"Input Border",type:"border-v2",default:{hover:{border:"solid",color:"line-3",width:"1px",borderWidth:"1px"}},state:{hover:!0,normal:!1}},{id:"shapeBorder",type:"border-v2",devices:{desktop:{default:{border:"solid",color:"line-3",width:"1px",borderWidth:"1px"}}}},{id:"shapeRounded",type:"corner-v2",devices:{desktop:{default:{radiusType:"none"}}}},{id:"shapeShadow",type:"shadow-v2",devices:{desktop:{default:{}}},compoDefaultValue:{desktop:{default:{type:"shadow-1",distance:"4px",blur:"4px",spread:"0px",color:"rgba(18, 18, 18, 0.20)",angle:45,enable:!0}}}}]}];exports.ProductQuantitySettings=ProductQuantitySettings;
3
+ <path fill="currentColor" strokelinecap="round" strokelinejoin="round" d="M224,128a8,8,0,0,1-8,8H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128Z"></path></svg>`},{id:"enableHoverInput",label:"Enable hover input",type:"toggle",default:!1},{id:"enableHoverButton",label:"Enable hover input",type:"toggle",default:!1}]},{id:"style",controls:[{id:"quantityLayout",label:"Style",type:"layout-selector",popoverLabel:{en:"Style"},iconViewBox:"0 0 80 48",enableItemBackground:!0,itemPerRow:2,itemSpacing:"large",options:[{label:"Square",value:"product-quantity-square",type:"p-quantity-layout",iconName:"gp-product-quantity-square"},{label:"Square with divider",value:"product-quantity-square-divider",type:"p-quantity-layout",iconName:"gp-product-quantity-square-divider"},{label:"Rounded",value:"product-quantity-rounded",type:"p-quantity-layout",iconName:"gp-product-quantity-rounded"},{label:"Rounded with divider",value:"product-quantity-rounded-divider",type:"p-quantity-layout",iconName:"gp-product-quantity-rounded-divider"},{label:"Square input only",value:"product-quantity-square-input-only",type:"p-quantity-layout",iconName:"gp-product-quantity-square-input-only"},{label:"Rounded input only",value:"product-quantity-rounded-input-only",type:"p-quantity-layout",iconName:"gp-product-quantity-rounded-input-only"}],default:"product-quantity-square"},{id:"dimensions",type:"group",label:"Dimensions",controls:[{id:"fullWidth",label:"Full Width",type:"toggle",devices:{desktop:{default:!1}}},{id:"quantityWidth",type:"dropdown:input",label:"Width",inputType:"number",units:["px","%"],hideUnit:!1,displayOptions:[{label:"Full",value:"100%",showValue:!0}],devices:{desktop:{default:"160px"}}},{id:"inputHeight",type:"dropdown:input",label:"Width",inputType:"number",units:["px","%"],hideUnit:!1,displayOptions:[{label:"Full",value:"100%",showValue:!0}],devices:{desktop:{default:"45px"}}},{id:"buttonWidth",type:"dropdown:input",label:"Button Width",inputType:"number",units:["px","%"],hideUnit:!1,displayOptions:[{label:"Full",value:"100%",showValue:!0}],devices:{desktop:{default:"45px"}}},{id:"iconSizeCustom",type:"input:stepper",includeUnit:"px",min:1,devices:{desktop:{default:"16px"}}}]},{id:"inputStyle",type:"group",label:"Input Style",controls:[{id:"typo",type:"typography-combo",default:{type:"paragraph-1",attrs:{color:"#121212"},custom:{fontSize:{desktop:"16px",tablet:"16px",mobile:"14px"},lineHeight:{desktop:"120%",tablet:"180%",mobile:"180%"},fontWeight:"400",fontFamily:{value:"Assistant",type:"google"},hasShadowText:!1,textShadow:{enable:!1}}},ignoreReRender:!0,hiddenSetting:{transform:!0,textAlign:!0}},{id:"align",label:"Alignment",type:"option:value",options:[{label:"Left",value:"left",type:"align",tooltip:"Align left",iconName:"gp-align-left"},{label:"Center",value:"center",type:"align",tooltip:"Align center",iconName:"gp-align-center"},{label:"Right",value:"right",type:"align",tooltip:"Align right",iconName:"gp-align-right"}],devices:{desktop:{default:"left"}}}]},{id:"button-behavior-state",type:"behavior-state",label:"Button Style",hide:!0,controls:[{id:"textColor",type:"color-picker-v2",label:"Text Color",default:{normal:"text-2"},compoDefaultValue:{hover:"text-2"},state:{hover:!0,normal:!0},enableGradient:!0},{id:"inputBackgroundColor",type:"color-picker-v2",label:"Background Color",state:{hover:!0,normal:!0},compoDefaultValue:{normal:"highlight",hover:"highlight"},enableGradient:!0},{id:"buttonBackgroundColor",type:"color-picker-v2",label:"Button Background Color",state:{hover:!0,normal:!0},enableGradient:!0,compoDefaultValue:{normal:"brand",hover:"highlight"}},{id:"iconColor",type:"color-picker-v2",label:"Icon Color",default:{normal:"#121212"},compoDefaultValue:{hover:"text-2"},state:{hover:!0,normal:!0},enableGradient:!0}]},{id:"borderBtn",label:"Border",type:"border-v2",default:{normal:{}},compoDefaultValue:{normal:{border:"solid",color:"#212121",width:"1px",borderWidth:"1px"},hover:{border:"solid",color:"#212121",width:"1px",borderWidth:"1px"}},state:{hover:!0,normal:!0}},{id:"corner",label:"Corner",type:"corner-v2",default:{normal:{btrr:"0px",bblr:"0px",bbrr:"0px",btlr:"0px",radiusType:"none"}}},{id:"inputBoxShadow",type:"shadow-v2",default:{normal:{}},compoDefaultValue:{normal:{type:"shadow-1",distance:"4px",blur:"4px",spread:"0px",color:"#121212",angle:90}}},{id:"backgroundColor",type:"color-picker-v2",label:"Background Color",devices:{desktop:{default:"#FFFFFF"}},enableGradient:!0},{id:"dividerColor",type:"color-picker-v2",label:"Divider Color",default:{normal:"line-3"},compoDefaultValue:{normal:"line-3"},state:{hover:!0,normal:!0},enableGradient:!0},{id:"dividerStroke",label:"Thickness",type:"input:stepper",min:1,default:{normal:1},state:{hover:!0,normal:!0}},{id:"inputBorder",label:"Input Border",type:"border-v2",default:{hover:{}},state:{hover:!0,normal:!0}},{id:"shapeBorder",type:"border-v2",devices:{desktop:{default:{border:"solid",color:"line-3",width:"1px",borderWidth:"1px"}}}},{id:"shapeRounded",type:"corner-v2",devices:{desktop:{default:{radiusType:"none"}}}},{id:"shapeShadow",type:"shadow-v2",devices:{desktop:{default:{}}},compoDefaultValue:{desktop:{default:{type:"shadow-1",distance:"4px",blur:"4px",spread:"0px",color:"rgba(18, 18, 18, 0.20)",angle:45,enable:!0}}}}]}];exports.ProductQuantitySettings=ProductQuantitySettings;
@@ -1 +1 @@
1
- "use strict";const SettingUIV2=[{controls:[{label:{en:"Button"},setting:{id:"hasButton"},options:{labelVariant:"primary",toggleStyle:"switch"}},{label:{en:"Width"},setting:{id:"buttonWidth"},conditionDisplay:"hasButton === true"},{label:{en:"Background"},setting:{id:"buttonBackgroundColor",state:"normal"},conditionDisplay:"hasButton === true"},{label:{en:"Plus icon"},setting:{id:"plusIcon"},conditionDisplay:"hasButton === true"},{label:{en:"Minus icon"},setting:{id:"minusIcon"},conditionDisplay:"hasButton === true"},{label:{en:"Icon color"},setting:{id:"iconColor",state:"normal"},conditionDisplay:"hasButton === true"}],moreSettings:{type:"collapse",controls:[{label:{en:"Icon size"},setting:{id:"iconSizeCustom"},conditionDisplay:"hasButton === true"},{label:{en:"Border"},setting:{id:"borderBtn",state:"normal"},conditionDisplay:"hasButton === true"},{label:{en:"Corner"},setting:{id:"corner",state:"normal"},conditionDisplay:"hasButton === true"},{label:{en:"Hover"},type:"combo",iconName:"polaris-check-clicked",fixedValue:"Styled",setting:{id:"enableHoverButton"},popoverLabel:{en:"Hover effect"},state:"hover",conditionDisplay:"hasButton === true",controls:[{label:{en:"Background"},setting:{id:"buttonBackgroundColor",state:"hover"},compoDefaultValue:{default:"highlight"}},{label:{en:"Icon color"},setting:{id:"iconColor",state:"hover"}},{label:{en:"Border"},setting:{id:"borderBtn",state:"hover"}},{label:{en:"Corner"},setting:{id:"corner",state:"hover"}}]}]}},{label:{en:"Input"},controls:[{label:{en:"Background"},setting:{id:"inputBackgroundColor",state:"normal"}},{label:{en:"Text style"},setting:{id:"typo"},options:{updateFields:[{field:"attrs.color",settingId:"textColor",state:"normal"}]},controlChangeTrigger:{settings:[{action:{controlId:"textColor",valueFromField:"attrs.color",groupType:"style",controlType:"style",removeDevice:!0,state:"normal"}}],options:{noRecordHistory:!0}}},{label:{en:"Divider"},type:"combo",conditionDisplay:"hasButton === true",comboType:"color",getValueFromSettingID:"dividerColor.normal",compoDefaultValue:"line-3",controls:[{label:{en:"Color"},setting:{id:"dividerColor",state:"normal"}},{label:{en:"Thickness"},setting:{id:"dividerStroke",state:"normal"}}]},{label:{en:"Shadow"},setting:{id:"inputBoxShadow",state:"normal"}},{label:{en:"Hover"},type:"combo",iconName:"polaris-check-clicked",fixedValue:"Styled",popoverLabel:{en:"Hover effect"},setting:{id:"enableHoverInput"},state:"hover",controls:[{label:{en:"Background"},setting:{id:"inputBackgroundColor",state:"hover"}},{label:{en:"Text color"},setting:{id:"textColor",state:"hover"}},{label:{en:"Divider"},setting:{id:"dividerColor",state:"hover"},conditionDisplay:"hasButton === true"},{label:{en:"Divider thickness"},setting:{id:"dividerStroke",state:"hover"},conditionDisplay:"hasButton === true"},{label:{en:"Border"},setting:{id:"inputBorder",state:"hover"},conditionDisplay:"hasButton === false"},{label:{en:"Shadow"},setting:{id:"inputBoxShadow",state:"hover"}}]}]},{label:{en:"Size"},controls:[{label:{en:"Width"},setting:{id:"quantityWidth"}},{label:{en:"Height"},setting:{id:"inputHeight"}}]},{label:{en:"Background"},controls:[{label:{en:"Color"},setting:{id:"backgroundColor"}}]},{label:{en:"Shape"},controls:[{label:{en:"Border"},setting:{id:"shapeBorder"}},{label:{en:"Corner"},setting:{id:"shapeRounded"}},{label:{en:"Shadow"},setting:{id:"shapeShadow"}}]},{label:{en:"Display condition"},controls:[{label:{en:"Default quantity"},setting:{id:"defaultQtyValue"}},{label:{en:"Update price"},setting:{id:"updatePrice"}}]},{controls:[{label:{en:"Align"},conditionEnable:'!(parseInt(quantityWidth) >= 100 && quantityWidth?.includes("%"))',setting:{id:"align"},options:{labelVariant:"primary",fullWidth:!0,disableMessage:"Align is not supported when width is 100%"}}]}];exports.SettingUIV2=SettingUIV2;
1
+ "use strict";const SettingUIV2=[{controls:[{label:{en:"Button"},setting:{id:"hasButton"},options:{labelVariant:"primary",toggleStyle:"switch"}},{label:{en:"Width"},setting:{id:"buttonWidth"},conditionDisplay:"hasButton === true"},{label:{en:"Background"},setting:{id:"buttonBackgroundColor",state:"normal"},conditionDisplay:"hasButton === true"},{label:{en:"Plus icon"},setting:{id:"plusIcon"},conditionDisplay:"hasButton === true"},{label:{en:"Minus icon"},setting:{id:"minusIcon"},conditionDisplay:"hasButton === true"},{label:{en:"Icon color"},setting:{id:"iconColor",state:"normal"},conditionDisplay:"hasButton === true"}],moreSettings:{type:"collapse",controls:[{label:{en:"Icon size"},setting:{id:"iconSizeCustom"},conditionDisplay:"hasButton === true"},{label:{en:"Border"},setting:{id:"borderBtn",state:"normal"},conditionDisplay:"hasButton === true"},{label:{en:"Corner"},setting:{id:"corner",state:"normal"},conditionDisplay:"hasButton === true"},{label:{en:"Hover"},type:"combo",iconName:"polaris-check-clicked",fixedValue:"Styled",setting:{id:"enableHoverButton"},popoverLabel:{en:"Hover effect"},state:"hover",conditionDisplay:"hasButton === true",controls:[{label:{en:"Background"},setting:{id:"buttonBackgroundColor",state:"hover"},compoDefaultValue:{default:"highlight"}},{label:{en:"Icon color"},setting:{id:"iconColor",state:"hover"}},{label:{en:"Border"},setting:{id:"borderBtn",state:"hover"}},{label:{en:"Corner"},setting:{id:"corner",state:"hover"}}]}]}},{label:{en:"Input"},controls:[{label:{en:"Background"},setting:{id:"inputBackgroundColor",state:"normal"}},{label:{en:"Text style"},setting:{id:"typo"},options:{updateFields:[{field:"attrs.color",settingId:"textColor",state:"normal"}]},controlChangeTrigger:{settings:[{action:{controlId:"textColor",valueFromField:"attrs.color",groupType:"style",controlType:"style",removeDevice:!0,state:"normal"}}],options:{noRecordHistory:!0}}},{label:{en:"Divider"},type:"combo",conditionDisplay:"hasButton === true",comboType:"color",getValueFromSettingID:"dividerColor.normal",compoDefaultValue:"line-3",controls:[{label:{en:"Color"},setting:{id:"dividerColor",state:"normal"}},{label:{en:"Thickness"},setting:{id:"dividerStroke",state:"normal"}}]},{label:{en:"Border"},setting:{id:"inputBorder",state:"normal"},conditionDisplay:"hasButton === false"},{label:{en:"Shadow"},setting:{id:"inputBoxShadow",state:"normal"}},{label:{en:"Hover"},type:"combo",iconName:"polaris-check-clicked",fixedValue:"Styled",popoverLabel:{en:"Hover effect"},setting:{id:"enableHoverInput"},state:"hover",controls:[{label:{en:"Background"},setting:{id:"inputBackgroundColor",state:"hover"}},{label:{en:"Text color"},setting:{id:"textColor",state:"hover"}},{label:{en:"Divider"},setting:{id:"dividerColor",state:"hover"},conditionDisplay:"hasButton === true"},{label:{en:"Divider thickness"},setting:{id:"dividerStroke",state:"hover"},conditionDisplay:"hasButton === true"},{label:{en:"Border"},setting:{id:"inputBorder",state:"hover"},conditionDisplay:"hasButton === false"},{label:{en:"Shadow"},setting:{id:"inputBoxShadow",state:"hover"}}]}]},{label:{en:"Size"},controls:[{label:{en:"Width"},setting:{id:"quantityWidth"}},{label:{en:"Height"},setting:{id:"inputHeight"}}]},{label:{en:"Background"},controls:[{label:{en:"Color"},setting:{id:"backgroundColor"}}]},{label:{en:"Shape"},controls:[{label:{en:"Border"},setting:{id:"shapeBorder"}},{label:{en:"Corner"},setting:{id:"shapeRounded"}},{label:{en:"Shadow"},setting:{id:"shapeShadow"}}]},{label:{en:"Display condition"},controls:[{label:{en:"Default quantity"},setting:{id:"defaultQtyValue"}},{label:{en:"Update price"},setting:{id:"updatePrice"}}]},{controls:[{label:{en:"Align"},conditionEnable:'!(parseInt(quantityWidth) >= 100 && quantityWidth?.includes("%"))',setting:{id:"align"},options:{labelVariant:"primary",fullWidth:!0,disableMessage:"Align is not supported when width is 100%"}}]}];exports.SettingUIV2=SettingUIV2;
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{jsx as t,jsxs as e}from"react/jsx-runtime";import{useCurrentVariant as s,useQuantity as o}from"@gem-sdk/core";import{createAttr as l,createClass as n,createStyle as r,If as a}from"@gem-sdk/system";import{useProductQuantity as i}from"./hooks/useProductQuantity.js";import{getContainerAttrs as m,getInputAttr as u,getButtonAttrs as c}from"./common/attrs.js";import{getContainerClasses as d,getWrapperClasses as y,getInputClasses as b,getButtonClass as f,getIconWrapperClasses as h}from"./common/classes.js";import{getContainerStyles as p,getWrapperStyles as g,getInputStyle as N,getButtonStyle as j}from"./common/styles.js";import{getIconWidth as v,getMinusIcon as B,getPlusIcon as H}from"./common/helpers.js";let ProductQuantity=S=>{let{setting:k={},styles:C={},builderProps:D,advanced:Q}=S,_=s(),{quantity:P}=o(),{isInStock:x,ref:I,onClickIncrement:L,onClickDecrement:M,onChangeInput:T,onFocusInput:F}=i(S),{plusIcon:V,minusIcon:q}=k,w=k.defaultQtyValue||1,{inputHeight:z,buttonBackgroundColor:A,backgroundColor:E,iconColor:G,inputBackgroundColor:J,textColor:K,align:O,borderBtn:R,buttonWidth:U,iconSizeCustom:W,corner:X}=C,Y=k?.hasButton,Z=l({...m({isDisabled:!x,uid:D?.uid||""})}),$=n({...d(Q?.cssClass)}),tt=r({...p({align:O,inputHeight:z})}),te=n({...y()}),ts=r({...g({backgroundColor:E,styles:C,setting:k})}),to=l({...u({hasButton:Y,quantity:P,currentVariant:_,defaultQty:w})}),tl=n({...b({styles:C,borderBtn:R,inputBackgroundColor:J,textColor:K,isDisabled:!x})}),tn=r({...N(S)}),tr=n({...f({borderBtn:R,buttonBackgroundColor:A,iconColor:G,buttonSide:"left",isDisabled:!x})}),ta=r({...j({borderBtn:R,buttonWidth:U,buttonBackgroundColor:A,iconColor:G,corner:X,enableHoverButton:k?.enableHoverButton})}),ti=l({...c({buttonSide:"left"})}),tm=n({...f({borderBtn:R,buttonBackgroundColor:A,iconColor:G,buttonSide:"right",isDisabled:!x})}),tu=r({...j({borderBtn:R,buttonWidth:U,buttonBackgroundColor:A,iconColor:G,corner:X,enableHoverButton:k?.enableHoverButton})}),tc=l({...c({buttonSide:"right"})}),td=n({...h()}),ty=r({...v(W)});return t("div",{ref:I,...Z,className:$,style:tt,children:e("div",{className:te,style:ts,children:[a(Y,t("button",{...ti,onClick:M,className:tr,style:ta,children:t("span",{className:td,style:ty,dangerouslySetInnerHTML:{__html:B(q)}})})),t("input",{...to,className:tl,style:tn,onChange:t=>T(t),onFocus:t=>F(t)}),a(Y,t("button",{...tc,onClick:L,className:tm,style:tu,children:t("span",{className:td,style:ty,dangerouslySetInnerHTML:{__html:H(V)}})}))]})})};export{ProductQuantity as default};
2
+ import{jsx as t,jsxs as e}from"react/jsx-runtime";import{useCurrentVariant as s,useQuantity as o}from"@gem-sdk/core";import{createAttr as l,createClass as n,createStyle as r,If as a}from"@gem-sdk/system";import{useProductQuantity as i}from"./hooks/useProductQuantity.js";import{getContainerAttrs as m,getInputAttr as u,getButtonAttrs as c}from"./common/attrs.js";import{getContainerClasses as d,getWrapperClasses as y,getInputClasses as b,getButtonClass as f,getIconWrapperClasses as h}from"./common/classes.js";import{getContainerStyles as p,getWrapperStyles as g,getInputStyle as N,getButtonStyle as j}from"./common/styles.js";import{getIconWidth as v,getMinusIcon as B,getPlusIcon as H}from"./common/helpers.js";let ProductQuantity=S=>{let{setting:k={},styles:C={},builderProps:D,advanced:Q}=S,_=s(),{quantity:P}=o(),{isInStock:x,ref:I,onClickIncrement:L,onClickDecrement:M,onChangeInput:T,onFocusInput:F}=i(S),{plusIcon:V,minusIcon:q}=k,w=k.defaultQtyValue||1,{inputHeight:z,buttonBackgroundColor:A,backgroundColor:E,iconColor:G,inputBackgroundColor:J,textColor:K,align:O,borderBtn:R,buttonWidth:U,iconSizeCustom:W,corner:X}=C,Y=k?.hasButton,Z=l({...m({isDisabled:!x,uid:D?.uid||""})}),$=n({...d(Q?.cssClass)}),tt=r({...p({align:O,inputHeight:z})}),te=n({...y()}),ts=r({...g({backgroundColor:E,styles:C})}),to=l({...u({hasButton:Y,quantity:P,currentVariant:_,defaultQty:w})}),tl=n({...b({styles:C,borderBtn:R,inputBackgroundColor:J,textColor:K,isDisabled:!x})}),tn=r({...N(S)}),tr=n({...f({borderBtn:R,buttonBackgroundColor:A,iconColor:G,buttonSide:"left",isDisabled:!x})}),ta=r({...j({borderBtn:R,buttonWidth:U,buttonBackgroundColor:A,iconColor:G,corner:X,enableHoverButton:k?.enableHoverButton})}),ti=l({...c({buttonSide:"left"})}),tm=n({...f({borderBtn:R,buttonBackgroundColor:A,iconColor:G,buttonSide:"right",isDisabled:!x})}),tu=r({...j({borderBtn:R,buttonWidth:U,buttonBackgroundColor:A,iconColor:G,corner:X,enableHoverButton:k?.enableHoverButton})}),tc=l({...c({buttonSide:"right"})}),td=n({...h()}),ty=r({...v(W)});return t("div",{ref:I,...Z,className:$,style:tt,children:e("div",{className:te,style:ts,children:[a(Y,t("button",{...ti,onClick:M,className:tr,style:ta,children:t("span",{className:td,style:ty,dangerouslySetInnerHTML:{__html:B(q)}})})),t("input",{...to,className:tl,style:tn,onChange:t=>T(t),onFocus:t=>F(t)}),a(Y,t("button",{...tc,onClick:L,className:tm,style:tu,children:t("span",{className:td,style:ty,dangerouslySetInnerHTML:{__html:H(V)}})}))]})})};export{ProductQuantity as default};
@@ -1,4 +1,4 @@
1
- import{template as t,RenderIf as s,isLocalEnv as e,baseAssetURL as a}from"@gem-sdk/core";import{getSettingPreloadData as i}from"../../../helpers.js";import{createAttr as l,createClass as r,createStyle as o}from"@gem-sdk/system";import{getContainerAttrs as n,getInputAttr as u,getButtonAttrs as d}from"./common/attrs.js";import{getContainerClasses as c,getWrapperClasses as p,getInputClasses as f,getButtonClass as m,getIconWrapperClasses as $}from"./common/classes.js";import{getContainerStyles as b,getWrapperStyles as y,getInputStyle as v,getButtonStyle as g}from"./common/styles.js";import{getIconWidth as S,getMinusIcon as _,getPlusIcon as h}from"./common/helpers.js";let ProductQuantity=({setting:j={},styles:q={},advanced:B,builderProps:k})=>{let{plusIcon:E,minusIcon:H,updatePrice:P}=j,Q=j.defaultQtyValue??1,{inputHeight:A,buttonBackgroundColor:G,iconColor:L,inputBackgroundColor:M,textColor:V,align:x,borderBtn:C,buttonWidth:D,iconSizeCustom:I,corner:N,backgroundColor:O,dividerColor:R,dividerStroke:T}=q,w=j?.hasButton,z=l({...n({uid:k?.uid||"",isDisableByLiquid:!0})}),F=r({...c(B?.cssClass)}),J=o({...b({align:x,inputHeight:A})}),K=r({...p()}),U=o({...y({backgroundColor:O,styles:q,setting:j})}),W=l({...u({isLiquid:!0,hasButton:w,defaultQty:Q})}),X=r({...f({styles:q,borderBtn:C,inputBackgroundColor:M,textColor:V})}),Y=o({...v({setting:j,styles:{...q,borderBtn:C,inputBackgroundColor:M,textColor:V,dividerColor:R,dividerStroke:T}})}),Z=r({...m({borderBtn:C,buttonBackgroundColor:G,iconColor:L,buttonSide:"left"})}),tt=o({...g({borderBtn:C,buttonWidth:D,buttonBackgroundColor:G,iconColor:L,corner:N,enableHoverButton:j?.enableHoverButton})}),ts=l({...d({buttonSide:"left"})}),te=r({...m({borderBtn:C,buttonBackgroundColor:G,iconColor:L,buttonSide:"right"})}),ta=o({...g({borderBtn:C,buttonWidth:D,buttonBackgroundColor:G,iconColor:L,corner:N,enableHoverButton:j?.enableHoverButton})}),ti=l({...d({buttonSide:"right"})}),tl=r({...$()}),tr=S(I);return t`
1
+ import{template as t,RenderIf as s,isLocalEnv as e,baseAssetURL as a}from"@gem-sdk/core";import{getSettingPreloadData as i}from"../../../helpers.js";import{createAttr as l,createClass as r,createStyle as o}from"@gem-sdk/system";import{getContainerAttrs as n,getInputAttr as u,getButtonAttrs as d}from"./common/attrs.js";import{getContainerClasses as c,getWrapperClasses as p,getInputClasses as f,getButtonClass as m,getIconWrapperClasses as $}from"./common/classes.js";import{getContainerStyles as b,getWrapperStyles as y,getInputStyle as v,getButtonStyle as g}from"./common/styles.js";import{getIconWidth as S,getMinusIcon as _,getPlusIcon as h}from"./common/helpers.js";let ProductQuantity=({setting:j={},styles:q={},advanced:B,builderProps:k})=>{let{plusIcon:E,minusIcon:H,updatePrice:P}=j,Q=j.defaultQtyValue??1,{inputHeight:A,buttonBackgroundColor:G,iconColor:L,inputBackgroundColor:M,textColor:V,align:x,borderBtn:C,buttonWidth:D,iconSizeCustom:I,corner:N,backgroundColor:O,dividerColor:R,dividerStroke:T}=q,w=j?.hasButton,z=l({...n({uid:k?.uid||"",isDisableByLiquid:!0})}),F=r({...c(B?.cssClass)}),J=o({...b({align:x,inputHeight:A})}),K=r({...p()}),U=o({...y({backgroundColor:O,styles:q})}),W=l({...u({isLiquid:!0,hasButton:w,defaultQty:Q})}),X=r({...f({styles:q,borderBtn:C,inputBackgroundColor:M,textColor:V})}),Y=o({...v({setting:j,styles:{...q,borderBtn:C,inputBackgroundColor:M,textColor:V,dividerColor:R,dividerStroke:T}})}),Z=r({...m({borderBtn:C,buttonBackgroundColor:G,iconColor:L,buttonSide:"left"})}),tt=o({...g({borderBtn:C,buttonWidth:D,buttonBackgroundColor:G,iconColor:L,corner:N,enableHoverButton:j?.enableHoverButton})}),ts=l({...d({buttonSide:"left"})}),te=r({...m({borderBtn:C,buttonBackgroundColor:G,iconColor:L,buttonSide:"right"})}),ta=o({...g({borderBtn:C,buttonWidth:D,buttonBackgroundColor:G,iconColor:L,corner:N,enableHoverButton:j?.enableHoverButton})}),ti=l({...d({buttonSide:"right"})}),tl=r({...$()}),tr=S(I);return t`
2
2
  {%- liquid
3
3
  assign current_variant = product.selected_or_first_available_variant
4
4
  assign available = current_variant.available | default: false
@@ -1 +1 @@
1
- import{composeTypographyClassName as e,handleConvertClassColor as t,getGlobalColorStateClass as p,composeClasses as g}from"@gem-sdk/core";let getInputClasses=({styles:l,borderBtn:s,inputBackgroundColor:n,textColor:r,isDisabled:a})=>{let o="gp-flex gp-w-full gp-px-1 gp-min-w-[45px] gp-shrink-[99999] gp-appearance-none gp-items-center gp-text-center gp-outline-none gp-transition-all gp-duration-150 hover:gp-text-black disabled:gp-cursor-not-allowed",i=e(l?.typo,l?.typography),u=t(s),c=p("bg",n),d=p("text",r);return u&&(o+=` ${u} `),i&&(o+=` ${i} `),c&&(o+=` ${c} `),d&&(o+=` ${d} `),a&&(o+="gp-cursor-not-allowed"),{...g(o)}},getButtonClass=({borderBtn:e,buttonBackgroundColor:l,iconColor:s,buttonSide:n,isDisabled:r})=>{let a=`gp-flex gp-aspect-square gp-h-full disabled:gp-cursor-not-allowed ${r?"gp-cursor-not-allowed":"gp-cursor-pointer"} gp-items-center gp-justify-center gp-outline-none ${"left"===n?"gp-minus":"gp-plus"} `,o=t(e),i=p("bg",l),u=p("text",s);return o&&(a+=` ${o} `),i&&(a+=` ${i} `),u&&(a+=` ${u} `),{...g(a)}},getContainerClasses=e=>({...g(`quantityClass gp-relative gp-inline-flex gp-h-12 gp-w-full gp-bg-transparent gp-transition-all gp-duration-150 data-[disabled=true]:gp-opacity-60 ${e??""}`)}),getWrapperClasses=()=>({...g("gp-inline-flex gp-w-full gp-overflow-hidden")}),getIconWrapperClasses=()=>({...g("gp-inline-flex gp-items-center gp-justify-center [&>*]:gp-h-full [&>*]:gp-w-full")});export{getButtonClass,getContainerClasses,getIconWrapperClasses,getInputClasses,getWrapperClasses};
1
+ import{composeTypographyClassName as e,handleConvertClassColor as t,getGlobalColorStateClass as p,composeClasses as l}from"@gem-sdk/core";let getInputClasses=({styles:g,borderBtn:s,inputBackgroundColor:n,textColor:r,isDisabled:a})=>{let o="gp-flex gp-w-full gp-px-1 gp-min-w-[45px] gp-shrink-[99999] gp-appearance-none gp-items-center gp-text-center gp-outline-none focus-visible:gp-shadow-none focus-visible:gp-outline-none gp-transition-all gp-duration-150 hover:gp-text-black disabled:gp-cursor-not-allowed",i=e(g?.typo,g?.typography),u=t(s),c=p("bg",n),f=p("text",r);return u&&(o+=` ${u} `),i&&(o+=` ${i} `),c&&(o+=` ${c} `),f&&(o+=` ${f} `),a&&(o+="gp-cursor-not-allowed"),{...l(o)}},getButtonClass=({borderBtn:e,buttonBackgroundColor:g,iconColor:s,buttonSide:n,isDisabled:r})=>{let a=`gp-flex gp-aspect-square gp-h-full disabled:gp-cursor-not-allowed ${r?"gp-cursor-not-allowed":"gp-cursor-pointer"} gp-items-center gp-justify-center gp-outline-none ${"left"===n?"gp-minus":"gp-plus"} `,o=t(e),i=p("bg",g),u=p("text",s);return o&&(a+=` ${o} `),i&&(a+=` ${i} `),u&&(a+=` ${u} `),{...l(a)}},getContainerClasses=e=>({...l(`quantityClass gp-relative gp-inline-flex gp-h-12 gp-w-full gp-bg-transparent gp-transition-all gp-duration-150 data-[disabled=true]:gp-opacity-60 ${e??""}`)}),getWrapperClasses=()=>({...l("gp-inline-flex gp-w-full")}),getIconWrapperClasses=()=>({...l("gp-inline-flex gp-items-center gp-justify-center [&>*]:gp-h-full [&>*]:gp-w-full")});export{getButtonClass,getContainerClasses,getIconWrapperClasses,getInputClasses,getWrapperClasses};
@@ -1 +1 @@
1
- import{composeTypographyStyle as e,getStyleShadowState as t,getGlobalColorStateStyle as r,makeStyle as o,getStyleShadow as a,filterHoverVariables as l,makeStyleResponsive as n,handleConvertBorderStyle as d,handleConvertBorderWidth as i,handleConvertBorderColor as s,composeRadius as p,getResponsiveStyleShadowWithoutState as h,getGlobalColorResponsiveStyle as b,composeBorderResponsive as u,composeRadiusResponsive as m,makeStyleState as g}from"@gem-sdk/core";let addPxToValues=e=>Object.fromEntries(Object.entries(e).map(([e,t])=>[e,`${t}px`])),getDividerWidth=(e,t)=>{if(!e||!t)return{};let r=addPxToValues(e),o={...g("brw",r),...g("blw",r)};return o},getDividerColorStyle=e=>{if(!e)return{};let t={...e,normal:e?.normal??"transparent"},o={...r("brc",t),...r("blc",t)},a=Object.fromEntries(Object.entries(o).filter(([e,t])=>void 0!==t));return a},getInputStyle=n=>{let{styles:d,setting:i}=n,{inputBackgroundColor:s,textColor:p,dividerColor:h,dividerStroke:b,inputBoxShadow:u}=d??{},{enableHoverInput:m,hasButton:g}=i??{},y=e(d?.typo,d?.typography),S=t(u,"box-shadow",{normal:!!u?.normal,hover:!!u?.hover}),c={...getDividerWidth(b,h),...getDividerColorStyle(h)},w={...r("bg",{...s,normal:s?.normal??"transparent"}),...S,...r("c",{...p,hover:p?.hover??p?.normal}),...g?c:{}},v={...o({}),...y,...w,...a({value:d?.typo?.custom?.textShadow,styleAppliedFor:"text-shadow",isEnableShadow:d?.typo?.custom?.hasShadowText})};return m?v:l(v)},getButtonStyle=({borderBtn:e,buttonWidth:t,buttonBackgroundColor:o,iconColor:a,corner:h,enableHoverButton:b})=>{let u={...n("w",t),...d(e),...i(e),...s(e),...r("bg",o),...r("c",a),...p(h)};return b?u:l(u)},getContainerStyles=({inputHeight:e,align:t})=>({...n("h",e),...n("jc",t)}),getWrapperStyles=({backgroundColor:e,styles:t,setting:r})=>{let{enableHoverInput:o,hasButton:a}=r??{},l=t?.shapeShadow,p=h(l,"box-shadow",{desktop:l?.desktop??{},tablet:l?.tablet??l?.desktop??{},mobile:l?.mobile??l?.tablet??l?.desktop??{}}),g=t?.inputBorder,y=o&&!a,S={...d(g),...i(g),...s(g)};return{...y?S:{},...b("bg",e),...n("maxw",t?.quantityWidth),...u(t?.shapeBorder),...m(t?.shapeRounded),...p}};export{getButtonStyle,getContainerStyles,getInputStyle,getWrapperStyles};
1
+ import{composeTypographyStyle as e,getStyleShadowState as t,getGlobalColorStateStyle as r,handleConvertBorderStyle as o,handleConvertBorderWidth as a,handleConvertBorderColor as l,composeRadiusResponsive as n,makeStyle as d,getStyleShadow as s,filterHoverVariables as i,makeStyleResponsive as p,composeRadius as h,getResponsiveStyleShadowWithoutState as u,getGlobalColorResponsiveStyle as b,composeBorderResponsive as m,makeStyleState as g}from"@gem-sdk/core";let addPxToValues=e=>Object.fromEntries(Object.entries(e).map(([e,t])=>[e,`${t}px`])),getDividerWidth=(e,t)=>{if(!e||!t)return{};let r=addPxToValues(e),o={...g("brw",r),...g("blw",r)};return o},getDividerColorStyle=e=>{if(!e)return{};let t={...e,normal:e?.normal??"transparent"},o={...r("brc",t),...r("blc",t)},a=Object.fromEntries(Object.entries(o).filter(([e,t])=>void 0!==t));return a},getInputStyle=p=>{let{styles:h,setting:u}=p,{inputBackgroundColor:b,textColor:m,dividerColor:g,dividerStroke:y,inputBoxShadow:S}=h??{},{enableHoverInput:c,hasButton:w}=u??{},v=e(h?.typo,h?.typography),x=t(S,"box-shadow",{normal:!!S?.normal,hover:!!S?.hover}),f={...getDividerWidth(y,g),...getDividerColorStyle(g)},j={...r("bg",{...b,normal:b?.normal??"transparent"}),...x,...r("c",{...m,hover:m?.hover??m?.normal}),...w?f:{}},k=h?.inputBorder,W={...o(k),...a(k),...l(k)},B={...w?{}:W,...w?{}:n(h?.shapeRounded),...d({}),...v,...j,...s({value:h?.typo?.custom?.textShadow,styleAppliedFor:"text-shadow",isEnableShadow:h?.typo?.custom?.hasShadowText})};return c?B:i(B)},getButtonStyle=({borderBtn:e,buttonWidth:t,buttonBackgroundColor:n,iconColor:d,corner:s,enableHoverButton:u})=>{let b={...p("w",t),...o(e),...a(e),...l(e),...r("bg",n),...r("c",d),...h(s)};return u?b:i(b)},getContainerStyles=({inputHeight:e,align:t})=>({...p("h",e),...p("jc",t)}),getWrapperStyles=({backgroundColor:e,styles:t})=>{let r=t?.shapeShadow,o=u(r,"box-shadow",{desktop:r?.desktop??{},tablet:r?.tablet??r?.desktop??{},mobile:r?.mobile??r?.tablet??r?.desktop??{}});return{...b("bg",e),...p("maxw",t?.quantityWidth),...m(t?.shapeBorder),...n(t?.shapeRounded),...o}};export{getButtonStyle,getContainerStyles,getInputStyle,getWrapperStyles};
@@ -1,3 +1,3 @@
1
1
  let ProductQuantitySettings=[{id:"setting",controls:[{id:"updatePrice",label:"Update price",type:"toggle",default:!0},{id:"hasButton",label:"Button",type:"toggle",default:!0},{id:"defaultQtyValue",label:"Text",type:"input:stepper",min:1,default:1},{id:"plusIcon",type:"icon",isHideClear:!0,customLabel:"Plus",info:"Choose from list or paste any SVG icon",default:`<svg height="20px" width="20px" data-name="plus-regular" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor" data-id="508817698760687976">
2
2
  <path fill="currentColor" strokelinecap="round" strokelinejoin="round" d="M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"></path></svg>`},{id:"minusIcon",type:"icon",isHideClear:!0,customLabel:"Minus",info:"Choose from list or paste any SVG icon",default:`<svg height="20px" width="20px" data-name="minus-regular" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor" data-id="508817690725712232">
3
- <path fill="currentColor" strokelinecap="round" strokelinejoin="round" d="M224,128a8,8,0,0,1-8,8H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128Z"></path></svg>`},{id:"enableHoverInput",label:"Enable hover input",type:"toggle",default:!1},{id:"enableHoverButton",label:"Enable hover input",type:"toggle",default:!1}]},{id:"style",controls:[{id:"quantityLayout",label:"Style",type:"layout-selector",popoverLabel:{en:"Style"},iconViewBox:"0 0 80 48",enableItemBackground:!0,itemPerRow:2,itemSpacing:"large",options:[{label:"Square",value:"product-quantity-square",type:"p-quantity-layout",iconName:"gp-product-quantity-square"},{label:"Square with divider",value:"product-quantity-square-divider",type:"p-quantity-layout",iconName:"gp-product-quantity-square-divider"},{label:"Rounded",value:"product-quantity-rounded",type:"p-quantity-layout",iconName:"gp-product-quantity-rounded"},{label:"Rounded with divider",value:"product-quantity-rounded-divider",type:"p-quantity-layout",iconName:"gp-product-quantity-rounded-divider"},{label:"Square input only",value:"product-quantity-square-input-only",type:"p-quantity-layout",iconName:"gp-product-quantity-square-input-only"},{label:"Rounded input only",value:"product-quantity-rounded-input-only",type:"p-quantity-layout",iconName:"gp-product-quantity-rounded-input-only"}],default:"product-quantity-square"},{id:"dimensions",type:"group",label:"Dimensions",controls:[{id:"fullWidth",label:"Full Width",type:"toggle",devices:{desktop:{default:!1}}},{id:"quantityWidth",type:"dropdown:input",label:"Width",inputType:"number",units:["px","%"],hideUnit:!1,displayOptions:[{label:"Full",value:"100%",showValue:!0}],devices:{desktop:{default:"160px"}}},{id:"inputHeight",type:"dropdown:input",label:"Width",inputType:"number",units:["px","%"],hideUnit:!1,displayOptions:[{label:"Full",value:"100%",showValue:!0}],devices:{desktop:{default:"45px"}}},{id:"buttonWidth",type:"dropdown:input",label:"Button Width",inputType:"number",units:["px","%"],hideUnit:!1,displayOptions:[{label:"Full",value:"100%",showValue:!0}],devices:{desktop:{default:"45px"}}},{id:"iconSizeCustom",type:"input:stepper",includeUnit:"px",min:1,devices:{desktop:{default:"16px"}}}]},{id:"inputStyle",type:"group",label:"Input Style",controls:[{id:"typo",type:"typography-combo",default:{type:"paragraph-1",attrs:{color:"#121212"},custom:{fontSize:{desktop:"16px",tablet:"16px",mobile:"14px"},lineHeight:{desktop:"120%",tablet:"180%",mobile:"180%"},fontWeight:"400",fontFamily:{value:"Assistant",type:"google"},hasShadowText:!1,textShadow:{enable:!1}}},ignoreReRender:!0,hiddenSetting:{transform:!0,textAlign:!0}},{id:"align",label:"Alignment",type:"option:value",options:[{label:"Left",value:"left",type:"align",tooltip:"Align left",iconName:"gp-align-left"},{label:"Center",value:"center",type:"align",tooltip:"Align center",iconName:"gp-align-center"},{label:"Right",value:"right",type:"align",tooltip:"Align right",iconName:"gp-align-right"}],devices:{desktop:{default:"left"}}}]},{id:"button-behavior-state",type:"behavior-state",label:"Button Style",hide:!0,controls:[{id:"textColor",type:"color-picker-v2",label:"Text Color",default:{normal:"text-2"},compoDefaultValue:{hover:"text-2"},state:{hover:!0,normal:!0},enableGradient:!0},{id:"inputBackgroundColor",type:"color-picker-v2",label:"Background Color",state:{hover:!0,normal:!0},compoDefaultValue:{normal:"highlight",hover:"highlight"},enableGradient:!0},{id:"buttonBackgroundColor",type:"color-picker-v2",label:"Button Background Color",state:{hover:!0,normal:!0},enableGradient:!0,compoDefaultValue:{normal:"brand",hover:"highlight"}},{id:"iconColor",type:"color-picker-v2",label:"Icon Color",default:{normal:"#121212"},compoDefaultValue:{hover:"text-2"},state:{hover:!0,normal:!0},enableGradient:!0}]},{id:"borderBtn",label:"Border",type:"border-v2",default:{normal:{}},compoDefaultValue:{normal:{border:"solid",color:"#212121",width:"1px",borderWidth:"1px"},hover:{border:"solid",color:"#212121",width:"1px",borderWidth:"1px"}},state:{hover:!0,normal:!0}},{id:"corner",label:"Corner",type:"corner-v2",default:{normal:{btrr:"0px",bblr:"0px",bbrr:"0px",btlr:"0px",radiusType:"none"}}},{id:"inputBoxShadow",type:"shadow-v2",default:{normal:{}},compoDefaultValue:{normal:{type:"shadow-1",distance:"4px",blur:"4px",spread:"0px",color:"#121212",angle:90}}},{id:"backgroundColor",type:"color-picker-v2",label:"Background Color",devices:{desktop:{default:"#FFFFFF"}},enableGradient:!0},{id:"dividerColor",type:"color-picker-v2",label:"Divider Color",default:{normal:"line-3"},compoDefaultValue:{normal:"line-3"},state:{hover:!0,normal:!0},enableGradient:!0},{id:"dividerStroke",label:"Thickness",type:"input:stepper",min:1,default:{normal:1},state:{hover:!0,normal:!0}},{id:"inputBorder",label:"Input Border",type:"border-v2",default:{hover:{border:"solid",color:"line-3",width:"1px",borderWidth:"1px"}},state:{hover:!0,normal:!1}},{id:"shapeBorder",type:"border-v2",devices:{desktop:{default:{border:"solid",color:"line-3",width:"1px",borderWidth:"1px"}}}},{id:"shapeRounded",type:"corner-v2",devices:{desktop:{default:{radiusType:"none"}}}},{id:"shapeShadow",type:"shadow-v2",devices:{desktop:{default:{}}},compoDefaultValue:{desktop:{default:{type:"shadow-1",distance:"4px",blur:"4px",spread:"0px",color:"rgba(18, 18, 18, 0.20)",angle:45,enable:!0}}}}]}];export{ProductQuantitySettings};
3
+ <path fill="currentColor" strokelinecap="round" strokelinejoin="round" d="M224,128a8,8,0,0,1-8,8H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128Z"></path></svg>`},{id:"enableHoverInput",label:"Enable hover input",type:"toggle",default:!1},{id:"enableHoverButton",label:"Enable hover input",type:"toggle",default:!1}]},{id:"style",controls:[{id:"quantityLayout",label:"Style",type:"layout-selector",popoverLabel:{en:"Style"},iconViewBox:"0 0 80 48",enableItemBackground:!0,itemPerRow:2,itemSpacing:"large",options:[{label:"Square",value:"product-quantity-square",type:"p-quantity-layout",iconName:"gp-product-quantity-square"},{label:"Square with divider",value:"product-quantity-square-divider",type:"p-quantity-layout",iconName:"gp-product-quantity-square-divider"},{label:"Rounded",value:"product-quantity-rounded",type:"p-quantity-layout",iconName:"gp-product-quantity-rounded"},{label:"Rounded with divider",value:"product-quantity-rounded-divider",type:"p-quantity-layout",iconName:"gp-product-quantity-rounded-divider"},{label:"Square input only",value:"product-quantity-square-input-only",type:"p-quantity-layout",iconName:"gp-product-quantity-square-input-only"},{label:"Rounded input only",value:"product-quantity-rounded-input-only",type:"p-quantity-layout",iconName:"gp-product-quantity-rounded-input-only"}],default:"product-quantity-square"},{id:"dimensions",type:"group",label:"Dimensions",controls:[{id:"fullWidth",label:"Full Width",type:"toggle",devices:{desktop:{default:!1}}},{id:"quantityWidth",type:"dropdown:input",label:"Width",inputType:"number",units:["px","%"],hideUnit:!1,displayOptions:[{label:"Full",value:"100%",showValue:!0}],devices:{desktop:{default:"160px"}}},{id:"inputHeight",type:"dropdown:input",label:"Width",inputType:"number",units:["px","%"],hideUnit:!1,displayOptions:[{label:"Full",value:"100%",showValue:!0}],devices:{desktop:{default:"45px"}}},{id:"buttonWidth",type:"dropdown:input",label:"Button Width",inputType:"number",units:["px","%"],hideUnit:!1,displayOptions:[{label:"Full",value:"100%",showValue:!0}],devices:{desktop:{default:"45px"}}},{id:"iconSizeCustom",type:"input:stepper",includeUnit:"px",min:1,devices:{desktop:{default:"16px"}}}]},{id:"inputStyle",type:"group",label:"Input Style",controls:[{id:"typo",type:"typography-combo",default:{type:"paragraph-1",attrs:{color:"#121212"},custom:{fontSize:{desktop:"16px",tablet:"16px",mobile:"14px"},lineHeight:{desktop:"120%",tablet:"180%",mobile:"180%"},fontWeight:"400",fontFamily:{value:"Assistant",type:"google"},hasShadowText:!1,textShadow:{enable:!1}}},ignoreReRender:!0,hiddenSetting:{transform:!0,textAlign:!0}},{id:"align",label:"Alignment",type:"option:value",options:[{label:"Left",value:"left",type:"align",tooltip:"Align left",iconName:"gp-align-left"},{label:"Center",value:"center",type:"align",tooltip:"Align center",iconName:"gp-align-center"},{label:"Right",value:"right",type:"align",tooltip:"Align right",iconName:"gp-align-right"}],devices:{desktop:{default:"left"}}}]},{id:"button-behavior-state",type:"behavior-state",label:"Button Style",hide:!0,controls:[{id:"textColor",type:"color-picker-v2",label:"Text Color",default:{normal:"text-2"},compoDefaultValue:{hover:"text-2"},state:{hover:!0,normal:!0},enableGradient:!0},{id:"inputBackgroundColor",type:"color-picker-v2",label:"Background Color",state:{hover:!0,normal:!0},compoDefaultValue:{normal:"highlight",hover:"highlight"},enableGradient:!0},{id:"buttonBackgroundColor",type:"color-picker-v2",label:"Button Background Color",state:{hover:!0,normal:!0},enableGradient:!0,compoDefaultValue:{normal:"brand",hover:"highlight"}},{id:"iconColor",type:"color-picker-v2",label:"Icon Color",default:{normal:"#121212"},compoDefaultValue:{hover:"text-2"},state:{hover:!0,normal:!0},enableGradient:!0}]},{id:"borderBtn",label:"Border",type:"border-v2",default:{normal:{}},compoDefaultValue:{normal:{border:"solid",color:"#212121",width:"1px",borderWidth:"1px"},hover:{border:"solid",color:"#212121",width:"1px",borderWidth:"1px"}},state:{hover:!0,normal:!0}},{id:"corner",label:"Corner",type:"corner-v2",default:{normal:{btrr:"0px",bblr:"0px",bbrr:"0px",btlr:"0px",radiusType:"none"}}},{id:"inputBoxShadow",type:"shadow-v2",default:{normal:{}},compoDefaultValue:{normal:{type:"shadow-1",distance:"4px",blur:"4px",spread:"0px",color:"#121212",angle:90}}},{id:"backgroundColor",type:"color-picker-v2",label:"Background Color",devices:{desktop:{default:"#FFFFFF"}},enableGradient:!0},{id:"dividerColor",type:"color-picker-v2",label:"Divider Color",default:{normal:"line-3"},compoDefaultValue:{normal:"line-3"},state:{hover:!0,normal:!0},enableGradient:!0},{id:"dividerStroke",label:"Thickness",type:"input:stepper",min:1,default:{normal:1},state:{hover:!0,normal:!0}},{id:"inputBorder",label:"Input Border",type:"border-v2",default:{hover:{}},state:{hover:!0,normal:!0}},{id:"shapeBorder",type:"border-v2",devices:{desktop:{default:{border:"solid",color:"line-3",width:"1px",borderWidth:"1px"}}}},{id:"shapeRounded",type:"corner-v2",devices:{desktop:{default:{radiusType:"none"}}}},{id:"shapeShadow",type:"shadow-v2",devices:{desktop:{default:{}}},compoDefaultValue:{desktop:{default:{type:"shadow-1",distance:"4px",blur:"4px",spread:"0px",color:"rgba(18, 18, 18, 0.20)",angle:45,enable:!0}}}}]}];export{ProductQuantitySettings};
@@ -1 +1 @@
1
- let SettingUIV2=[{controls:[{label:{en:"Button"},setting:{id:"hasButton"},options:{labelVariant:"primary",toggleStyle:"switch"}},{label:{en:"Width"},setting:{id:"buttonWidth"},conditionDisplay:"hasButton === true"},{label:{en:"Background"},setting:{id:"buttonBackgroundColor",state:"normal"},conditionDisplay:"hasButton === true"},{label:{en:"Plus icon"},setting:{id:"plusIcon"},conditionDisplay:"hasButton === true"},{label:{en:"Minus icon"},setting:{id:"minusIcon"},conditionDisplay:"hasButton === true"},{label:{en:"Icon color"},setting:{id:"iconColor",state:"normal"},conditionDisplay:"hasButton === true"}],moreSettings:{type:"collapse",controls:[{label:{en:"Icon size"},setting:{id:"iconSizeCustom"},conditionDisplay:"hasButton === true"},{label:{en:"Border"},setting:{id:"borderBtn",state:"normal"},conditionDisplay:"hasButton === true"},{label:{en:"Corner"},setting:{id:"corner",state:"normal"},conditionDisplay:"hasButton === true"},{label:{en:"Hover"},type:"combo",iconName:"polaris-check-clicked",fixedValue:"Styled",setting:{id:"enableHoverButton"},popoverLabel:{en:"Hover effect"},state:"hover",conditionDisplay:"hasButton === true",controls:[{label:{en:"Background"},setting:{id:"buttonBackgroundColor",state:"hover"},compoDefaultValue:{default:"highlight"}},{label:{en:"Icon color"},setting:{id:"iconColor",state:"hover"}},{label:{en:"Border"},setting:{id:"borderBtn",state:"hover"}},{label:{en:"Corner"},setting:{id:"corner",state:"hover"}}]}]}},{label:{en:"Input"},controls:[{label:{en:"Background"},setting:{id:"inputBackgroundColor",state:"normal"}},{label:{en:"Text style"},setting:{id:"typo"},options:{updateFields:[{field:"attrs.color",settingId:"textColor",state:"normal"}]},controlChangeTrigger:{settings:[{action:{controlId:"textColor",valueFromField:"attrs.color",groupType:"style",controlType:"style",removeDevice:!0,state:"normal"}}],options:{noRecordHistory:!0}}},{label:{en:"Divider"},type:"combo",conditionDisplay:"hasButton === true",comboType:"color",getValueFromSettingID:"dividerColor.normal",compoDefaultValue:"line-3",controls:[{label:{en:"Color"},setting:{id:"dividerColor",state:"normal"}},{label:{en:"Thickness"},setting:{id:"dividerStroke",state:"normal"}}]},{label:{en:"Shadow"},setting:{id:"inputBoxShadow",state:"normal"}},{label:{en:"Hover"},type:"combo",iconName:"polaris-check-clicked",fixedValue:"Styled",popoverLabel:{en:"Hover effect"},setting:{id:"enableHoverInput"},state:"hover",controls:[{label:{en:"Background"},setting:{id:"inputBackgroundColor",state:"hover"}},{label:{en:"Text color"},setting:{id:"textColor",state:"hover"}},{label:{en:"Divider"},setting:{id:"dividerColor",state:"hover"},conditionDisplay:"hasButton === true"},{label:{en:"Divider thickness"},setting:{id:"dividerStroke",state:"hover"},conditionDisplay:"hasButton === true"},{label:{en:"Border"},setting:{id:"inputBorder",state:"hover"},conditionDisplay:"hasButton === false"},{label:{en:"Shadow"},setting:{id:"inputBoxShadow",state:"hover"}}]}]},{label:{en:"Size"},controls:[{label:{en:"Width"},setting:{id:"quantityWidth"}},{label:{en:"Height"},setting:{id:"inputHeight"}}]},{label:{en:"Background"},controls:[{label:{en:"Color"},setting:{id:"backgroundColor"}}]},{label:{en:"Shape"},controls:[{label:{en:"Border"},setting:{id:"shapeBorder"}},{label:{en:"Corner"},setting:{id:"shapeRounded"}},{label:{en:"Shadow"},setting:{id:"shapeShadow"}}]},{label:{en:"Display condition"},controls:[{label:{en:"Default quantity"},setting:{id:"defaultQtyValue"}},{label:{en:"Update price"},setting:{id:"updatePrice"}}]},{controls:[{label:{en:"Align"},conditionEnable:'!(parseInt(quantityWidth) >= 100 && quantityWidth?.includes("%"))',setting:{id:"align"},options:{labelVariant:"primary",fullWidth:!0,disableMessage:"Align is not supported when width is 100%"}}]}];export{SettingUIV2};
1
+ let SettingUIV2=[{controls:[{label:{en:"Button"},setting:{id:"hasButton"},options:{labelVariant:"primary",toggleStyle:"switch"}},{label:{en:"Width"},setting:{id:"buttonWidth"},conditionDisplay:"hasButton === true"},{label:{en:"Background"},setting:{id:"buttonBackgroundColor",state:"normal"},conditionDisplay:"hasButton === true"},{label:{en:"Plus icon"},setting:{id:"plusIcon"},conditionDisplay:"hasButton === true"},{label:{en:"Minus icon"},setting:{id:"minusIcon"},conditionDisplay:"hasButton === true"},{label:{en:"Icon color"},setting:{id:"iconColor",state:"normal"},conditionDisplay:"hasButton === true"}],moreSettings:{type:"collapse",controls:[{label:{en:"Icon size"},setting:{id:"iconSizeCustom"},conditionDisplay:"hasButton === true"},{label:{en:"Border"},setting:{id:"borderBtn",state:"normal"},conditionDisplay:"hasButton === true"},{label:{en:"Corner"},setting:{id:"corner",state:"normal"},conditionDisplay:"hasButton === true"},{label:{en:"Hover"},type:"combo",iconName:"polaris-check-clicked",fixedValue:"Styled",setting:{id:"enableHoverButton"},popoverLabel:{en:"Hover effect"},state:"hover",conditionDisplay:"hasButton === true",controls:[{label:{en:"Background"},setting:{id:"buttonBackgroundColor",state:"hover"},compoDefaultValue:{default:"highlight"}},{label:{en:"Icon color"},setting:{id:"iconColor",state:"hover"}},{label:{en:"Border"},setting:{id:"borderBtn",state:"hover"}},{label:{en:"Corner"},setting:{id:"corner",state:"hover"}}]}]}},{label:{en:"Input"},controls:[{label:{en:"Background"},setting:{id:"inputBackgroundColor",state:"normal"}},{label:{en:"Text style"},setting:{id:"typo"},options:{updateFields:[{field:"attrs.color",settingId:"textColor",state:"normal"}]},controlChangeTrigger:{settings:[{action:{controlId:"textColor",valueFromField:"attrs.color",groupType:"style",controlType:"style",removeDevice:!0,state:"normal"}}],options:{noRecordHistory:!0}}},{label:{en:"Divider"},type:"combo",conditionDisplay:"hasButton === true",comboType:"color",getValueFromSettingID:"dividerColor.normal",compoDefaultValue:"line-3",controls:[{label:{en:"Color"},setting:{id:"dividerColor",state:"normal"}},{label:{en:"Thickness"},setting:{id:"dividerStroke",state:"normal"}}]},{label:{en:"Border"},setting:{id:"inputBorder",state:"normal"},conditionDisplay:"hasButton === false"},{label:{en:"Shadow"},setting:{id:"inputBoxShadow",state:"normal"}},{label:{en:"Hover"},type:"combo",iconName:"polaris-check-clicked",fixedValue:"Styled",popoverLabel:{en:"Hover effect"},setting:{id:"enableHoverInput"},state:"hover",controls:[{label:{en:"Background"},setting:{id:"inputBackgroundColor",state:"hover"}},{label:{en:"Text color"},setting:{id:"textColor",state:"hover"}},{label:{en:"Divider"},setting:{id:"dividerColor",state:"hover"},conditionDisplay:"hasButton === true"},{label:{en:"Divider thickness"},setting:{id:"dividerStroke",state:"hover"},conditionDisplay:"hasButton === true"},{label:{en:"Border"},setting:{id:"inputBorder",state:"hover"},conditionDisplay:"hasButton === false"},{label:{en:"Shadow"},setting:{id:"inputBoxShadow",state:"hover"}}]}]},{label:{en:"Size"},controls:[{label:{en:"Width"},setting:{id:"quantityWidth"}},{label:{en:"Height"},setting:{id:"inputHeight"}}]},{label:{en:"Background"},controls:[{label:{en:"Color"},setting:{id:"backgroundColor"}}]},{label:{en:"Shape"},controls:[{label:{en:"Border"},setting:{id:"shapeBorder"}},{label:{en:"Corner"},setting:{id:"shapeRounded"}},{label:{en:"Shadow"},setting:{id:"shapeShadow"}}]},{label:{en:"Display condition"},controls:[{label:{en:"Default quantity"},setting:{id:"defaultQtyValue"}},{label:{en:"Update price"},setting:{id:"updatePrice"}}]},{controls:[{label:{en:"Align"},conditionEnable:'!(parseInt(quantityWidth) >= 100 && quantityWidth?.includes("%"))',setting:{id:"align"},options:{labelVariant:"primary",fullWidth:!0,disableMessage:"Align is not supported when width is 100%"}}]}];export{SettingUIV2};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.0.0-staging.1017",
3
+ "version": "2.0.0-staging.1019",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",