@gem-sdk/core 1.17.6 → 1.17.9

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.
@@ -97,11 +97,12 @@ const getRadiusStyleActiveState = (radiusValue)=>{
97
97
  }
98
98
  return getRadiusCSSFromGlobal('normal', radiusValue?.active?.radiusType);
99
99
  };
100
- const composeCornerCss = (value)=>{
100
+ const composeCornerCss = (value, important = false)=>{
101
101
  if (!value) {
102
- return;
102
+ return '';
103
103
  }
104
104
  const { radiusType, bblr, bbrr, btlr, btrr } = value;
105
+ const sub = important ? ' !important' : '';
105
106
  let radiusValue = undefined;
106
107
  switch(radiusType){
107
108
  case 'medium':
@@ -113,13 +114,10 @@ const composeCornerCss = (value)=>{
113
114
  case 'none':
114
115
  case 'custom':
115
116
  radiusValue = `
116
- ${bblr ? `border-bottom-left-radius: ${bblr};` : ''}
117
-
118
- ${bbrr ? `border-bottom-right-radius: ${bbrr};` : ''}
119
-
120
- ${btlr ? `border-top-left-radius: ${btlr};` : ''}
121
-
122
- ${btrr ? `border-top-right-radius: ${btrr};` : ''}
117
+ ${bblr ? `border-bottom-left-radius: ${bblr}${sub};` : ''}
118
+ ${bbrr ? `border-bottom-right-radius: ${bbrr}${sub};` : ''}
119
+ ${btlr ? `border-top-left-radius: ${btlr}${sub};` : ''}
120
+ ${btrr ? `border-top-right-radius: ${btrr}${sub};` : ''}
123
121
  `;
124
122
  break;
125
123
  }
@@ -43,11 +43,12 @@ const getStyleShadowState = (shadow, styleAppliedFor, isEnableShadow)=>{
43
43
  }
44
44
  return style;
45
45
  };
46
- const composeShadowCss = ({ hasBoxShadow, boxShadowValue })=>{
46
+ const composeShadowCss = ({ hasBoxShadow, boxShadowValue, important })=>{
47
47
  if (!hasBoxShadow) return undefined;
48
48
  if (!boxShadowValue) return undefined;
49
49
  const { value: distance, unit: unitDistance } = parseValueWithUnit(`${boxShadowValue?.distance}`);
50
- return `box-shadow: ${Math.cos(parseFloat(`${boxShadowValue?.angle}`) * Math.PI / 180) * parseFloat(`${distance}`)}${unitDistance} ${Math.sin(parseFloat(`${boxShadowValue?.angle}`) * Math.PI / 180) * parseFloat(`${distance}`)}${unitDistance} ${boxShadowValue?.blur} ${boxShadowValue?.spread + ' '}${colors.getSingleColorVariable(boxShadowValue?.color)};`;
50
+ const sub = important ? ' !important' : '';
51
+ return `box-shadow: ${Math.cos(parseFloat(`${boxShadowValue?.angle}`) * Math.PI / 180) * parseFloat(`${distance}`)}${unitDistance} ${Math.sin(parseFloat(`${boxShadowValue?.angle}`) * Math.PI / 180) * parseFloat(`${distance}`)}${unitDistance} ${boxShadowValue?.blur} ${boxShadowValue?.spread + ' '}${colors.getSingleColorVariable(boxShadowValue?.color)}${sub};`;
51
52
  };
52
53
 
53
54
  exports.composeShadowCss = composeShadowCss;
@@ -95,11 +95,12 @@ const getRadiusStyleActiveState = (radiusValue)=>{
95
95
  }
96
96
  return getRadiusCSSFromGlobal('normal', radiusValue?.active?.radiusType);
97
97
  };
98
- const composeCornerCss = (value)=>{
98
+ const composeCornerCss = (value, important = false)=>{
99
99
  if (!value) {
100
- return;
100
+ return '';
101
101
  }
102
102
  const { radiusType, bblr, bbrr, btlr, btrr } = value;
103
+ const sub = important ? ' !important' : '';
103
104
  let radiusValue = undefined;
104
105
  switch(radiusType){
105
106
  case 'medium':
@@ -111,13 +112,10 @@ const composeCornerCss = (value)=>{
111
112
  case 'none':
112
113
  case 'custom':
113
114
  radiusValue = `
114
- ${bblr ? `border-bottom-left-radius: ${bblr};` : ''}
115
-
116
- ${bbrr ? `border-bottom-right-radius: ${bbrr};` : ''}
117
-
118
- ${btlr ? `border-top-left-radius: ${btlr};` : ''}
119
-
120
- ${btrr ? `border-top-right-radius: ${btrr};` : ''}
115
+ ${bblr ? `border-bottom-left-radius: ${bblr}${sub};` : ''}
116
+ ${bbrr ? `border-bottom-right-radius: ${bbrr}${sub};` : ''}
117
+ ${btlr ? `border-top-left-radius: ${btlr}${sub};` : ''}
118
+ ${btrr ? `border-top-right-radius: ${btrr}${sub};` : ''}
121
119
  `;
122
120
  break;
123
121
  }
@@ -41,11 +41,12 @@ const getStyleShadowState = (shadow, styleAppliedFor, isEnableShadow)=>{
41
41
  }
42
42
  return style;
43
43
  };
44
- const composeShadowCss = ({ hasBoxShadow, boxShadowValue })=>{
44
+ const composeShadowCss = ({ hasBoxShadow, boxShadowValue, important })=>{
45
45
  if (!hasBoxShadow) return undefined;
46
46
  if (!boxShadowValue) return undefined;
47
47
  const { value: distance, unit: unitDistance } = parseValueWithUnit(`${boxShadowValue?.distance}`);
48
- return `box-shadow: ${Math.cos(parseFloat(`${boxShadowValue?.angle}`) * Math.PI / 180) * parseFloat(`${distance}`)}${unitDistance} ${Math.sin(parseFloat(`${boxShadowValue?.angle}`) * Math.PI / 180) * parseFloat(`${distance}`)}${unitDistance} ${boxShadowValue?.blur} ${boxShadowValue?.spread + ' '}${getSingleColorVariable(boxShadowValue?.color)};`;
48
+ const sub = important ? ' !important' : '';
49
+ return `box-shadow: ${Math.cos(parseFloat(`${boxShadowValue?.angle}`) * Math.PI / 180) * parseFloat(`${distance}`)}${unitDistance} ${Math.sin(parseFloat(`${boxShadowValue?.angle}`) * Math.PI / 180) * parseFloat(`${distance}`)}${unitDistance} ${boxShadowValue?.blur} ${boxShadowValue?.spread + ' '}${getSingleColorVariable(boxShadowValue?.color)}${sub};`;
49
50
  };
50
51
 
51
52
  export { composeShadowCss, getStyleShadow, getStyleShadowState, parseValueWithUnit };
@@ -9290,7 +9290,7 @@ declare const getRadiusCSSFromGlobal: (state: StateType, key?: RoundedSize, devi
9290
9290
  declare const getCustomRadius: (state: StateType, radius?: CornerRadius, device?: NameDevices) => React.CSSProperties;
9291
9291
  declare const composeRadius: (value?: StateProp<CornerRadius> | ResponsiveStateProp<CornerRadius>) => React.CSSProperties;
9292
9292
  declare const getRadiusStyleActiveState: (radiusValue?: StateProp<CornerRadius>) => React.CSSProperties;
9293
- declare const composeCornerCss: (value?: CornerRadius | undefined) => string | undefined;
9293
+ declare const composeCornerCss: (value?: CornerRadius | undefined, important?: boolean) => string | undefined;
9294
9294
 
9295
9295
  declare function getSelectedVariant(variants?: Maybe<VariantSelectFragment>[], choices?: Record<string, string>): Maybe<VariantSelectFragment>;
9296
9296
  declare function parseSelectedOption(options: SelectedOption[]): SelectedOption | undefined;
@@ -9370,9 +9370,10 @@ declare const getStyleShadow: (shadowStyle: ShadowStyle, isActiveState?: boolean
9370
9370
  [x: string]: string;
9371
9371
  };
9372
9372
  declare const getStyleShadowState: (shadow?: StateProp<ShadowProps>, styleAppliedFor?: ShadowStyleApplied, isEnableShadow?: StateProp<boolean>) => React.CSSProperties;
9373
- declare const composeShadowCss: ({ hasBoxShadow, boxShadowValue, }: {
9373
+ declare const composeShadowCss: ({ hasBoxShadow, boxShadowValue, important, }: {
9374
9374
  hasBoxShadow?: boolean | undefined;
9375
9375
  boxShadowValue?: ShadowProps | undefined;
9376
+ important?: boolean | undefined;
9376
9377
  }) => string | undefined;
9377
9378
 
9378
9379
  type Options = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/core",
3
- "version": "1.17.6",
3
+ "version": "1.17.9",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "devDependencies": {
27
27
  "@gem-sdk/adapter-shopify": "1.12.0",
28
- "@gem-sdk/styles": "1.15.12"
28
+ "@gem-sdk/styles": "1.17.7"
29
29
  },
30
30
  "dependencies": {
31
31
  "react-error-boundary": "4.0.10",