@gem-sdk/core 1.23.0-staging.100 → 1.23.0-staging.106

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.
@@ -9,10 +9,10 @@ const getCornerCSSFromGlobal = (corner)=>{
9
9
  'custom',
10
10
  'circle'
11
11
  ].includes(corner?.radiusType)) return makeStyle.makeStyle({
12
- bblr: corner.bblr,
13
- bbrr: corner.bbrr,
14
- btlr: corner.btlr,
15
- btrr: corner.btrr
12
+ bblr: convertCornerPercentToCircle(corner.bblr),
13
+ bbrr: convertCornerPercentToCircle(corner.bbrr),
14
+ btlr: convertCornerPercentToCircle(corner.btlr),
15
+ btrr: convertCornerPercentToCircle(corner.btrr)
16
16
  });
17
17
  return makeStyle.makeStyle({
18
18
  radius: `var(--g-radius-${corner?.radiusType})`
@@ -31,10 +31,10 @@ const getCustomRadius = (state, radius, device)=>{
31
31
  const suffix = device && device !== 'desktop' ? constant.devicesMapping?.[device] : '';
32
32
  const mState = constant.stateMapping?.[state];
33
33
  return {
34
- [`-${mState}-bblr${suffix}`]: radius.bblr,
35
- [`-${mState}-bbrr${suffix}`]: radius.bbrr,
36
- [`-${mState}-btlr${suffix}`]: radius.btlr,
37
- [`-${mState}-btrr${suffix}`]: radius.btrr
34
+ [`-${mState}-bblr${suffix}`]: convertCornerPercentToCircle(radius.bblr),
35
+ [`-${mState}-bbrr${suffix}`]: convertCornerPercentToCircle(radius.bbrr),
36
+ [`-${mState}-btlr${suffix}`]: convertCornerPercentToCircle(radius.btlr),
37
+ [`-${mState}-btrr${suffix}`]: convertCornerPercentToCircle(radius.btrr)
38
38
  };
39
39
  };
40
40
  const composeRadius = (value)=>{
@@ -121,15 +121,18 @@ const composeCornerCss = (value, important = false)=>{
121
121
  case 'none':
122
122
  case 'custom':
123
123
  radiusValue = `
124
- ${bblr ? `border-bottom-left-radius: ${bblr}${sub};` : ''}
125
- ${bbrr ? `border-bottom-right-radius: ${bbrr}${sub};` : ''}
126
- ${btlr ? `border-top-left-radius: ${btlr}${sub};` : ''}
127
- ${btrr ? `border-top-right-radius: ${btrr}${sub};` : ''}
124
+ ${bblr ? `border-bottom-left-radius: ${convertCornerPercentToCircle(bblr)}${sub};` : ''}
125
+ ${bbrr ? `border-bottom-right-radius: ${convertCornerPercentToCircle(bbrr)}${sub};` : ''}
126
+ ${btlr ? `border-top-left-radius: ${convertCornerPercentToCircle(btlr)}${sub};` : ''}
127
+ ${btrr ? `border-top-right-radius: ${convertCornerPercentToCircle(btrr)}${sub};` : ''}
128
128
  `;
129
129
  break;
130
130
  }
131
131
  return radiusValue;
132
132
  };
133
+ const convertCornerPercentToCircle = (value)=>{
134
+ return value && value.includes('%') && parseInt(value) >= 50 ? '999999px' : value;
135
+ };
133
136
 
134
137
  exports.composeCornerCss = composeCornerCss;
135
138
  exports.composeRadius = composeRadius;
@@ -7,10 +7,10 @@ const getCornerCSSFromGlobal = (corner)=>{
7
7
  'custom',
8
8
  'circle'
9
9
  ].includes(corner?.radiusType)) return makeStyle({
10
- bblr: corner.bblr,
11
- bbrr: corner.bbrr,
12
- btlr: corner.btlr,
13
- btrr: corner.btrr
10
+ bblr: convertCornerPercentToCircle(corner.bblr),
11
+ bbrr: convertCornerPercentToCircle(corner.bbrr),
12
+ btlr: convertCornerPercentToCircle(corner.btlr),
13
+ btrr: convertCornerPercentToCircle(corner.btrr)
14
14
  });
15
15
  return makeStyle({
16
16
  radius: `var(--g-radius-${corner?.radiusType})`
@@ -29,10 +29,10 @@ const getCustomRadius = (state, radius, device)=>{
29
29
  const suffix = device && device !== 'desktop' ? devicesMapping?.[device] : '';
30
30
  const mState = stateMapping?.[state];
31
31
  return {
32
- [`-${mState}-bblr${suffix}`]: radius.bblr,
33
- [`-${mState}-bbrr${suffix}`]: radius.bbrr,
34
- [`-${mState}-btlr${suffix}`]: radius.btlr,
35
- [`-${mState}-btrr${suffix}`]: radius.btrr
32
+ [`-${mState}-bblr${suffix}`]: convertCornerPercentToCircle(radius.bblr),
33
+ [`-${mState}-bbrr${suffix}`]: convertCornerPercentToCircle(radius.bbrr),
34
+ [`-${mState}-btlr${suffix}`]: convertCornerPercentToCircle(radius.btlr),
35
+ [`-${mState}-btrr${suffix}`]: convertCornerPercentToCircle(radius.btrr)
36
36
  };
37
37
  };
38
38
  const composeRadius = (value)=>{
@@ -119,14 +119,17 @@ const composeCornerCss = (value, important = false)=>{
119
119
  case 'none':
120
120
  case 'custom':
121
121
  radiusValue = `
122
- ${bblr ? `border-bottom-left-radius: ${bblr}${sub};` : ''}
123
- ${bbrr ? `border-bottom-right-radius: ${bbrr}${sub};` : ''}
124
- ${btlr ? `border-top-left-radius: ${btlr}${sub};` : ''}
125
- ${btrr ? `border-top-right-radius: ${btrr}${sub};` : ''}
122
+ ${bblr ? `border-bottom-left-radius: ${convertCornerPercentToCircle(bblr)}${sub};` : ''}
123
+ ${bbrr ? `border-bottom-right-radius: ${convertCornerPercentToCircle(bbrr)}${sub};` : ''}
124
+ ${btlr ? `border-top-left-radius: ${convertCornerPercentToCircle(btlr)}${sub};` : ''}
125
+ ${btrr ? `border-top-right-radius: ${convertCornerPercentToCircle(btrr)}${sub};` : ''}
126
126
  `;
127
127
  break;
128
128
  }
129
129
  return radiusValue;
130
130
  };
131
+ const convertCornerPercentToCircle = (value)=>{
132
+ return value && value.includes('%') && parseInt(value) >= 50 ? '999999px' : value;
133
+ };
131
134
 
132
135
  export { composeCornerCss, composeRadius, composeRadiusResponsive, getCornerCSSFromGlobal, getCustomRadius, getRadiusCSSFromGlobal, getRadiusStyleActiveState };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/core",
3
- "version": "1.23.0-staging.100",
3
+ "version": "1.23.0-staging.106",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",