@gem-sdk/components 3.1.1 → 3.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";var core=require("@gem-sdk/core"),helpers=require("../../helpers.js");const getTextIconNotFound=e=>"react"===e?"Icons not found":helpers.getStaticLocale("IconList","icons_not_found"),getTextIconTranslations=({setting:e,builderProps:t,pageContext:o,key:n,type:s})=>{let{childItem:i,translate:c}=e??{};return"react"===s?i?.[n]:helpers.getDynamicSourceLocales({val:i?.[n],uid:t?.uid,settingId:`childItem_${n}`,pageContext:o,translate:c,isReplaceLocationOrigin:!0})},getvalueMap=({setting:e})=>{let{childConfig:t,iconType:o,iconSvg:n}=e??{};return o&&"matching"!==o?"different"===o?t:void 0:Array(t?.length).fill(n)},composePostionIconList=(e,t,o)=>{let n={...o,desktop:o?.desktop??0,tablet:o?.tablet??o?.desktop??0,mobile:o?.mobile??o?.tablet??o?.desktop??0},s={};return core.DEVICES.forEach(o=>{core.composePositionLineHeight({compose:s,lineHeight:e,device:o,position:t,iconWidth:n})}),s};exports.composePostionIconList=composePostionIconList,exports.getTextIconNotFound=getTextIconNotFound,exports.getTextIconTranslations=getTextIconTranslations,exports.getvalueMap=getvalueMap;
1
+ "use strict";var core=require("@gem-sdk/core"),helpers=require("../../helpers.js");const composeIconWith=e=>({...e,desktop:e?.desktop??0,tablet:e?.tablet??e?.desktop??0,mobile:e?.mobile??e?.tablet??e?.desktop??0}),getTextIconNotFound=e=>"react"===e?"Icons not found":helpers.getStaticLocale("IconList","icons_not_found"),getTextIconTranslations=({setting:e,builderProps:t,pageContext:o,key:s,type:n})=>{let{childItem:c,translate:i}=e??{};return"react"===n?c?.[s]:helpers.getDynamicSourceLocales({val:c?.[s],uid:t?.uid,settingId:`childItem_${s}`,pageContext:o,translate:i,isReplaceLocationOrigin:!0})},getvalueMap=({setting:e})=>{let{childConfig:t,iconType:o,iconSvg:s}=e??{};return o&&"matching"!==o?"different"===o?t:void 0:Array(t?.length).fill(s)},composePostionIconList=(e,t,o)=>{let s={...o,desktop:o?.desktop??0,tablet:o?.tablet??o?.desktop??0,mobile:o?.mobile??o?.tablet??o?.desktop??0},n={};return core.DEVICES.forEach(o=>{core.composePositionLineHeight({compose:n,lineHeight:e,device:o,position:t,iconWidth:s})}),n};exports.composeIconWith=composeIconWith,exports.composePostionIconList=composePostionIconList,exports.getTextIconNotFound=getTextIconNotFound,exports.getTextIconTranslations=getTextIconTranslations,exports.getvalueMap=getvalueMap;
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),useGetProductId=require("../../hooks/useGetProductId.js"),Text=require("../../text/components/Text.js"),system=require("@gem-sdk/system"),classes=require("../common/classes.js"),styles=require("../common/styles.js"),helpers=require("../common/helpers.js"),useIconLineHeight=require("../hooks/useIconLineHeight.js");const IconListV2=e=>{let{builderProps:s,builderAttrs:t,style:l,setting:a,styles:r,pageContext:c,advanced:n}=e,i=system.createClass({[s?.uid??""]:!0}),o=system.createClass(classes.getClassWraplistIcon()),y=system.createClass(classes.getClassColListIcon()),m=system.createClass(classes.getClassWrapItemIcon({builderProps:s})),u=system.createClass(classes.getClassWrapIcon()),d=system.createClass(classes.getClassIcon()),p=system.createClass(classes.getClassTextItem({setting:a})),x=system.createStyle(styles.getStyleContainerIconlistMain({styles:r,style:l,type:"react",advanced:n})),I=system.createStyle(styles.getStyleWraplistIcon({styles:r})),g=system.createStyle(styles.getStyleColListIcon({styles:r})),j=system.createStyle(styles.getStyleIcon({styles:r,setting:a})),h=styles.getStyleTypoText({setting:a}),C=system.createAttr({...t}),S=helpers.getTextIconNotFound("react"),T=helpers.getvalueMap({setting:a}),{ref:v,lineHeight:L}=useIconLineHeight.useIconLineHeight({iconWidth:a?.iconWidth}),q=helpers.composePostionIconList(L,r?.position,a?.iconWidth),{refContainer:R,productID:W}=useGetProductId.useGetProductId(),N=system.createStyle({...styles.getStyleWrapIcon({styles:r,setting:a}),...q.content}),f=system.createStyle({...styles.getStyleWrapItemIcon({styles:r}),...q.wrapper});return jsxRuntime.jsx("div",{...C,...s,"data-id":s?.uid,style:x,className:i,ref:R,children:system.If(!T||!T.length,jsxRuntime.jsx("div",{children:S}),jsxRuntime.jsx("div",{className:o,style:I,children:jsxRuntime.jsx("div",{className:y,style:g,children:T?.map((e,t)=>{let l=helpers.getTextIconTranslations({setting:a,builderProps:s,pageContext:c,key:t,type:"react"});return jsxRuntime.jsxs("div",{"data-index":t,className:m,style:f,children:[jsxRuntime.jsx("div",{className:u,style:N,children:jsxRuntime.jsx("span",{style:j,className:d,dangerouslySetInnerHTML:{__html:e}})}),jsxRuntime.jsx(Text.default,{setting:{text:l?.toString(),htmlTag:"div",options:{useState:!0,uniqueId:`${s?.uid}-${t}-${W}`,productID:W,customClass:{wrapper:"gp-w-full"}}},styles:h,className:p,ref:v})]},t)})})}))})};exports.default=IconListV2;
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),useGetProductId=require("../../hooks/useGetProductId.js"),Text=require("../../text/components/Text.js"),system=require("@gem-sdk/system"),classes=require("../common/classes.js"),styles=require("../common/styles.js"),helpers=require("../common/helpers.js"),useIconLineHeight=require("../hooks/useIconLineHeight.js");const IconListV2=e=>{let{builderProps:s,builderAttrs:t,style:l,setting:a,styles:r,pageContext:c,advanced:n}=e,i=system.createClass({[s?.uid??""]:!0}),o=system.createClass(classes.getClassWraplistIcon()),y=system.createClass(classes.getClassColListIcon()),m=system.createClass(classes.getClassWrapItemIcon({builderProps:s})),u=system.createClass(classes.getClassWrapIcon()),d=system.createClass(classes.getClassIcon()),p=system.createClass(classes.getClassTextItem({setting:a})),I=system.createStyle(styles.getStyleContainerIconlistMain({styles:r,style:l,type:"react",advanced:n})),x=system.createStyle(styles.getStyleWraplistIcon({styles:r})),g=system.createStyle(styles.getStyleColListIcon({styles:r})),h=system.createStyle(styles.getStyleIcon({styles:r,setting:a})),j=styles.getStyleTypoText({setting:a}),C=system.createAttr({...t}),S=helpers.getTextIconNotFound("react"),T=helpers.getvalueMap({setting:a}),{ref:v,lineHeight:L}=useIconLineHeight.useIconLineHeight({iconWidth:helpers.composeIconWith(a?.iconWidth)}),W=helpers.composePostionIconList(L,r?.position,a?.iconWidth),{refContainer:q,productID:R}=useGetProductId.useGetProductId(),N=system.createStyle({...styles.getStyleWrapIcon({styles:r,setting:a}),...W.content}),f=system.createStyle({...styles.getStyleWrapItemIcon({styles:r}),...W.wrapper});return jsxRuntime.jsx("div",{...C,...s,"data-id":s?.uid,style:I,className:i,ref:q,children:system.If(!T||!T.length,jsxRuntime.jsx("div",{children:S}),jsxRuntime.jsx("div",{className:o,style:x,children:jsxRuntime.jsx("div",{className:y,style:g,children:T?.map((e,t)=>{let l=helpers.getTextIconTranslations({setting:a,builderProps:s,pageContext:c,key:t,type:"react"});return jsxRuntime.jsxs("div",{"data-index":t,className:m,style:f,children:[jsxRuntime.jsx("div",{className:u,style:N,children:jsxRuntime.jsx("span",{style:h,className:d,dangerouslySetInnerHTML:{__html:e}})}),jsxRuntime.jsx(Text.default,{setting:{text:l?.toString(),htmlTag:"div",options:{useState:!0,uniqueId:`${s?.uid}-${t}-${R}`,productID:R,customClass:{wrapper:"gp-w-full"}}},styles:j,className:p,ref:v})]},t)})})}))})};exports.default=IconListV2;
@@ -1 +1 @@
1
- "use strict";var React=require("react");const useIconLineHeight=({iconWidth:e})=>{let t=React.useRef(null),[r,u]=React.useState("");return React.useEffect(()=>{if(t?.current){let e=window.getComputedStyle(t?.current).getPropertyValue("line-height");u(e)}},[e?.desktop]),{ref:t,lineHeight:r}};exports.useIconLineHeight=useIconLineHeight;
1
+ "use strict";var core=require("@gem-sdk/core"),React=require("react");const useIconLineHeight=({iconWidth:e})=>{let t=React.useRef(null),[r,c]=React.useState(""),u=core.useCurrentDevice();return React.useEffect(()=>{if(t?.current){let e=window.getComputedStyle(t?.current).getPropertyValue("line-height");c(e)}},[e,u]),{ref:t,lineHeight:r}};exports.useIconLineHeight=useIconLineHeight;
@@ -1 +1 @@
1
- "use strict";const TabsSettings=[{id:"setting",controls:[{id:"childItem",label:"Tabs Item",type:"child-item",default:["Tab 1","Tab 2","Tab 3"]},{id:"activeKey",type:"select-custom-options",label:"Order",controlOption:"childItem",default:0},{id:"translate",type:"input",default:"childItem"},{id:"position",type:"layout-selector",label:"Layout",iconViewBox:"0 0 74 48",enableItemBackground:!0,itemPerRow:2,options:[{value:"top",label:"Top",iconName:"gp-tab-top"},{value:"left",label:"Left",iconName:"gp-tab-left"},{value:"right",label:"Right",iconName:"gp-tab-bottom"}],devices:{desktop:{default:"top"}}},{id:"group-header",label:"Tabs Header",type:"group",controls:[{id:"labelTypoV2",type:"typography-v2",default:{type:"paragraph-1",attrs:{color:"text-1"}},compoDefaultValue:{custom:{textShadow:{color:"rgba(18, 18, 18, 0.5)"}}},ignoreReRender:!0},{id:"panelFullWidth",label:"Full Width",type:"toggle",devices:{desktop:{default:!1}}},{id:"panelWidth",label:"Width",type:"dropdown:input",units:["px","%"],displayOptions:[{label:"Fit content",value:"Auto",showValue:!0},{label:"Full",value:"100%",showValue:!0}],devices:{desktop:{default:"Auto"}}},{id:"panelAlign",type:"option:value",label:"Alignment",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:"panelAlignVertical",type:"option:value",label:"Alignment",options:[{label:"Top",value:"start",type:"align",tooltip:"Align Top",iconName:"gp-align-top"},{label:"Center",value:"center",type:"align",tooltip:"Align center",iconName:"gp-align-center"},{label:"Bottom",value:"end",type:"align",tooltip:"Align Bottom",iconName:"gp-align-bottom"}],devices:{desktop:{default:"start"}}},{id:"labelWidth",label:"Width",type:"input:unit",units:["px","%"],devices:{desktop:{default:"auto"}}},{id:"padding",type:"padding-v2",devices:{desktop:{}}},{id:"labelAlign",type:"option:value",label:"Text alignment",options:[{label:"Left",value:"left",type:"text"},{label:"Center",value:"center",type:"text"},{label:"Right",value:"right",type:"text"}],devices:{desktop:{default:"left"}}}]},{id:"enableHoverEffect",label:"",type:"toggle",default:!1},{id:"enableActiveEffect",label:"",type:"toggle",default:!0},{id:"behavior-state-group",type:"behavior-state",controls:[{id:"labelBgColor",label:"Background Color",type:"color-picker-v2",default:{active:"bg-1"},compoDefaultValue:{normal:"bg-2",hover:"bg-2",active:"bg-1"}},{id:"labelColor",label:"Text Color",type:"color-picker-v2",default:{normal:"text-1"},compoDefaultValue:{normal:"text-1"}},{id:"borderTab",type:"border",label:"Border",default:{active:{border:"solid",width:"0px 0px 1px 0px",borderWidth:"1px",color:"line-3",position:"bottom",isCustom:!0}}}]},{id:"containWidth",type:"input:unit",placeholder:"Auto",units:["px","%"],devices:{desktop:{default:"100%"}}},{id:"background",type:"background-media",ignoreReRender:!0,devices:{desktop:{default:{type:"color",color:"transparent",image:{src:"",width:0,height:0},size:"cover",position:{x:50,y:50},repeat:"no-repeat",attachment:"scroll"}}},compoDefaultValue:{desktop:{default:{type:"color",color:"#DDDDDD",image:{src:"https://cdn.shopify.com/s/files/1/2005/9307/files/background_settings.jpg",width:1200,height:1200},size:"cover",position:{x:50,y:50},repeat:"no-repeat",attachment:"scroll"}}}},{id:"align",label:"Align",type:"option:value",options:[{label:"Left",value:"start",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:"end",type:"align",tooltip:"Align right",iconName:"gp-align-right"}],devices:{desktop:{default:"center"}}}]}];exports.TabsSettings=TabsSettings;
1
+ "use strict";const TabsSettings=[{id:"setting",controls:[{id:"childItem",label:"Tabs Item",type:"child-item",default:["Tab 1","Tab 2","Tab 3"]},{id:"activeKey",type:"select-custom-options",label:"Order",controlOption:"childItem",default:0},{id:"translate",type:"input",default:"childItem"},{id:"position",type:"layout-selector",label:"Layout",iconViewBox:"0 0 74 48",enableItemBackground:!0,itemPerRow:2,options:[{value:"top",label:"Top",iconName:"gp-tab-top"},{value:"left",label:"Left",iconName:"gp-tab-left"},{value:"right",label:"Right",iconName:"gp-tab-bottom"}],devices:{desktop:{default:"top"}}},{id:"group-header",label:"Tabs Header",type:"group",controls:[{id:"labelTypoV2",type:"typography-v2",default:{type:"paragraph-1",attrs:{color:"text-1"}},compoDefaultValue:{custom:{textShadow:{angle:135,blur:"2px",distance:"2px",type:"custom",color:"rgba(18, 18, 18, 0.5)"}}},ignoreReRender:!0},{id:"panelFullWidth",label:"Full Width",type:"toggle",devices:{desktop:{default:!1}}},{id:"panelWidth",label:"Width",type:"dropdown:input",units:["px","%"],displayOptions:[{label:"Fit content",value:"Auto",showValue:!0},{label:"Full",value:"100%",showValue:!0}],devices:{desktop:{default:"Auto"}}},{id:"panelAlign",type:"option:value",label:"Alignment",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:"panelAlignVertical",type:"option:value",label:"Alignment",options:[{label:"Top",value:"start",type:"align",tooltip:"Align Top",iconName:"gp-align-top"},{label:"Center",value:"center",type:"align",tooltip:"Align center",iconName:"gp-align-center"},{label:"Bottom",value:"end",type:"align",tooltip:"Align Bottom",iconName:"gp-align-bottom"}],devices:{desktop:{default:"start"}}},{id:"labelWidth",label:"Width",type:"input:unit",units:["px","%"],devices:{desktop:{default:"auto"}}},{id:"padding",type:"padding-v2",devices:{desktop:{}}},{id:"labelAlign",type:"option:value",label:"Text alignment",options:[{label:"Left",value:"left",type:"text"},{label:"Center",value:"center",type:"text"},{label:"Right",value:"right",type:"text"}],devices:{desktop:{default:"left"}}}]},{id:"enableHoverEffect",label:"",type:"toggle",default:!1},{id:"enableActiveEffect",label:"",type:"toggle",default:!0},{id:"behavior-state-group",type:"behavior-state",controls:[{id:"labelBgColor",label:"Background Color",type:"color-picker-v2",default:{active:"bg-1"},compoDefaultValue:{normal:"bg-2",hover:"bg-2",active:"bg-1"}},{id:"labelColor",label:"Text Color",type:"color-picker-v2",default:{normal:"text-1"},compoDefaultValue:{normal:"text-1"}},{id:"borderTab",type:"border",label:"Border",default:{active:{border:"solid",width:"0px 0px 1px 0px",borderWidth:"1px",color:"line-3",position:"bottom",isCustom:!0}}}]},{id:"containWidth",type:"input:unit",placeholder:"Auto",units:["px","%"],devices:{desktop:{default:"100%"}}},{id:"background",type:"background-media",ignoreReRender:!0,devices:{desktop:{default:{type:"color",color:"transparent",image:{src:"",width:0,height:0},size:"cover",position:{x:50,y:50},repeat:"no-repeat",attachment:"scroll"}}},compoDefaultValue:{desktop:{default:{type:"color",color:"#DDDDDD",image:{src:"https://cdn.shopify.com/s/files/1/2005/9307/files/background_settings.jpg",width:1200,height:1200},size:"cover",position:{x:50,y:50},repeat:"no-repeat",attachment:"scroll"}}}},{id:"align",label:"Align",type:"option:value",options:[{label:"Left",value:"start",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:"end",type:"align",tooltip:"Align right",iconName:"gp-align-right"}],devices:{desktop:{default:"center"}}}]}];exports.TabsSettings=TabsSettings;
@@ -1 +1 @@
1
- import{DEVICES as t,composePositionLineHeight as e}from"@gem-sdk/core";import{getDynamicSourceLocales as o,getStaticLocale as n}from"../../helpers.js";let getTextIconNotFound=t=>"react"===t?"Icons not found":n("IconList","icons_not_found"),getTextIconTranslations=({setting:t,builderProps:e,pageContext:n,key:i,type:r})=>{let{childItem:s,translate:c}=t??{};return"react"===r?s?.[i]:o({val:s?.[i],uid:e?.uid,settingId:`childItem_${i}`,pageContext:n,translate:c,isReplaceLocationOrigin:!0})},getvalueMap=({setting:t})=>{let{childConfig:e,iconType:o,iconSvg:n}=t??{};return o&&"matching"!==o?"different"===o?e:void 0:Array(e?.length).fill(n)},composePostionIconList=(o,n,i)=>{let r={...i,desktop:i?.desktop??0,tablet:i?.tablet??i?.desktop??0,mobile:i?.mobile??i?.tablet??i?.desktop??0},s={};return t.forEach(t=>{e({compose:s,lineHeight:o,device:t,position:n,iconWidth:r})}),s};export{composePostionIconList,getTextIconNotFound,getTextIconTranslations,getvalueMap};
1
+ import{DEVICES as t,composePositionLineHeight as o}from"@gem-sdk/core";import{getDynamicSourceLocales as e,getStaticLocale as n}from"../../helpers.js";let composeIconWith=t=>({...t,desktop:t?.desktop??0,tablet:t?.tablet??t?.desktop??0,mobile:t?.mobile??t?.tablet??t?.desktop??0}),getTextIconNotFound=t=>"react"===t?"Icons not found":n("IconList","icons_not_found"),getTextIconTranslations=({setting:t,builderProps:o,pageContext:n,key:i,type:s})=>{let{childItem:l,translate:c}=t??{};return"react"===s?l?.[i]:e({val:l?.[i],uid:o?.uid,settingId:`childItem_${i}`,pageContext:n,translate:c,isReplaceLocationOrigin:!0})},getvalueMap=({setting:t})=>{let{childConfig:o,iconType:e,iconSvg:n}=t??{};return e&&"matching"!==e?"different"===e?o:void 0:Array(o?.length).fill(n)},composePostionIconList=(e,n,i)=>{let s={...i,desktop:i?.desktop??0,tablet:i?.tablet??i?.desktop??0,mobile:i?.mobile??i?.tablet??i?.desktop??0},l={};return t.forEach(t=>{o({compose:l,lineHeight:e,device:t,position:n,iconWidth:s})}),l};export{composeIconWith,composePostionIconList,getTextIconNotFound,getTextIconTranslations,getvalueMap};
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useGetProductId as s}from"../../hooks/useGetProductId.js";import o from"../../text/components/Text.js";import{createClass as i,createStyle as r,createAttr as m,If as l}from"@gem-sdk/system";import{getClassWraplistIcon as n,getClassColListIcon as a,getClassWrapItemIcon as c,getClassWrapIcon as d,getClassIcon as p,getClassTextItem as h}from"../common/classes.js";import{getStyleContainerIconlistMain as u,getStyleWraplistIcon as f,getStyleColListIcon as y,getStyleIcon as g,getStyleWrapIcon as j,getStyleWrapItemIcon as v,getStyleTypoText as N}from"../common/styles.js";import{getvalueMap as x,composePostionIconList as I,getTextIconTranslations as L,getTextIconNotFound as k}from"../common/helpers.js";import{useIconLineHeight as w}from"../hooks/useIconLineHeight.js";let IconListV2=S=>{let{builderProps:T,builderAttrs:W,style:$,setting:H,styles:V,pageContext:_,advanced:q}=S,C=i({[T?.uid??""]:!0}),G=i(n()),M=i(a()),P=i(c({builderProps:T})),b=i(d()),z=i(p()),A=i(h({setting:H})),B=r(u({styles:V,style:$,type:"react",advanced:q})),D=r(f({styles:V})),E=r(y({styles:V})),F=r(g({styles:V,setting:H})),J=N({setting:H}),K=m({...W}),O=k("react"),Q=x({setting:H}),{ref:R,lineHeight:U}=w({iconWidth:H?.iconWidth}),X=I(U,V?.position,H?.iconWidth),{refContainer:Y,productID:Z}=s(),ee=r({...j({styles:V,setting:H}),...X.content}),et=r({...v({styles:V}),...X.wrapper});return e("div",{...K,...T,"data-id":T?.uid,style:B,className:C,ref:Y,children:l(!Q||!Q.length,e("div",{children:O}),e("div",{className:G,style:D,children:e("div",{className:M,style:E,children:Q?.map((s,i)=>{let r=L({setting:H,builderProps:T,pageContext:_,key:i,type:"react"});return t("div",{"data-index":i,className:P,style:et,children:[e("div",{className:b,style:ee,children:e("span",{style:F,className:z,dangerouslySetInnerHTML:{__html:s}})}),e(o,{setting:{text:r?.toString(),htmlTag:"div",options:{useState:!0,uniqueId:`${T?.uid}-${i}-${Z}`,productID:Z,customClass:{wrapper:"gp-w-full"}}},styles:J,className:A,ref:R})]},i)})})}))})};export{IconListV2 as default};
2
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useGetProductId as s}from"../../hooks/useGetProductId.js";import o from"../../text/components/Text.js";import{createClass as i,createStyle as r,createAttr as m,If as l}from"@gem-sdk/system";import{getClassWraplistIcon as n,getClassColListIcon as a,getClassWrapItemIcon as c,getClassWrapIcon as d,getClassIcon as p,getClassTextItem as h}from"../common/classes.js";import{getStyleContainerIconlistMain as u,getStyleWraplistIcon as f,getStyleColListIcon as y,getStyleIcon as g,getStyleWrapIcon as j,getStyleWrapItemIcon as v,getStyleTypoText as N}from"../common/styles.js";import{getvalueMap as x,composePostionIconList as I,getTextIconTranslations as L,getTextIconNotFound as k,composeIconWith as w}from"../common/helpers.js";import{useIconLineHeight as S}from"../hooks/useIconLineHeight.js";let IconListV2=T=>{let{builderProps:W,builderAttrs:$,style:H,setting:V,styles:_,pageContext:q,advanced:C}=T,G=i({[W?.uid??""]:!0}),M=i(n()),P=i(a()),b=i(c({builderProps:W})),z=i(d()),A=i(p()),B=i(h({setting:V})),D=r(u({styles:_,style:H,type:"react",advanced:C})),E=r(f({styles:_})),F=r(y({styles:_})),J=r(g({styles:_,setting:V})),K=N({setting:V}),O=m({...$}),Q=k("react"),R=x({setting:V}),{ref:U,lineHeight:X}=S({iconWidth:w(V?.iconWidth)}),Y=I(X,_?.position,V?.iconWidth),{refContainer:Z,productID:ee}=s(),et=r({...j({styles:_,setting:V}),...Y.content}),es=r({...v({styles:_}),...Y.wrapper});return e("div",{...O,...W,"data-id":W?.uid,style:D,className:G,ref:Z,children:l(!R||!R.length,e("div",{children:Q}),e("div",{className:M,style:E,children:e("div",{className:P,style:F,children:R?.map((s,i)=>{let r=L({setting:V,builderProps:W,pageContext:q,key:i,type:"react"});return t("div",{"data-index":i,className:b,style:es,children:[e("div",{className:z,style:et,children:e("span",{style:J,className:A,dangerouslySetInnerHTML:{__html:s}})}),e(o,{setting:{text:r?.toString(),htmlTag:"div",options:{useState:!0,uniqueId:`${W?.uid}-${i}-${ee}`,productID:ee,customClass:{wrapper:"gp-w-full"}}},styles:K,className:B,ref:U})]},i)})})}))})};export{IconListV2 as default};
@@ -1 +1 @@
1
- import{useRef as e,useState as t,useEffect as r}from"react";let useIconLineHeight=({iconWidth:n})=>{let i=e(null),[o,l]=t("");return r(()=>{if(i?.current){let e=window.getComputedStyle(i?.current).getPropertyValue("line-height");l(e)}},[n?.desktop]),{ref:i,lineHeight:o}};export{useIconLineHeight};
1
+ import{useCurrentDevice as e}from"@gem-sdk/core";import{useRef as t,useState as r,useEffect as o}from"react";let useIconLineHeight=({iconWidth:i})=>{let n=t(null),[l,u]=r(""),c=e();return o(()=>{if(n?.current){let e=window.getComputedStyle(n?.current).getPropertyValue("line-height");u(e)}},[i,c]),{ref:n,lineHeight:l}};export{useIconLineHeight};
@@ -1 +1 @@
1
- let TabsSettings=[{id:"setting",controls:[{id:"childItem",label:"Tabs Item",type:"child-item",default:["Tab 1","Tab 2","Tab 3"]},{id:"activeKey",type:"select-custom-options",label:"Order",controlOption:"childItem",default:0},{id:"translate",type:"input",default:"childItem"},{id:"position",type:"layout-selector",label:"Layout",iconViewBox:"0 0 74 48",enableItemBackground:!0,itemPerRow:2,options:[{value:"top",label:"Top",iconName:"gp-tab-top"},{value:"left",label:"Left",iconName:"gp-tab-left"},{value:"right",label:"Right",iconName:"gp-tab-bottom"}],devices:{desktop:{default:"top"}}},{id:"group-header",label:"Tabs Header",type:"group",controls:[{id:"labelTypoV2",type:"typography-v2",default:{type:"paragraph-1",attrs:{color:"text-1"}},compoDefaultValue:{custom:{textShadow:{color:"rgba(18, 18, 18, 0.5)"}}},ignoreReRender:!0},{id:"panelFullWidth",label:"Full Width",type:"toggle",devices:{desktop:{default:!1}}},{id:"panelWidth",label:"Width",type:"dropdown:input",units:["px","%"],displayOptions:[{label:"Fit content",value:"Auto",showValue:!0},{label:"Full",value:"100%",showValue:!0}],devices:{desktop:{default:"Auto"}}},{id:"panelAlign",type:"option:value",label:"Alignment",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:"panelAlignVertical",type:"option:value",label:"Alignment",options:[{label:"Top",value:"start",type:"align",tooltip:"Align Top",iconName:"gp-align-top"},{label:"Center",value:"center",type:"align",tooltip:"Align center",iconName:"gp-align-center"},{label:"Bottom",value:"end",type:"align",tooltip:"Align Bottom",iconName:"gp-align-bottom"}],devices:{desktop:{default:"start"}}},{id:"labelWidth",label:"Width",type:"input:unit",units:["px","%"],devices:{desktop:{default:"auto"}}},{id:"padding",type:"padding-v2",devices:{desktop:{}}},{id:"labelAlign",type:"option:value",label:"Text alignment",options:[{label:"Left",value:"left",type:"text"},{label:"Center",value:"center",type:"text"},{label:"Right",value:"right",type:"text"}],devices:{desktop:{default:"left"}}}]},{id:"enableHoverEffect",label:"",type:"toggle",default:!1},{id:"enableActiveEffect",label:"",type:"toggle",default:!0},{id:"behavior-state-group",type:"behavior-state",controls:[{id:"labelBgColor",label:"Background Color",type:"color-picker-v2",default:{active:"bg-1"},compoDefaultValue:{normal:"bg-2",hover:"bg-2",active:"bg-1"}},{id:"labelColor",label:"Text Color",type:"color-picker-v2",default:{normal:"text-1"},compoDefaultValue:{normal:"text-1"}},{id:"borderTab",type:"border",label:"Border",default:{active:{border:"solid",width:"0px 0px 1px 0px",borderWidth:"1px",color:"line-3",position:"bottom",isCustom:!0}}}]},{id:"containWidth",type:"input:unit",placeholder:"Auto",units:["px","%"],devices:{desktop:{default:"100%"}}},{id:"background",type:"background-media",ignoreReRender:!0,devices:{desktop:{default:{type:"color",color:"transparent",image:{src:"",width:0,height:0},size:"cover",position:{x:50,y:50},repeat:"no-repeat",attachment:"scroll"}}},compoDefaultValue:{desktop:{default:{type:"color",color:"#DDDDDD",image:{src:"https://cdn.shopify.com/s/files/1/2005/9307/files/background_settings.jpg",width:1200,height:1200},size:"cover",position:{x:50,y:50},repeat:"no-repeat",attachment:"scroll"}}}},{id:"align",label:"Align",type:"option:value",options:[{label:"Left",value:"start",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:"end",type:"align",tooltip:"Align right",iconName:"gp-align-right"}],devices:{desktop:{default:"center"}}}]}];export{TabsSettings};
1
+ let TabsSettings=[{id:"setting",controls:[{id:"childItem",label:"Tabs Item",type:"child-item",default:["Tab 1","Tab 2","Tab 3"]},{id:"activeKey",type:"select-custom-options",label:"Order",controlOption:"childItem",default:0},{id:"translate",type:"input",default:"childItem"},{id:"position",type:"layout-selector",label:"Layout",iconViewBox:"0 0 74 48",enableItemBackground:!0,itemPerRow:2,options:[{value:"top",label:"Top",iconName:"gp-tab-top"},{value:"left",label:"Left",iconName:"gp-tab-left"},{value:"right",label:"Right",iconName:"gp-tab-bottom"}],devices:{desktop:{default:"top"}}},{id:"group-header",label:"Tabs Header",type:"group",controls:[{id:"labelTypoV2",type:"typography-v2",default:{type:"paragraph-1",attrs:{color:"text-1"}},compoDefaultValue:{custom:{textShadow:{angle:135,blur:"2px",distance:"2px",type:"custom",color:"rgba(18, 18, 18, 0.5)"}}},ignoreReRender:!0},{id:"panelFullWidth",label:"Full Width",type:"toggle",devices:{desktop:{default:!1}}},{id:"panelWidth",label:"Width",type:"dropdown:input",units:["px","%"],displayOptions:[{label:"Fit content",value:"Auto",showValue:!0},{label:"Full",value:"100%",showValue:!0}],devices:{desktop:{default:"Auto"}}},{id:"panelAlign",type:"option:value",label:"Alignment",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:"panelAlignVertical",type:"option:value",label:"Alignment",options:[{label:"Top",value:"start",type:"align",tooltip:"Align Top",iconName:"gp-align-top"},{label:"Center",value:"center",type:"align",tooltip:"Align center",iconName:"gp-align-center"},{label:"Bottom",value:"end",type:"align",tooltip:"Align Bottom",iconName:"gp-align-bottom"}],devices:{desktop:{default:"start"}}},{id:"labelWidth",label:"Width",type:"input:unit",units:["px","%"],devices:{desktop:{default:"auto"}}},{id:"padding",type:"padding-v2",devices:{desktop:{}}},{id:"labelAlign",type:"option:value",label:"Text alignment",options:[{label:"Left",value:"left",type:"text"},{label:"Center",value:"center",type:"text"},{label:"Right",value:"right",type:"text"}],devices:{desktop:{default:"left"}}}]},{id:"enableHoverEffect",label:"",type:"toggle",default:!1},{id:"enableActiveEffect",label:"",type:"toggle",default:!0},{id:"behavior-state-group",type:"behavior-state",controls:[{id:"labelBgColor",label:"Background Color",type:"color-picker-v2",default:{active:"bg-1"},compoDefaultValue:{normal:"bg-2",hover:"bg-2",active:"bg-1"}},{id:"labelColor",label:"Text Color",type:"color-picker-v2",default:{normal:"text-1"},compoDefaultValue:{normal:"text-1"}},{id:"borderTab",type:"border",label:"Border",default:{active:{border:"solid",width:"0px 0px 1px 0px",borderWidth:"1px",color:"line-3",position:"bottom",isCustom:!0}}}]},{id:"containWidth",type:"input:unit",placeholder:"Auto",units:["px","%"],devices:{desktop:{default:"100%"}}},{id:"background",type:"background-media",ignoreReRender:!0,devices:{desktop:{default:{type:"color",color:"transparent",image:{src:"",width:0,height:0},size:"cover",position:{x:50,y:50},repeat:"no-repeat",attachment:"scroll"}}},compoDefaultValue:{desktop:{default:{type:"color",color:"#DDDDDD",image:{src:"https://cdn.shopify.com/s/files/1/2005/9307/files/background_settings.jpg",width:1200,height:1200},size:"cover",position:{x:50,y:50},repeat:"no-repeat",attachment:"scroll"}}}},{id:"align",label:"Align",type:"option:value",options:[{label:"Left",value:"start",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:"end",type:"align",tooltip:"Align right",iconName:"gp-align-right"}],devices:{desktop:{default:"center"}}}]}];export{TabsSettings};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "3.1.1",
3
+ "version": "3.1.4",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -25,7 +25,7 @@
25
25
  "scan-all-text": "rollup -c ./scripts/rollup.config.settings.mjs && node ./scripts/scan-all-text && node ./scripts/scan-all-text"
26
26
  },
27
27
  "devDependencies": {
28
- "@gem-sdk/core": "3.1.0",
28
+ "@gem-sdk/core": "3.1.2",
29
29
  "@gem-sdk/styles": "3.1.0",
30
30
  "@gem-sdk/system": "3.1.0",
31
31
  "tsup": "^8.5.0",