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