@gem-sdk/core 1.48.0-dev.83 → 1.48.0-dev.88

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.
@@ -114,9 +114,9 @@ const getGlobalColorResponsiveStyle = (type, data)=>{
114
114
  }
115
115
  }));
116
116
  };
117
- const getGlobalColorStateStyle = (type, data)=>{
117
+ const getGlobalColorStateStyle = (type, data, states)=>{
118
118
  if (!data) return {};
119
- return Object.fromEntries(Object.entries(data).map(([state, value])=>{
119
+ return Object.fromEntries(Object.entries(data).filter(([state])=>states?.length ? states?.includes(state) : true).map(([state, value])=>{
120
120
  if (state === 'active') return [];
121
121
  return [
122
122
  `-${constant.stateMapping?.[state] || ''}-${type}`,
@@ -28,7 +28,8 @@ const composeTypographyV2Css = (typography, isImportant)=>{
28
28
  const composeImportant = isImportant ? '!important' : '';
29
29
  return `
30
30
  ${fontFamily ? `font-family: ${composeFontFamilyTypographyV2({
31
- fontFamily
31
+ fontFamily,
32
+ type: typography?.type
32
33
  })} ${composeImportant}` : ''};
33
34
  ${fontSize?.desktop ? `font-size: ${fontSize?.desktop} ${composeImportant}` : ''};
34
35
  ${bold ? `font-weight: bold ${composeImportant}` : fontWeight ? `font-weight: ${fontWeight} ${composeImportant}` : ''};
@@ -76,7 +77,7 @@ const composeTypographyV2 = (value, attrs)=>{
76
77
  });
77
78
  };
78
79
  const composeFontFamilyTypographyV2 = (value)=>{
79
- const { fontFamily, isCustom, fallbackFontFamily } = value || {};
80
+ const { fontFamily, isCustom, fallbackFontFamily, type } = value || {};
80
81
  if (!fontFamily) {
81
82
  return isCustom ? fallbackFontFamily : undefined;
82
83
  }
@@ -93,7 +94,7 @@ const composeFontFamilyTypographyV2 = (value)=>{
93
94
  default:
94
95
  return getFontUsedByTypographyV2({
95
96
  fontFamily: fontFamily.value,
96
- fallbackFontFamily: value?.fallbackFontFamily
97
+ fallbackFontFamily: composeFallbackTypographyStyle(type ?? 'heading')
97
98
  });
98
99
  }
99
100
  }
@@ -112,9 +112,9 @@ const getGlobalColorResponsiveStyle = (type, data)=>{
112
112
  }
113
113
  }));
114
114
  };
115
- const getGlobalColorStateStyle = (type, data)=>{
115
+ const getGlobalColorStateStyle = (type, data, states)=>{
116
116
  if (!data) return {};
117
- return Object.fromEntries(Object.entries(data).map(([state, value])=>{
117
+ return Object.fromEntries(Object.entries(data).filter(([state])=>states?.length ? states?.includes(state) : true).map(([state, value])=>{
118
118
  if (state === 'active') return [];
119
119
  return [
120
120
  `-${stateMapping?.[state] || ''}-${type}`,
@@ -26,7 +26,8 @@ const composeTypographyV2Css = (typography, isImportant)=>{
26
26
  const composeImportant = isImportant ? '!important' : '';
27
27
  return `
28
28
  ${fontFamily ? `font-family: ${composeFontFamilyTypographyV2({
29
- fontFamily
29
+ fontFamily,
30
+ type: typography?.type
30
31
  })} ${composeImportant}` : ''};
31
32
  ${fontSize?.desktop ? `font-size: ${fontSize?.desktop} ${composeImportant}` : ''};
32
33
  ${bold ? `font-weight: bold ${composeImportant}` : fontWeight ? `font-weight: ${fontWeight} ${composeImportant}` : ''};
@@ -74,7 +75,7 @@ const composeTypographyV2 = (value, attrs)=>{
74
75
  });
75
76
  };
76
77
  const composeFontFamilyTypographyV2 = (value)=>{
77
- const { fontFamily, isCustom, fallbackFontFamily } = value || {};
78
+ const { fontFamily, isCustom, fallbackFontFamily, type } = value || {};
78
79
  if (!fontFamily) {
79
80
  return isCustom ? fallbackFontFamily : undefined;
80
81
  }
@@ -91,7 +92,7 @@ const composeFontFamilyTypographyV2 = (value)=>{
91
92
  default:
92
93
  return getFontUsedByTypographyV2({
93
94
  fontFamily: fontFamily.value,
94
- fallbackFontFamily: value?.fallbackFontFamily
95
+ fallbackFontFamily: composeFallbackTypographyStyle(type ?? 'heading')
95
96
  });
96
97
  }
97
98
  }
@@ -29756,7 +29756,7 @@ declare const getGlobalColorStateClassDynamicBtn: (type: ColorType, data?: State
29756
29756
  declare const getGlobalColorStateResponsiveClass: (type: ColorType, data?: ResponsiveStateProp<ColorValueType>) => string;
29757
29757
  declare const getGlobalColorStateResponsiveClassDynamicBtn: (type: ColorType, data?: ResponsiveStateProp<ColorValueType>) => string;
29758
29758
  declare const getGlobalColorResponsiveStyle: (type: ColorProp, data?: ObjectDevices<ColorValueType>) => React.CSSProperties;
29759
- declare const getGlobalColorStateStyle: (type: ColorProp, data?: StateProp<ColorValueType>) => React.CSSProperties;
29759
+ declare const getGlobalColorStateStyle: (type: ColorProp, data?: StateProp<ColorValueType>, states?: string[]) => React.CSSProperties;
29760
29760
  declare const getGlobalColorStateResponsiveStyle: (type: ColorProp, data?: ResponsiveStateProp<ColorValueType>) => React.CSSProperties;
29761
29761
  declare const getSingleColorVariable: (color?: ColorValueType) => string | undefined;
29762
29762
  declare function isColor(color: string): boolean;
@@ -37470,7 +37470,9 @@ declare const composeTypographyCss: (typography: TypographySetting | undefined)
37470
37470
  declare const composeTypographyV2Css: (typography: TypographySettingV2 | undefined, isImportant?: boolean) => string;
37471
37471
  declare const composeTypography: (typography?: ObjectDevices<TypographyProps>) => React.CSSProperties;
37472
37472
  declare const composeTypographyV2: (value?: TypographyV2Props, attrs?: TypographyV2Attrs) => React.CSSProperties;
37473
- declare const composeFontFamilyTypographyV2: (value?: TypographyV2Props) => string | undefined;
37473
+ declare const composeFontFamilyTypographyV2: (value?: TypographyV2Props & {
37474
+ type?: string;
37475
+ }) => string | undefined;
37474
37476
  declare const composeTypographyAttr: (attrs?: TypographyV2Attrs) => React.CSSProperties;
37475
37477
  declare const composeTypographyClassName: (typo?: TypographySettingV2, typography?: TypographySetting) => "" | "gp-g-heading-1" | "gp-g-heading-2" | "gp-g-heading-3" | "gp-g-subheading-1" | "gp-g-subheading-2" | "gp-g-subheading-3" | "gp-g-paragraph-1" | "gp-g-paragraph-2" | "gp-g-paragraph-3" | undefined;
37476
37478
  declare const composeFallbackTypographyStyle: (tag: string) => "var(--g-font-heading, heading)" | "var(--g-font-body, body)";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/core",
3
- "version": "1.48.0-dev.83",
3
+ "version": "1.48.0-dev.88",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -28,7 +28,7 @@
28
28
  },
29
29
  "devDependencies": {
30
30
  "@gem-sdk/adapter-shopify": "1.48.0-dev.3",
31
- "@gem-sdk/styles": "1.48.0-dev.72",
31
+ "@gem-sdk/styles": "1.48.0-dev.86",
32
32
  "@types/classnames": "^2.3.1"
33
33
  },
34
34
  "dependencies": {