@gem-sdk/components 2.0.0-dev.457 → 2.0.0-dev.460

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.
Files changed (34) hide show
  1. package/dist/cjs/breadcrumb/components/Breadcrumb.js +1 -0
  2. package/dist/cjs/breadcrumb/components/Breadcrumb.liquid.js +1 -0
  3. package/dist/cjs/breadcrumb/setting/configs/settings.js +29 -2
  4. package/dist/cjs/breadcrumb/setting/configs/uiV2.js +230 -114
  5. package/dist/cjs/button/setting/configs/settings.js +2 -1
  6. package/dist/cjs/coupon/common/classes.js +16 -2
  7. package/dist/cjs/coupon/common/index.js +2 -2
  8. package/dist/cjs/coupon/common/styles.js +44 -26
  9. package/dist/cjs/coupon/components/Coupon.js +3 -6
  10. package/dist/cjs/coupon/components/Coupon.liquid.js +4 -7
  11. package/dist/cjs/coupon/setting/config/settings.js +194 -131
  12. package/dist/cjs/coupon/setting/config/uiV2.js +349 -142
  13. package/dist/cjs/product/components/FileUpload/components/config/uiV2.js +15 -0
  14. package/dist/cjs/product/setting/product/configs/settings.js +1 -1
  15. package/dist/cjs/sticky/components/Sticky.js +0 -2
  16. package/dist/cjs/sticky/components/Sticky.liquid.js +1 -2
  17. package/dist/esm/breadcrumb/components/Breadcrumb.js +2 -1
  18. package/dist/esm/breadcrumb/components/Breadcrumb.liquid.js +2 -1
  19. package/dist/esm/breadcrumb/setting/configs/settings.js +29 -2
  20. package/dist/esm/breadcrumb/setting/configs/uiV2.js +230 -114
  21. package/dist/esm/button/setting/configs/settings.js +2 -1
  22. package/dist/esm/coupon/common/classes.js +16 -2
  23. package/dist/esm/coupon/common/index.js +2 -2
  24. package/dist/esm/coupon/common/styles.js +45 -26
  25. package/dist/esm/coupon/components/Coupon.js +5 -8
  26. package/dist/esm/coupon/components/Coupon.liquid.js +6 -9
  27. package/dist/esm/coupon/setting/config/settings.js +194 -131
  28. package/dist/esm/coupon/setting/config/uiV2.js +349 -142
  29. package/dist/esm/product/components/FileUpload/components/config/uiV2.js +15 -0
  30. package/dist/esm/product/setting/product/configs/settings.js +1 -1
  31. package/dist/esm/sticky/components/Sticky.js +2 -4
  32. package/dist/esm/sticky/components/Sticky.liquid.js +1 -2
  33. package/dist/types/index.d.ts +1 -0
  34. package/package.json +2 -2
@@ -55,6 +55,7 @@ const Breadcrumb = ({ className, setting = {}, style: style$1, styles = {}, buil
55
55
  ...attr.getNavAttr()
56
56
  });
57
57
  const navStyles = system.createStyle({
58
+ ...core.makeGlobalSize(setting?.globalSize).padding,
58
59
  ...style.getSpacingStyles(setting?.spacing),
59
60
  ...core.makeStyleResponsive('jc', align)
60
61
  });
@@ -49,6 +49,7 @@ const Breadcrumb = ({ setting = {}, builderAttrs, style: style$1, styles = {}, c
49
49
  ...attr.getNavAttr()
50
50
  });
51
51
  const navStyles = system.createStyle({
52
+ ...core.makeGlobalSize(setting?.globalSize).padding,
52
53
  ...style.getSpacingStyles(spacing),
53
54
  ...core.makeStyleResponsive('jc', align)
54
55
  });
@@ -4,6 +4,31 @@ const BreadcrumbSettings = [
4
4
  {
5
5
  id: 'setting',
6
6
  controls: [
7
+ {
8
+ id: 'globalSize',
9
+ type: 'size-setting',
10
+ devices: {
11
+ desktop: {
12
+ default: {
13
+ width: 'Auto',
14
+ height: 'Auto',
15
+ padding: {
16
+ type: 'custom',
17
+ top: '4px',
18
+ bottom: '4px',
19
+ left: '16px',
20
+ right: '16px'
21
+ }
22
+ }
23
+ }
24
+ },
25
+ hiddenSettings: [
26
+ 'shape',
27
+ 'gap',
28
+ 'width',
29
+ 'height'
30
+ ]
31
+ },
7
32
  {
8
33
  id: 'hideCurrentPage',
9
34
  type: 'toggle',
@@ -37,10 +62,12 @@ const BreadcrumbSettings = [
37
62
  {
38
63
  id: 'spacing',
39
64
  label: 'Spacing',
40
- type: 'input:unit',
65
+ type: 'input:slider',
41
66
  units: [
42
67
  'px'
43
68
  ],
69
+ step: 1,
70
+ max: 40,
44
71
  devices: {
45
72
  desktop: {
46
73
  default: '4px'
@@ -180,7 +207,7 @@ const BreadcrumbSettings = [
180
207
  id: 'color',
181
208
  type: 'color-picker-v2',
182
209
  label: 'Color',
183
- default: '#595959'
210
+ default: 'text-1'
184
211
  }
185
212
  ]
186
213
  },
@@ -2,205 +2,321 @@
2
2
 
3
3
  const SettingUIV2 = [
4
4
  {
5
+ label: {
6
+ en: 'Separator Icon'
7
+ },
5
8
  controls: [
6
9
  {
7
10
  label: {
8
- en: 'Hide current page'
11
+ en: 'Icon'
9
12
  },
10
13
  setting: {
11
- id: 'hideCurrentPage'
14
+ id: 'iconSvg'
15
+ }
16
+ },
17
+ {
18
+ label: {
19
+ en: 'Color'
12
20
  },
13
- options: {
14
- labelVariant: 'primary',
15
- toggleStyle: 'switch'
21
+ setting: {
22
+ id: 'color'
23
+ }
24
+ },
25
+ {
26
+ label: {
27
+ en: 'Size'
28
+ },
29
+ setting: {
30
+ id: 'iconWidth'
16
31
  }
17
32
  }
18
33
  ]
19
34
  },
20
35
  {
21
36
  label: {
22
- en: 'Item'
37
+ en: 'Text style'
23
38
  },
24
39
  controls: [
25
40
  {
26
- label: {
27
- en: 'Text style'
41
+ setting: {
42
+ id: 'typo'
28
43
  },
29
- type: 'combo',
30
- iconName: 'polaris-text-title',
31
- fixedValue: 'Edit...',
32
- isHideClear: true,
33
- controls: [
34
- {
35
- setting: {
36
- id: 'typo'
44
+ layout: 'vertical',
45
+ options: {
46
+ updateFields: [
47
+ {
48
+ field: 'attrs.color',
49
+ settingId: 'labelColor',
50
+ state: 'normal'
37
51
  },
38
- layout: 'vertical',
39
- options: {
40
- updateFields: [
41
- {
42
- field: 'attrs.color',
43
- settingId: 'labelColor',
44
- state: 'normal'
45
- },
46
- {
47
- field: 'custom.fontWeight',
48
- settingId: 'fontWeight',
49
- state: 'normal'
50
- }
51
- ]
52
+ {
53
+ field: 'custom.fontWeight',
54
+ settingId: 'fontWeight',
55
+ state: 'normal'
56
+ }
57
+ ]
58
+ },
59
+ controlChangeTrigger: {
60
+ settings: [
61
+ {
62
+ action: {
63
+ controlId: 'labelColor',
64
+ valueFromField: 'attrs.color',
65
+ groupType: 'setting',
66
+ controlType: 'setting',
67
+ removeDevice: true,
68
+ state: 'normal'
69
+ }
52
70
  },
53
- controlChangeTrigger: {
54
- settings: [
55
- {
56
- action: {
57
- controlId: 'labelColor',
58
- valueFromField: 'attrs.color',
59
- groupType: 'setting',
60
- controlType: 'setting',
61
- removeDevice: true,
62
- state: 'normal'
63
- }
64
- },
65
- {
66
- action: {
67
- controlId: 'fontWeight',
68
- valueFromField: 'custom.fontWeight',
69
- groupType: 'setting',
70
- controlType: 'setting',
71
- removeDevice: true,
72
- state: 'normal'
73
- }
74
- }
75
- ],
76
- options: {
77
- noRecordHistory: true
71
+ {
72
+ action: {
73
+ controlId: 'fontWeight',
74
+ valueFromField: 'custom.fontWeight',
75
+ groupType: 'setting',
76
+ controlType: 'setting',
77
+ removeDevice: true,
78
+ state: 'normal'
78
79
  }
79
80
  }
81
+ ],
82
+ options: {
83
+ noRecordHistory: true
80
84
  }
81
- ]
82
- },
85
+ }
86
+ }
87
+ ]
88
+ },
89
+ {
90
+ label: {
91
+ en: 'Item spacing'
92
+ },
93
+ controls: [
83
94
  {
84
95
  label: {
85
- en: 'Effect'
96
+ en: 'Gap'
86
97
  },
87
- type: 'combo',
88
- iconName: 'polaris-edit',
89
- fixedValue: 'Hover',
90
- isHideClear: true,
91
- popoverLabel: {
92
- en: 'Hover'
98
+ setting: {
99
+ id: 'spacing'
100
+ }
101
+ }
102
+ ]
103
+ },
104
+ {
105
+ label: {
106
+ en: 'Size'
107
+ },
108
+ controls: [
109
+ {
110
+ label: {
111
+ en: 'Padding'
93
112
  },
94
- controls: [
95
- {
96
- label: {
97
- en: 'Text color'
98
- },
99
- setting: {
100
- id: 'labelColor',
101
- state: 'hover'
102
- }
113
+ controlConfig: {
114
+ id: 'padding',
115
+ type: 'padding-v2',
116
+ linkWithSetting: {
117
+ name: 'globalSize',
118
+ field: 'padding'
103
119
  },
104
- {
105
- label: {
106
- en: 'Font weight'
107
- },
108
- setting: {
109
- id: 'fontWeight',
110
- state: 'hover'
120
+ compoDefaultValue: {
121
+ desktop: {
122
+ default: {
123
+ type: 'custom',
124
+ top: '4px',
125
+ bottom: '4px',
126
+ left: '16px',
127
+ right: '16px'
128
+ }
111
129
  }
112
130
  }
113
- ]
131
+ }
114
132
  }
115
133
  ]
116
134
  },
117
135
  {
118
136
  label: {
119
- en: 'Item spacing'
137
+ en: 'Background'
120
138
  },
121
139
  controls: [
122
140
  {
123
141
  label: {
124
- en: 'Spacing'
142
+ en: 'Color'
125
143
  },
126
- setting: {
127
- id: 'spacing'
144
+ controlConfig: {
145
+ id: 'background-color',
146
+ type: 'color-picker-v2',
147
+ linkWithSetting: {
148
+ name: 'background',
149
+ field: 'color'
150
+ },
151
+ compoDefaultValue: {
152
+ desktop: {
153
+ default: '#ffffff'
154
+ }
155
+ }
128
156
  }
129
157
  }
130
158
  ]
131
159
  },
132
160
  {
133
161
  label: {
134
- en: 'Separator Icon'
162
+ en: 'Shape'
135
163
  },
136
164
  controls: [
137
165
  {
138
166
  label: {
139
- en: 'Choose icon'
167
+ en: 'Border'
140
168
  },
141
169
  setting: {
142
- id: 'iconSvg'
170
+ id: 'border',
171
+ state: 'normal'
143
172
  }
144
173
  },
145
174
  {
146
175
  label: {
147
- en: 'Size'
176
+ en: 'Corner'
148
177
  },
149
178
  setting: {
150
- id: 'iconWidth'
179
+ id: 'rounded',
180
+ state: 'normal'
151
181
  }
152
182
  },
153
183
  {
154
184
  label: {
155
- en: 'Icon color'
185
+ en: 'Shadow'
156
186
  },
157
187
  setting: {
158
- id: 'color'
188
+ id: 'boxShadow',
189
+ state: 'normal'
190
+ },
191
+ options: {
192
+ updateFields: [
193
+ {
194
+ field: 'enable',
195
+ settingId: 'hasBoxShadow',
196
+ state: 'normal'
197
+ }
198
+ ]
199
+ },
200
+ controlChangeTrigger: {
201
+ settings: [
202
+ {
203
+ condition: `boxShadow.normal.enable === true`,
204
+ source: [
205
+ 'boxShadow',
206
+ 'hasBoxShadow'
207
+ ],
208
+ action: {
209
+ controlId: 'hasBoxShadow',
210
+ groupType: 'advanced',
211
+ controlType: 'advanced',
212
+ state: 'normal',
213
+ newValue: true
214
+ }
215
+ },
216
+ {
217
+ condition: `boxShadow.normal.enable === false`,
218
+ source: [
219
+ 'boxShadow',
220
+ 'hasBoxShadow'
221
+ ],
222
+ action: {
223
+ controlId: 'hasBoxShadow',
224
+ groupType: 'advanced',
225
+ controlType: 'advanced',
226
+ state: 'normal',
227
+ newValue: false
228
+ }
229
+ }
230
+ ],
231
+ options: {
232
+ noRecordHistory: true
233
+ }
159
234
  }
160
235
  }
161
236
  ]
162
237
  },
163
238
  {
164
239
  label: {
165
- en: 'Background'
240
+ en: 'Effect'
166
241
  },
167
242
  controls: [
168
243
  {
169
244
  label: {
170
- en: 'Color'
245
+ en: 'Hover'
171
246
  },
172
- controlConfig: {
173
- id: 'background-color',
174
- type: 'color-picker-v2',
175
- linkWithSetting: {
176
- name: 'background',
177
- field: 'color'
247
+ type: 'combo',
248
+ iconName: 'polaris-check-hover',
249
+ fixedValue: 'Enabled',
250
+ isHideClear: true,
251
+ popoverLabel: {
252
+ en: 'Hover'
253
+ },
254
+ controls: [
255
+ {
256
+ label: {
257
+ en: 'Text color'
258
+ },
259
+ setting: {
260
+ id: 'labelColor',
261
+ state: 'hover'
262
+ }
263
+ },
264
+ {
265
+ label: {
266
+ en: 'Font weight'
267
+ },
268
+ setting: {
269
+ id: 'fontWeight',
270
+ state: 'hover'
271
+ }
178
272
  }
179
- }
273
+ ]
274
+ },
275
+ {
276
+ label: {
277
+ en: 'Active'
278
+ },
279
+ type: 'combo',
280
+ iconName: 'polaris-status-active',
281
+ fixedValue: 'Enabled',
282
+ isHideClear: true,
283
+ popoverLabel: {
284
+ en: 'Active'
285
+ },
286
+ controls: [
287
+ {
288
+ label: {
289
+ en: 'Text color'
290
+ },
291
+ setting: {
292
+ id: 'labelColor',
293
+ state: 'active'
294
+ }
295
+ },
296
+ {
297
+ label: {
298
+ en: 'Font weight'
299
+ },
300
+ setting: {
301
+ id: 'fontWeight',
302
+ state: 'active'
303
+ }
304
+ }
305
+ ]
180
306
  }
181
307
  ]
182
308
  },
183
309
  {
184
310
  label: {
185
- en: 'Active item'
311
+ en: 'Display option'
186
312
  },
187
313
  controls: [
188
314
  {
189
315
  label: {
190
- en: 'Text color'
316
+ en: 'Current page'
191
317
  },
192
318
  setting: {
193
- id: 'labelColor',
194
- state: 'active'
195
- }
196
- },
197
- {
198
- label: {
199
- en: 'Font weight'
200
- },
201
- setting: {
202
- id: 'fontWeight',
203
- state: 'active'
319
+ id: 'hideCurrentPage'
204
320
  }
205
321
  }
206
322
  ]
@@ -424,7 +424,8 @@ const ButtonSettings = [
424
424
  hover: 'text-3'
425
425
  }
426
426
  }
427
- }
427
+ },
428
+ enableGradient: true
428
429
  },
429
430
  {
430
431
  id: 'transform',
@@ -2,8 +2,22 @@
2
2
 
3
3
  var core = require('@gem-sdk/core');
4
4
 
5
- const getActiveClasses = (backgroundColorActive, textActive)=>{
6
- return core.composeClasses(core.cls('gp-coupon', backgroundColorActive ? `[&_button]:data-[active=true]:!gp-bg-[${backgroundColorActive}]` : '', textActive ? `[&_button]:data-[active=true]:!gp-text-[${textActive}]` : ''));
5
+ const getActiveClasses = (backgroundColor, text)=>{
6
+ const breakpoints = {
7
+ desktop: '',
8
+ tablet: 'tablet:',
9
+ mobile: 'mobile:'
10
+ };
11
+ const generateClass = (type, device, value)=>value ? `${breakpoints[device]}[_&button]:data-[active=true]:!gp-${type}-[${value}]` : '';
12
+ const classes = [
13
+ generateClass('bg', 'desktop', backgroundColor?.desktop?.active),
14
+ generateClass('bg', 'tablet', backgroundColor?.tablet?.active),
15
+ generateClass('bg', 'mobile', backgroundColor?.mobile?.active),
16
+ generateClass('text', 'desktop', text?.desktop?.active),
17
+ generateClass('text', 'tablet', text?.tablet?.active),
18
+ generateClass('text', 'mobile', text?.mobile?.active)
19
+ ].filter(Boolean).join(' ');
20
+ return core.composeClasses(core.cls('gp-coupon', classes));
7
21
  };
8
22
 
9
23
  exports.getActiveClasses = getActiveClasses;
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
3
  const getButtonSetting = (setting, label, htmlType)=>{
4
- const { iconSvg, iconAlign, couponLayout, translate, shouldClearSpace } = setting ?? {};
4
+ const { iconSvg, iconAlign, couponLayout, translate, shouldClearSpace, iconVisible } = setting ?? {};
5
5
  return {
6
6
  label,
7
7
  htmlType,
8
8
  iconAlign,
9
9
  iconSvg,
10
- iconVisible: couponLayout === 'icon',
10
+ iconVisible: couponLayout === 'icon' && iconVisible,
11
11
  translate,
12
12
  shouldClearSpace
13
13
  };
@@ -2,10 +2,9 @@
2
2
 
3
3
  var core = require('@gem-sdk/core');
4
4
 
5
- const getButtonStyles = (styles, removedActiveShadow)=>{
5
+ const getButtonStyles = (styles)=>{
6
6
  return {
7
- ...styles,
8
- hasBoxShadowBtn: removedActiveShadow
7
+ ...styles
9
8
  };
10
9
  };
11
10
  const getButtonStyle = (style, styles)=>{
@@ -14,33 +13,52 @@ const getButtonStyle = (style, styles)=>{
14
13
  ...core.makeStyleResponsive('ta', styles?.align)
15
14
  };
16
15
  };
17
- const getInnerBorderCornerCss = (data)=>{
18
- const { borderActive, cornerActive, uid, styles } = data;
19
- return `
20
- .gp-coupon[data-active="true"] .${uid}::before {
21
- ${core.composeBorderCss(borderActive)}
22
- }
23
- .gp-coupon[data-active="true"] .${uid} {
24
- ${core.composeCornerCss(cornerActive, true)}
25
- }
26
- .gp-coupon[data-active="true"] .${uid} {
27
- box-shadow: ${styles?.hasBoxShadowBtn?.active ? core.getStyleShadow({
28
- value: styles?.boxShadowBtn?.active,
29
- state: 'active',
30
- styleAppliedFor: 'box-shadow',
31
- isEnableShadow: true
32
- })['--shadow'] : 'none'}
33
- }
34
- `;
35
- };
36
- const removedActiveShadow = (styles)=>{
16
+ const getResponsiveSetting = (setting)=>{
17
+ const desktop = setting.desktop;
18
+ const tablet = setting.tablet ? setting.tablet : desktop;
19
+ const mobile = setting.mobile ? setting.mobile : tablet;
37
20
  return {
38
- hover: styles?.hasBoxShadowBtn?.hover,
39
- normal: styles?.hasBoxShadowBtn?.normal
21
+ desktop,
22
+ tablet,
23
+ mobile
24
+ };
25
+ };
26
+ const getInnerBorderCornerCss = (data)=>{
27
+ const { uid, styles } = data;
28
+ const borderBtnV2 = getResponsiveSetting(styles?.borderBtnV2 || {});
29
+ const roundedBtnV2 = getResponsiveSetting(styles?.roundedBtnV2 || {});
30
+ const boxShadowBtnV2 = getResponsiveSetting(styles?.boxShadowBtnV2 || {});
31
+ const getShadowValue = (value)=>value ? core.getStyleShadow({
32
+ value,
33
+ state: 'active',
34
+ styleAppliedFor: 'box-shadow',
35
+ isEnableShadow: true
36
+ })['--shadow'] : 'none';
37
+ const breakpoints = {
38
+ desktop: '',
39
+ tablet: '@media only screen and (max-width: 1024px) and (min-width: 768px)',
40
+ mobile: '@media only screen and (max-width: 768px)'
41
+ };
42
+ const generateStyles = (device)=>{
43
+ const mediaQuery = breakpoints[device] ? `${breakpoints[device]} {` : '';
44
+ const closeMediaQuery = mediaQuery ? '}' : '';
45
+ return `
46
+ ${mediaQuery}
47
+ .gp-coupon[data-active="true"] .${uid} {
48
+ ${core.composeBorderCss(borderBtnV2?.[device]?.active)} !important;
49
+ ${core.composeCornerCss(roundedBtnV2?.[device]?.active)} !important;
50
+ box-shadow: ${getShadowValue(boxShadowBtnV2?.[device]?.active)} !important;
51
+ }
52
+ ${closeMediaQuery}
53
+ `;
40
54
  };
55
+ return [
56
+ generateStyles('desktop'),
57
+ generateStyles('tablet'),
58
+ generateStyles('mobile')
59
+ ].join('\n').trim();
41
60
  };
42
61
 
43
62
  exports.getButtonStyle = getButtonStyle;
44
63
  exports.getButtonStyles = getButtonStyles;
45
64
  exports.getInnerBorderCornerCss = getInnerBorderCornerCss;
46
- exports.removedActiveShadow = removedActiveShadow;
@@ -12,14 +12,11 @@ var useCoupon = require('../hooks/useCoupon.js');
12
12
  var classes = require('../common/classes.js');
13
13
 
14
14
  const Coupon = ({ setting, builderProps, builderAttrs, style, styles: styles$1, advanced, children })=>{
15
- const { borderBtn, roundedBtn, backgroundColor, textColor } = styles$1 ?? {};
15
+ const { backgroundColorV2, textColorHover } = styles$1 ?? {};
16
16
  const { mode, changeStateILP, defaultLabelState, dataActive } = useCoupon.default(setting);
17
- const computedRemovedActiveShadow = system.createStyle(styles.removedActiveShadow(styles$1));
18
- const composeCouponComponentClasses = system.createClass(classes.getActiveClasses(backgroundColor?.active, textColor?.active));
17
+ const composeCouponComponentClasses = system.createClass(classes.getActiveClasses(backgroundColorV2, textColorHover));
19
18
  const computedInnerBorderCornerCss = styles.getInnerBorderCornerCss({
20
19
  uid: builderProps?.uid,
21
- borderActive: borderBtn?.active,
22
- cornerActive: roundedBtn?.active,
23
20
  styles: styles$1
24
21
  });
25
22
  return /*#__PURE__*/ jsxRuntime.jsxs("div", {
@@ -44,7 +41,7 @@ const Coupon = ({ setting, builderProps, builderAttrs, style, styles: styles$1,
44
41
  ...styles.getButtonStyle(style, styles$1)
45
42
  },
46
43
  styles: {
47
- ...styles.getButtonStyles(styles$1, computedRemovedActiveShadow)
44
+ ...styles.getButtonStyles(styles$1)
48
45
  },
49
46
  children: children
50
47
  })