@gem-sdk/components 2.0.0-staging.989 → 2.0.0-staging.990
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=t=>({"--d":"flex","--jc":"center"," --ai":"center","--w":"100%","--h":"100%","--of":"hidden"
|
|
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 +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
|
|
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};
|