@gem-sdk/components 2.0.0-dev.423 → 2.0.0-dev.425

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 (28) hide show
  1. package/dist/cjs/banner/components/HeroBanner.liquid.js +2 -1
  2. package/dist/cjs/banner/components/common/getClasses.js +5 -2
  3. package/dist/cjs/banner/setting/setting.js +1 -3
  4. package/dist/cjs/banner/setting/uiV2.js +34 -29
  5. package/dist/cjs/icon-list/common/styles.js +16 -6
  6. package/dist/cjs/icon-list/components/IconList.js +3 -3
  7. package/dist/cjs/icon-list/components/IconList.liquid.js +4 -4
  8. package/dist/cjs/icon-list/components/IconListItem.js +2 -2
  9. package/dist/cjs/icon-list/components/IconListItem.liquid.js +2 -2
  10. package/dist/cjs/icon-list/setting/configs/ItemTemplate.js +26 -0
  11. package/dist/cjs/icon-list/setting/configs/settings.js +131 -5
  12. package/dist/cjs/icon-list/setting/configs/uiV2.js +175 -5
  13. package/dist/cjs/product/setting/product-title/configs/settings.js +4 -1
  14. package/dist/esm/banner/components/HeroBanner.liquid.js +2 -1
  15. package/dist/esm/banner/components/common/getClasses.js +5 -2
  16. package/dist/esm/banner/setting/setting.js +1 -3
  17. package/dist/esm/banner/setting/uiV2.js +34 -29
  18. package/dist/esm/icon-list/common/styles.js +17 -7
  19. package/dist/esm/icon-list/components/IconList.js +3 -3
  20. package/dist/esm/icon-list/components/IconList.liquid.js +4 -4
  21. package/dist/esm/icon-list/components/IconListItem.js +2 -2
  22. package/dist/esm/icon-list/components/IconListItem.liquid.js +2 -2
  23. package/dist/esm/icon-list/setting/configs/ItemTemplate.js +26 -0
  24. package/dist/esm/icon-list/setting/configs/settings.js +131 -5
  25. package/dist/esm/icon-list/setting/configs/uiV2.js +175 -5
  26. package/dist/esm/product/setting/product-title/configs/settings.js +4 -1
  27. package/dist/types/index.d.ts +9 -1
  28. package/package.json +1 -1
@@ -56,7 +56,10 @@ const ProductTitleSettings = [
56
56
  id: 'typo',
57
57
  type: 'typography-v2',
58
58
  default: {
59
- type: 'subheading-3'
59
+ type: 'subheading-3',
60
+ attrs: {
61
+ transform: 'none'
62
+ }
60
63
  },
61
64
  ignoreReRender: true,
62
65
  hiddenSetting: {
@@ -24,7 +24,8 @@ const HeroBanner = (props)=>{
24
24
  contentPosition2Col: styles?.contentPosition2Col,
25
25
  aspectRatio: setting?.aspectRatio,
26
26
  target: urlData?.target ?? '_blank',
27
- href: urlData?.href ?? ''
27
+ href: urlData?.href ?? '',
28
+ linkType: link?.type ?? ''
28
29
  });
29
30
  const hasLinkCover = !!link?.link;
30
31
  const attrs = createAttr({
@@ -43,8 +43,11 @@ const getRowClasses = (styles, setting)=>{
43
43
  const fitContentClass = getClassForContentByFitContent(sizeSetting, background);
44
44
  const stretchContentClass = getClassForStretchContent(verticalAlign);
45
45
  const layoutClass = getClassSpaceBetween(setting?.layout || {}, styles?.contentPosition1Col || {}, styles?.contentPosition2Col || {});
46
- const classList = `gp-hero-banner-row gp-absolute gp-inset-0 gp-left-[var(--left)] gp-top-[var(--top)] gp-transition-all gp-duration-300 group-hover/hero:gp-bg-[color:var(--hvr-bgc,_var(--bgc))] group-hover/hero:gp-opacity-[var(--hvr-op,_var(--op))] ${fitContentClass} ${stretchContentClass} ${layoutClass}`;
47
- return composeClasses(classList.trim());
46
+ const classList = `gp-hero-banner-row gp-transition-all gp-duration-300 group-hover/hero:gp-bg-[color:var(--hvr-bgc,_var(--bgc))] group-hover/hero:gp-opacity-[var(--hvr-op,_var(--op))] ${fitContentClass} ${stretchContentClass}`;
47
+ return {
48
+ ...composeClasses(classList),
49
+ ...layoutClass
50
+ };
48
51
  };
49
52
  const getAdaptiveClasses = ()=>{
50
53
  const classList = `adaptive-hero-banner`;
@@ -162,6 +162,7 @@ const SettingsV2 = [
162
162
  label: 'Speed',
163
163
  useOnlyUnitInit: true,
164
164
  hideUnit: true,
165
+ isNumber: true,
165
166
  min: 0,
166
167
  max: 1,
167
168
  step: 0.1,
@@ -668,9 +669,6 @@ const SettingsV2 = [
668
669
  id: 'overlayColor',
669
670
  label: 'Color',
670
671
  type: 'color-picker-v2',
671
- default: {
672
- normal: '#121212'
673
- },
674
672
  state: {
675
673
  normal: true,
676
674
  hover: true
@@ -102,36 +102,41 @@ const SettingUIV2 = [
102
102
  id: 'background'
103
103
  },
104
104
  layout: 'vertical'
105
- },
106
- {
107
- label: {
108
- en: 'Overlay'
109
- },
110
- type: 'combo',
111
- comboType: 'color',
112
- getValueFromSettingID: 'overlayColor.normal',
113
- controls: [
114
- {
115
- setting: {
116
- id: 'overlayColor',
117
- state: 'normal'
118
- },
119
- label: {
120
- en: 'Color'
121
- }
105
+ }
106
+ ],
107
+ moreSettings: {
108
+ type: 'collapse',
109
+ controls: [
110
+ {
111
+ label: {
112
+ en: 'Overlay'
122
113
  },
123
- {
124
- setting: {
125
- id: 'overlayOpacity',
126
- state: 'normal'
114
+ type: 'combo',
115
+ comboType: 'color',
116
+ getValueFromSettingID: 'overlayColor.normal',
117
+ controls: [
118
+ {
119
+ setting: {
120
+ id: 'overlayColor',
121
+ state: 'normal'
122
+ },
123
+ label: {
124
+ en: 'Color'
125
+ }
127
126
  },
128
- label: {
129
- en: 'Opacity'
127
+ {
128
+ setting: {
129
+ id: 'overlayOpacity',
130
+ state: 'normal'
131
+ },
132
+ label: {
133
+ en: 'Opacity'
134
+ }
130
135
  }
131
- }
132
- ]
133
- }
134
- ]
136
+ ]
137
+ }
138
+ ]
139
+ }
135
140
  },
136
141
  {
137
142
  label: {
@@ -245,7 +250,7 @@ const SettingUIV2 = [
245
250
  {
246
251
  type: 'combo',
247
252
  fixedValue: 'Effect',
248
- iconName: 'polaris-star',
253
+ iconName: 'polaris-check-clicked',
249
254
  label: {
250
255
  en: 'Hover'
251
256
  },
@@ -309,7 +314,7 @@ const SettingUIV2 = [
309
314
  label: {
310
315
  en: 'Parallax scroll'
311
316
  },
312
- iconName: 'polaris-star',
317
+ iconName: 'polaris-parallax-effect',
313
318
  getValueFromSettingID: 'speedParallax',
314
319
  defaultValueWhenClear: 0,
315
320
  controls: [
@@ -1,24 +1,34 @@
1
- import { makeStyleResponsive, getStyleBackgroundByDevice } from '@gem-sdk/core';
1
+ import { makeGlobalSize, makeStyleResponsive, getStyleBackgroundByDevice, getGradientBgrStyleByDevice, getResponsiveStyleShadowWithoutState, composeRadiusResponsive, composeBorderResponsive, getGlobalColorResponsiveStyle } from '@gem-sdk/core';
2
2
 
3
3
  const getContainerStyles = (style, styles, extraData)=>{
4
- const { align, background } = styles || {};
4
+ const { align, background, globalSize } = styles || {};
5
+ const composePadding = makeGlobalSize(globalSize);
5
6
  return {
6
7
  ...style,
7
8
  ...extraData?.advancedClasses,
9
+ ...composePadding.width,
10
+ ...composePadding.padding,
8
11
  ...makeStyleResponsive('ta', align),
9
12
  ...getStyleBackgroundByDevice(background, {
10
13
  liquid: extraData?.isLiquid
11
- })
14
+ }),
15
+ ...getGradientBgrStyleByDevice(background)
12
16
  };
13
17
  };
14
- const getItemStyles = (horizontalSpacing)=>{
18
+ const getItemStyles = (parentStyles)=>{
19
+ const composePadding = makeGlobalSize(parentStyles?.itemPadding);
15
20
  return {
16
- ...makeStyleResponsive('cg', horizontalSpacing)
21
+ ...composePadding.padding,
22
+ ...getResponsiveStyleShadowWithoutState(parentStyles?.itemBoxShadow, 'box-shadow', parentStyles?.itemBoxShadow),
23
+ ...composeRadiusResponsive(parentStyles?.itemRounded),
24
+ ...composeBorderResponsive(parentStyles?.itemBorder),
25
+ ...getGlobalColorResponsiveStyle('bgc', parentStyles?.itemBackgroundColor),
26
+ ...makeStyleResponsive('cg', parentStyles?.horizontalSpacing)
17
27
  };
18
28
  };
19
- const getUlStyles = (verticalSpacing)=>{
29
+ const getUlStyles = (parentStyles)=>{
20
30
  return {
21
- ...makeStyleResponsive('rg', verticalSpacing)
31
+ ...makeStyleResponsive('gg', parentStyles?.verticalSpacing)
22
32
  };
23
33
  };
24
34
 
@@ -9,13 +9,13 @@ import { getUlClasses } from '../common/classes.js';
9
9
 
10
10
  const IconList = ({ style, setting, children, styles, builderProps, advanced })=>{
11
11
  const { preload } = setting || {};
12
- const { background, horizontalSpacing, verticalSpacing } = styles ?? {};
12
+ const { background } = styles ?? {};
13
13
  const advancedStyle = composeAdvanceStyle(advanced);
14
14
  const computedContainerStyles = createStyle(getContainerStyles(style, styles, {
15
15
  advancedClasses: advancedStyle
16
16
  }));
17
17
  const computedUlClasses = createClass(getUlClasses(advanced?.cssClass));
18
- const computedUlStyles = createStyle(getUlStyles(verticalSpacing));
18
+ const computedUlStyles = createStyle(getUlStyles(styles));
19
19
  return /*#__PURE__*/ jsxs(Fragment, {
20
20
  children: [
21
21
  If(preload, /*#__PURE__*/ jsxs(Head, {
@@ -52,7 +52,7 @@ const IconList = ({ style, setting, children, styles, builderProps, advanced })=
52
52
  return /*#__PURE__*/ jsx(child.type, {
53
53
  ...child.props,
54
54
  parentUid: builderProps?.uid,
55
- horizontalSpacing: horizontalSpacing,
55
+ parentStyles: styles,
56
56
  dataIndex: key
57
57
  });
58
58
  }
@@ -6,14 +6,14 @@ import { getUlClasses } from '../common/classes.js';
6
6
 
7
7
  const IconList = ({ builderProps, style, setting, rawChildren, styles, advanced })=>{
8
8
  const { preload } = setting || {};
9
- const { background, horizontalSpacing, verticalSpacing } = styles || {};
9
+ const { background } = styles || {};
10
10
  const advancedStyle = composeAdvanceStyle(advanced);
11
11
  const computedContainerStyles = createStyle(getContainerStyles(style, styles, {
12
12
  advancedClasses: advancedStyle,
13
13
  isLiquid: true
14
14
  }));
15
15
  const computedUlClasses = createClass(getUlClasses(advanced?.cssClass));
16
- const computedUlStyles = createStyle(getUlStyles(verticalSpacing));
16
+ const computedUlStyles = createStyle(getUlStyles(styles));
17
17
  return template`
18
18
  ${If(!!preload, `${If(!!background?.desktop?.image?.src, `<link rel="preload" href="${background?.desktop?.image?.src}" as="image" />`)}
19
19
  ${If(!!background?.tablet?.image?.src, `<link rel="preload" href="${background?.tablet?.image?.src}" as="image" />`)}
@@ -33,9 +33,9 @@ const IconList = ({ builderProps, style, setting, rawChildren, styles, advanced
33
33
  if (child) {
34
34
  return RenderChildren({
35
35
  ...child,
36
- horizontalSpacing: horizontalSpacing,
37
36
  dataIndex: index,
38
- parentUid: builderProps?.uid
37
+ parentUid: builderProps?.uid,
38
+ parentStyles: styles
39
39
  });
40
40
  }
41
41
  }))}
@@ -7,7 +7,7 @@ import { getItemClasses } from '../common/classes.js';
7
7
  import { getItemAttrs } from '../common/attrs.js';
8
8
  import { getItemStyles } from '../common/styles.js';
9
9
 
10
- const IconListItem = ({ children, horizontalSpacing, parentUid, builderProps, dataIndex })=>{
10
+ const IconListItem = ({ children, parentUid, builderProps, dataIndex, parentStyles })=>{
11
11
  if (isEmptyChildren(children)) {
12
12
  return null;
13
13
  }
@@ -15,7 +15,7 @@ const IconListItem = ({ children, horizontalSpacing, parentUid, builderProps, da
15
15
  const computedItemAttrs = createAttr({
16
16
  ...getItemAttrs(builderProps?.uid, dataIndex)
17
17
  });
18
- const computedItemStyles = createStyle(getItemStyles(horizontalSpacing));
18
+ const computedItemStyles = createStyle(getItemStyles(parentStyles));
19
19
  return /*#__PURE__*/ jsx("li", {
20
20
  className: computedItemClasses,
21
21
  ...computedItemAttrs,
@@ -4,7 +4,7 @@ import { getItemClasses } from '../common/classes.js';
4
4
  import { getItemAttrs } from '../common/attrs.js';
5
5
  import { getItemStyles } from '../common/styles.js';
6
6
 
7
- const IconListItem = ({ children, horizontalSpacing, dataIndex, parentUid, builderProps })=>{
7
+ const IconListItem = ({ children, dataIndex, parentUid, builderProps, parentStyles })=>{
8
8
  if (isEmptyChildren(children)) {
9
9
  return null;
10
10
  }
@@ -12,7 +12,7 @@ const IconListItem = ({ children, horizontalSpacing, dataIndex, parentUid, build
12
12
  const computedItemAttrs = createAttr({
13
13
  ...getItemAttrs(builderProps?.uid, dataIndex)
14
14
  });
15
- const computedItemStyles = createStyle(getItemStyles(horizontalSpacing));
15
+ const computedItemStyles = createStyle(getItemStyles(parentStyles));
16
16
  return template`
17
17
  <li
18
18
  ${computedItemAttrs}
@@ -36,6 +36,32 @@ const itemChildrenTemplateImage = (src)=>({
36
36
  }
37
37
  ]
38
38
  },
39
+ {
40
+ tag: 'Col',
41
+ styles: {
42
+ fullWidth: true
43
+ },
44
+ advanced: {
45
+ w: {
46
+ desktop: '100%'
47
+ },
48
+ boxShadow: {
49
+ desktop: {
50
+ normal: {}
51
+ }
52
+ }
53
+ },
54
+ childrens: [
55
+ {
56
+ tag: 'Text',
57
+ settings: {
58
+ text: 'Your custom text goes here',
59
+ htmlTag: 'div'
60
+ },
61
+ childrens: []
62
+ }
63
+ ]
64
+ },
39
65
  {
40
66
  tag: 'Col',
41
67
  styles: {
@@ -57,7 +57,7 @@ const IconListSettings = [
57
57
  desktop: {
58
58
  default: {
59
59
  type: 'color',
60
- color: '#DDDDDD',
60
+ color: 'bg-2',
61
61
  image: {
62
62
  src: 'https://ucarecdn.com/5e27d43d-eb1e-4e71-b7e1-4158f3071bb6/-/format/auto/',
63
63
  width: 1200,
@@ -110,28 +110,154 @@ const IconListSettings = [
110
110
  {
111
111
  id: 'horizontalSpacing',
112
112
  label: 'Horizontal Spacing',
113
- type: 'input:unit',
113
+ type: 'input:slider',
114
114
  units: [
115
115
  'px'
116
116
  ],
117
+ step: 1,
118
+ min: 0,
119
+ max: 40,
117
120
  devices: {
118
121
  desktop: {
119
- default: '16'
122
+ default: '12px'
120
123
  }
121
124
  }
122
125
  },
123
126
  {
124
127
  id: 'verticalSpacing',
125
128
  label: 'Vertical Spacing',
126
- type: 'input:unit',
129
+ type: 'input:slider',
127
130
  units: [
128
131
  'px'
129
132
  ],
133
+ step: 1,
134
+ min: 0,
135
+ max: 40,
130
136
  devices: {
131
137
  desktop: {
132
- default: '16'
138
+ default: '12px'
133
139
  }
134
140
  }
141
+ },
142
+ {
143
+ id: 'itemPadding',
144
+ type: 'size-setting',
145
+ devices: {
146
+ desktop: {
147
+ default: {
148
+ padding: {}
149
+ }
150
+ }
151
+ },
152
+ hiddenSettings: [
153
+ 'shape',
154
+ 'gap',
155
+ 'height',
156
+ 'width'
157
+ ]
158
+ },
159
+ {
160
+ id: 'itemBackgroundColor',
161
+ type: 'color-picker-v2',
162
+ devices: {
163
+ desktop: {
164
+ default: 'transparent'
165
+ }
166
+ },
167
+ compoDefaultValue: {
168
+ desktop: {
169
+ default: 'bg-2'
170
+ }
171
+ },
172
+ enableGradient: true
173
+ },
174
+ {
175
+ id: 'itemBorder',
176
+ type: 'border-v2',
177
+ devices: {
178
+ desktop: {
179
+ default: {}
180
+ }
181
+ },
182
+ compoDefaultValue: {
183
+ desktop: {
184
+ default: {
185
+ border: 'solid',
186
+ color: '#121212',
187
+ width: '1px',
188
+ borderWidth: '1px'
189
+ }
190
+ }
191
+ }
192
+ },
193
+ {
194
+ id: 'itemRounded',
195
+ type: 'corner-v2',
196
+ devices: {
197
+ desktop: {}
198
+ },
199
+ compoDefaultValue: {
200
+ desktop: {
201
+ default: {
202
+ btrr: '8px',
203
+ bblr: '8px',
204
+ bbrr: '8px',
205
+ btlr: '8px',
206
+ radiusType: 'rounded'
207
+ }
208
+ }
209
+ }
210
+ },
211
+ {
212
+ id: 'itemBoxShadow',
213
+ type: 'shadow-v2',
214
+ devices: {
215
+ desktop: {
216
+ default: {}
217
+ }
218
+ },
219
+ compoDefaultValue: {
220
+ desktop: {
221
+ default: {
222
+ type: 'shadow-1',
223
+ distance: '4px',
224
+ blur: '4px',
225
+ spread: '0px',
226
+ color: '#121212',
227
+ angle: 45
228
+ }
229
+ }
230
+ }
231
+ },
232
+ {
233
+ id: 'globalSize',
234
+ type: 'size-setting',
235
+ devices: {
236
+ desktop: {
237
+ default: {
238
+ width: '100%',
239
+ padding: {}
240
+ }
241
+ },
242
+ mobile: {
243
+ default: {
244
+ width: '100%'
245
+ }
246
+ }
247
+ },
248
+ settingConfig: {
249
+ width: {
250
+ displayOptions: [
251
+ 'full',
252
+ 'auto'
253
+ ]
254
+ }
255
+ },
256
+ hiddenSettings: [
257
+ 'shape',
258
+ 'gap',
259
+ 'height'
260
+ ]
135
261
  }
136
262
  ]
137
263
  }