@gem-sdk/components 2.0.0-dev.492 → 2.0.0-dev.494

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.
@@ -24,7 +24,7 @@ const ArticleTagPresets = [
24
24
  'spacing-setting': {
25
25
  desktop: {
26
26
  margin: {
27
- bottom: 'var(--g-s-s)'
27
+ bottom: 'var(--g-s-l)'
28
28
  }
29
29
  }
30
30
  }
@@ -203,8 +203,11 @@ const DialogSettings = [
203
203
  label: 'SVG Icon',
204
204
  type: 'icon',
205
205
  default: `<svg height="20" width="20" data-name="x-bold" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor" data-id="508817606065848680">
206
- <path fill="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"/>
207
- </svg>`
206
+ <path fill="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"/>
207
+ </svg>`,
208
+ compoDefaultValue: `<svg height="20" width="20" data-name="x-bold" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor" data-id="508817606065848680">
209
+ <path fill="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"/>
210
+ </svg>`
208
211
  },
209
212
  {
210
213
  id: 'btnWidth',
@@ -54,7 +54,7 @@ const StockCounter = ({ setting, styles, builderProps })=>{
54
54
  });
55
55
  };
56
56
  const iconAttrs = ({ isOutOfStockIcon, isVisible })=>{
57
- return system.createStyle({
57
+ return system.createAttr({
58
58
  ...getAttrs.getIconAttrs(isOutOfStockIcon, isVisible)
59
59
  });
60
60
  };
@@ -54,7 +54,7 @@ const StockCounter = ({ setting, styles, style, advanced, builderProps })=>{
54
54
  });
55
55
  };
56
56
  const iconAttrs = ({ isOutOfStockIcon, isVisible })=>{
57
- return system.createStyle({
57
+ return system.createAttr({
58
58
  ...getAttrs.getIconAttrs(isOutOfStockIcon, isVisible)
59
59
  });
60
60
  };
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const getLiquidTagAttrs = (builderProps, setting, styles)=>{
4
- const { displayByDefault, scarcityThreshold = 0, template: templateString, outOfStockMessage, continueSelling, unlimitedQuantityMessage, hiddenCounterWhenOutOfStock } = setting ?? {};
4
+ const { displayByDefault, scarcityThreshold = 0, template: templateString, outOfStockMessage, continueSelling, unlimitedQuantityMessage, hiddenCounterWhenOutOfStock, remaining, source } = setting ?? {};
5
5
  const { displayProgressBar, textColor, oosTextColor, typo } = styles ?? {};
6
6
  const mainColor = textColor || 'brand';
7
7
  const typoColor = typo?.attrs?.color;
@@ -20,7 +20,9 @@ const getLiquidTagAttrs = (builderProps, setting, styles)=>{
20
20
  color: mainColor,
21
21
  hiddenCounterWhenOutOfStock,
22
22
  oosTextColor,
23
- typoColor
23
+ typoColor,
24
+ remaining,
25
+ source
24
26
  }).replaceAll(`"`, '&#34;')
25
27
  };
26
28
  };
@@ -13,7 +13,7 @@ const getProgressBarStyles = (styles, setting)=>{
13
13
  ]));
14
14
  }
15
15
  return {
16
- ...core.makeStyleResponsive('h', convertedProgressBarHeight, 'px'),
16
+ ...core.makeStyleResponsive('h', core.makeWidth(convertedProgressBarHeight), 'px'),
17
17
  ...core.makeStyle({
18
18
  bg: 'linear-gradient(90deg, #eee 50%, transparent 50%)',
19
19
  bgc: core.getSingleColorVariable(color),
@@ -43,7 +43,7 @@ const getIconStyles = (styles, setting, isOutOfStock)=>{
43
43
  ...core.makeStyle({
44
44
  c: core.getSingleColorVariable(isOutOfStock ? oosIconColor : iconColor)
45
45
  }),
46
- ...core.makeStyleResponsive('w', iconSize, 'px')
46
+ ...core.makeStyleResponsive('w', core.makeWidth(iconSize), 'px')
47
47
  };
48
48
  };
49
49
  const getTextStyles = (styles, isOutOfStock)=>{
@@ -233,6 +233,8 @@ const StockCounterSettingsV2 = [
233
233
  units: [
234
234
  '%'
235
235
  ],
236
+ showDefaultUnit: true,
237
+ isNumber: true,
236
238
  useOnlyUnitInit: true
237
239
  }
238
240
  ]
@@ -22,7 +22,7 @@ const ArticleTagPresets = [
22
22
  'spacing-setting': {
23
23
  desktop: {
24
24
  margin: {
25
- bottom: 'var(--g-s-s)'
25
+ bottom: 'var(--g-s-l)'
26
26
  }
27
27
  }
28
28
  }
@@ -201,8 +201,11 @@ const DialogSettings = [
201
201
  label: 'SVG Icon',
202
202
  type: 'icon',
203
203
  default: `<svg height="20" width="20" data-name="x-bold" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor" data-id="508817606065848680">
204
- <path fill="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"/>
205
- </svg>`
204
+ <path fill="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"/>
205
+ </svg>`,
206
+ compoDefaultValue: `<svg height="20" width="20" data-name="x-bold" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor" data-id="508817606065848680">
207
+ <path fill="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"/>
208
+ </svg>`
206
209
  },
207
210
  {
208
211
  id: 'btnWidth',
@@ -50,7 +50,7 @@ const StockCounter = ({ setting, styles, builderProps })=>{
50
50
  });
51
51
  };
52
52
  const iconAttrs = ({ isOutOfStockIcon, isVisible })=>{
53
- return createStyle({
53
+ return createAttr({
54
54
  ...getIconAttrs(isOutOfStockIcon, isVisible)
55
55
  });
56
56
  };
@@ -50,7 +50,7 @@ const StockCounter = ({ setting, styles, style, advanced, builderProps })=>{
50
50
  });
51
51
  };
52
52
  const iconAttrs = ({ isOutOfStockIcon, isVisible })=>{
53
- return createStyle({
53
+ return createAttr({
54
54
  ...getIconAttrs(isOutOfStockIcon, isVisible)
55
55
  });
56
56
  };
@@ -1,5 +1,5 @@
1
1
  const getLiquidTagAttrs = (builderProps, setting, styles)=>{
2
- const { displayByDefault, scarcityThreshold = 0, template: templateString, outOfStockMessage, continueSelling, unlimitedQuantityMessage, hiddenCounterWhenOutOfStock } = setting ?? {};
2
+ const { displayByDefault, scarcityThreshold = 0, template: templateString, outOfStockMessage, continueSelling, unlimitedQuantityMessage, hiddenCounterWhenOutOfStock, remaining, source } = setting ?? {};
3
3
  const { displayProgressBar, textColor, oosTextColor, typo } = styles ?? {};
4
4
  const mainColor = textColor || 'brand';
5
5
  const typoColor = typo?.attrs?.color;
@@ -18,7 +18,9 @@ const getLiquidTagAttrs = (builderProps, setting, styles)=>{
18
18
  color: mainColor,
19
19
  hiddenCounterWhenOutOfStock,
20
20
  oosTextColor,
21
- typoColor
21
+ typoColor,
22
+ remaining,
23
+ source
22
24
  }).replaceAll(`"`, '&#34;')
23
25
  };
24
26
  };
@@ -1,4 +1,4 @@
1
- import { makeStyleResponsive, makeStyle, getSingleColorVariable, makeWidth, composeTypographyStyle, getStyleShadow } from '@gem-sdk/core';
1
+ import { makeStyleResponsive, makeWidth, makeStyle, getSingleColorVariable, composeTypographyStyle, getStyleShadow } from '@gem-sdk/core';
2
2
 
3
3
  const getProgressBarStyles = (styles, setting)=>{
4
4
  const { progressBarHeight, color } = styles ?? {};
@@ -11,7 +11,7 @@ const getProgressBarStyles = (styles, setting)=>{
11
11
  ]));
12
12
  }
13
13
  return {
14
- ...makeStyleResponsive('h', convertedProgressBarHeight, 'px'),
14
+ ...makeStyleResponsive('h', makeWidth(convertedProgressBarHeight), 'px'),
15
15
  ...makeStyle({
16
16
  bg: 'linear-gradient(90deg, #eee 50%, transparent 50%)',
17
17
  bgc: getSingleColorVariable(color),
@@ -41,7 +41,7 @@ const getIconStyles = (styles, setting, isOutOfStock)=>{
41
41
  ...makeStyle({
42
42
  c: getSingleColorVariable(isOutOfStock ? oosIconColor : iconColor)
43
43
  }),
44
- ...makeStyleResponsive('w', iconSize, 'px')
44
+ ...makeStyleResponsive('w', makeWidth(iconSize), 'px')
45
45
  };
46
46
  };
47
47
  const getTextStyles = (styles, isOutOfStock)=>{
@@ -231,6 +231,8 @@ const StockCounterSettingsV2 = [
231
231
  units: [
232
232
  '%'
233
233
  ],
234
+ showDefaultUnit: true,
235
+ isNumber: true,
234
236
  useOnlyUnitInit: true
235
237
  }
236
238
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.0.0-dev.492",
3
+ "version": "2.0.0-dev.494",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",