@gem-sdk/components 3.1.0-staging.1146 → 3.1.0-staging.1147

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 getWrapperStyleActive=e=>{let{preset:o,optionTypography:t,optionTypo:r,typeOfOption:l}=e,a=o?.optionBgColor,p=o?.optionTextColor,i=o?.optionBorder,c=o?.optionHasShadow,d=o?.optionShadow,n=o?.optionRounded,h="color"===l,s="image"===l||"image_shopify"===l,g=core.composeTypographyStyle(r,t),y=e=>{let o=a?.active??a?.normal,t=i?.active??i?.normal;return core.makeStyle({bg:e&&core.getSingleColorVariable(o),bs:t?.border,bw:t?.width,bc:core.getSingleColorVariable(t?.color)})},S=d?.active??d?.normal,b=c?.active??c?.normal,m=p?.active??p?.normal;return helpers.filterTruthyObject({...y(!h),...core.getRadiusStyleActiveState(n),...core.getStyleShadow({value:S,state:"active",styleAppliedFor:"box-shadow",isEnableShadow:b},!0),...g,...!h&&!s&&core.makeStyle({c:core.getSingleColorVariable(m)}),...core.makeStyle({h:o?.height})})},getWrapperStyleNormalAndHover=e=>{let{preset:o,optionTransform:t,optionTypography:r,optionTypo:l,typeOfOption:a}=e,p=o?.optionBgColor,i=o?.optionTextColor,c=o?.optionBorder,d=o?.optionHasShadow,n=o?.optionShadow,h=o?.optionRounded,s="color"===a,g="image"===a||"image_shopify"===a,y=core.composeTypographyStyle(l,r),S=["normal","hover"].reduce((e,o)=>({...e,...core.getStyleShadow({value:n?.[o],state:o,styleAppliedFor:"box-shadow",isEnableShadow:d?.[o]})}),{});return helpers.filterTruthyObject({...core.composeRadius(h),...S,...!s&&core.getGlobalColorStateStyle("bg",p),...!s&&core.handleConvertBorderStyle(c),...!s&&core.handleConvertBorderWidth(c),...!s&&core.handleConvertBorderColor(c),...!s&&!g&&core.makeStyle({c:t}),...!s&&!g&&core.getGlobalColorStateStyle("c",i),...y,...core.makeStyle({h:o?.height})})},getWrapperTextStyle=e=>{let{preset:o,typeOfOption:t,checked:r}=e,l=o?.optionBorder,a=o?.optionRounded,p="color"===t,i=()=>{let e="16px",t={"--pl":"0px","--pr":"0px","--pl-tablet":"0px","--pr-tablet":"0px","--pl-mobile":"0px","--pr-mobile":"0px","--pt":"0px","--pb":"0px"};return o?.width?.desktop?.toLowerCase()!=="auto"&&o?.width?.desktop||(t["--pl"]=e,t["--pr"]=e),o?.width?.tablet?.toLowerCase()!=="auto"&&o?.width?.tablet||(t["--pl-tablet"]=e,t["--pr-tablet"]=e),o?.width?.mobile?.toLowerCase()!=="auto"&&o?.width?.mobile||(t["--pl-mobile"]=e,t["--pr-mobile"]=e),(o?.height?.toLowerCase()==="auto"||o?.height)&&(t["--pt"]="8px",t["--pb"]="8px"),t},c={...a,active:{...a?.active||{},radiusType:"custom"}},d=r?core.getRadiusStyleActiveState(c):core.composeRadius(a),n=!r&&p?{...core.handleConvertBorderStyle(l),...core.handleConvertBorderWidth(l),...core.handleConvertBorderColor(l)}:{};return helpers.filterTruthyObject({...!p&&i(),...p&&d,...n})},getColorStyle=({optionBorder:e,optionRounded:o,isActive:t,color:r})=>{let l=()=>r?r?.startsWith("linear-gradient")?{backgroundImage:r}:{backgroundColor:r}:{},a=o=>o?{"--bs":"none"}:core.handleConvertBorderStyle(e),p=t=>({"--d":"flex","--jc":"center"," --ai":"center","--w":"100%","--h":"100%","--of":"hidden",...a(t),...core.handleConvertBorderWidth(e),...core.handleConvertBorderColor(e),...core.composeRadius(o),...l()});return p(!!t)},getTextStyle=({optionTypo:e,optionTypography:o})=>{let t=core.composeTypographyStyle(e,o);return delete t["--c"],helpers.filterTruthyObject({...t})};exports.getColorStyle=getColorStyle,exports.getTextStyle=getTextStyle,exports.getWrapperStyleActive=getWrapperStyleActive,exports.getWrapperStyleNormalAndHover=getWrapperStyleNormalAndHover,exports.getWrapperTextStyle=getWrapperTextStyle;
1
+ "use strict";var core=require("@gem-sdk/core"),helpers=require("../../../../../helpers.js");const getColorStyleWidth=e=>{let t=e?.height||"32px",o=e?.width||{desktop:t},r=Object.fromEntries(Object.entries(o).map(([e,o])=>{let r=o&&"undefined"!==o&&"auto"!==o?o:t;return[e,r]}));return core.makeStyleResponsive("minw",r)},getWrapperStyleActive=e=>{let{preset:t,optionTypography:o,optionTypo:r,typeOfOption:l}=e,a=t?.optionBgColor,p=t?.optionTextColor,i=t?.optionBorder,d=t?.optionHasShadow,c=t?.optionShadow,n=t?.optionRounded,h="color"===l,s="image"===l||"image_shopify"===l,g=core.composeTypographyStyle(r,o),y=e=>{let t=a?.active??a?.normal,o=i?.active??i?.normal;return core.makeStyle({bg:e&&core.getSingleColorVariable(t),bs:o?.border,bw:o?.width,bc:core.getSingleColorVariable(o?.color)})},S=c?.active??c?.normal,b=d?.active??d?.normal,m=p?.active??p?.normal;return helpers.filterTruthyObject({...y(!h),...core.getRadiusStyleActiveState(n),...core.getStyleShadow({value:S,state:"active",styleAppliedFor:"box-shadow",isEnableShadow:b},!0),...g,...!h&&!s&&core.makeStyle({c:core.getSingleColorVariable(m)}),...h&&getColorStyleWidth(t),...core.makeStyle({h:t?.height})})},getWrapperStyleNormalAndHover=e=>{let{preset:t,optionTransform:o,optionTypography:r,optionTypo:l,typeOfOption:a}=e,p=t?.optionBgColor,i=t?.optionTextColor,d=t?.optionBorder,c=t?.optionHasShadow,n=t?.optionShadow,h=t?.optionRounded,s="color"===a,g="image"===a||"image_shopify"===a,y=core.composeTypographyStyle(l,r),S=["normal","hover"].reduce((e,t)=>({...e,...core.getStyleShadow({value:n?.[t],state:t,styleAppliedFor:"box-shadow",isEnableShadow:c?.[t]})}),{});return helpers.filterTruthyObject({...core.composeRadius(h),...S,...!s&&core.getGlobalColorStateStyle("bg",p),...!s&&core.handleConvertBorderStyle(d),...!s&&core.handleConvertBorderWidth(d),...!s&&core.handleConvertBorderColor(d),...!s&&!g&&core.makeStyle({c:o}),...!s&&!g&&core.getGlobalColorStateStyle("c",i),...y,...s&&getColorStyleWidth(t),...core.makeStyle({h:t?.height})})},getWrapperTextStyle=e=>{let{preset:t,typeOfOption:o,checked:r}=e,l=t?.optionBorder,a=t?.optionRounded,p="color"===o,i=()=>{let e="16px",o={"--pl":"0px","--pr":"0px","--pl-tablet":"0px","--pr-tablet":"0px","--pl-mobile":"0px","--pr-mobile":"0px","--pt":"0px","--pb":"0px"};return t?.width?.desktop?.toLowerCase()!=="auto"&&t?.width?.desktop||(o["--pl"]=e,o["--pr"]=e),t?.width?.tablet?.toLowerCase()!=="auto"&&t?.width?.tablet||(o["--pl-tablet"]=e,o["--pr-tablet"]=e),t?.width?.mobile?.toLowerCase()!=="auto"&&t?.width?.mobile||(o["--pl-mobile"]=e,o["--pr-mobile"]=e),(t?.height?.toLowerCase()==="auto"||t?.height)&&(o["--pt"]="8px",o["--pb"]="8px"),o},d={...a,active:{...a?.active||{},radiusType:"custom"}},c=r?core.getRadiusStyleActiveState(d):core.composeRadius(a),n=!r&&p?{...core.handleConvertBorderStyle(l),...core.handleConvertBorderWidth(l),...core.handleConvertBorderColor(l)}:{};return helpers.filterTruthyObject({...!p&&i(),...p&&c,...n})},getColorStyle=({optionBorder:e,optionRounded:t,isActive:o,color:r})=>{let l=()=>r?r?.startsWith("linear-gradient")?{backgroundImage:r}:{backgroundColor:r}:{},a=t=>t?{"--bs":"none"}:core.handleConvertBorderStyle(e),p=o=>({"--d":"flex","--jc":"center"," --ai":"center","--w":"100%","--h":"100%","--of":"hidden",...a(o),...core.handleConvertBorderWidth(e),...core.handleConvertBorderColor(e),...core.composeRadius(t),...l()});return p(!!o)},getTextStyle=({optionTypo:e,optionTypography:t})=>{let o=core.composeTypographyStyle(e,t);return delete o["--c"],helpers.filterTruthyObject({...o})};exports.getColorStyle=getColorStyle,exports.getTextStyle=getTextStyle,exports.getWrapperStyleActive=getWrapperStyleActive,exports.getWrapperStyleNormalAndHover=getWrapperStyleNormalAndHover,exports.getWrapperTextStyle=getWrapperTextStyle;
@@ -1 +1 @@
1
- import{composeTypographyStyle as e,getRadiusStyleActiveState as t,getStyleShadow as o,makeStyle as r,getSingleColorVariable as l,composeRadius as p,getGlobalColorStateStyle as a,handleConvertBorderStyle as i,handleConvertBorderWidth as n,handleConvertBorderColor as d}from"@gem-sdk/core";import{filterTruthyObject as h}from"../../../../../helpers.js";let getWrapperStyleActive=p=>{let{preset:a,optionTypography:i,optionTypo:n,typeOfOption:d}=p,c=a?.optionBgColor,b=a?.optionTextColor,g=a?.optionBorder,s=a?.optionHasShadow,m=a?.optionShadow,u=a?.optionRounded,w="color"===d,x="image"===d||"image_shopify"===d,S=e(n,i),v=e=>{let t=c?.active??c?.normal,o=g?.active??g?.normal;return r({bg:e&&l(t),bs:o?.border,bw:o?.width,bc:l(o?.color)})},y=m?.active??m?.normal,C=s?.active??s?.normal,T=b?.active??b?.normal;return h({...v(!w),...t(u),...o({value:y,state:"active",styleAppliedFor:"box-shadow",isEnableShadow:C},!0),...S,...!w&&!x&&r({c:l(T)}),...r({h:a?.height})})},getWrapperStyleNormalAndHover=t=>{let{preset:l,optionTransform:c,optionTypography:b,optionTypo:g,typeOfOption:s}=t,m=l?.optionBgColor,u=l?.optionTextColor,w=l?.optionBorder,x=l?.optionHasShadow,S=l?.optionShadow,v=l?.optionRounded,y="color"===s,C="image"===s||"image_shopify"===s,T=e(g,b),W=["normal","hover"].reduce((e,t)=>({...e,...o({value:S?.[t],state:t,styleAppliedFor:"box-shadow",isEnableShadow:x?.[t]})}),{});return h({...p(v),...W,...!y&&a("bg",m),...!y&&i(w),...!y&&n(w),...!y&&d(w),...!y&&!C&&r({c:c}),...!y&&!C&&a("c",u),...T,...r({h:l?.height})})},getWrapperTextStyle=e=>{let{preset:o,typeOfOption:r,checked:l}=e,a=o?.optionBorder,c=o?.optionRounded,b="color"===r,g=()=>{let e="16px",t={"--pl":"0px","--pr":"0px","--pl-tablet":"0px","--pr-tablet":"0px","--pl-mobile":"0px","--pr-mobile":"0px","--pt":"0px","--pb":"0px"};return o?.width?.desktop?.toLowerCase()!=="auto"&&o?.width?.desktop||(t["--pl"]=e,t["--pr"]=e),o?.width?.tablet?.toLowerCase()!=="auto"&&o?.width?.tablet||(t["--pl-tablet"]=e,t["--pr-tablet"]=e),o?.width?.mobile?.toLowerCase()!=="auto"&&o?.width?.mobile||(t["--pl-mobile"]=e,t["--pr-mobile"]=e),(o?.height?.toLowerCase()==="auto"||o?.height)&&(t["--pt"]="8px",t["--pb"]="8px"),t},s={...c,active:{...c?.active||{},radiusType:"custom"}},m=l?t(s):p(c),u=!l&&b?{...i(a),...n(a),...d(a)}:{};return h({...!b&&g(),...b&&m,...u})},getColorStyle=({optionBorder:e,optionRounded:t,isActive:o,color:r})=>{let l=()=>r?r?.startsWith("linear-gradient")?{backgroundImage:r}:{backgroundColor:r}:{},a=t=>t?{"--bs":"none"}:i(e),h=o=>({"--d":"flex","--jc":"center"," --ai":"center","--w":"100%","--h":"100%","--of":"hidden",...a(o),...n(e),...d(e),...p(t),...l()});return h(!!o)},getTextStyle=({optionTypo:t,optionTypography:o})=>{let r=e(t,o);return delete r["--c"],h({...r})};export{getColorStyle,getTextStyle,getWrapperStyleActive,getWrapperStyleNormalAndHover,getWrapperTextStyle};
1
+ import{composeTypographyStyle as e,getRadiusStyleActiveState as t,getStyleShadow as o,makeStyle as r,getSingleColorVariable as l,composeRadius as p,getGlobalColorStateStyle as i,handleConvertBorderStyle as a,handleConvertBorderWidth as n,handleConvertBorderColor as d,makeStyleResponsive as h}from"@gem-sdk/core";import{filterTruthyObject as c}from"../../../../../helpers.js";let getColorStyleWidth=e=>{let t=e?.height||"32px",o=e?.width||{desktop:t},r=Object.fromEntries(Object.entries(o).map(([e,o])=>{let r=o&&"undefined"!==o&&"auto"!==o?o:t;return[e,r]}));return h("minw",r)},getWrapperStyleActive=p=>{let{preset:i,optionTypography:a,optionTypo:n,typeOfOption:d}=p,h=i?.optionBgColor,g=i?.optionTextColor,b=i?.optionBorder,s=i?.optionHasShadow,m=i?.optionShadow,u=i?.optionRounded,w="color"===d,x="image"===d||"image_shopify"===d,S=e(n,a),y=e=>{let t=h?.active??h?.normal,o=b?.active??b?.normal;return r({bg:e&&l(t),bs:o?.border,bw:o?.width,bc:l(o?.color)})},v=m?.active??m?.normal,C=s?.active??s?.normal,W=g?.active??g?.normal;return c({...y(!w),...t(u),...o({value:v,state:"active",styleAppliedFor:"box-shadow",isEnableShadow:C},!0),...S,...!w&&!x&&r({c:l(W)}),...w&&getColorStyleWidth(i),...r({h:i?.height})})},getWrapperStyleNormalAndHover=t=>{let{preset:l,optionTransform:h,optionTypography:g,optionTypo:b,typeOfOption:s}=t,m=l?.optionBgColor,u=l?.optionTextColor,w=l?.optionBorder,x=l?.optionHasShadow,S=l?.optionShadow,y=l?.optionRounded,v="color"===s,C="image"===s||"image_shopify"===s,W=e(b,g),f=["normal","hover"].reduce((e,t)=>({...e,...o({value:S?.[t],state:t,styleAppliedFor:"box-shadow",isEnableShadow:x?.[t]})}),{});return c({...p(y),...f,...!v&&i("bg",m),...!v&&a(w),...!v&&n(w),...!v&&d(w),...!v&&!C&&r({c:h}),...!v&&!C&&i("c",u),...W,...v&&getColorStyleWidth(l),...r({h:l?.height})})},getWrapperTextStyle=e=>{let{preset:o,typeOfOption:r,checked:l}=e,i=o?.optionBorder,h=o?.optionRounded,g="color"===r,b=()=>{let e="16px",t={"--pl":"0px","--pr":"0px","--pl-tablet":"0px","--pr-tablet":"0px","--pl-mobile":"0px","--pr-mobile":"0px","--pt":"0px","--pb":"0px"};return o?.width?.desktop?.toLowerCase()!=="auto"&&o?.width?.desktop||(t["--pl"]=e,t["--pr"]=e),o?.width?.tablet?.toLowerCase()!=="auto"&&o?.width?.tablet||(t["--pl-tablet"]=e,t["--pr-tablet"]=e),o?.width?.mobile?.toLowerCase()!=="auto"&&o?.width?.mobile||(t["--pl-mobile"]=e,t["--pr-mobile"]=e),(o?.height?.toLowerCase()==="auto"||o?.height)&&(t["--pt"]="8px",t["--pb"]="8px"),t},s={...h,active:{...h?.active||{},radiusType:"custom"}},m=l?t(s):p(h),u=!l&&g?{...a(i),...n(i),...d(i)}:{};return c({...!g&&b(),...g&&m,...u})},getColorStyle=({optionBorder:e,optionRounded:t,isActive:o,color:r})=>{let l=()=>r?r?.startsWith("linear-gradient")?{backgroundImage:r}:{backgroundColor:r}:{},i=t=>t?{"--bs":"none"}:a(e),h=o=>({"--d":"flex","--jc":"center"," --ai":"center","--w":"100%","--h":"100%","--of":"hidden",...i(o),...n(e),...d(e),...p(t),...l()});return h(!!o)},getTextStyle=({optionTypo:t,optionTypography:o})=>{let r=e(t,o);return delete r["--c"],c({...r})};export{getColorStyle,getTextStyle,getWrapperStyleActive,getWrapperStyleNormalAndHover,getWrapperTextStyle};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "3.1.0-staging.1146",
3
+ "version": "3.1.0-staging.1147",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",