@gem-sdk/components 2.0.0-dev.478 → 2.0.0-dev.480

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.
@@ -8,7 +8,6 @@ var getAttr = require('./common/getAttr.js');
8
8
  var getStyle = require('./common/getStyle.js');
9
9
  var getClasses = require('./common/getClasses.js');
10
10
  var helpers = require('../../helpers.js');
11
- var ButtonIcon = require('../../button/components/ButtonIcon.js');
12
11
 
13
12
  const Dialog = (props)=>{
14
13
  const { setting, children, builderProps, style, advanced, builderAttrs } = props;
@@ -152,13 +151,11 @@ const Dialog = (props)=>{
152
151
  class="${buttonContentClasses}"
153
152
  style="${buttonContentStyle}"
154
153
  >
155
- ${ButtonIcon.default({
156
- iconSvg: iconSvg ?? `<svg viewBox="0 0 12 12" fill="currentColor" style={svgContentStyle}>
157
- <path d="M7.1,6l4.5,4.5l-1.1,1.1L6,7.1l-4.5,4.5l-1.1-1.1L4.9,6L0.5,1.5l1.1-1.1L6,4.9l4.5-4.5l1.1,1.1L7.1,6z"></path>
158
- </svg>`,
159
- styles: svgContentStyle,
160
- classes: svgContentClasses
161
- })}
154
+ <span style="${svgContentStyle}" class="${svgContentClasses}">
155
+ ${iconSvg ?? `<svg viewBox="0 0 12 12" fill="currentColor" style={svgContentStyle}>
156
+ <path d="M7.1,6l4.5,4.5l-1.1,1.1L6,7.1l-4.5,4.5l-1.1-1.1L4.9,6L0.5,1.5l1.1-1.1L6,4.9l4.5-4.5l1.1,1.1L7.1,6z"></path>
157
+ </svg>`}
158
+ </span>
162
159
  </button>
163
160
  <div
164
161
  aria-label="Dialog body"
@@ -201,11 +201,9 @@ const DialogSettings = [
201
201
  id: 'iconSvg',
202
202
  label: 'SVG Icon',
203
203
  type: 'icon',
204
- default: `
205
- <svg viewBox="0 0 12 12" fill="currentColor">
206
- <path d="M7.1,6l4.5,4.5l-1.1,1.1L6,7.1l-4.5,4.5l-1.1-1.1L4.9,6L0.5,1.5l1.1-1.1L6,4.9l4.5-4.5l1.1,1.1L7.1,6z"></path>
207
- </svg>
208
- `
204
+ 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">
205
+ <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"/>
206
+ </svg>`
209
207
  },
210
208
  {
211
209
  id: 'btnWidth',
@@ -266,12 +264,14 @@ const DialogSettings = [
266
264
  {
267
265
  id: 'btnBg',
268
266
  type: 'color-picker-v2',
269
- default: '#ffffff'
267
+ default: 'brand',
268
+ compoDefaultValue: 'brand'
270
269
  },
271
270
  {
272
271
  id: 'btnColor',
273
272
  type: 'color-picker-v2',
274
- default: 'text-1'
273
+ default: 'text-3',
274
+ compoDefaultValue: 'text-3'
275
275
  },
276
276
  {
277
277
  id: 'trigger',
@@ -340,7 +340,7 @@ const DialogSettings = [
340
340
  desktop: {
341
341
  default: {
342
342
  type: 'color',
343
- color: '#FFFFFF',
343
+ color: 'bg-3',
344
344
  image: {
345
345
  src: '',
346
346
  width: 0,
@@ -360,7 +360,7 @@ const DialogSettings = [
360
360
  desktop: {
361
361
  default: {
362
362
  type: 'color',
363
- color: '#CCCCCC',
363
+ color: 'bg-3',
364
364
  image: {
365
365
  src: 'https://ucarecdn.com/5e27d43d-eb1e-4e71-b7e1-4158f3071bb6/-/format/auto/',
366
366
  width: 1200,
@@ -25,7 +25,8 @@ const ProductSku = ({ setting, styles, advanced, builderProps })=>{
25
25
  setting: {
26
26
  ...setting,
27
27
  text: `{% if currentVariant.sku.size > 0 %} ${labelContent} {{ currentVariant.sku }} {% endif %}`,
28
- excludeFlex: true
28
+ excludeFlex: true,
29
+ isForceValue: true
29
30
  },
30
31
  advanced: advanced,
31
32
  builderProps,
@@ -54,9 +54,21 @@ const getWrapperStyleNormalAndHover = (props)=>{
54
54
  const isColorType = typeOfOption === 'color';
55
55
  const isUploadImageType = typeOfOption === 'image' || typeOfOption === 'image_shopify';
56
56
  const appendTypoStyle = core.composeTypographyStyle(optionTypo, optionTypography);
57
+ const composeShadow = [
58
+ 'normal',
59
+ 'hover'
60
+ ].reduce((acc, state)=>({
61
+ ...acc,
62
+ ...core.getStyleShadow({
63
+ value: optionShadow?.[state],
64
+ state,
65
+ styleAppliedFor: 'box-shadow',
66
+ isEnableShadow: optionHasShadow?.[state]
67
+ })
68
+ }), {});
57
69
  return helpers.filterTruthyObject({
58
70
  ...core.composeRadius(optionRounded),
59
- ...core.getStyleShadowState(optionShadow, 'box-shadow', optionHasShadow),
71
+ ...composeShadow,
60
72
  ...!isColorType && core.getGlobalColorStateStyle('bg', optionBgColor),
61
73
  ...!isColorType && core.handleConvertBorderStyle(optionBorder),
62
74
  ...!isColorType && core.handleConvertBorderWidth(optionBorder),
@@ -22,7 +22,7 @@ const ProductVariantSettings = [
22
22
  default: 'singleOption',
23
23
  options: [
24
24
  {
25
- label: 'Separate',
25
+ label: 'Separated',
26
26
  value: 'singleOption'
27
27
  },
28
28
  {
@@ -28,24 +28,27 @@ const TabsSettings = [
28
28
  },
29
29
  {
30
30
  id: 'position',
31
- type: 'layout-segment',
31
+ type: 'layout-selector',
32
32
  label: 'Layout',
33
- disableToggle: true,
33
+ iconViewBox: '0 0 74 48',
34
+ enableItemBackground: true,
35
+ itemPerRow: 2,
36
+ itemSpacing: 'large',
34
37
  options: [
35
38
  {
36
39
  value: 'top',
37
40
  label: 'Top',
38
- type: 'layout-align'
41
+ iconName: 'gp-tab-top'
39
42
  },
40
43
  {
41
44
  value: 'left',
42
45
  label: 'Left',
43
- type: 'layout-align'
46
+ iconName: 'gp-tab-top'
44
47
  },
45
48
  {
46
49
  value: 'right',
47
50
  label: 'Right',
48
- type: 'layout-align'
51
+ iconName: 'gp-tab-top'
49
52
  }
50
53
  ],
51
54
  devices: {
@@ -142,7 +145,7 @@ const TabsSettings = [
142
145
  ],
143
146
  devices: {
144
147
  desktop: {
145
- default: '200px'
148
+ default: 'auto'
146
149
  }
147
150
  }
148
151
  },
@@ -16,32 +16,17 @@ const SettingUIV2 = [
16
16
  },
17
17
  {
18
18
  label: {
19
- en: 'Item management'
19
+ en: 'Tabs'
20
20
  },
21
21
  controls: [
22
22
  {
23
23
  label: {
24
- en: 'Items'
24
+ en: 'Order'
25
25
  },
26
26
  setting: {
27
27
  id: 'childItem'
28
28
  }
29
29
  },
30
- {
31
- label: {
32
- en: 'Default active tab'
33
- },
34
- setting: {
35
- id: 'activeKey'
36
- }
37
- }
38
- ]
39
- },
40
- {
41
- label: {
42
- en: 'Tab item style'
43
- },
44
- controls: [
45
30
  {
46
31
  label: {
47
32
  en: 'Text style'
@@ -83,8 +68,8 @@ const SettingUIV2 = [
83
68
  action: {
84
69
  controlId: 'labelColor',
85
70
  valueFromField: 'attrs.color',
86
- groupType: 'style',
87
- controlType: 'style',
71
+ groupType: 'setting',
72
+ controlType: 'setting',
88
73
  removeDevice: true,
89
74
  state: 'normal'
90
75
  }
@@ -105,112 +90,252 @@ const SettingUIV2 = [
105
90
  setting: {
106
91
  id: 'panelWidth'
107
92
  }
108
- },
109
- {
110
- conditionDisplay: 'position != "top"',
111
- label: {
112
- en: 'Width'
93
+ }
94
+ ],
95
+ moreSettings: {
96
+ type: 'collapse',
97
+ controls: [
98
+ {
99
+ id: 'Width',
100
+ label: {
101
+ en: 'Width'
102
+ },
103
+ conditionDisplay: 'position != "top"',
104
+ controlConfig: {
105
+ id: 'width',
106
+ type: 'dropdown:input',
107
+ label: 'Width',
108
+ inputType: 'number',
109
+ units: [
110
+ 'px',
111
+ '%'
112
+ ],
113
+ hideUnit: false,
114
+ fallbackValue: 'Auto',
115
+ linkWithSetting: {
116
+ name: 'labelWidth'
117
+ },
118
+ displayOptions: [
119
+ {
120
+ label: 'Fit content',
121
+ value: 'Auto',
122
+ showValue: true
123
+ },
124
+ {
125
+ label: 'Full',
126
+ value: '100%',
127
+ showValue: true
128
+ }
129
+ ]
130
+ },
131
+ layout: 'horizontal'
113
132
  },
114
- setting: {
115
- id: 'labelWidth'
116
- }
117
- },
118
- {
119
- label: {
120
- en: 'Border'
133
+ {
134
+ label: {
135
+ en: 'Background'
136
+ },
137
+ setting: {
138
+ id: 'labelBgColor',
139
+ state: 'normal'
140
+ }
121
141
  },
122
- setting: {
123
- id: 'borderTab',
124
- state: 'normal'
125
- }
126
- },
127
- {
128
- label: {
129
- en: 'Effect'
142
+ {
143
+ label: {
144
+ en: 'Border'
145
+ },
146
+ setting: {
147
+ id: 'borderTab',
148
+ state: 'normal'
149
+ }
130
150
  },
131
- type: 'combo',
132
- iconName: 'polaris-edit',
133
- fixedValue: 'Hover',
134
- isHideClear: true,
135
- popoverLabel: {
136
- en: 'Hover effect'
151
+ {
152
+ conditionDisplay: 'position == "top" && labelWidth != "100%"',
153
+ label: {
154
+ en: 'Tabs align'
155
+ },
156
+ setting: {
157
+ id: 'panelAlign'
158
+ }
137
159
  },
138
- controls: [
139
- {
140
- label: {
141
- en: 'Background color'
142
- },
143
- setting: {
144
- id: 'labelBgColor',
145
- state: 'hover'
146
- }
160
+ {
161
+ label: {
162
+ en: 'Hover effect'
147
163
  },
148
- {
149
- label: {
150
- en: 'Text color'
164
+ type: 'combo',
165
+ iconName: 'polaris-edit',
166
+ fixedValue: 'Enabled',
167
+ isHideClear: true,
168
+ popoverLabel: {
169
+ en: 'Tabs hover effect'
170
+ },
171
+ controls: [
172
+ {
173
+ label: {
174
+ en: 'Text color'
175
+ },
176
+ setting: {
177
+ id: 'labelColor',
178
+ state: 'hover'
179
+ }
151
180
  },
152
- setting: {
153
- id: 'labelColor',
154
- state: 'hover'
181
+ {
182
+ label: {
183
+ en: 'Border'
184
+ },
185
+ setting: {
186
+ id: 'borderTab',
187
+ state: 'hover'
188
+ }
155
189
  }
190
+ ]
191
+ },
192
+ {
193
+ label: {
194
+ en: 'Active state'
156
195
  },
157
- {
158
- label: {
159
- en: 'Border'
196
+ type: 'combo',
197
+ iconName: 'polaris-edit',
198
+ fixedValue: 'Enabled',
199
+ isHideClear: true,
200
+ popoverLabel: {
201
+ en: 'Tabs active state'
202
+ },
203
+ controls: [
204
+ {
205
+ label: {
206
+ en: 'Text color'
207
+ },
208
+ setting: {
209
+ id: 'labelColor',
210
+ state: 'active'
211
+ }
160
212
  },
161
- setting: {
162
- id: 'borderTab',
163
- state: 'hover'
213
+ {
214
+ label: {
215
+ en: 'Background'
216
+ },
217
+ setting: {
218
+ id: 'labelBgColor',
219
+ state: 'active'
220
+ }
221
+ },
222
+ {
223
+ label: {
224
+ en: 'Border'
225
+ },
226
+ setting: {
227
+ id: 'borderTab',
228
+ state: 'active'
229
+ }
164
230
  }
165
- }
166
- ]
231
+ ]
232
+ }
233
+ ]
234
+ }
235
+ },
236
+ {
237
+ label: {
238
+ en: 'Background'
239
+ },
240
+ controls: [
241
+ {
242
+ setting: {
243
+ id: 'background'
244
+ },
245
+ layout: 'vertical'
167
246
  }
168
247
  ]
169
248
  },
170
249
  {
171
250
  label: {
172
- en: 'Active tab item'
251
+ en: 'Shape'
173
252
  },
174
253
  controls: [
175
254
  {
176
255
  label: {
177
- en: 'Background color'
256
+ en: 'Border'
178
257
  },
179
258
  setting: {
180
- id: 'labelBgColor',
181
- state: 'active'
259
+ id: 'border',
260
+ state: 'normal'
182
261
  }
183
262
  },
184
263
  {
185
264
  label: {
186
- en: 'Text color'
265
+ en: 'Corner'
187
266
  },
188
267
  setting: {
189
- id: 'labelColor',
190
- state: 'active'
268
+ id: 'rounded',
269
+ state: 'normal'
191
270
  }
192
271
  },
193
272
  {
194
273
  label: {
195
- en: 'Border'
274
+ en: 'Shadow'
196
275
  },
197
276
  setting: {
198
- id: 'borderTab',
199
- state: 'active'
277
+ id: 'boxShadow',
278
+ state: 'normal'
279
+ },
280
+ options: {
281
+ updateFields: [
282
+ {
283
+ field: 'enable',
284
+ settingId: 'advanced.hasBoxShadow',
285
+ state: 'normal'
286
+ }
287
+ ]
288
+ },
289
+ controlChangeTrigger: {
290
+ settings: [
291
+ {
292
+ condition: `boxShadow.normal.enable === true`,
293
+ source: [
294
+ 'boxShadow',
295
+ 'hasBoxShadow'
296
+ ],
297
+ action: {
298
+ controlId: 'hasBoxShadow',
299
+ groupType: 'advanced',
300
+ controlType: 'advanced',
301
+ state: 'normal',
302
+ newValue: true
303
+ }
304
+ },
305
+ {
306
+ condition: `boxShadow.normal.enable === false`,
307
+ source: [
308
+ 'boxShadow',
309
+ 'hasBoxShadow'
310
+ ],
311
+ action: {
312
+ controlId: 'hasBoxShadow',
313
+ groupType: 'advanced',
314
+ controlType: 'advanced',
315
+ state: 'normal',
316
+ newValue: false
317
+ }
318
+ }
319
+ ],
320
+ options: {
321
+ noRecordHistory: true
322
+ }
200
323
  }
201
324
  }
202
325
  ]
203
326
  },
204
327
  {
205
328
  label: {
206
- en: 'Background'
329
+ en: 'Display option'
207
330
  },
208
331
  controls: [
209
332
  {
210
- setting: {
211
- id: 'background'
333
+ label: {
334
+ en: 'Default active'
212
335
  },
213
- layout: 'vertical'
336
+ setting: {
337
+ id: 'activeKey'
338
+ }
214
339
  }
215
340
  ]
216
341
  }
@@ -4,7 +4,6 @@ import { getAttr, getAttrContainer, getAttrOverlay, getAttrClose } from './commo
4
4
  import { getWrapperStyle, getContainStyle, getBackdropStyle, getOverlayStyle, getDialogContentStyle, getButtonContentStyle, getSvgContentStyle, getBodyContentStyle } from './common/getStyle.js';
5
5
  import { getContainClasses, getBackdropClasses, getOverlayClasses, getDialogContentClasses, getHeadContentClasses, getButtonContentClasses, getSvgContentClasses, getBodyContentClasses } from './common/getClasses.js';
6
6
  import { getSettingPreloadData } from '../../helpers.js';
7
- import ButtonIcon from '../../button/components/ButtonIcon.js';
8
7
 
9
8
  const Dialog = (props)=>{
10
9
  const { setting, children, builderProps, style, advanced, builderAttrs } = props;
@@ -148,13 +147,11 @@ const Dialog = (props)=>{
148
147
  class="${buttonContentClasses}"
149
148
  style="${buttonContentStyle}"
150
149
  >
151
- ${ButtonIcon({
152
- iconSvg: iconSvg ?? `<svg viewBox="0 0 12 12" fill="currentColor" style={svgContentStyle}>
153
- <path d="M7.1,6l4.5,4.5l-1.1,1.1L6,7.1l-4.5,4.5l-1.1-1.1L4.9,6L0.5,1.5l1.1-1.1L6,4.9l4.5-4.5l1.1,1.1L7.1,6z"></path>
154
- </svg>`,
155
- styles: svgContentStyle,
156
- classes: svgContentClasses
157
- })}
150
+ <span style="${svgContentStyle}" class="${svgContentClasses}">
151
+ ${iconSvg ?? `<svg viewBox="0 0 12 12" fill="currentColor" style={svgContentStyle}>
152
+ <path d="M7.1,6l4.5,4.5l-1.1,1.1L6,7.1l-4.5,4.5l-1.1-1.1L4.9,6L0.5,1.5l1.1-1.1L6,4.9l4.5-4.5l1.1,1.1L7.1,6z"></path>
153
+ </svg>`}
154
+ </span>
158
155
  </button>
159
156
  <div
160
157
  aria-label="Dialog body"
@@ -199,11 +199,9 @@ const DialogSettings = [
199
199
  id: 'iconSvg',
200
200
  label: 'SVG Icon',
201
201
  type: 'icon',
202
- default: `
203
- <svg viewBox="0 0 12 12" fill="currentColor">
204
- <path d="M7.1,6l4.5,4.5l-1.1,1.1L6,7.1l-4.5,4.5l-1.1-1.1L4.9,6L0.5,1.5l1.1-1.1L6,4.9l4.5-4.5l1.1,1.1L7.1,6z"></path>
205
- </svg>
206
- `
202
+ 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">
203
+ <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"/>
204
+ </svg>`
207
205
  },
208
206
  {
209
207
  id: 'btnWidth',
@@ -264,12 +262,14 @@ const DialogSettings = [
264
262
  {
265
263
  id: 'btnBg',
266
264
  type: 'color-picker-v2',
267
- default: '#ffffff'
265
+ default: 'brand',
266
+ compoDefaultValue: 'brand'
268
267
  },
269
268
  {
270
269
  id: 'btnColor',
271
270
  type: 'color-picker-v2',
272
- default: 'text-1'
271
+ default: 'text-3',
272
+ compoDefaultValue: 'text-3'
273
273
  },
274
274
  {
275
275
  id: 'trigger',
@@ -338,7 +338,7 @@ const DialogSettings = [
338
338
  desktop: {
339
339
  default: {
340
340
  type: 'color',
341
- color: '#FFFFFF',
341
+ color: 'bg-3',
342
342
  image: {
343
343
  src: '',
344
344
  width: 0,
@@ -358,7 +358,7 @@ const DialogSettings = [
358
358
  desktop: {
359
359
  default: {
360
360
  type: 'color',
361
- color: '#CCCCCC',
361
+ color: 'bg-3',
362
362
  image: {
363
363
  src: 'https://ucarecdn.com/5e27d43d-eb1e-4e71-b7e1-4158f3071bb6/-/format/auto/',
364
364
  width: 1200,
@@ -21,7 +21,8 @@ const ProductSku = ({ setting, styles, advanced, builderProps })=>{
21
21
  setting: {
22
22
  ...setting,
23
23
  text: `{% if currentVariant.sku.size > 0 %} ${labelContent} {{ currentVariant.sku }} {% endif %}`,
24
- excludeFlex: true
24
+ excludeFlex: true,
25
+ isForceValue: true
25
26
  },
26
27
  advanced: advanced,
27
28
  builderProps,
@@ -1,4 +1,4 @@
1
- import { composeTypographyStyle, getRadiusStyleActiveState, getStyleShadow, makeStyle, getSingleColorVariable, composeRadius, getStyleShadowState, getGlobalColorStateStyle, handleConvertBorderStyle, handleConvertBorderWidth, handleConvertBorderColor } from '@gem-sdk/core';
1
+ import { composeTypographyStyle, getRadiusStyleActiveState, getStyleShadow, makeStyle, getSingleColorVariable, composeRadius, getGlobalColorStateStyle, handleConvertBorderStyle, handleConvertBorderWidth, handleConvertBorderColor } from '@gem-sdk/core';
2
2
  import { filterTruthyObject } from '../../../../../helpers.js';
3
3
 
4
4
  const getWrapperStyleActive = (props)=>{
@@ -52,9 +52,21 @@ const getWrapperStyleNormalAndHover = (props)=>{
52
52
  const isColorType = typeOfOption === 'color';
53
53
  const isUploadImageType = typeOfOption === 'image' || typeOfOption === 'image_shopify';
54
54
  const appendTypoStyle = composeTypographyStyle(optionTypo, optionTypography);
55
+ const composeShadow = [
56
+ 'normal',
57
+ 'hover'
58
+ ].reduce((acc, state)=>({
59
+ ...acc,
60
+ ...getStyleShadow({
61
+ value: optionShadow?.[state],
62
+ state,
63
+ styleAppliedFor: 'box-shadow',
64
+ isEnableShadow: optionHasShadow?.[state]
65
+ })
66
+ }), {});
55
67
  return filterTruthyObject({
56
68
  ...composeRadius(optionRounded),
57
- ...getStyleShadowState(optionShadow, 'box-shadow', optionHasShadow),
69
+ ...composeShadow,
58
70
  ...!isColorType && getGlobalColorStateStyle('bg', optionBgColor),
59
71
  ...!isColorType && handleConvertBorderStyle(optionBorder),
60
72
  ...!isColorType && handleConvertBorderWidth(optionBorder),
@@ -20,7 +20,7 @@ const ProductVariantSettings = [
20
20
  default: 'singleOption',
21
21
  options: [
22
22
  {
23
- label: 'Separate',
23
+ label: 'Separated',
24
24
  value: 'singleOption'
25
25
  },
26
26
  {
@@ -26,24 +26,27 @@ const TabsSettings = [
26
26
  },
27
27
  {
28
28
  id: 'position',
29
- type: 'layout-segment',
29
+ type: 'layout-selector',
30
30
  label: 'Layout',
31
- disableToggle: true,
31
+ iconViewBox: '0 0 74 48',
32
+ enableItemBackground: true,
33
+ itemPerRow: 2,
34
+ itemSpacing: 'large',
32
35
  options: [
33
36
  {
34
37
  value: 'top',
35
38
  label: 'Top',
36
- type: 'layout-align'
39
+ iconName: 'gp-tab-top'
37
40
  },
38
41
  {
39
42
  value: 'left',
40
43
  label: 'Left',
41
- type: 'layout-align'
44
+ iconName: 'gp-tab-top'
42
45
  },
43
46
  {
44
47
  value: 'right',
45
48
  label: 'Right',
46
- type: 'layout-align'
49
+ iconName: 'gp-tab-top'
47
50
  }
48
51
  ],
49
52
  devices: {
@@ -140,7 +143,7 @@ const TabsSettings = [
140
143
  ],
141
144
  devices: {
142
145
  desktop: {
143
- default: '200px'
146
+ default: 'auto'
144
147
  }
145
148
  }
146
149
  },
@@ -14,32 +14,17 @@ const SettingUIV2 = [
14
14
  },
15
15
  {
16
16
  label: {
17
- en: 'Item management'
17
+ en: 'Tabs'
18
18
  },
19
19
  controls: [
20
20
  {
21
21
  label: {
22
- en: 'Items'
22
+ en: 'Order'
23
23
  },
24
24
  setting: {
25
25
  id: 'childItem'
26
26
  }
27
27
  },
28
- {
29
- label: {
30
- en: 'Default active tab'
31
- },
32
- setting: {
33
- id: 'activeKey'
34
- }
35
- }
36
- ]
37
- },
38
- {
39
- label: {
40
- en: 'Tab item style'
41
- },
42
- controls: [
43
28
  {
44
29
  label: {
45
30
  en: 'Text style'
@@ -81,8 +66,8 @@ const SettingUIV2 = [
81
66
  action: {
82
67
  controlId: 'labelColor',
83
68
  valueFromField: 'attrs.color',
84
- groupType: 'style',
85
- controlType: 'style',
69
+ groupType: 'setting',
70
+ controlType: 'setting',
86
71
  removeDevice: true,
87
72
  state: 'normal'
88
73
  }
@@ -103,112 +88,252 @@ const SettingUIV2 = [
103
88
  setting: {
104
89
  id: 'panelWidth'
105
90
  }
106
- },
107
- {
108
- conditionDisplay: 'position != "top"',
109
- label: {
110
- en: 'Width'
91
+ }
92
+ ],
93
+ moreSettings: {
94
+ type: 'collapse',
95
+ controls: [
96
+ {
97
+ id: 'Width',
98
+ label: {
99
+ en: 'Width'
100
+ },
101
+ conditionDisplay: 'position != "top"',
102
+ controlConfig: {
103
+ id: 'width',
104
+ type: 'dropdown:input',
105
+ label: 'Width',
106
+ inputType: 'number',
107
+ units: [
108
+ 'px',
109
+ '%'
110
+ ],
111
+ hideUnit: false,
112
+ fallbackValue: 'Auto',
113
+ linkWithSetting: {
114
+ name: 'labelWidth'
115
+ },
116
+ displayOptions: [
117
+ {
118
+ label: 'Fit content',
119
+ value: 'Auto',
120
+ showValue: true
121
+ },
122
+ {
123
+ label: 'Full',
124
+ value: '100%',
125
+ showValue: true
126
+ }
127
+ ]
128
+ },
129
+ layout: 'horizontal'
111
130
  },
112
- setting: {
113
- id: 'labelWidth'
114
- }
115
- },
116
- {
117
- label: {
118
- en: 'Border'
131
+ {
132
+ label: {
133
+ en: 'Background'
134
+ },
135
+ setting: {
136
+ id: 'labelBgColor',
137
+ state: 'normal'
138
+ }
119
139
  },
120
- setting: {
121
- id: 'borderTab',
122
- state: 'normal'
123
- }
124
- },
125
- {
126
- label: {
127
- en: 'Effect'
140
+ {
141
+ label: {
142
+ en: 'Border'
143
+ },
144
+ setting: {
145
+ id: 'borderTab',
146
+ state: 'normal'
147
+ }
128
148
  },
129
- type: 'combo',
130
- iconName: 'polaris-edit',
131
- fixedValue: 'Hover',
132
- isHideClear: true,
133
- popoverLabel: {
134
- en: 'Hover effect'
149
+ {
150
+ conditionDisplay: 'position == "top" && labelWidth != "100%"',
151
+ label: {
152
+ en: 'Tabs align'
153
+ },
154
+ setting: {
155
+ id: 'panelAlign'
156
+ }
135
157
  },
136
- controls: [
137
- {
138
- label: {
139
- en: 'Background color'
140
- },
141
- setting: {
142
- id: 'labelBgColor',
143
- state: 'hover'
144
- }
158
+ {
159
+ label: {
160
+ en: 'Hover effect'
145
161
  },
146
- {
147
- label: {
148
- en: 'Text color'
162
+ type: 'combo',
163
+ iconName: 'polaris-edit',
164
+ fixedValue: 'Enabled',
165
+ isHideClear: true,
166
+ popoverLabel: {
167
+ en: 'Tabs hover effect'
168
+ },
169
+ controls: [
170
+ {
171
+ label: {
172
+ en: 'Text color'
173
+ },
174
+ setting: {
175
+ id: 'labelColor',
176
+ state: 'hover'
177
+ }
149
178
  },
150
- setting: {
151
- id: 'labelColor',
152
- state: 'hover'
179
+ {
180
+ label: {
181
+ en: 'Border'
182
+ },
183
+ setting: {
184
+ id: 'borderTab',
185
+ state: 'hover'
186
+ }
153
187
  }
188
+ ]
189
+ },
190
+ {
191
+ label: {
192
+ en: 'Active state'
154
193
  },
155
- {
156
- label: {
157
- en: 'Border'
194
+ type: 'combo',
195
+ iconName: 'polaris-edit',
196
+ fixedValue: 'Enabled',
197
+ isHideClear: true,
198
+ popoverLabel: {
199
+ en: 'Tabs active state'
200
+ },
201
+ controls: [
202
+ {
203
+ label: {
204
+ en: 'Text color'
205
+ },
206
+ setting: {
207
+ id: 'labelColor',
208
+ state: 'active'
209
+ }
158
210
  },
159
- setting: {
160
- id: 'borderTab',
161
- state: 'hover'
211
+ {
212
+ label: {
213
+ en: 'Background'
214
+ },
215
+ setting: {
216
+ id: 'labelBgColor',
217
+ state: 'active'
218
+ }
219
+ },
220
+ {
221
+ label: {
222
+ en: 'Border'
223
+ },
224
+ setting: {
225
+ id: 'borderTab',
226
+ state: 'active'
227
+ }
162
228
  }
163
- }
164
- ]
229
+ ]
230
+ }
231
+ ]
232
+ }
233
+ },
234
+ {
235
+ label: {
236
+ en: 'Background'
237
+ },
238
+ controls: [
239
+ {
240
+ setting: {
241
+ id: 'background'
242
+ },
243
+ layout: 'vertical'
165
244
  }
166
245
  ]
167
246
  },
168
247
  {
169
248
  label: {
170
- en: 'Active tab item'
249
+ en: 'Shape'
171
250
  },
172
251
  controls: [
173
252
  {
174
253
  label: {
175
- en: 'Background color'
254
+ en: 'Border'
176
255
  },
177
256
  setting: {
178
- id: 'labelBgColor',
179
- state: 'active'
257
+ id: 'border',
258
+ state: 'normal'
180
259
  }
181
260
  },
182
261
  {
183
262
  label: {
184
- en: 'Text color'
263
+ en: 'Corner'
185
264
  },
186
265
  setting: {
187
- id: 'labelColor',
188
- state: 'active'
266
+ id: 'rounded',
267
+ state: 'normal'
189
268
  }
190
269
  },
191
270
  {
192
271
  label: {
193
- en: 'Border'
272
+ en: 'Shadow'
194
273
  },
195
274
  setting: {
196
- id: 'borderTab',
197
- state: 'active'
275
+ id: 'boxShadow',
276
+ state: 'normal'
277
+ },
278
+ options: {
279
+ updateFields: [
280
+ {
281
+ field: 'enable',
282
+ settingId: 'advanced.hasBoxShadow',
283
+ state: 'normal'
284
+ }
285
+ ]
286
+ },
287
+ controlChangeTrigger: {
288
+ settings: [
289
+ {
290
+ condition: `boxShadow.normal.enable === true`,
291
+ source: [
292
+ 'boxShadow',
293
+ 'hasBoxShadow'
294
+ ],
295
+ action: {
296
+ controlId: 'hasBoxShadow',
297
+ groupType: 'advanced',
298
+ controlType: 'advanced',
299
+ state: 'normal',
300
+ newValue: true
301
+ }
302
+ },
303
+ {
304
+ condition: `boxShadow.normal.enable === false`,
305
+ source: [
306
+ 'boxShadow',
307
+ 'hasBoxShadow'
308
+ ],
309
+ action: {
310
+ controlId: 'hasBoxShadow',
311
+ groupType: 'advanced',
312
+ controlType: 'advanced',
313
+ state: 'normal',
314
+ newValue: false
315
+ }
316
+ }
317
+ ],
318
+ options: {
319
+ noRecordHistory: true
320
+ }
198
321
  }
199
322
  }
200
323
  ]
201
324
  },
202
325
  {
203
326
  label: {
204
- en: 'Background'
327
+ en: 'Display option'
205
328
  },
206
329
  controls: [
207
330
  {
208
- setting: {
209
- id: 'background'
331
+ label: {
332
+ en: 'Default active'
210
333
  },
211
- layout: 'vertical'
334
+ setting: {
335
+ id: 'activeKey'
336
+ }
212
337
  }
213
338
  ]
214
339
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.0.0-dev.478",
3
+ "version": "2.0.0-dev.480",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -23,7 +23,7 @@
23
23
  "update-img-src-3rd": "node ./scripts/update-img-src-3rd.js"
24
24
  },
25
25
  "devDependencies": {
26
- "@gem-sdk/core": "2.0.0-dev.474",
26
+ "@gem-sdk/core": "2.0.0-dev.479",
27
27
  "@gem-sdk/styles": "2.0.0-dev.464",
28
28
  "@gem-sdk/system": "2.0.0-dev.464",
29
29
  "@types/react-transition-group": "^4.4.5"