@gem-sdk/components 2.0.0-dev.662 → 2.0.0-dev.664

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.
@@ -2,6 +2,11 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var settings = require('./settings.js');
6
+ var uiV1 = require('./uiV1.js');
7
+ var presets = require('./presets.js');
8
+ var uiV2 = require('./uiV2.js');
9
+
5
10
  const config = {
6
11
  tag: 'Header',
7
12
  label: 'Header',
@@ -13,715 +18,15 @@ const config = {
13
18
  <path fill-rule="evenodd" clip-rule="evenodd" d="M31.3754 29.0825H8.625V33.2821H31.3754V29.0825ZM5.875 26.3325V34.7821C5.875 35.4724 6.43464 36.0321 7.125 36.0321H32.8754C33.5658 36.0321 34.1254 35.4724 34.1254 34.7821V26.3325H5.875Z" fill="currentColor"/>
14
19
  </svg>
15
20
  `,
16
- settings: [
17
- {
18
- id: 'setting',
19
- controls: [
20
- // {
21
- // id: 'kind',
22
- // label: 'Header Preset',
23
- // type: 'select',
24
- // options: [
25
- // {
26
- // label: 'Basic',
27
- // value: 'basic',
28
- // },
29
- // {
30
- // label: 'Morden',
31
- // value: 'morden',
32
- // },
33
- // ],
34
- // default: 'basic',
35
- // },
36
- {
37
- id: 'breakpoint',
38
- label: 'Breakpoint',
39
- type: 'select',
40
- hideOnMode: {
41
- mobileOnly: true
42
- },
43
- options: [
44
- {
45
- label: 'Desktop',
46
- value: 'desktop'
47
- },
48
- {
49
- label: 'Tablet',
50
- value: 'tablet'
51
- },
52
- {
53
- label: 'Mobile',
54
- value: 'mobile'
55
- }
56
- ],
57
- default: 'mobile'
58
- },
59
- {
60
- id: 'menu',
61
- label: 'Menu',
62
- type: 'menu',
63
- default: {
64
- ROOT: {
65
- id: 'ROOT',
66
- title: 'Root',
67
- childrens: [
68
- '1',
69
- '2',
70
- '3'
71
- ]
72
- },
73
- '1': {
74
- id: '1',
75
- title: 'Menu 1',
76
- link: '',
77
- childrens: [
78
- '13',
79
- '14'
80
- ]
81
- },
82
- '2': {
83
- id: '2',
84
- title: 'Menu 2',
85
- link: '',
86
- childrens: [
87
- '6',
88
- '7',
89
- '8'
90
- ]
91
- },
92
- '6': {
93
- id: '6',
94
- title: 'Sub Menu 2.1',
95
- childrens: []
96
- },
97
- '7': {
98
- id: '7',
99
- title: 'Sub Menu 2.2',
100
- childrens: [
101
- '10',
102
- '11'
103
- ]
104
- },
105
- '8': {
106
- id: '8',
107
- title: 'Sub Menu 2.3',
108
- childrens: [
109
- '12'
110
- ]
111
- },
112
- '9': {
113
- id: '9',
114
- title: 'Sub Menu 2.4',
115
- childrens: []
116
- },
117
- '10': {
118
- id: '10',
119
- title: 'Sub Menu 2.2.1',
120
- childrens: []
121
- },
122
- '11': {
123
- id: '11',
124
- title: 'Sub Menu 2.2.2',
125
- childrens: []
126
- },
127
- '12': {
128
- id: '12',
129
- title: 'Sub Menu 2.3.1',
130
- childrens: []
131
- },
132
- '3': {
133
- id: '3',
134
- title: 'Menu 3',
135
- link: '',
136
- childrens: []
137
- },
138
- '13': {
139
- id: '13',
140
- title: 'Sub Menu 1.1',
141
- link: '',
142
- childrens: []
143
- },
144
- '14': {
145
- id: '14',
146
- title: 'Sub Menu 1.2',
147
- link: '',
148
- childrens: []
149
- }
150
- }
151
- },
152
- {
153
- type: 'group',
154
- label: 'Logo',
155
- id: 'logo-group',
156
- controls: [
157
- {
158
- id: 'logo',
159
- label: 'Logo',
160
- type: 'image',
161
- devices: {
162
- desktop: {
163
- default: {
164
- src: 'https://ucarecdn.com/465c7cbb-f087-4d1d-8f08-f6665179f02f/-/format/auto/-/quality/lighter/placeholder-1.png',
165
- width: 800,
166
- height: 533
167
- }
168
- }
169
- }
170
- },
171
- {
172
- id: 'logoAspectRatio',
173
- type: 'select',
174
- label: 'Aspect Ratio',
175
- options: [
176
- {
177
- label: 'Auto',
178
- value: 'auto'
179
- },
180
- {
181
- label: '1:1',
182
- value: '1'
183
- },
184
- {
185
- label: '3:2',
186
- value: '3/2'
187
- },
188
- {
189
- label: '4:3',
190
- value: '4/3'
191
- },
192
- {
193
- label: '16:9',
194
- value: '16/9'
195
- },
196
- {
197
- label: '21:9',
198
- value: '21/9'
199
- },
200
- {
201
- label: '2:3',
202
- value: '2/3'
203
- },
204
- {
205
- label: '3:4',
206
- value: '3/4'
207
- },
208
- {
209
- label: '9:16',
210
- value: '9/16'
211
- },
212
- {
213
- label: 'Custom',
214
- value: 'custom'
215
- }
216
- ],
217
- devices: {
218
- desktop: {
219
- default: 'auto'
220
- }
221
- }
222
- },
223
- {
224
- id: 'customAspectRadio',
225
- type: 'ratio',
226
- min: 1,
227
- devices: {
228
- desktop: {
229
- default: {
230
- width: '1',
231
- height: '1'
232
- }
233
- }
234
- },
235
- hide: true
236
- },
237
- {
238
- id: 'layout',
239
- type: 'select',
240
- label: 'Object Fit',
241
- options: [
242
- {
243
- label: 'Fill',
244
- value: 'fill'
245
- },
246
- {
247
- label: 'Cover',
248
- value: 'cover'
249
- },
250
- {
251
- label: 'Contain',
252
- value: 'contain'
253
- },
254
- {
255
- label: 'None',
256
- value: 'none'
257
- },
258
- {
259
- label: 'Scale down',
260
- value: 'scale-down'
261
- }
262
- ],
263
- devices: {
264
- desktop: {
265
- default: 'contain'
266
- }
267
- }
268
- },
269
- {
270
- id: 'logoWidth',
271
- label: 'Width',
272
- type: 'input:unit',
273
- units: [
274
- 'px',
275
- '%'
276
- ],
277
- devices: {
278
- desktop: {
279
- default: '80px'
280
- }
281
- }
282
- }
283
- ]
284
- },
285
- {
286
- id: 'arrow',
287
- label: 'Arrow Icon',
288
- type: 'icon',
289
- default: `<svg width="16" viewBox="3 3 14 14"><path fill="currentColor" d="M15.854 7.646a.5.5 0 0 1 .001.707l-5.465 5.484a.55.55 0 0 1-.78 0L4.147 8.353a.5.5 0 1 1 .708-.706L10 12.812l5.147-5.165a.5.5 0 0 1 .707-.001Z"/></svg>`
290
- },
291
- // {
292
- // id: 'buyNow',
293
- // type: 'toggle',
294
- // label: 'Buy Now',
295
- // default: false,
296
- // },
297
- // {
298
- // id: 'buy-now-group-setting',
299
- // type: 'group',
300
- // label: 'Buy Now Button',
301
- // controls: [
302
- // {
303
- // id: 'openMode',
304
- // type: 'segment',
305
- // label: 'Open Mode',
306
- // options: [
307
- // {
308
- // label: 'Popup',
309
- // value: 'popup',
310
- // },
311
- // {
312
- // label: 'New Page',
313
- // value: 'page',
314
- // },
315
- // ],
316
- // default: 'page',
317
- // },
318
- // ],
319
- // },
320
- {
321
- id: 'cart-setting',
322
- type: 'group',
323
- label: 'Cart Setting',
324
- controls: [
325
- {
326
- id: 'cartIcon',
327
- label: 'Cart Icon',
328
- type: 'icon',
329
- default: `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M3 3h2l.4 2M7 13h10l4-8H5.4M7 13L5.4 5M7 13l-2.293 2.293c-.63.63-.184 1.707.707 1.707H17m0 0a2 2 0 100 4 2 2 0 000-4zm-8 2a2 2 0 11-4 0 2 2 0 014 0z"></path></svg>`
330
- }
331
- ]
332
- }
333
- ]
334
- },
335
- {
336
- id: 'style',
337
- controls: [
338
- {
339
- id: 'height',
340
- label: 'Height',
341
- type: 'input:unit',
342
- units: [
343
- 'px'
344
- ],
345
- devices: {
346
- desktop: {
347
- default: '60px'
348
- }
349
- }
350
- },
351
- {
352
- id: 'typography',
353
- label: 'Typography',
354
- type: 'typography',
355
- default: {
356
- type: 'paragraph-1'
357
- }
358
- },
359
- {
360
- id: 'typo',
361
- label: 'Text styles',
362
- type: 'typography-v2',
363
- default: {
364
- type: 'paragraph-1'
365
- },
366
- hiddenSetting: {
367
- color: true
368
- },
369
- ignoreReRender: true
370
- },
371
- {
372
- id: 'background-group',
373
- label: 'Background',
374
- type: 'group',
375
- controls: [
376
- {
377
- id: 'headerBg',
378
- type: 'colorpicker',
379
- label: 'Header',
380
- devices: {
381
- desktop: {
382
- default: '#FFFFFF'
383
- }
384
- }
385
- },
386
- {
387
- id: 'menuBg',
388
- type: 'colorpicker',
389
- label: 'Menu',
390
- info: 'Dropdown and collapse menu background color',
391
- devices: {
392
- desktop: {
393
- default: '#FFFFFF'
394
- }
395
- }
396
- }
397
- ]
398
- },
399
- {
400
- id: 'color-state',
401
- type: 'behavior-state',
402
- controls: [
403
- {
404
- id: 'textColor',
405
- label: 'Text Color',
406
- type: 'colorpicker',
407
- state: {
408
- normal: true,
409
- hover: true
410
- },
411
- default: {
412
- normal: '#111111'
413
- }
414
- },
415
- {
416
- id: 'menuTextColor',
417
- label: 'Menu Text Color',
418
- type: 'colorpicker',
419
- state: {
420
- normal: true,
421
- hover: true
422
- },
423
- default: {
424
- normal: '#111111'
425
- }
426
- },
427
- // {
428
- // id: 'bgColor',
429
- // label: 'Background Color',
430
- // type: 'colorpicker',
431
- // state: {
432
- // normal: true,
433
- // hover: true,
434
- // active: true,
435
- // },
436
- // default: {
437
- // normal: '#FFFFFF',
438
- // },
439
- // },
440
- {
441
- id: 'cartIconColor',
442
- type: 'colorpicker',
443
- label: 'Cart Icon Color',
444
- state: {
445
- normal: true,
446
- hover: true
447
- },
448
- default: {
449
- normal: 'text-1'
450
- }
451
- }
452
- ]
453
- }
454
- ]
455
- }
456
- ],
21
+ settings: settings.HeaderSettings,
457
22
  editorConfigs: {
458
23
  toolbar: {
459
24
  parent: true
460
25
  }
461
26
  },
462
- ui: [
463
- {
464
- type: 'control',
465
- label: {
466
- en: 'Breakpoint'
467
- },
468
- setting: {
469
- id: 'breakpoint'
470
- }
471
- },
472
- {
473
- type: 'control',
474
- label: {
475
- en: 'Menu'
476
- },
477
- setting: {
478
- id: 'menu'
479
- }
480
- },
481
- {
482
- type: 'group',
483
- label: {
484
- en: 'Logo'
485
- },
486
- controls: [
487
- {
488
- type: 'control',
489
- label: {
490
- en: 'Logo'
491
- },
492
- layout: 'vertical',
493
- setting: {
494
- id: 'logo'
495
- }
496
- },
497
- {
498
- type: 'control',
499
- label: {
500
- en: 'Aspect Ratio'
501
- },
502
- setting: {
503
- id: 'logoAspectRatio'
504
- }
505
- },
506
- {
507
- type: 'control',
508
- condition: 'logoAspectRatio == "custom"',
509
- setting: {
510
- id: 'customAspectRadio'
511
- }
512
- },
513
- {
514
- type: 'control',
515
- label: {
516
- en: 'Object Fit'
517
- },
518
- setting: {
519
- id: 'layout'
520
- }
521
- },
522
- {
523
- type: 'control',
524
- label: {
525
- en: 'Width'
526
- },
527
- setting: {
528
- id: 'logoWidth'
529
- }
530
- }
531
- ]
532
- },
533
- {
534
- type: 'group',
535
- label: {
536
- en: 'Arrow Icon'
537
- },
538
- controls: [
539
- {
540
- type: 'control',
541
- setting: {
542
- id: 'arrow'
543
- },
544
- layout: 'vertical'
545
- }
546
- ]
547
- },
548
- {
549
- type: 'group',
550
- label: {
551
- en: 'Cart Setting'
552
- },
553
- controls: [
554
- {
555
- type: 'control',
556
- setting: {
557
- id: 'cartIcon'
558
- },
559
- layout: 'vertical'
560
- }
561
- ]
562
- },
563
- {
564
- label: {
565
- en: 'Height'
566
- },
567
- type: 'control',
568
- setting: {
569
- id: 'height'
570
- }
571
- },
572
- {
573
- type: 'group',
574
- label: {
575
- en: 'Text'
576
- },
577
- controls: [
578
- {
579
- type: 'control',
580
- layout: 'vertical',
581
- setting: {
582
- id: 'typo'
583
- }
584
- }
585
- ]
586
- },
587
- {
588
- type: 'group',
589
- label: {
590
- en: 'Background'
591
- },
592
- controls: [
593
- {
594
- type: 'control',
595
- label: {
596
- en: 'Header'
597
- },
598
- setting: {
599
- id: 'headerBg'
600
- }
601
- },
602
- {
603
- type: 'control',
604
- label: {
605
- en: 'Menu'
606
- },
607
- setting: {
608
- id: 'menuBg'
609
- }
610
- }
611
- ]
612
- },
613
- {
614
- type: 'group',
615
- label: {
616
- en: 'Interaction states'
617
- },
618
- controls: [
619
- {
620
- type: 'tab',
621
- controls: [
622
- {
623
- type: 'group',
624
- label: {
625
- en: 'Normal'
626
- },
627
- controls: [
628
- {
629
- type: 'control',
630
- label: {
631
- en: 'Text Color'
632
- },
633
- setting: {
634
- id: 'textColor',
635
- state: 'normal'
636
- }
637
- },
638
- {
639
- type: 'control',
640
- label: {
641
- en: 'Menu Text Color'
642
- },
643
- setting: {
644
- id: 'menuTextColor',
645
- state: 'normal'
646
- }
647
- },
648
- {
649
- type: 'control',
650
- label: {
651
- en: 'Cart Icon Color'
652
- },
653
- setting: {
654
- id: 'cartIconColor',
655
- state: 'normal'
656
- }
657
- }
658
- ]
659
- },
660
- {
661
- type: 'group',
662
- label: {
663
- en: 'Hover'
664
- },
665
- controls: [
666
- {
667
- type: 'control',
668
- label: {
669
- en: 'Text Color'
670
- },
671
- setting: {
672
- id: 'textColor',
673
- state: 'hover'
674
- }
675
- },
676
- {
677
- type: 'control',
678
- label: {
679
- en: 'Menu Text Color'
680
- },
681
- setting: {
682
- id: 'menuTextColor',
683
- state: 'hover'
684
- }
685
- },
686
- {
687
- type: 'control',
688
- label: {
689
- en: 'Cart Icon Color'
690
- },
691
- setting: {
692
- id: 'cartIconColor',
693
- state: 'hover'
694
- }
695
- }
696
- ]
697
- }
698
- ]
699
- }
700
- ]
701
- }
702
- ],
703
- presets: [
704
- {
705
- id: 'instant-header',
706
- name: {
707
- en: 'Header'
708
- },
709
- icon: {
710
- desktop: `
711
- <svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
712
- <path d="M5.875 17.7183H8.625V26.3325H5.875V17.7183Z" fill="#D6D6D6"/>
713
- <path d="M31.375 17.7183H34.125V26.3325H31.375V17.7183Z" fill="#D6D6D6"/>
714
- <path fill-rule="evenodd" clip-rule="evenodd" d="M5.25 6.71826V14.9683H34.75V6.71826H5.25ZM3.75 3.96826C3.05964 3.96826 2.5 4.52791 2.5 5.21826V16.4683C2.5 17.1586 3.05964 17.7183 3.75 17.7183H36.25C36.9404 17.7183 37.5 17.1586 37.5 16.4683V5.21826C37.5 4.52791 36.9404 3.96826 36.25 3.96826H3.75Z" fill="#D6D6D6"/>
715
- <path fill-rule="evenodd" clip-rule="evenodd" d="M31.3754 29.0825H8.625V33.2821H31.3754V29.0825ZM5.875 26.3325V34.7821C5.875 35.4724 6.43464 36.0321 7.125 36.0321H32.8754C33.5658 36.0321 34.1254 35.4724 34.1254 34.7821V26.3325H5.875Z" fill="#D6D6D6"/>
716
- </svg>`
717
- },
718
- components: [
719
- {
720
- tag: 'Header'
721
- }
722
- ]
723
- }
724
- ]
27
+ ui: uiV1.SettingUIV1,
28
+ uiV2: uiV2.SettingUIV2,
29
+ presets: presets.HeaderPreset
725
30
  };
726
31
 
727
32
  exports.default = config;