@gem-sdk/components 2.0.0-staging.983 → 2.0.0-staging.985

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"),Link=require("next/link");const DesktopMenuItem=({id:e,menu:t,arrow:l,textColor:r,menuTextColor:p,depth:i=0,maxDepth:s=2,menuBg:n,typo:o,typography:g,enableHoverEffect:a})=>{let c=t?.[e];if(!c||i>s)return null;let u=i===s,m=core.composeTypographyStyle(o,g),x=!!c?.childrens?.length&&!u,d=x&&!!l,h=core.getGlobalColorStateStyle("c",0===i?r:p),j=a?h:core.filterHoverVariables(h);return jsxRuntime.jsxs("li",{className:core.cls("gp-group gp-relative gp-inline-flex gp-flex-1 gp-cursor-pointer gp-items-center gp-gap-2 gp-whitespace-nowrap gp-px-4 gp-py-2 gp-transition-colors gp-duration-300 !gp-max-w-fit hover:gp-z-50",{"gp-justify-center":0===i,"gp-min-w-[200px] gp-border-b last:gp-border-b-transparent":i>0}),style:{...j,...m},children:[c?.link&&!c.childrens?.length?jsxRuntime.jsx(Link,{href:c.link,title:c.title,children:c.title}):jsxRuntime.jsx("span",{children:c?.title}),d&&jsxRuntime.jsx("span",{dangerouslySetInnerHTML:{__html:l},className:core.cls("gp-ml-auto gp-shrink-0 [&>svg]:gp-h-4 [&>svg]:gp-w-auto",{"-gp-rotate-90":1===i})}),x&&jsxRuntime.jsx("div",{className:core.cls("gp-invisible gp-absolute gp-min-w-max gp-opacity-0 gp-transition-all gp-duration-300 gp-ease-in-out [li:hover>div&]:gp-visible [li:hover>div&]:gp-opacity-100 gp-z-[100]",{"gp-left-0 gp-top-full":0===i,"gp-left-full gp-top-0 gp-translate-y-4 [li:hover>div&]:gp-translate-y-0":1===i}),children:jsxRuntime.jsx("ul",{className:core.cls("gp-flex gp-flex-col gp-shadow-card-2 gp-relative",{"gp-ml-4":1===i}),style:{...core.getGlobalColorResponsiveStyle("bgc",n)},children:c?.childrens?.map(e=>jsxRuntime.jsx(DesktopMenuItem,{id:e,menu:t,depth:i+1,maxDepth:s,arrow:l,menuTextColor:p,menuBg:n,typo:o,typography:g},e))})})]})};exports.default=DesktopMenuItem;
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),Link=require("next/link");const DesktopMenuItem=({id:e,menu:t,arrow:l,textColor:r,menuTextColor:p,depth:i=0,maxDepth:s=2,menuBg:n,typo:o,typography:g,enableHoverEffect:a})=>{let c=t?.[e];if(!c||i>s)return null;let u=i===s,m=core.composeTypographyStyle(o,g),x=!!c?.childrens?.length&&!u,d=x&&!!l,h=core.getGlobalColorStateStyle("c",0===i?r:p),j=0===i&&a||0!==i?h:core.filterHoverVariables(h);return jsxRuntime.jsxs("li",{className:core.cls("gp-group gp-relative gp-inline-flex gp-flex-1 gp-cursor-pointer gp-items-center gp-gap-2 gp-whitespace-nowrap gp-px-4 gp-py-2 gp-transition-colors gp-duration-300 !gp-max-w-fit hover:gp-z-50",{"gp-justify-center":0===i,"gp-min-w-[200px] gp-border-b last:gp-border-b-transparent":i>0}),style:{...m,...j},children:[c?.link&&!c.childrens?.length?jsxRuntime.jsx(Link,{href:c.link,title:c.title,children:c.title}):jsxRuntime.jsx("span",{children:c?.title}),d&&jsxRuntime.jsx("span",{dangerouslySetInnerHTML:{__html:l},className:core.cls("gp-ml-auto gp-shrink-0 [&>svg]:gp-h-4 [&>svg]:gp-w-auto",{"-gp-rotate-90":1===i})}),x&&jsxRuntime.jsx("div",{className:core.cls("gp-invisible gp-absolute gp-min-w-max gp-opacity-0 gp-transition-all gp-duration-300 gp-ease-in-out [li:hover>div&]:gp-visible [li:hover>div&]:gp-opacity-100 gp-z-[100]",{"gp-left-0 gp-top-full":0===i,"gp-left-full gp-top-0 gp-translate-y-4 [li:hover>div&]:gp-translate-y-0":1===i}),children:jsxRuntime.jsx("ul",{className:core.cls("gp-flex gp-flex-col gp-shadow-card-2 gp-relative",{"gp-ml-4":1===i}),style:{...core.getGlobalColorResponsiveStyle("bgc",n)},children:c?.childrens?.map(e=>jsxRuntime.jsx(DesktopMenuItem,{id:e,menu:t,depth:i+1,maxDepth:s,arrow:l,menuTextColor:p,menuBg:n,typo:o,typography:g},e))})})]})};exports.default=DesktopMenuItem;
@@ -1,4 +1,4 @@
1
1
  "use strict";const HeaderSettings=[{id:"setting",controls:[{id:"breakpoint",label:"Breakpoint",type:"select",hideOnMode:{mobileOnly:!0},options:[{label:"From desktop and smaller",subTitle:"Display menu icon for desktop, tablet and mobile",value:"desktop"},{label:"From tablet and smaller",subTitle:"Display menu icon for tablet and mobile",value:"tablet"},{label:"Only mobile",subTitle:"Display menu icon for only mobile",value:"mobile"}],default:"mobile"},{id:"itemEnableHoverEffect",type:"toggle",default:!0},{id:"cardEnableHoverEffect",type:"toggle",default:!0},{id:"menu",label:"Menu",type:"menu",default:{ROOT:{id:"ROOT",title:"Root",childrens:["1","2","3"]},1:{id:"1",title:"Menu 1",link:"",childrens:["13","14"]},2:{id:"2",title:"Menu 2",link:"",childrens:["6","7","8"]},6:{id:"6",title:"Sub Menu 2.1",childrens:[]},7:{id:"7",title:"Sub Menu 2.2",childrens:["10","11"]},8:{id:"8",title:"Sub Menu 2.3",childrens:["12"]},9:{id:"9",title:"Sub Menu 2.4",childrens:[]},10:{id:"10",title:"Sub Menu 2.2.1",childrens:[]},11:{id:"11",title:"Sub Menu 2.2.2",childrens:[]},12:{id:"12",title:"Sub Menu 2.3.1",childrens:[]},3:{id:"3",title:"Menu 3",link:"",childrens:[]},13:{id:"13",title:"Sub Menu 1.1",link:"",childrens:[]},14:{id:"14",title:"Sub Menu 1.2",link:"",childrens:[]}}},{type:"group",label:"Logo",id:"logo-group",controls:[{id:"logo",label:"Logo",type:"image-select",devices:{desktop:{default:{src:"https://cdn.shopify.com/s/files/1/2005/9307/files/image_demo.jpg",width:800,height:533}}}},{id:"logoAspectRatio",type:"select",label:"Aspect Ratio",options:[{label:"Auto",value:"auto"},{label:"1:1",value:"1"},{label:"3:2",value:"3/2"},{label:"4:3",value:"4/3"},{label:"16:9",value:"16/9"},{label:"21:9",value:"21/9"},{label:"2:3",value:"2/3"},{label:"3:4",value:"3/4"},{label:"9:16",value:"9/16"},{label:"Custom",value:"custom"}],devices:{desktop:{default:"auto"}}},{id:"customAspectRadio",type:"ratio",min:1,devices:{desktop:{default:{width:"1",height:"1"}}},hide:!0},{id:"layout",type:"select",label:"Object Fit",options:[{label:"Fill",value:"fill"},{label:"Cover",value:"cover"},{label:"Contain",value:"contain"},{label:"None",value:"none"},{label:"Scale down",value:"scale-down"}],devices:{desktop:{default:"contain"}}},{id:"logoWidth",label:"Width",type:"input:unit",units:["px","%"],devices:{desktop:{default:"80px"}}}]},{id:"arrow",label:"Arrow Icon",type:"icon",default:`<svg data-name="chevron down" width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
2
  <path fill-rule="evenodd" clip-rule="evenodd" d="M4.57576 6.77583C4.81007 6.54152 5.18997 6.54152 5.42429 6.77583L8.20002 9.55157L10.9758 6.77583C11.2101 6.54152 11.59 6.54152 11.8243 6.77583C12.0586 7.01015 12.0586 7.39005 11.8243 7.62436L8.62429 10.8244C8.38997 11.0587 8.01007 11.0587 7.77576 10.8244L4.57576 7.62436C4.34145 7.39005 4.34145 7.01015 4.57576 6.77583Z" fill="currentColor"/>
3
3
  </svg>
4
- `},{id:"cart-setting",type:"group",label:"Cart Setting",controls:[{id:"cartIcon",label:"Cart Icon",type:"icon",default:'<svg data-name="cart" width="16" height="16" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M3 3h2l.4 2M7 13h10l4-8H5.4M7 13L5.4 5M7 13l-2.293 2.293c-.63.63-.184 1.707.707 1.707H17m0 0a2 2 0 100 4 2 2 0 000-4zm-8 2a2 2 0 11-4 0 2 2 0 014 0z"></path></svg>'}]}]},{id:"style",controls:[{id:"height",label:"Height",type:"input:unit",units:["px"],devices:{desktop:{default:"60px"}}},{id:"typography",label:"Typography",type:"typography",default:{type:"paragraph-1"}},{id:"typo",label:"Text styles",type:"typography-v2",default:{type:"paragraph-1"},hiddenSetting:{textAlign:!0,textShadow:!0},ignoreReRender:!0},{id:"background-group",label:"Background",type:"group",controls:[{id:"headerBg",type:"color-picker-v2",label:"Header",devices:{desktop:{default:"#FFFFFF"}}},{id:"menuBg",type:"color-picker-v2",label:"Menu",info:"Dropdown and collapse menu background color",compoDefaultValue:{desktop:{default:"#FFFFFF"}},devices:{desktop:{default:"#FFFFFF"}}}]},{id:"color-state",type:"behavior-state",controls:[{id:"textColor",label:"Text Color",type:"color-picker-v2",state:{normal:!0,hover:!0},default:{normal:"text-1"}},{id:"menuTextColor",label:"Menu Text Color",type:"color-picker-v2",state:{normal:!0,hover:!0},compoDefaultValue:{normal:"text-1",hover:"text-2"},default:{normal:"text-1"}},{id:"cartIconColor",type:"color-picker-v2",label:"Cart Icon Color",state:{normal:!0,hover:!0},default:{normal:"text-1"}}]}]}];exports.HeaderSettings=HeaderSettings;
4
+ `},{id:"cart-setting",type:"group",label:"Cart Setting",controls:[{id:"cartIcon",label:"Cart Icon",type:"icon",default:'<svg data-name="cart" width="16" height="16" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M3 3h2l.4 2M7 13h10l4-8H5.4M7 13L5.4 5M7 13l-2.293 2.293c-.63.63-.184 1.707.707 1.707H17m0 0a2 2 0 100 4 2 2 0 000-4zm-8 2a2 2 0 11-4 0 2 2 0 014 0z"></path></svg>'}]}]},{id:"style",controls:[{id:"height",label:"Height",type:"input:unit",units:["px"],devices:{desktop:{default:"60px"}}},{id:"typography",label:"Typography",type:"typography",default:{type:"paragraph-1"}},{id:"typo",label:"Text styles",type:"typography-v2",default:{type:"paragraph-1"},hiddenSetting:{textAlign:!0,textShadow:!0},ignoreReRender:!0},{id:"background-group",label:"Background",type:"group",controls:[{id:"headerBg",type:"color-picker-v2",label:"Header",devices:{desktop:{default:"#FFFFFF"}}},{id:"menuBg",type:"color-picker-v2",label:"Menu",info:"Dropdown and collapse menu background color",compoDefaultValue:{desktop:{default:"#FFFFFF"}},devices:{desktop:{default:"#FFFFFF"}}}]},{id:"color-state",type:"behavior-state",controls:[{id:"textColor",label:"Text Color",type:"color-picker-v2",state:{normal:!0,hover:!0},default:{normal:"text-1"},compoDefaultValue:{hover:"text-2"}},{id:"menuTextColor",label:"Menu Text Color",type:"color-picker-v2",state:{normal:!0,hover:!0},compoDefaultValue:{normal:"text-1",hover:"text-2"},default:{normal:"text-1"}},{id:"cartIconColor",type:"color-picker-v2",label:"Cart Icon Color",state:{normal:!0,hover:!0},default:{normal:"text-1"}}]}]}];exports.HeaderSettings=HeaderSettings;
@@ -1 +1 @@
1
- "use strict";var core=require("@gem-sdk/core"),helpers=require("./helpers.js");function composeClasses(e){return e.split(" ").reduce((e,s)=>(e[s]=!0,e),{})}const getClasses=({setting:e,builderProps:s,advancedCssClass:t})=>{let o="gp-group/hero gp-flex gp-w-full gp-flex-col gp-self-center gp-transition-colors gp-duration-200 gp-ease-in-out";return t&&(o+=` ${t}`),{...s?.uid&&{[s.uid]:!0},...composeClasses(o),...helpers.getClassAlignBanner(helpers.getResponsiveSetting(e?.alignBanner||{}))}},getLinkClasses=()=>({...composeClasses("gp-cursor-pointer")}),getContainerClasses=(e,s)=>({...composeClasses("gp-relative gp-flex gp-w-full gp-flex-col gp-items-center gp-overflow-hidden hero-banner-container"),...helpers.getClassContentPosition(helpers.getContentPosition(e?.layout,s?.contentPosition1Col,s?.contentPosition2Col)||{})}),getOverlayClasses=e=>{let{overlayColor:s}=e??{},t="gp-absolute gp-inset-0 gp-left-[var(--left)] gp-top-[var(--top)] gp-z-1 gp-transition-all gp-duration-300 ",{disableHoverOpacity:o,disableOpacity:l}=helpers.opacityEnabledData(e);return o||(t+=" group-hover/hero:gp-bg-[color:var(--hvr-bgc,_var(--bgc))] group-hover/hero:gp-opacity-[var(--hvr-op,_var(--op))]"),core.getGlobalColorStateClass("bg",s,l,o)&&(t+=` ${core.getGlobalColorStateClass("bg",s,l,o)}`),composeClasses(t)},getRowClasses=(e,s)=>{let{sizeSetting:t,background:o}=e??{},{verticalAlign:l}=s??{},a=helpers.getClassForContentByFitContent(t,o),r=helpers.getClassForStretchContent(l),g=helpers.getClassSpaceBetween(s?.layout||{},e?.contentPosition1Col||{},e?.contentPosition2Col||{}),p=helpers.getClassSpaceBetweenLeftRight(s?.layout||{}),n=`gp-hero-banner-row ${a} ${r}`;return{...composeClasses(n),...g,...p}},getAdaptiveClasses=()=>composeClasses("adaptive-hero-banner"),getAdaptivePictureClasses=()=>composeClasses("gp-w-full"),getBackgroundClasses=(e,s)=>{let t="hero-banner-bg gp-hero-banner-image-background";return s&&(t+=" gp_lazybg"),e&&(t+=" gp-duration-[var(--duration)] group-hover/hero:gp-scale-[var(--scale)] gp-transition-transform"),composeClasses(t)},getContainBackgroundClasses=()=>composeClasses("gp-hero-banner-bg gp-absolute gp-overflow-hidden gp-w-full gp-h-full top-0 left-0"),getHtml5VideoClasses=(e,s=!1)=>{let t="gp-relative",o=core.getValueByDevice(e,"tablet"),l=core.getValueByDevice(e,"mobile");return s&&(t+=" gp-hidden"),o&&(t+=" tablet:gp-h-full tablet:gp-object-cover"),l&&(t+=" mobile:gp-h-full mobile:gp-object-cover"),composeClasses(t)},getWrapperYoutubeClasses=()=>composeClasses("gp-pb-[56.25%] gp-h-full gp-w-full !gp-max-w-none gp-pointer-events-none"),getIframeYoutubeClasses=()=>composeClasses("!gp-w-[500%] !gp-ml-[-200%] !gp-h-full !gp-max-w-none gp-scale-[104%]"),getLazyBackgroundClasses=e=>{let s="gp-absolute gp-top-0 gp-invisible gp-w-full gp_lazyload gp-h-full gp_lazyforbg";return"tablet"===e&&(s+=" gp_lazybg_tl"),"mobile"===e&&(s+=" gp_lazybg_mb"),composeClasses(s)};exports.getAdaptiveClasses=getAdaptiveClasses,exports.getAdaptivePictureClasses=getAdaptivePictureClasses,exports.getBackgroundClasses=getBackgroundClasses,exports.getClasses=getClasses,exports.getContainBackgroundClasses=getContainBackgroundClasses,exports.getContainerClasses=getContainerClasses,exports.getHtml5VideoClasses=getHtml5VideoClasses,exports.getIframeYoutubeClasses=getIframeYoutubeClasses,exports.getLazyBackgroundClasses=getLazyBackgroundClasses,exports.getLinkClasses=getLinkClasses,exports.getOverlayClasses=getOverlayClasses,exports.getRowClasses=getRowClasses,exports.getWrapperYoutubeClasses=getWrapperYoutubeClasses;
1
+ "use strict";var core=require("@gem-sdk/core"),helpers=require("./helpers.js");function composeClasses(e){return e.split(" ").reduce((e,s)=>(e[s]=!0,e),{})}const getClasses=({setting:e,builderProps:s,advancedCssClass:t})=>{let o="gp-group/hero gp-flex gp-w-full gp-flex-col gp-self-center gp-transition-colors gp-duration-200 gp-ease-in-out";return t&&(o+=` ${t}`),{...s?.uid&&{[s.uid]:!0},...composeClasses(o),...helpers.getClassAlignBanner(helpers.getResponsiveSetting(e?.alignBanner||{}))}},getLinkClasses=()=>({...composeClasses("gp-cursor-pointer")}),getContainerClasses=(e,s)=>({...composeClasses("gp-relative gp-flex gp-w-full gp-flex-col gp-items-center gp-overflow-hidden hero-banner-container gp-h-full"),...helpers.getClassContentPosition(helpers.getContentPosition(e?.layout,s?.contentPosition1Col,s?.contentPosition2Col)||{})}),getOverlayClasses=e=>{let{overlayColor:s}=e??{},t="gp-absolute gp-inset-0 gp-left-[var(--left)] gp-top-[var(--top)] gp-z-1 gp-transition-all gp-duration-300 ",{disableHoverOpacity:o,disableOpacity:l}=helpers.opacityEnabledData(e);return o||(t+=" group-hover/hero:gp-bg-[color:var(--hvr-bgc,_var(--bgc))] group-hover/hero:gp-opacity-[var(--hvr-op,_var(--op))]"),core.getGlobalColorStateClass("bg",s,l,o)&&(t+=` ${core.getGlobalColorStateClass("bg",s,l,o)}`),composeClasses(t)},getRowClasses=(e,s)=>{let{sizeSetting:t,background:o}=e??{},{verticalAlign:l}=s??{},a=helpers.getClassForContentByFitContent(t,o),r=helpers.getClassForStretchContent(l),g=helpers.getClassSpaceBetween(s?.layout||{},e?.contentPosition1Col||{},e?.contentPosition2Col||{}),p=helpers.getClassSpaceBetweenLeftRight(s?.layout||{}),n=`gp-hero-banner-row ${a} ${r}`;return{...composeClasses(n),...g,...p}},getAdaptiveClasses=()=>composeClasses("adaptive-hero-banner"),getAdaptivePictureClasses=()=>composeClasses("gp-w-full"),getBackgroundClasses=(e,s)=>{let t="hero-banner-bg gp-hero-banner-image-background";return s&&(t+=" gp_lazybg"),e&&(t+=" gp-duration-[var(--duration)] group-hover/hero:gp-scale-[var(--scale)] gp-transition-transform"),composeClasses(t)},getContainBackgroundClasses=()=>composeClasses("gp-hero-banner-bg gp-absolute gp-overflow-hidden gp-w-full gp-h-full top-0 left-0"),getHtml5VideoClasses=(e,s=!1)=>{let t="gp-relative",o=core.getValueByDevice(e,"tablet"),l=core.getValueByDevice(e,"mobile");return s&&(t+=" gp-hidden"),o&&(t+=" tablet:gp-h-full tablet:gp-object-cover"),l&&(t+=" mobile:gp-h-full mobile:gp-object-cover"),composeClasses(t)},getWrapperYoutubeClasses=()=>composeClasses("gp-pb-[56.25%] gp-h-full gp-w-full !gp-max-w-none gp-pointer-events-none"),getIframeYoutubeClasses=()=>composeClasses("!gp-w-[500%] !gp-ml-[-200%] !gp-h-full !gp-max-w-none gp-scale-[104%]"),getLazyBackgroundClasses=e=>{let s="gp-absolute gp-top-0 gp-invisible gp-w-full gp_lazyload gp-h-full gp_lazyforbg";return"tablet"===e&&(s+=" gp_lazybg_tl"),"mobile"===e&&(s+=" gp_lazybg_mb"),composeClasses(s)};exports.getAdaptiveClasses=getAdaptiveClasses,exports.getAdaptivePictureClasses=getAdaptivePictureClasses,exports.getBackgroundClasses=getBackgroundClasses,exports.getClasses=getClasses,exports.getContainBackgroundClasses=getContainBackgroundClasses,exports.getContainerClasses=getContainerClasses,exports.getHtml5VideoClasses=getHtml5VideoClasses,exports.getIframeYoutubeClasses=getIframeYoutubeClasses,exports.getLazyBackgroundClasses=getLazyBackgroundClasses,exports.getLinkClasses=getLinkClasses,exports.getOverlayClasses=getOverlayClasses,exports.getRowClasses=getRowClasses,exports.getWrapperYoutubeClasses=getWrapperYoutubeClasses;
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{jsxs as e,jsx as p}from"react/jsx-runtime";import{composeTypographyStyle as t,getGlobalColorStateStyle as l,filterHoverVariables as r,cls as g,getGlobalColorResponsiveStyle as i}from"@gem-sdk/core";import n from"next/link";let DesktopMenuItem=({id:a,menu:o,arrow:s,textColor:m,menuTextColor:c,depth:u=0,maxDepth:d=2,menuBg:h,typo:f,typography:v,enableHoverEffect:x})=>{let y=o?.[a];if(!y||u>d)return null;let b=u===d,k=t(f,v),w=!!y?.childrens?.length&&!b,D=w&&!!s,I=l("c",0===u?m:c),M=x?I:r(I);return e("li",{className:g("gp-group gp-relative gp-inline-flex gp-flex-1 gp-cursor-pointer gp-items-center gp-gap-2 gp-whitespace-nowrap gp-px-4 gp-py-2 gp-transition-colors gp-duration-300 !gp-max-w-fit hover:gp-z-50",{"gp-justify-center":0===u,"gp-min-w-[200px] gp-border-b last:gp-border-b-transparent":u>0}),style:{...M,...k},children:[y?.link&&!y.childrens?.length?p(n,{href:y.link,title:y.title,children:y.title}):p("span",{children:y?.title}),D&&p("span",{dangerouslySetInnerHTML:{__html:s},className:g("gp-ml-auto gp-shrink-0 [&>svg]:gp-h-4 [&>svg]:gp-w-auto",{"-gp-rotate-90":1===u})}),w&&p("div",{className:g("gp-invisible gp-absolute gp-min-w-max gp-opacity-0 gp-transition-all gp-duration-300 gp-ease-in-out [li:hover>div&]:gp-visible [li:hover>div&]:gp-opacity-100 gp-z-[100]",{"gp-left-0 gp-top-full":0===u,"gp-left-full gp-top-0 gp-translate-y-4 [li:hover>div&]:gp-translate-y-0":1===u}),children:p("ul",{className:g("gp-flex gp-flex-col gp-shadow-card-2 gp-relative",{"gp-ml-4":1===u}),style:{...i("bgc",h)},children:y?.childrens?.map(e=>p(DesktopMenuItem,{id:e,menu:o,depth:u+1,maxDepth:d,arrow:s,menuTextColor:c,menuBg:h,typo:f,typography:v},e))})})]})};export{DesktopMenuItem as default};
2
+ import{jsxs as e,jsx as p}from"react/jsx-runtime";import{composeTypographyStyle as t,getGlobalColorStateStyle as l,filterHoverVariables as r,cls as g,getGlobalColorResponsiveStyle as i}from"@gem-sdk/core";import n from"next/link";let DesktopMenuItem=({id:a,menu:o,arrow:s,textColor:m,menuTextColor:c,depth:u=0,maxDepth:d=2,menuBg:h,typo:f,typography:v,enableHoverEffect:x})=>{let y=o?.[a];if(!y||u>d)return null;let b=u===d,k=t(f,v),w=!!y?.childrens?.length&&!b,D=w&&!!s,I=l("c",0===u?m:c),M=0===u&&x||0!==u?I:r(I);return e("li",{className:g("gp-group gp-relative gp-inline-flex gp-flex-1 gp-cursor-pointer gp-items-center gp-gap-2 gp-whitespace-nowrap gp-px-4 gp-py-2 gp-transition-colors gp-duration-300 !gp-max-w-fit hover:gp-z-50",{"gp-justify-center":0===u,"gp-min-w-[200px] gp-border-b last:gp-border-b-transparent":u>0}),style:{...k,...M},children:[y?.link&&!y.childrens?.length?p(n,{href:y.link,title:y.title,children:y.title}):p("span",{children:y?.title}),D&&p("span",{dangerouslySetInnerHTML:{__html:s},className:g("gp-ml-auto gp-shrink-0 [&>svg]:gp-h-4 [&>svg]:gp-w-auto",{"-gp-rotate-90":1===u})}),w&&p("div",{className:g("gp-invisible gp-absolute gp-min-w-max gp-opacity-0 gp-transition-all gp-duration-300 gp-ease-in-out [li:hover>div&]:gp-visible [li:hover>div&]:gp-opacity-100 gp-z-[100]",{"gp-left-0 gp-top-full":0===u,"gp-left-full gp-top-0 gp-translate-y-4 [li:hover>div&]:gp-translate-y-0":1===u}),children:p("ul",{className:g("gp-flex gp-flex-col gp-shadow-card-2 gp-relative",{"gp-ml-4":1===u}),style:{...i("bgc",h)},children:y?.childrens?.map(e=>p(DesktopMenuItem,{id:e,menu:o,depth:u+1,maxDepth:d,arrow:s,menuTextColor:c,menuBg:h,typo:f,typography:v},e))})})]})};export{DesktopMenuItem as default};
@@ -1,4 +1,4 @@
1
1
  let HeaderSettings=[{id:"setting",controls:[{id:"breakpoint",label:"Breakpoint",type:"select",hideOnMode:{mobileOnly:!0},options:[{label:"From desktop and smaller",subTitle:"Display menu icon for desktop, tablet and mobile",value:"desktop"},{label:"From tablet and smaller",subTitle:"Display menu icon for tablet and mobile",value:"tablet"},{label:"Only mobile",subTitle:"Display menu icon for only mobile",value:"mobile"}],default:"mobile"},{id:"itemEnableHoverEffect",type:"toggle",default:!0},{id:"cardEnableHoverEffect",type:"toggle",default:!0},{id:"menu",label:"Menu",type:"menu",default:{ROOT:{id:"ROOT",title:"Root",childrens:["1","2","3"]},1:{id:"1",title:"Menu 1",link:"",childrens:["13","14"]},2:{id:"2",title:"Menu 2",link:"",childrens:["6","7","8"]},6:{id:"6",title:"Sub Menu 2.1",childrens:[]},7:{id:"7",title:"Sub Menu 2.2",childrens:["10","11"]},8:{id:"8",title:"Sub Menu 2.3",childrens:["12"]},9:{id:"9",title:"Sub Menu 2.4",childrens:[]},10:{id:"10",title:"Sub Menu 2.2.1",childrens:[]},11:{id:"11",title:"Sub Menu 2.2.2",childrens:[]},12:{id:"12",title:"Sub Menu 2.3.1",childrens:[]},3:{id:"3",title:"Menu 3",link:"",childrens:[]},13:{id:"13",title:"Sub Menu 1.1",link:"",childrens:[]},14:{id:"14",title:"Sub Menu 1.2",link:"",childrens:[]}}},{type:"group",label:"Logo",id:"logo-group",controls:[{id:"logo",label:"Logo",type:"image-select",devices:{desktop:{default:{src:"https://cdn.shopify.com/s/files/1/2005/9307/files/image_demo.jpg",width:800,height:533}}}},{id:"logoAspectRatio",type:"select",label:"Aspect Ratio",options:[{label:"Auto",value:"auto"},{label:"1:1",value:"1"},{label:"3:2",value:"3/2"},{label:"4:3",value:"4/3"},{label:"16:9",value:"16/9"},{label:"21:9",value:"21/9"},{label:"2:3",value:"2/3"},{label:"3:4",value:"3/4"},{label:"9:16",value:"9/16"},{label:"Custom",value:"custom"}],devices:{desktop:{default:"auto"}}},{id:"customAspectRadio",type:"ratio",min:1,devices:{desktop:{default:{width:"1",height:"1"}}},hide:!0},{id:"layout",type:"select",label:"Object Fit",options:[{label:"Fill",value:"fill"},{label:"Cover",value:"cover"},{label:"Contain",value:"contain"},{label:"None",value:"none"},{label:"Scale down",value:"scale-down"}],devices:{desktop:{default:"contain"}}},{id:"logoWidth",label:"Width",type:"input:unit",units:["px","%"],devices:{desktop:{default:"80px"}}}]},{id:"arrow",label:"Arrow Icon",type:"icon",default:`<svg data-name="chevron down" width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
2
  <path fill-rule="evenodd" clip-rule="evenodd" d="M4.57576 6.77583C4.81007 6.54152 5.18997 6.54152 5.42429 6.77583L8.20002 9.55157L10.9758 6.77583C11.2101 6.54152 11.59 6.54152 11.8243 6.77583C12.0586 7.01015 12.0586 7.39005 11.8243 7.62436L8.62429 10.8244C8.38997 11.0587 8.01007 11.0587 7.77576 10.8244L4.57576 7.62436C4.34145 7.39005 4.34145 7.01015 4.57576 6.77583Z" fill="currentColor"/>
3
3
  </svg>
4
- `},{id:"cart-setting",type:"group",label:"Cart Setting",controls:[{id:"cartIcon",label:"Cart Icon",type:"icon",default:'<svg data-name="cart" width="16" height="16" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M3 3h2l.4 2M7 13h10l4-8H5.4M7 13L5.4 5M7 13l-2.293 2.293c-.63.63-.184 1.707.707 1.707H17m0 0a2 2 0 100 4 2 2 0 000-4zm-8 2a2 2 0 11-4 0 2 2 0 014 0z"></path></svg>'}]}]},{id:"style",controls:[{id:"height",label:"Height",type:"input:unit",units:["px"],devices:{desktop:{default:"60px"}}},{id:"typography",label:"Typography",type:"typography",default:{type:"paragraph-1"}},{id:"typo",label:"Text styles",type:"typography-v2",default:{type:"paragraph-1"},hiddenSetting:{textAlign:!0,textShadow:!0},ignoreReRender:!0},{id:"background-group",label:"Background",type:"group",controls:[{id:"headerBg",type:"color-picker-v2",label:"Header",devices:{desktop:{default:"#FFFFFF"}}},{id:"menuBg",type:"color-picker-v2",label:"Menu",info:"Dropdown and collapse menu background color",compoDefaultValue:{desktop:{default:"#FFFFFF"}},devices:{desktop:{default:"#FFFFFF"}}}]},{id:"color-state",type:"behavior-state",controls:[{id:"textColor",label:"Text Color",type:"color-picker-v2",state:{normal:!0,hover:!0},default:{normal:"text-1"}},{id:"menuTextColor",label:"Menu Text Color",type:"color-picker-v2",state:{normal:!0,hover:!0},compoDefaultValue:{normal:"text-1",hover:"text-2"},default:{normal:"text-1"}},{id:"cartIconColor",type:"color-picker-v2",label:"Cart Icon Color",state:{normal:!0,hover:!0},default:{normal:"text-1"}}]}]}];export{HeaderSettings};
4
+ `},{id:"cart-setting",type:"group",label:"Cart Setting",controls:[{id:"cartIcon",label:"Cart Icon",type:"icon",default:'<svg data-name="cart" width="16" height="16" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M3 3h2l.4 2M7 13h10l4-8H5.4M7 13L5.4 5M7 13l-2.293 2.293c-.63.63-.184 1.707.707 1.707H17m0 0a2 2 0 100 4 2 2 0 000-4zm-8 2a2 2 0 11-4 0 2 2 0 014 0z"></path></svg>'}]}]},{id:"style",controls:[{id:"height",label:"Height",type:"input:unit",units:["px"],devices:{desktop:{default:"60px"}}},{id:"typography",label:"Typography",type:"typography",default:{type:"paragraph-1"}},{id:"typo",label:"Text styles",type:"typography-v2",default:{type:"paragraph-1"},hiddenSetting:{textAlign:!0,textShadow:!0},ignoreReRender:!0},{id:"background-group",label:"Background",type:"group",controls:[{id:"headerBg",type:"color-picker-v2",label:"Header",devices:{desktop:{default:"#FFFFFF"}}},{id:"menuBg",type:"color-picker-v2",label:"Menu",info:"Dropdown and collapse menu background color",compoDefaultValue:{desktop:{default:"#FFFFFF"}},devices:{desktop:{default:"#FFFFFF"}}}]},{id:"color-state",type:"behavior-state",controls:[{id:"textColor",label:"Text Color",type:"color-picker-v2",state:{normal:!0,hover:!0},default:{normal:"text-1"},compoDefaultValue:{hover:"text-2"}},{id:"menuTextColor",label:"Menu Text Color",type:"color-picker-v2",state:{normal:!0,hover:!0},compoDefaultValue:{normal:"text-1",hover:"text-2"},default:{normal:"text-1"}},{id:"cartIconColor",type:"color-picker-v2",label:"Cart Icon Color",state:{normal:!0,hover:!0},default:{normal:"text-1"}}]}]}];export{HeaderSettings};
@@ -1 +1 @@
1
- import{getGlobalColorStateClass as e,getValueByDevice as s}from"@gem-sdk/core";import{getClassAlignBanner as o,getResponsiveSetting as l,getClassContentPosition as t,getContentPosition as a,getClassForContentByFitContent as g,getClassForStretchContent as p,opacityEnabledData as r,getClassSpaceBetween as n,getClassSpaceBetweenLeftRight as i}from"./helpers.js";function composeClasses(e){return e.split(" ").reduce((e,s)=>(e[s]=!0,e),{})}let getClasses=({setting:e,builderProps:s,advancedCssClass:t})=>{let a="gp-group/hero gp-flex gp-w-full gp-flex-col gp-self-center gp-transition-colors gp-duration-200 gp-ease-in-out";return t&&(a+=` ${t}`),{...s?.uid&&{[s.uid]:!0},...composeClasses(a),...o(l(e?.alignBanner||{}))}},getLinkClasses=()=>({...composeClasses("gp-cursor-pointer")}),getContainerClasses=(e,s)=>({...composeClasses("gp-relative gp-flex gp-w-full gp-flex-col gp-items-center gp-overflow-hidden hero-banner-container"),...t(a(e?.layout,s?.contentPosition1Col,s?.contentPosition2Col)||{})}),getOverlayClasses=s=>{let{overlayColor:o}=s??{},l="gp-absolute gp-inset-0 gp-left-[var(--left)] gp-top-[var(--top)] gp-z-1 gp-transition-all gp-duration-300 ",{disableHoverOpacity:t,disableOpacity:a}=r(s);return t||(l+=" group-hover/hero:gp-bg-[color:var(--hvr-bgc,_var(--bgc))] group-hover/hero:gp-opacity-[var(--hvr-op,_var(--op))]"),e("bg",o,a,t)&&(l+=` ${e("bg",o,a,t)}`),composeClasses(l)},getRowClasses=(e,s)=>{let{sizeSetting:o,background:l}=e??{},{verticalAlign:t}=s??{},a=g(o,l),r=p(t),u=n(s?.layout||{},e?.contentPosition1Col||{},e?.contentPosition2Col||{}),c=i(s?.layout||{}),C=`gp-hero-banner-row ${a} ${r}`;return{...composeClasses(C),...u,...c}},getAdaptiveClasses=()=>composeClasses("adaptive-hero-banner"),getAdaptivePictureClasses=()=>composeClasses("gp-w-full"),getBackgroundClasses=(e,s)=>{let o="hero-banner-bg gp-hero-banner-image-background";return s&&(o+=" gp_lazybg"),e&&(o+=" gp-duration-[var(--duration)] group-hover/hero:gp-scale-[var(--scale)] gp-transition-transform"),composeClasses(o)},getContainBackgroundClasses=()=>composeClasses("gp-hero-banner-bg gp-absolute gp-overflow-hidden gp-w-full gp-h-full top-0 left-0"),getHtml5VideoClasses=(e,o=!1)=>{let l="gp-relative",t=s(e,"tablet"),a=s(e,"mobile");return o&&(l+=" gp-hidden"),t&&(l+=" tablet:gp-h-full tablet:gp-object-cover"),a&&(l+=" mobile:gp-h-full mobile:gp-object-cover"),composeClasses(l)},getWrapperYoutubeClasses=()=>composeClasses("gp-pb-[56.25%] gp-h-full gp-w-full !gp-max-w-none gp-pointer-events-none"),getIframeYoutubeClasses=()=>composeClasses("!gp-w-[500%] !gp-ml-[-200%] !gp-h-full !gp-max-w-none gp-scale-[104%]"),getLazyBackgroundClasses=e=>{let s="gp-absolute gp-top-0 gp-invisible gp-w-full gp_lazyload gp-h-full gp_lazyforbg";return"tablet"===e&&(s+=" gp_lazybg_tl"),"mobile"===e&&(s+=" gp_lazybg_mb"),composeClasses(s)};export{getAdaptiveClasses,getAdaptivePictureClasses,getBackgroundClasses,getClasses,getContainBackgroundClasses,getContainerClasses,getHtml5VideoClasses,getIframeYoutubeClasses,getLazyBackgroundClasses,getLinkClasses,getOverlayClasses,getRowClasses,getWrapperYoutubeClasses};
1
+ import{getGlobalColorStateClass as e,getValueByDevice as s}from"@gem-sdk/core";import{getClassAlignBanner as o,getResponsiveSetting as l,getClassContentPosition as t,getContentPosition as a,getClassForContentByFitContent as g,getClassForStretchContent as p,opacityEnabledData as r,getClassSpaceBetween as n,getClassSpaceBetweenLeftRight as i}from"./helpers.js";function composeClasses(e){return e.split(" ").reduce((e,s)=>(e[s]=!0,e),{})}let getClasses=({setting:e,builderProps:s,advancedCssClass:t})=>{let a="gp-group/hero gp-flex gp-w-full gp-flex-col gp-self-center gp-transition-colors gp-duration-200 gp-ease-in-out";return t&&(a+=` ${t}`),{...s?.uid&&{[s.uid]:!0},...composeClasses(a),...o(l(e?.alignBanner||{}))}},getLinkClasses=()=>({...composeClasses("gp-cursor-pointer")}),getContainerClasses=(e,s)=>({...composeClasses("gp-relative gp-flex gp-w-full gp-flex-col gp-items-center gp-overflow-hidden hero-banner-container gp-h-full"),...t(a(e?.layout,s?.contentPosition1Col,s?.contentPosition2Col)||{})}),getOverlayClasses=s=>{let{overlayColor:o}=s??{},l="gp-absolute gp-inset-0 gp-left-[var(--left)] gp-top-[var(--top)] gp-z-1 gp-transition-all gp-duration-300 ",{disableHoverOpacity:t,disableOpacity:a}=r(s);return t||(l+=" group-hover/hero:gp-bg-[color:var(--hvr-bgc,_var(--bgc))] group-hover/hero:gp-opacity-[var(--hvr-op,_var(--op))]"),e("bg",o,a,t)&&(l+=` ${e("bg",o,a,t)}`),composeClasses(l)},getRowClasses=(e,s)=>{let{sizeSetting:o,background:l}=e??{},{verticalAlign:t}=s??{},a=g(o,l),r=p(t),u=n(s?.layout||{},e?.contentPosition1Col||{},e?.contentPosition2Col||{}),c=i(s?.layout||{}),C=`gp-hero-banner-row ${a} ${r}`;return{...composeClasses(C),...u,...c}},getAdaptiveClasses=()=>composeClasses("adaptive-hero-banner"),getAdaptivePictureClasses=()=>composeClasses("gp-w-full"),getBackgroundClasses=(e,s)=>{let o="hero-banner-bg gp-hero-banner-image-background";return s&&(o+=" gp_lazybg"),e&&(o+=" gp-duration-[var(--duration)] group-hover/hero:gp-scale-[var(--scale)] gp-transition-transform"),composeClasses(o)},getContainBackgroundClasses=()=>composeClasses("gp-hero-banner-bg gp-absolute gp-overflow-hidden gp-w-full gp-h-full top-0 left-0"),getHtml5VideoClasses=(e,o=!1)=>{let l="gp-relative",t=s(e,"tablet"),a=s(e,"mobile");return o&&(l+=" gp-hidden"),t&&(l+=" tablet:gp-h-full tablet:gp-object-cover"),a&&(l+=" mobile:gp-h-full mobile:gp-object-cover"),composeClasses(l)},getWrapperYoutubeClasses=()=>composeClasses("gp-pb-[56.25%] gp-h-full gp-w-full !gp-max-w-none gp-pointer-events-none"),getIframeYoutubeClasses=()=>composeClasses("!gp-w-[500%] !gp-ml-[-200%] !gp-h-full !gp-max-w-none gp-scale-[104%]"),getLazyBackgroundClasses=e=>{let s="gp-absolute gp-top-0 gp-invisible gp-w-full gp_lazyload gp-h-full gp_lazyforbg";return"tablet"===e&&(s+=" gp_lazybg_tl"),"mobile"===e&&(s+=" gp_lazybg_mb"),composeClasses(s)};export{getAdaptiveClasses,getAdaptivePictureClasses,getBackgroundClasses,getClasses,getContainBackgroundClasses,getContainerClasses,getHtml5VideoClasses,getIframeYoutubeClasses,getLazyBackgroundClasses,getLinkClasses,getOverlayClasses,getRowClasses,getWrapperYoutubeClasses};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.0.0-staging.983",
3
+ "version": "2.0.0-staging.985",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",