@gem-sdk/core 1.14.0-dev.742 → 1.14.0-dev.743
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.
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
`},composeTypographyV2Css=(e,o)=>{let t=e?.custom,{fontFamily:p,fontSize:s,fontWeight:a,lineHeight:y,letterSpacing:l}=t??{},r=e?.attrs,{bold:i,italic:n,underline:g,transform:m}=r??{},c=o?"!important":"";return`
|
|
9
9
|
${p?`font-family: var(--g-font-${p}, ${p}) ${c};`:""}
|
|
10
10
|
${s?.desktop?`font-size: ${s?.desktop} ${c};`:""}
|
|
11
|
-
${i
|
|
11
|
+
${i?`font-weight: bold ${c};`:a?`font-weight: ${a} ${c};`:""}
|
|
12
12
|
${l?`letter-spacing: ${l} ${c};`:""}
|
|
13
13
|
${y?`line-height: ${y} ${c};`:""}
|
|
14
|
-
${n?`font-style: italic${c};`:""}
|
|
14
|
+
${n?`font-style: italic ${c};`:""}
|
|
15
15
|
${g?`text-decoration-line: underline ${c};`:""}
|
|
16
16
|
${m?`text-transform: ${m} ${c};`:""}
|
|
17
17
|
`};function getCustomCSSByDevice(e,o){if(!e||!o)return{};let t="desktop"!==o&&o?`-${o}`:"",{fontFamily:p}=e?.[o]??{};return{[`--size${t}`]:e?.[o]?.fontSize,[`--lh${t}`]:e?.[o]?.lineHeight,[`--fs${t}`]:e?.[o]?.fontStyle,[`--ff${t}`]:p?`var(--g-font-${p}, ${p})`:void 0,[`--weight${t}`]:e?.[o]?.fontWeight,[`--ls${t}`]:e?.[o]?.letterSpacing}}const composeTypography=e=>e?makeStyle.removeNullUndefined({...getCustomCSSByDevice(e,"desktop"),...getCustomCSSByDevice(e,"tablet"),...getCustomCSSByDevice(e,"mobile")}):{},composeTypographyV2=(e,o)=>e?makeStyle.removeNullUndefined({...makeStyle.makeStyle({fs:o?.italic?void 0:e?.fontStyle,ff:e?.fontFamily?`var(--g-font-${e.fontFamily.replace(/ /g,"-")}, '${e.fontFamily}'), ${e.fallbackFontFamily}`:void 0,weight:o?.bold?void 0:e?.fontWeight,ls:e?.letterSpacing,lh:e?.lineHeight}),...makeStyle.makeStyleResponsive("size",e?.fontSize)}):{},composeTypographyAttr=e=>e?makeStyle.removeNullUndefined({...makeStyle.makeStyle({fs:e?.italic?"italic":void 0,weight:e?.bold?"bold":void 0,c:colors.getSingleColorVariable(e?.color),tt:e?.transform,tdl:e?.underline?"underline":void 0})}):{},composeTypographyClassName=(e,o)=>e?e?.type&&!e.custom?genTypoClass(e.type):"":o?.type&&genTypoClass(o?.type),composeFallbackTypographyStyle=e=>["heading","heading-1","heading-2","heading-3","heading-4","heading-5","heading-6"].includes(e)?"var(--g-font-heading, heading)":"var(--g-font-body, body)",composeTypographyStyle=(e,o,t)=>{if(e){let o=composeFallbackTypographyStyle(e.type??"heading"),p={...e.custom,fallbackFontFamily:o};return{...composeTypographyV2(p,e.attrs),...!t&&composeTypographyAttr(e.attrs)}}return{...o?.type?{}:composeTypography(o?.custom)}};exports.composeFallbackTypographyStyle=composeFallbackTypographyStyle,exports.composeTypography=composeTypography,exports.composeTypographyAttr=composeTypographyAttr,exports.composeTypographyClassName=composeTypographyClassName,exports.composeTypographyCss=composeTypographyCss,exports.composeTypographyStyle=composeTypographyStyle,exports.composeTypographyV2=composeTypographyV2,exports.composeTypographyV2Css=composeTypographyV2Css,exports.genTypoClass=genTypoClass;
|
|
@@ -5,13 +5,13 @@ import{getSingleColorVariable as o}from"./colors.js";import{removeNullUndefined
|
|
|
5
5
|
${s?`font-weight: ${s};`:""}
|
|
6
6
|
${y?`letter-spacing: ${y};`:""}
|
|
7
7
|
${i?`line-height: ${i};`:""}
|
|
8
|
-
`},composeTypographyV2Css=(o,e)=>{let t=o?.custom,{fontFamily:p,fontSize:a,fontWeight:s,lineHeight:i,letterSpacing:y}=t??{},l=o?.attrs,{bold:n,italic:r,underline:g,transform
|
|
9
|
-
${p?`font-family: var(--g-font-${p}, ${p}) ${
|
|
10
|
-
${a?.desktop?`font-size: ${a?.desktop} ${
|
|
11
|
-
${n
|
|
12
|
-
${y?`letter-spacing: ${y} ${
|
|
13
|
-
${i?`line-height: ${i} ${
|
|
14
|
-
${r?`font-style: italic${
|
|
15
|
-
${g?`text-decoration-line: underline ${
|
|
16
|
-
${
|
|
8
|
+
`},composeTypographyV2Css=(o,e)=>{let t=o?.custom,{fontFamily:p,fontSize:a,fontWeight:s,lineHeight:i,letterSpacing:y}=t??{},l=o?.attrs,{bold:n,italic:r,underline:g,transform:$}=l??{},c=e?"!important":"";return`
|
|
9
|
+
${p?`font-family: var(--g-font-${p}, ${p}) ${c};`:""}
|
|
10
|
+
${a?.desktop?`font-size: ${a?.desktop} ${c};`:""}
|
|
11
|
+
${n?`font-weight: bold ${c};`:s?`font-weight: ${s} ${c};`:""}
|
|
12
|
+
${y?`letter-spacing: ${y} ${c};`:""}
|
|
13
|
+
${i?`line-height: ${i} ${c};`:""}
|
|
14
|
+
${r?`font-style: italic ${c};`:""}
|
|
15
|
+
${g?`text-decoration-line: underline ${c};`:""}
|
|
16
|
+
${$?`text-transform: ${$} ${c};`:""}
|
|
17
17
|
`};function getCustomCSSByDevice(o,e){if(!o||!e)return{};let t="desktop"!==e&&e?`-${e}`:"",{fontFamily:p}=o?.[e]??{};return{[`--size${t}`]:o?.[e]?.fontSize,[`--lh${t}`]:o?.[e]?.lineHeight,[`--fs${t}`]:o?.[e]?.fontStyle,[`--ff${t}`]:p?`var(--g-font-${p}, ${p})`:void 0,[`--weight${t}`]:o?.[e]?.fontWeight,[`--ls${t}`]:o?.[e]?.letterSpacing}}let composeTypography=o=>o?e({...getCustomCSSByDevice(o,"desktop"),...getCustomCSSByDevice(o,"tablet"),...getCustomCSSByDevice(o,"mobile")}):{},composeTypographyV2=(o,a)=>o?e({...t({fs:a?.italic?void 0:o?.fontStyle,ff:o?.fontFamily?`var(--g-font-${o.fontFamily.replace(/ /g,"-")}, '${o.fontFamily}'), ${o.fallbackFontFamily}`:void 0,weight:a?.bold?void 0:o?.fontWeight,ls:o?.letterSpacing,lh:o?.lineHeight}),...p("size",o?.fontSize)}):{},composeTypographyAttr=p=>p?e({...t({fs:p?.italic?"italic":void 0,weight:p?.bold?"bold":void 0,c:o(p?.color),tt:p?.transform,tdl:p?.underline?"underline":void 0})}):{},composeTypographyClassName=(o,e)=>o?o?.type&&!o.custom?genTypoClass(o.type):"":e?.type&&genTypoClass(e?.type),composeFallbackTypographyStyle=o=>["heading","heading-1","heading-2","heading-3","heading-4","heading-5","heading-6"].includes(o)?"var(--g-font-heading, heading)":"var(--g-font-body, body)",composeTypographyStyle=(o,e,t)=>{if(o){let e=composeFallbackTypographyStyle(o.type??"heading"),p={...o.custom,fallbackFontFamily:e};return{...composeTypographyV2(p,o.attrs),...!t&&composeTypographyAttr(o.attrs)}}return{...e?.type?{}:composeTypography(e?.custom)}};export{composeFallbackTypographyStyle,composeTypography,composeTypographyAttr,composeTypographyClassName,composeTypographyCss,composeTypographyStyle,composeTypographyV2,composeTypographyV2Css,genTypoClass};
|