@gem-sdk/core 1.14.0-dev.794 → 1.14.0-dev.796
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.
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
${s?.desktop?`font-size: ${s?.desktop} ${c};`:""}
|
|
11
11
|
${i?`font-weight: bold ${c};`:a?`font-weight: ${a} ${c};`:""}
|
|
12
12
|
${l?`letter-spacing: ${l} ${c};`:""}
|
|
13
|
-
${y?`line-height: ${y} ${c};`:""}
|
|
13
|
+
${y?.desktop?`line-height: ${y?.desktop} ${c};`:""}
|
|
14
14
|
${n?`font-style: italic ${c};`:""}
|
|
15
15
|
${g?`text-decoration-line: underline ${c};`:""}
|
|
16
16
|
${m?`text-transform: ${m} ${c};`:""}
|
|
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
|
|
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}),...makeStyle.makeStyleResponsive("size",e?.fontSize),...makeStyle.makeStyleResponsive("lh",e?.lineHeight)}):{},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;
|
|
@@ -10,8 +10,8 @@ import{getSingleColorVariable as o}from"./colors.js";import{removeNullUndefined
|
|
|
10
10
|
${a?.desktop?`font-size: ${a?.desktop} ${c};`:""}
|
|
11
11
|
${n?`font-weight: bold ${c};`:s?`font-weight: ${s} ${c};`:""}
|
|
12
12
|
${y?`letter-spacing: ${y} ${c};`:""}
|
|
13
|
-
${i?`line-height: ${i} ${c};`:""}
|
|
13
|
+
${i?.desktop?`line-height: ${i?.desktop} ${c};`:""}
|
|
14
14
|
${r?`font-style: italic ${c};`:""}
|
|
15
15
|
${g?`text-decoration-line: underline ${c};`:""}
|
|
16
16
|
${$?`text-transform: ${$} ${c};`:""}
|
|
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
|
|
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}),...p("size",o?.fontSize),...p("lh",o?.lineHeight)}):{},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};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -25424,7 +25424,7 @@ type TypographyProps = {
|
|
|
25424
25424
|
};
|
|
25425
25425
|
type TypographyV2Props = Omit<TypographyProps, 'fontSize' | 'lineHeight'> & {
|
|
25426
25426
|
fontSize?: ObjectDevices<string>;
|
|
25427
|
-
lineHeight?: string
|
|
25427
|
+
lineHeight?: ObjectDevices<string>;
|
|
25428
25428
|
};
|
|
25429
25429
|
type TypographyV2Attrs = {
|
|
25430
25430
|
bold?: boolean;
|