@gem-sdk/core 1.23.0-staging.106 → 1.23.0-staging.108
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.
- package/dist/cjs/helpers/radius.js +12 -15
- package/dist/esm/helpers/radius.js +12 -15
- package/package.json +1 -1
|
@@ -9,10 +9,10 @@ const getCornerCSSFromGlobal = (corner)=>{
|
|
|
9
9
|
'custom',
|
|
10
10
|
'circle'
|
|
11
11
|
].includes(corner?.radiusType)) return makeStyle.makeStyle({
|
|
12
|
-
bblr:
|
|
13
|
-
bbrr:
|
|
14
|
-
btlr:
|
|
15
|
-
btrr:
|
|
12
|
+
bblr: corner.bblr,
|
|
13
|
+
bbrr: corner.bbrr,
|
|
14
|
+
btlr: corner.btlr,
|
|
15
|
+
btrr: 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}`]:
|
|
35
|
-
[`-${mState}-bbrr${suffix}`]:
|
|
36
|
-
[`-${mState}-btlr${suffix}`]:
|
|
37
|
-
[`-${mState}-btrr${suffix}`]:
|
|
34
|
+
[`-${mState}-bblr${suffix}`]: radius.bblr,
|
|
35
|
+
[`-${mState}-bbrr${suffix}`]: radius.bbrr,
|
|
36
|
+
[`-${mState}-btlr${suffix}`]: radius.btlr,
|
|
37
|
+
[`-${mState}-btrr${suffix}`]: radius.btrr
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
40
|
const composeRadius = (value)=>{
|
|
@@ -121,18 +121,15 @@ const composeCornerCss = (value, important = false)=>{
|
|
|
121
121
|
case 'none':
|
|
122
122
|
case 'custom':
|
|
123
123
|
radiusValue = `
|
|
124
|
-
${bblr ? `border-bottom-left-radius: ${
|
|
125
|
-
${bbrr ? `border-bottom-right-radius: ${
|
|
126
|
-
${btlr ? `border-top-left-radius: ${
|
|
127
|
-
${btrr ? `border-top-right-radius: ${
|
|
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};` : ''}
|
|
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
|
-
};
|
|
136
133
|
|
|
137
134
|
exports.composeCornerCss = composeCornerCss;
|
|
138
135
|
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:
|
|
11
|
-
bbrr:
|
|
12
|
-
btlr:
|
|
13
|
-
btrr:
|
|
10
|
+
bblr: corner.bblr,
|
|
11
|
+
bbrr: corner.bbrr,
|
|
12
|
+
btlr: corner.btlr,
|
|
13
|
+
btrr: 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}`]:
|
|
33
|
-
[`-${mState}-bbrr${suffix}`]:
|
|
34
|
-
[`-${mState}-btlr${suffix}`]:
|
|
35
|
-
[`-${mState}-btrr${suffix}`]:
|
|
32
|
+
[`-${mState}-bblr${suffix}`]: radius.bblr,
|
|
33
|
+
[`-${mState}-bbrr${suffix}`]: radius.bbrr,
|
|
34
|
+
[`-${mState}-btlr${suffix}`]: radius.btlr,
|
|
35
|
+
[`-${mState}-btrr${suffix}`]: radius.btrr
|
|
36
36
|
};
|
|
37
37
|
};
|
|
38
38
|
const composeRadius = (value)=>{
|
|
@@ -119,17 +119,14 @@ const composeCornerCss = (value, important = false)=>{
|
|
|
119
119
|
case 'none':
|
|
120
120
|
case 'custom':
|
|
121
121
|
radiusValue = `
|
|
122
|
-
${bblr ? `border-bottom-left-radius: ${
|
|
123
|
-
${bbrr ? `border-bottom-right-radius: ${
|
|
124
|
-
${btlr ? `border-top-left-radius: ${
|
|
125
|
-
${btrr ? `border-top-right-radius: ${
|
|
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};` : ''}
|
|
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
|
-
};
|
|
134
131
|
|
|
135
132
|
export { composeCornerCss, composeRadius, composeRadiusResponsive, getCornerCSSFromGlobal, getCustomRadius, getRadiusCSSFromGlobal, getRadiusStyleActiveState };
|