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

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 (39) hide show
  1. package/dist/cjs/form/components/form-dropdown/common/composeClasses.js +1 -1
  2. package/dist/cjs/form/components/form-dropdown/common/composeStyles.js +1 -34
  3. package/dist/cjs/form/components/form-dropdown/hooks/index.js +2 -2
  4. package/dist/cjs/form/components/newsletter/Newsletter.liquid.js +9 -7
  5. package/dist/cjs/form/components/newsletter/common/composeAttrs.js +6 -1
  6. package/dist/cjs/form/components/newsletter/common/composeStyles.js +10 -4
  7. package/dist/cjs/form/setting/form-checkbox/configs/uiV2.js +3 -0
  8. package/dist/cjs/form/setting/form-textarea/configs/uiV2.js +3 -0
  9. package/dist/cjs/form/setting/text-field/configs/uiV2.js +3 -0
  10. package/dist/cjs/marquee/setting/Marquee.js +1 -3
  11. package/dist/cjs/marquee/setting/configs/presets.js +10 -10
  12. package/dist/cjs/marquee/setting/configs/settingsV2.js +42 -40
  13. package/dist/cjs/marquee/setting/configs/uiV2.js +137 -34
  14. package/dist/cjs/product/components/ProductVariants/components/variants/index.js +4 -1
  15. package/dist/cjs/product/setting/product-list/configs/presets.js +4 -6
  16. package/dist/cjs/product/setting/product-title/configs/settings.js +2 -2
  17. package/dist/cjs/product/setting/product-variant/configs/settings.js +9 -7
  18. package/dist/cjs/product/setting/product-variant/configs/uiV2.js +0 -3
  19. package/dist/esm/form/components/form-dropdown/common/composeClasses.js +1 -1
  20. package/dist/esm/form/components/form-dropdown/common/composeStyles.js +3 -35
  21. package/dist/esm/form/components/form-dropdown/hooks/index.js +2 -2
  22. package/dist/esm/form/components/newsletter/Newsletter.liquid.js +9 -7
  23. package/dist/esm/form/components/newsletter/common/composeAttrs.js +6 -1
  24. package/dist/esm/form/components/newsletter/common/composeStyles.js +10 -4
  25. package/dist/esm/form/setting/form-checkbox/configs/uiV2.js +3 -0
  26. package/dist/esm/form/setting/form-textarea/configs/uiV2.js +3 -0
  27. package/dist/esm/form/setting/text-field/configs/uiV2.js +3 -0
  28. package/dist/esm/marquee/setting/Marquee.js +1 -3
  29. package/dist/esm/marquee/setting/configs/presets.js +10 -10
  30. package/dist/esm/marquee/setting/configs/settingsV2.js +42 -40
  31. package/dist/esm/marquee/setting/configs/uiV2.js +137 -34
  32. package/dist/esm/product/components/ProductVariants/components/variants/index.js +4 -1
  33. package/dist/esm/product/setting/product-list/configs/presets.js +4 -6
  34. package/dist/esm/product/setting/product-title/configs/settings.js +2 -2
  35. package/dist/esm/product/setting/product-variant/configs/settings.js +9 -7
  36. package/dist/esm/product/setting/product-variant/configs/uiV2.js +0 -3
  37. package/package.json +2 -2
  38. package/dist/cjs/marquee/setting/configs/settings.js +0 -318
  39. package/dist/esm/marquee/setting/configs/settings.js +0 -316
@@ -147,7 +147,7 @@ const ProductListPreset = [
147
147
  },
148
148
  styles: {
149
149
  typo: {
150
- type: 'subheading-2'
150
+ type: 'subheading-1'
151
151
  },
152
152
  textAlign: {
153
153
  desktop: 'left'
@@ -156,8 +156,7 @@ const ProductListPreset = [
156
156
  desktop: true
157
157
  },
158
158
  lineClamp: {
159
- desktop: 2,
160
- mobile: 0
159
+ desktop: 2
161
160
  },
162
161
  color: {
163
162
  normal: 'text-1'
@@ -538,7 +537,7 @@ const ProductListPreset = [
538
537
  },
539
538
  styles: {
540
539
  typo: {
541
- type: 'subheading-2'
540
+ type: 'subheading-1'
542
541
  },
543
542
  textAlign: {
544
543
  desktop: 'left'
@@ -547,8 +546,7 @@ const ProductListPreset = [
547
546
  desktop: true
548
547
  },
549
548
  lineClamp: {
550
- desktop: 2,
551
- mobile: 0
549
+ desktop: 2
552
550
  },
553
551
  color: {
554
552
  normal: 'text-1'
@@ -56,7 +56,7 @@ const ProductTitleSettings = [
56
56
  id: 'typo',
57
57
  type: 'typography-v2',
58
58
  default: {
59
- type: 'subheading-3',
59
+ type: 'heading-2',
60
60
  attrs: {
61
61
  transform: 'none'
62
62
  }
@@ -123,7 +123,7 @@ const ProductTitleSettings = [
123
123
  disableDecimal: true,
124
124
  devices: {
125
125
  desktop: {
126
- default: 12
126
+ default: 2
127
127
  }
128
128
  },
129
129
  hide: true
@@ -183,7 +183,7 @@ const ProductVariantSettings = [
183
183
  {
184
184
  id: 'layout',
185
185
  label: 'Layout',
186
- type: 'layout-segment',
186
+ type: 'option:illustration',
187
187
  iconViewBox: '0 0 66 45',
188
188
  enableItemBackground: true,
189
189
  devices: {
@@ -192,15 +192,17 @@ const ProductVariantSettings = [
192
192
  }
193
193
  },
194
194
  options: [
195
- {
196
- label: 'Horizontal',
197
- value: 'horizontal',
198
- type: 'arrange'
199
- },
200
195
  {
201
196
  label: 'Vertical',
202
197
  value: 'vertical',
203
- type: 'arrange'
198
+ type: 'arrange',
199
+ svgName: 'gp-arrange-vertical'
200
+ },
201
+ {
202
+ label: 'Horizontal',
203
+ value: 'horizontal',
204
+ type: 'arrange',
205
+ svgName: 'gp-arrange-horizontal'
204
206
  }
205
207
  ]
206
208
  },
@@ -86,9 +86,6 @@ const SettingUIV2 = [
86
86
  ]
87
87
  },
88
88
  {
89
- label: {
90
- en: 'Variant style'
91
- },
92
89
  conditionDisplay: "optionType === 'singleOption'",
93
90
  controls: [
94
91
  {
@@ -14,7 +14,7 @@ const composeFormDropdownClasses = (setting)=>{
14
14
  return composeClasses({
15
15
  [appendTypoClass]: !!appendTypoClass,
16
16
  [`${genSizeClass(setting?.size?.type)}`]: !!setting?.size?.type,
17
- 'gp-form-item !gp-outline-none focus:!gp-shadow-none hover:!gp-shadow-none': true
17
+ 'gp-form-item !gp-outline-none ': true
18
18
  });
19
19
  };
20
20
 
@@ -1,5 +1,5 @@
1
1
  import { filterTruthy } from '../../../helpers/common.js';
2
- import { composeAdvanceStyle, makeStyleResponsive, makeGlobalSize, composeSize, getStyleBackgroundByDevice, getStyleShadow, getSingleColorVariable, getCustomRadius, composeTypographyStyle } from '@gem-sdk/core';
2
+ import { composeAdvanceStyle, makeStyleResponsive, makeGlobalSize, composeSize, getStyleBackgroundByDevice, composeTypographyStyle } from '@gem-sdk/core';
3
3
 
4
4
  const composeStyles = (styles)=>filterTruthy(styles);
5
5
  const composeContainerStyles = (advanced, setting)=>{
@@ -26,7 +26,7 @@ const composeContainerStyles = (advanced, setting)=>{
26
26
  const composeFormDropdownStyles = (advanced, setting, styles)=>{
27
27
  const { border, rounded, hasBoxShadow, boxShadow } = advanced ?? {};
28
28
  const { background, size } = setting ?? {};
29
- const { globalSize, borderActive, boxShadowActive, roundedActive, backgroundColorV2Active } = styles ?? {};
29
+ const { globalSize, backgroundColorV2Active } = styles ?? {};
30
30
  const inputStyle = composeAdvanceStyle({
31
31
  border,
32
32
  rounded,
@@ -46,18 +46,6 @@ const composeFormDropdownStyles = (advanced, setting, styles)=>{
46
46
  ...!size?.type ? composeSize(size?.custom) : {},
47
47
  appearance: 'none',
48
48
  ...getStyleBackgroundByDevice(background),
49
- ...generateStylesTarget({
50
- state: 'focus',
51
- borderStyle: borderActive?.active,
52
- background: backgroundColorV2Active?.active,
53
- radius: roundedActive?.active
54
- }),
55
- ...getStyleShadow({
56
- value: boxShadowActive?.active,
57
- state: 'focus',
58
- styleAppliedFor: 'box-shadow',
59
- isEnableShadow: true
60
- }),
61
49
  '--bgi': getBgImageUrl(background?.desktop?.color),
62
50
  'background-repeat': 'no-repeat',
63
51
  'background-position': 'right 10px center, 0 0',
@@ -68,26 +56,6 @@ const getBgImageUrl = (color)=>{
68
56
  const iconDropDown = 'url(https://cdn.shopify.com/s/files/1/1827/4239/t/1/assets/ico-select.svg?v=155563818344741998551488860031)';
69
57
  return `${iconDropDown} ${color?.includes('linear-gradient') ? ',' + color : ''}`;
70
58
  };
71
- const generateStylesTarget = ({ state, borderStyle, background, radius })=>{
72
- const { border, width, color } = borderStyle ?? {};
73
- const getState = {
74
- hover: 'hvr',
75
- focus: 'focus'
76
- };
77
- const currentState = getState[state];
78
- return {
79
- ...width && {
80
- [`--${currentState}-bw`]: `${width}`
81
- },
82
- ...border && {
83
- [`--${currentState}-b`]: `${border} ${getSingleColorVariable(color)}`
84
- },
85
- ...background && {
86
- [`--${currentState}-bgc`]: `${getSingleColorVariable(background)}`
87
- },
88
- ...getCustomRadius(state, radius)
89
- };
90
- };
91
59
  const getAppendTypoStyleFirstTime = (setting)=>{
92
60
  const appendTypoStyle = composeTypographyStyle(setting?.typo, setting?.typography);
93
61
  return composeStyles({
@@ -105,4 +73,4 @@ const getStyleOption = (setting)=>{
105
73
  });
106
74
  };
107
75
 
108
- export { composeContainerStyles, composeFormDropdownStyles, generateStylesTarget, getAppendTypoStyleFirstTime, getStyleOption };
76
+ export { composeContainerStyles, composeFormDropdownStyles, getAppendTypoStyleFirstTime, getStyleOption };
@@ -3,7 +3,7 @@ import { composeTypographyStyle } from '@gem-sdk/core';
3
3
 
4
4
  const useGetColorContent = (setting)=>{
5
5
  const [showPlaceholder, setShowPlaceholder] = useState(true);
6
- const { typography, placeholderColor } = setting ?? {};
6
+ const { typography, placeholderColor, defaultOption } = setting ?? {};
7
7
  const appendTypoStyle = composeTypographyStyle(setting?.typo, typography);
8
8
  const handleOnChange = ()=>{
9
9
  if (showPlaceholder) {
@@ -14,7 +14,7 @@ const useGetColorContent = (setting)=>{
14
14
  handleOnChange,
15
15
  getTextColor: {
16
16
  ...appendTypoStyle,
17
- ...showPlaceholder && {
17
+ ...showPlaceholder && Number(defaultOption) === 0 && {
18
18
  '--c': placeholderColor
19
19
  }
20
20
  }
@@ -27,8 +27,10 @@ const Newsletter = ({ builderProps, setting, children, style, formType, advanced
27
27
  const composedContainerStyles = createStyle(composeContainerStylesForm(style));
28
28
  const anchorAttrs = composeAnchorAttrs(builderProps, setting);
29
29
  const composedFormClasses = createClass(composeFormClasses());
30
- const composedFormStyles = createStyle(composeFormStyles(setting));
31
- const formAttrs = composeFormAttrs(builderProps);
30
+ const composedFormStylesError = createStyle(composeFormStyles('error'));
31
+ const composedFormStylesSuccess = createStyle(composeFormStyles('success'));
32
+ const formAttrsError = composeFormAttrs(builderProps, 'error');
33
+ const formAttrsSuccess = composeFormAttrs(builderProps, 'success');
32
34
  const popoverAttrs = composePopoverAttrs(builderProps);
33
35
  const generatedPopoverStyles = popoverStyles(builderProps);
34
36
  const containerStyle = createStyle(composeContainerStyles(setting, styles));
@@ -51,10 +53,10 @@ const Newsletter = ({ builderProps, setting, children, style, formType, advanced
51
53
  {% if form.errors %}
52
54
  <div
53
55
  ${{
54
- ...formAttrs
56
+ ...formAttrsError
55
57
  }}
56
58
  class="${composedFormClasses}"
57
- style="${composedFormStyles}"
59
+ style="${composedFormStylesError}"
58
60
  >
59
61
  ${errorMessage}
60
62
  </div>
@@ -63,14 +65,14 @@ const Newsletter = ({ builderProps, setting, children, style, formType, advanced
63
65
  ...popoverAttrs
64
66
  }}>
65
67
  <style>
66
- ${generatedPopoverStyles}
68
+ ${generatedPopoverStyles}
67
69
  </style>
68
70
  <div
69
71
  ${{
70
- ...formAttrs
72
+ ...formAttrsSuccess
71
73
  }}
72
74
  class="${composedFormClasses}"
73
- style="${composedFormStyles}"
75
+ style="${composedFormStylesSuccess}"
74
76
  >
75
77
  ${successMessage}
76
78
  </div>
@@ -17,7 +17,12 @@ const composeAnchorAttrs = (builderProps, setting)=>{
17
17
  target: urlData?.target
18
18
  });
19
19
  };
20
- const composeFormAttrs = (builderProps)=>{
20
+ const composeFormAttrs = (builderProps, type)=>{
21
+ if (type === 'success') {
22
+ return composeAttribute({
23
+ id: `gp-form-success-${builderProps?.uid}`
24
+ });
25
+ }
21
26
  return composeAttribute({
22
27
  id: `gp-form-error-${builderProps?.uid}`
23
28
  });
@@ -1,5 +1,4 @@
1
1
  import { filterTruthy } from '../../../helpers/common.js';
2
- import { getStyleBackgroundByDevice } from '@gem-sdk/core';
3
2
 
4
3
  const composeStyles = (styles)=>filterTruthy(styles);
5
4
  const composeContainerStylesForm = (style)=>{
@@ -7,10 +6,17 @@ const composeContainerStylesForm = (style)=>{
7
6
  ...style
8
7
  });
9
8
  };
10
- const composeFormStyles = (setting)=>{
11
- const { background } = setting ?? {};
9
+ const composeFormStyles = (type)=>{
10
+ if (type === 'success') {
11
+ return composeStyles({
12
+ 'background-color': '#F2FFEC',
13
+ left: '50%',
14
+ transform: 'translateX(-50%)',
15
+ color: '#009D3E'
16
+ });
17
+ }
12
18
  return composeStyles({
13
- ...getStyleBackgroundByDevice(background),
19
+ 'background-color': '#FFE9E9',
14
20
  left: '50%',
15
21
  transform: 'translateX(-50%)',
16
22
  color: '#EA3335'
@@ -205,6 +205,9 @@ const SettingUIV2 = [
205
205
  },
206
206
  setting: {
207
207
  id: 'name'
208
+ },
209
+ help: {
210
+ content: 'Identify the information submitted via this element.'
208
211
  }
209
212
  }
210
213
  ]
@@ -127,6 +127,9 @@ const SettingUIV2 = [
127
127
  },
128
128
  setting: {
129
129
  id: 'name'
130
+ },
131
+ help: {
132
+ content: 'Identify the information submitted via this element.'
130
133
  }
131
134
  }
132
135
  ]
@@ -145,6 +145,9 @@ const SettingUIV2 = [
145
145
  },
146
146
  setting: {
147
147
  id: 'name'
148
+ },
149
+ help: {
150
+ content: 'Identify the information submitted via this element.'
148
151
  }
149
152
  }
150
153
  ]
@@ -1,5 +1,4 @@
1
1
  import { MarqueePresets } from './configs/presets.js';
2
- import { MarqueeSettings } from './configs/settings.js';
3
2
  import { MarqueeSettingsV2 } from './configs/settingsV2.js';
4
3
  import { SettingUIV1 } from './configs/uiV1.js';
5
4
  import { SettingUIV2 } from './configs/uiV2.js';
@@ -12,8 +11,7 @@ const config = {
12
11
  <path fill-rule="evenodd" clip-rule="evenodd" d="M4.96586 7.25C4.96586 6.14543 5.86129 5.25 6.96586 5.25H17.0346C18.1391 5.25 19.0346 6.14543 19.0346 7.25V16.7484C19.0346 17.853 18.1391 18.7484 17.0346 18.7484H6.96586C5.86129 18.7484 4.96586 17.853 4.96586 16.7484V7.25ZM9.36039 6.25H6.96586C6.41357 6.25 5.96586 6.69772 5.96586 7.25V16.7484C5.96586 17.3007 6.41357 17.7484 6.96586 17.7484H9.36039L9.36039 6.25ZM10.3604 17.7484V6.25H14.1455V17.7484H10.3604ZM15.1455 17.7484H17.0346C17.5869 17.7484 18.0346 17.3007 18.0346 16.7484V7.25C18.0346 6.69771 17.5869 6.25 17.0346 6.25H15.1455V17.7484ZM3.31666 10.5447C3.51708 10.7346 3.52555 11.0511 3.33558 11.2515L2.61349 12.0133L3.33449 12.7691C3.52509 12.969 3.51762 13.2854 3.31781 13.4761C3.118 13.6667 2.8015 13.6592 2.6109 13.4594L1.693 12.4971C1.43561 12.2273 1.43493 11.803 1.69148 11.5324L2.60981 10.5636C2.79978 10.3632 3.11625 10.3547 3.31666 10.5447ZM20.6827 10.5458C20.8825 10.3552 21.199 10.3627 21.3896 10.5625L22.3075 11.5247C22.5649 11.7946 22.5656 12.2188 22.309 12.4894L21.3907 13.4583C21.2007 13.6587 20.8843 13.6672 20.6839 13.4772C20.4834 13.2872 20.475 12.9707 20.6649 12.7703L21.387 12.0085L20.666 11.2527C20.4754 11.0529 20.4829 10.7364 20.6827 10.5458ZM21.5839 12.215C21.5838 12.2149 21.584 12.2151 21.5839 12.215V12.215Z" fill="white"/>
13
12
  </svg>
14
13
  `,
15
- settings: MarqueeSettings,
16
- settingsV2: MarqueeSettingsV2,
14
+ settings: MarqueeSettingsV2,
17
15
  ui: SettingUIV1,
18
16
  uiV2: SettingUIV2,
19
17
  editorConfigs: {
@@ -39,11 +39,11 @@ const MarqueePresets = [
39
39
  'spacing-setting': {
40
40
  desktop: {
41
41
  padding: {
42
- top: '12px',
43
- bottom: '12px'
44
- },
45
- margin: {
46
- bottom: '16px'
42
+ type: 'custom',
43
+ top: '16px',
44
+ bottom: '16px',
45
+ left: '0px',
46
+ right: '0px'
47
47
  }
48
48
  }
49
49
  }
@@ -121,11 +121,11 @@ const MarqueePresets = [
121
121
  'spacing-setting': {
122
122
  desktop: {
123
123
  padding: {
124
- top: '12px',
125
- bottom: '12px'
126
- },
127
- margin: {
128
- bottom: '16px'
124
+ type: 'custom',
125
+ top: '16px',
126
+ bottom: '16px',
127
+ left: '0px',
128
+ right: '0px'
129
129
  }
130
130
  }
131
131
  }
@@ -4,6 +4,40 @@ const MarqueeSettingsV2 = [
4
4
  {
5
5
  id: 'setting',
6
6
  controls: [
7
+ {
8
+ id: 'itemWidthType',
9
+ type: 'select',
10
+ label: 'Aspect Ratio',
11
+ isFullWidth: true,
12
+ options: [
13
+ {
14
+ label: 'Fit to content',
15
+ value: 'FIT_CONTENT',
16
+ note: 'Match the width of the element inside'
17
+ },
18
+ {
19
+ label: 'Based on the item count',
20
+ value: 'BASE_ON_NUMBER_OF_ITEMS',
21
+ note: 'Max item width is screen width divided by the number of items'
22
+ },
23
+ {
24
+ label: 'Custom',
25
+ value: 'CUSTOM',
26
+ note: 'Set the max width as you want'
27
+ }
28
+ ],
29
+ devices: {
30
+ desktop: {
31
+ default: 'FIT_CONTENT'
32
+ },
33
+ tablet: {
34
+ default: 'FIT_CONTENT'
35
+ },
36
+ mobile: {
37
+ default: 'CUSTOM'
38
+ }
39
+ }
40
+ },
7
41
  {
8
42
  id: 'activeItem',
9
43
  type: 'input',
@@ -43,7 +77,7 @@ const MarqueeSettingsV2 = [
43
77
  id: 'stopOnHover',
44
78
  label: 'stopOnHover',
45
79
  type: 'toggle',
46
- default: false
80
+ default: true
47
81
  },
48
82
  {
49
83
  id: 'speed',
@@ -88,40 +122,6 @@ const MarqueeSettingsV2 = [
88
122
  label: 'hasItemShadow',
89
123
  type: 'toggle',
90
124
  default: false
91
- },
92
- {
93
- id: 'itemWidthType',
94
- type: 'select',
95
- label: 'Aspect Ratio',
96
- isFullWidth: true,
97
- options: [
98
- {
99
- label: 'Fit to content',
100
- value: 'FIT_CONTENT',
101
- note: 'Match the width of the element inside'
102
- },
103
- {
104
- label: 'Based on the item count',
105
- value: 'BASE_ON_NUMBER_OF_ITEMS',
106
- note: 'Max item width is screen width divided by the number of items'
107
- },
108
- {
109
- label: 'Custom',
110
- value: 'CUSTOM',
111
- note: 'Set the max width as you want'
112
- }
113
- ],
114
- devices: {
115
- desktop: {
116
- default: 'BASE_ON_NUMBER_OF_ITEMS'
117
- },
118
- tablet: {
119
- default: 'BASE_ON_NUMBER_OF_ITEMS'
120
- },
121
- mobile: {
122
- default: 'CUSTOM'
123
- }
124
- }
125
125
  }
126
126
  ]
127
127
  },
@@ -153,15 +153,17 @@ const MarqueeSettingsV2 = [
153
153
  {
154
154
  id: 'itemSpacing',
155
155
  label: 'Spacing',
156
- type: 'input:unit',
156
+ type: 'input:slider',
157
157
  units: [
158
158
  'px'
159
159
  ],
160
- placeholder: 'Auto',
161
160
  min: 0,
161
+ max: 100,
162
+ step: 1,
163
+ placeholder: 'Auto',
162
164
  devices: {
163
165
  desktop: {
164
- default: '48px'
166
+ default: '60px'
165
167
  }
166
168
  }
167
169
  },
@@ -219,9 +221,9 @@ const MarqueeSettingsV2 = [
219
221
  }
220
222
  },
221
223
  hiddenSettings: [
222
- 'padding',
223
224
  'gap',
224
- 'shape'
225
+ 'shape',
226
+ 'padding'
225
227
  ]
226
228
  },
227
229
  {