@gem-sdk/components 3.1.4 → 3.1.5

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");function filterTruthyStyles(e){return Object.fromEntries(Object.entries(e||{}).filter(([,e])=>!!e))}const getStyle=(e,t)=>{let o={...core.makeStyle({mr:e?.spacing,mb:e?.spacing}),...core.makeStyleResponsive("ta",e?.align),...t,"--dynamic-source-color":"#F4F4F4"};return filterTruthyStyles(o)},getContainerStyle=(e,t)=>{let{tagWidth:o}=t??{},r={...core.makeStyleResponsive("jc",e?.align),...o};return filterTruthyStyles(r)},getTextStyle=(e,t)=>{let o=core.makeGlobalSize(t?.globalSize),r=[e?.lineThrough&&"line-through",e?.typo?.attrs?.underline&&"underline"].filter(Boolean),l={...o?.width?.["--w"]?o.width:{"--w":"100%"},...core.makeStyle({tdc:core.getSingleColorVariable(e?.lineColor?.normal),tdt:helpers.formatThickness(e?.thickness)}),...core.composeBorderResponsive(e?.shapeBorder),...core.composeRadiusResponsive(e?.shapeRounded),...core.getResponsiveStyleShadowWithoutState(e?.shapeBoxShadow,"box-shadow",e?.shapeBoxShadow),...core.getStyleShadow({value:e?.typo?.custom?.textShadow,styleAppliedFor:"text-shadow",isEnableShadow:e?.typo?.custom?.hasShadowText}),...core.makeStyleResponsive("ta",e?.textAlign),...core.makeStyleResponsive("line-clamp",core.makeLineClamp(e?.lineClamp,e?.hasLineClamp)),...e?.textColor?core.getGlobalColorStyle(e.textColor):core.getGlobalColorStateStyle("c",e?.color),...core.composeTypographyStyle(e?.typo),"word-break":"break-word",...core.getStyleBackgroundByDevice(t?.background),...o.padding,...core.getGradientBgrStyleByDevice(t?.background,{desktop:!0,tablet:!0,mobile:!0}),overflow:"hidden",...e?.opacityPrice&&{opacity:`${e?.opacityPrice}%`},...core.makeStyle({tdl:r.join(" ")})};return e?.enableHoverEffect?filterTruthyStyles(l):core.filterHoverVariables(l)},getTextStyleInline=e=>{let t={...core.composeTypographyStyle(e?.typo),"word-break":"break-word",overflow:"hidden"};return filterTruthyStyles(t)};exports.getContainerStyle=getContainerStyle,exports.getStyle=getStyle,exports.getTextStyle=getTextStyle,exports.getTextStyleInline=getTextStyleInline;
1
+ "use strict";var core=require("@gem-sdk/core"),helpers=require("./helpers.js");function filterTruthyStyles(e){return Object.fromEntries(Object.entries(e||{}).filter(([,e])=>!!e))}const getStyle=(e,t)=>{let o={...core.makeStyle({mr:e?.spacing,mb:e?.spacing}),...core.makeStyleResponsive("ta",e?.align),...t,"--dynamic-source-color":"#F4F4F4"};return filterTruthyStyles(o)},getContainerStyle=(e,t)=>{let{tagWidth:o}=t??{},r={...core.makeStyleResponsive("jc",e?.align),...o};return filterTruthyStyles(r)},getTextStyle=(e,t)=>{let o=core.makeGlobalSize(t?.globalSize),r=[e?.lineThrough&&"line-through",e?.typo?.attrs?.underline&&"underline"].filter(Boolean),l={...o?.width?.["--w"]?o.width:{"--w":"100%"},...core.makeStyle({tdc:core.getSingleColorVariable(e?.lineColor?.normal),tdt:helpers.formatThickness(e?.thickness)}),...core.composeBorderResponsive(e?.shapeBorder),...core.composeRadiusResponsive(e?.shapeRounded),...core.getResponsiveStyleShadowWithoutState(e?.shapeBoxShadow,"box-shadow",e?.shapeBoxShadow),...core.getStyleShadow({value:e?.typo?.custom?.textShadow,styleAppliedFor:"text-shadow",isEnableShadow:e?.typo?.custom?.hasShadowText}),...core.makeStyleResponsive("ta",e?.textAlign),...core.makeStyleResponsive("line-clamp",core.makeLineClamp(e?.lineClamp,e?.hasLineClamp)),...e?.textColor?core.getGlobalColorStyle(e.textColor):core.getGlobalColorStateStyle("c",e?.color),...core.composeTypographyStyle(e?.typo,e?.typography),"word-break":"break-word",...core.getStyleBackgroundByDevice(t?.background),...o.padding,...core.getGradientBgrStyleByDevice(t?.background,{desktop:!0,tablet:!0,mobile:!0}),overflow:"hidden",...e?.opacityPrice&&{opacity:`${e?.opacityPrice}%`},...core.makeStyle({tdl:r.join(" ")})};return e?.enableHoverEffect?filterTruthyStyles(l):core.filterHoverVariables(l)},getTextStyleInline=e=>{let t={...core.composeTypographyStyle(e?.typo),"word-break":"break-word",overflow:"hidden"};return filterTruthyStyles(t)};exports.getContainerStyle=getContainerStyle,exports.getStyle=getStyle,exports.getTextStyle=getTextStyle,exports.getTextStyleInline=getTextStyleInline;
@@ -1 +1 @@
1
- import{makeStyle as e,makeStyleResponsive as t,makeGlobalSize as r,getSingleColorVariable as o,composeBorderResponsive as l,composeRadiusResponsive as i,getResponsiveStyleShadowWithoutState as n,getStyleShadow as a,makeLineClamp as d,getGlobalColorStyle as s,getGlobalColorStateStyle as h,composeTypographyStyle as y,getStyleBackgroundByDevice as c,getGradientBgrStyleByDevice as p,filterHoverVariables as u}from"@gem-sdk/core";import{formatThickness as g}from"./helpers.js";function filterTruthyStyles(e){return Object.fromEntries(Object.entries(e||{}).filter(([,e])=>!!e))}let getStyle=(r,o)=>{let l={...e({mr:r?.spacing,mb:r?.spacing}),...t("ta",r?.align),...o,"--dynamic-source-color":"#F4F4F4"};return filterTruthyStyles(l)},getContainerStyle=(e,r)=>{let{tagWidth:o}=r??{},l={...t("jc",e?.align),...o};return filterTruthyStyles(l)},getTextStyle=(S,w)=>{let m=r(w?.globalSize),b=[S?.lineThrough&&"line-through",S?.typo?.attrs?.underline&&"underline"].filter(Boolean),f={...m?.width?.["--w"]?m.width:{"--w":"100%"},...e({tdc:o(S?.lineColor?.normal),tdt:g(S?.thickness)}),...l(S?.shapeBorder),...i(S?.shapeRounded),...n(S?.shapeBoxShadow,"box-shadow",S?.shapeBoxShadow),...a({value:S?.typo?.custom?.textShadow,styleAppliedFor:"text-shadow",isEnableShadow:S?.typo?.custom?.hasShadowText}),...t("ta",S?.textAlign),...t("line-clamp",d(S?.lineClamp,S?.hasLineClamp)),...S?.textColor?s(S.textColor):h("c",S?.color),...y(S?.typo),"word-break":"break-word",...c(w?.background),...m.padding,...p(w?.background,{desktop:!0,tablet:!0,mobile:!0}),overflow:"hidden",...S?.opacityPrice&&{opacity:`${S?.opacityPrice}%`},...e({tdl:b.join(" ")})};return S?.enableHoverEffect?filterTruthyStyles(f):u(f)},getTextStyleInline=e=>{let t={...y(e?.typo),"word-break":"break-word",overflow:"hidden"};return filterTruthyStyles(t)};export{getContainerStyle,getStyle,getTextStyle,getTextStyleInline};
1
+ import{makeStyle as e,makeStyleResponsive as t,makeGlobalSize as r,getSingleColorVariable as o,composeBorderResponsive as l,composeRadiusResponsive as i,getResponsiveStyleShadowWithoutState as n,getStyleShadow as a,makeLineClamp as d,getGlobalColorStyle as y,getGlobalColorStateStyle as h,composeTypographyStyle as s,getStyleBackgroundByDevice as p,getGradientBgrStyleByDevice as c,filterHoverVariables as u}from"@gem-sdk/core";import{formatThickness as g}from"./helpers.js";function filterTruthyStyles(e){return Object.fromEntries(Object.entries(e||{}).filter(([,e])=>!!e))}let getStyle=(r,o)=>{let l={...e({mr:r?.spacing,mb:r?.spacing}),...t("ta",r?.align),...o,"--dynamic-source-color":"#F4F4F4"};return filterTruthyStyles(l)},getContainerStyle=(e,r)=>{let{tagWidth:o}=r??{},l={...t("jc",e?.align),...o};return filterTruthyStyles(l)},getTextStyle=(S,w)=>{let m=r(w?.globalSize),b=[S?.lineThrough&&"line-through",S?.typo?.attrs?.underline&&"underline"].filter(Boolean),f={...m?.width?.["--w"]?m.width:{"--w":"100%"},...e({tdc:o(S?.lineColor?.normal),tdt:g(S?.thickness)}),...l(S?.shapeBorder),...i(S?.shapeRounded),...n(S?.shapeBoxShadow,"box-shadow",S?.shapeBoxShadow),...a({value:S?.typo?.custom?.textShadow,styleAppliedFor:"text-shadow",isEnableShadow:S?.typo?.custom?.hasShadowText}),...t("ta",S?.textAlign),...t("line-clamp",d(S?.lineClamp,S?.hasLineClamp)),...S?.textColor?y(S.textColor):h("c",S?.color),...s(S?.typo,S?.typography),"word-break":"break-word",...p(w?.background),...m.padding,...c(w?.background,{desktop:!0,tablet:!0,mobile:!0}),overflow:"hidden",...S?.opacityPrice&&{opacity:`${S?.opacityPrice}%`},...e({tdl:b.join(" ")})};return S?.enableHoverEffect?filterTruthyStyles(f):u(f)},getTextStyleInline=e=>{let t={...s(e?.typo),"word-break":"break-word",overflow:"hidden"};return filterTruthyStyles(t)};export{getContainerStyle,getStyle,getTextStyle,getTextStyleInline};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "3.1.4",
3
+ "version": "3.1.5",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",