@bobbykim/manguito-theme 0.17.0 → 0.19.0

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 (66) hide show
  1. package/LICENSE.md +1 -1
  2. package/README.md +3 -2
  3. package/dist/core.cjs +2 -0
  4. package/dist/core.d.ts +676 -0
  5. package/dist/core.js +2088 -0
  6. package/dist/mcl-theme.cjs +1 -0
  7. package/dist/mcl-theme.d.ts +12 -0
  8. package/dist/mcl-theme.js +608 -0
  9. package/package.json +28 -7
  10. package/CHANGELOG.md +0 -137
  11. package/index.d.ts +0 -13
  12. package/index.js +0 -18
  13. package/index.ts +0 -29
  14. package/lib/collapse/Collapse.vue +0 -126
  15. package/lib/collapse/Collapse.vue.d.ts +0 -55
  16. package/lib/composables/index.d.ts +0 -1
  17. package/lib/composables/index.js +0 -1
  18. package/lib/composables/index.ts +0 -1
  19. package/lib/composables/observeVisible.d.ts +0 -1
  20. package/lib/composables/observeVisible.js +0 -24
  21. package/lib/composables/observeVisible.ts +0 -24
  22. package/lib/directives/index.d.ts +0 -6
  23. package/lib/directives/index.js +0 -186
  24. package/lib/directives/index.ts +0 -211
  25. package/lib/directives/index.types.d.ts +0 -14
  26. package/lib/directives/index.types.js +0 -1
  27. package/lib/directives/index.types.ts +0 -15
  28. package/lib/dropdown/DropdownContainer.vue +0 -50
  29. package/lib/dropdown/DropdownContainer.vue.d.ts +0 -19
  30. package/lib/dropdown/DropdownContent.vue +0 -69
  31. package/lib/dropdown/DropdownContent.vue.d.ts +0 -42
  32. package/lib/dropdown/index.types.d.ts +0 -4
  33. package/lib/dropdown/index.types.js +0 -1
  34. package/lib/dropdown/index.types.ts +0 -4
  35. package/lib/header/HeaderHorizontal.vue +0 -158
  36. package/lib/header/HeaderHorizontal.vue.d.ts +0 -84
  37. package/lib/header/HeaderVertical.vue +0 -116
  38. package/lib/header/HeaderVertical.vue.d.ts +0 -70
  39. package/lib/header/NavDrawer.vue +0 -121
  40. package/lib/header/NavDrawer.vue.d.ts +0 -43
  41. package/lib/header/index.types.d.ts +0 -1
  42. package/lib/header/index.types.js +0 -1
  43. package/lib/header/index.types.ts +0 -1
  44. package/lib/modal/Modal.vue +0 -227
  45. package/lib/modal/Modal.vue.d.ts +0 -108
  46. package/lib/sidebar/Sidebar.vue +0 -256
  47. package/lib/sidebar/Sidebar.vue.d.ts +0 -113
  48. package/lib/theme/generateClass.d.ts +0 -2
  49. package/lib/theme/generateClass.js +0 -18
  50. package/lib/theme/generateClass.ts +0 -25
  51. package/lib/theme/index.d.ts +0 -95
  52. package/lib/theme/index.js +0 -642
  53. package/lib/theme/index.ts +0 -676
  54. package/lib/theme/theme.d.ts +0 -89
  55. package/lib/theme/theme.js +0 -851
  56. package/lib/theme/theme.ts +0 -893
  57. package/lib/theme/theme.types.d.ts +0 -21
  58. package/lib/theme/theme.types.js +0 -1
  59. package/lib/theme/theme.types.ts +0 -68
  60. package/lib/tooltip/index.d.ts +0 -62
  61. package/lib/tooltip/index.js +0 -71
  62. package/lib/tooltip/index.ts +0 -76
  63. package/themeVariables.cjs +0 -607
  64. package/tsconfig.json +0 -5
  65. package/tsconfig.ts.json +0 -9
  66. package/tsconfig.vue.json +0 -9
@@ -1,642 +0,0 @@
1
- import MCLTheme from './theme.js';
2
- /**
3
- * @TailwindCSS - Good practice is to let all of used classes to be in full instead of generated dynamically using methods such as string literal.
4
- * @Interface - ClassType to define the case, and Input type to generate tailwind clssname.
5
- * @Export GenerateMCLClass - extends MCLTheme class
6
- */
7
- export const colorType = [
8
- 'BGCOLOR',
9
- 'BEFOREBG',
10
- 'AFTERBG',
11
- 'HVBGCOLOR',
12
- 'FCBGCOLOR',
13
- 'ACTIVEBG',
14
- 'TEXTCOLOR',
15
- 'HVTEXTCOLOR',
16
- 'FCTEXTCOLOR',
17
- 'DISABLEDTEXTCOLOR',
18
- 'SVGFILL',
19
- 'RINGCOLOR',
20
- 'FOCUSRING',
21
- 'ACTIVERING',
22
- 'OFFSETRING',
23
- 'DUMMYCOLOR',
24
- 'BTNCOLOR',
25
- 'LISTCOLOR',
26
- 'BORDER',
27
- 'BORDERX',
28
- 'BORDERY',
29
- 'BORDERT',
30
- 'BORDERB',
31
- 'BORDERL',
32
- 'BORDERR',
33
- ];
34
- export const textType = [
35
- 'H1',
36
- 'H2',
37
- 'H3',
38
- 'H4',
39
- 'BODYTEXT',
40
- 'FONTWEIGHT',
41
- 'TEXTALIGN',
42
- ];
43
- export const borderWidthType = [
44
- 'BORDERW',
45
- 'BORDERXW',
46
- 'BORDERYW',
47
- 'BORDERTW',
48
- 'BORDERBW',
49
- 'BORDERLW',
50
- 'BORDERRW',
51
- ];
52
- export const scaleType = ['BGOPACITY', 'OPACITY'];
53
- export const spacingType = [
54
- 'MARGIN',
55
- 'MARGINX',
56
- 'MARGINY',
57
- 'MARGINT',
58
- 'MARGINB',
59
- 'MARGINL',
60
- 'MARGINR',
61
- 'PADDING',
62
- 'PADDINGX',
63
- 'PADDINGY',
64
- 'PADDINGT',
65
- 'PADDINGB',
66
- 'PADDINGL',
67
- 'PADDINGR',
68
- 'GAP',
69
- ];
70
- const allType = [
71
- ...colorType,
72
- ...textType,
73
- ...borderWidthType,
74
- ...scaleType,
75
- ...spacingType,
76
- ];
77
- class GenerateMCLClass extends MCLTheme {
78
- classType;
79
- classValue;
80
- constructor(classType, classValue) {
81
- super();
82
- this.classType = classType;
83
- this.classValue = classValue;
84
- }
85
- // handle color classes types
86
- generateColorClass() {
87
- switch (this.classType) {
88
- case 'BGCOLOR':
89
- return this.getBgColorClass();
90
- case 'HVBGCOLOR':
91
- return this.getHoverBgColorClass();
92
- case 'FCBGCOLOR':
93
- return this.getFocusBgColorClass();
94
- case 'BEFOREBG':
95
- return this.getBeforeBgColorClass();
96
- case 'AFTERBG':
97
- return this.getAfterBgColorClass();
98
- case 'ACTIVEBG':
99
- return this.getActiveBgColorClass();
100
- case 'TEXTCOLOR':
101
- return this.getTextColorClass();
102
- case 'HVTEXTCOLOR':
103
- return this.getHoverTextColorClass();
104
- case 'FCTEXTCOLOR':
105
- return this.getFocusTextColorClass();
106
- case 'DISABLEDTEXTCOLOR':
107
- return this.getDisabledTextColorClass();
108
- case 'SVGFILL':
109
- return this.getSvgFillColorClass();
110
- case 'RINGCOLOR':
111
- return this.getRingColorClass();
112
- case 'FOCUSRING':
113
- return this.getFocusRingColorClass();
114
- case 'ACTIVERING':
115
- return this.getActiveRingColorClass();
116
- case 'OFFSETRING':
117
- return this.getRingOffsetColorClass();
118
- case 'BTNCOLOR':
119
- return this.getBtnColorClass();
120
- case 'LISTCOLOR':
121
- return this.getRingColorClass();
122
- case 'BORDER':
123
- return this.getBorderColorClass();
124
- case 'BORDERX':
125
- return this.getBorderXColorClass();
126
- case 'BORDERY':
127
- return this.getBorderYColorClass();
128
- case 'BORDERT':
129
- return this.getBorderTopColorClass();
130
- case 'BORDERB':
131
- return this.getBorderBottomColorClass();
132
- case 'BORDERL':
133
- return this.getBorderLeftColorClass();
134
- case 'BORDERR':
135
- return this.getBorderRightColorClass();
136
- default:
137
- return ' ';
138
- }
139
- }
140
- // handle text class types
141
- generateTextClass() {
142
- switch (this.classType) {
143
- // case: heading text class
144
- case 'H1':
145
- return this.getH1Class();
146
- case 'H2':
147
- return this.getH2Class();
148
- case 'H3':
149
- return this.getH3Class();
150
- case 'H4':
151
- return this.getH4Class();
152
- // case: body text class
153
- case 'BODYTEXT':
154
- return this.getBodyTextSizeClass();
155
- // case: font weight class
156
- case 'FONTWEIGHT':
157
- return this.getFontWeightClass();
158
- // case: text alignment class
159
- case 'TEXTALIGN':
160
- return this.getTextAlignClass();
161
- default:
162
- return ' ';
163
- }
164
- }
165
- // handle border width class types
166
- generateBorderWidthClass() {
167
- switch (this.classType) {
168
- // case: border width class
169
- case 'BORDERW':
170
- return this.getBorderWidthClass();
171
- case 'BORDERXW':
172
- return this.getBorderXWidthClass();
173
- case 'BORDERYW':
174
- return this.getBorderYWidthClass();
175
- case 'BORDERTW':
176
- return this.getBorderTopWidthClass();
177
- case 'BORDERBW':
178
- return this.getBorderBottomWidthClass();
179
- case 'BORDERLW':
180
- return this.getBorderLeftWidthClass();
181
- case 'BORDERRW':
182
- return this.getBorderWidthClass();
183
- default:
184
- return ' ';
185
- }
186
- }
187
- generateScaleClass() {
188
- switch (this.classType) {
189
- // case: opacity class
190
- case 'OPACITY':
191
- return this.getOpacityClass();
192
- case 'BGOPACITY':
193
- return this.getBgOpacityClass();
194
- default:
195
- return ' ';
196
- }
197
- }
198
- generateSpacingClass() {
199
- switch (this.classType) {
200
- // case: margins
201
- case 'MARGIN':
202
- return this.getMarginClass();
203
- case 'MARGINX':
204
- return this.getMarginXClass();
205
- case 'MARGINY':
206
- return this.getMarginYClass();
207
- case 'MARGINT':
208
- return this.getMarginTopClass();
209
- case 'MARGINB':
210
- return this.getMarginBottomClass();
211
- case 'MARGINL':
212
- return this.getMarginLeftClass();
213
- case 'MARGINR':
214
- return this.getMarginRightClass();
215
- // case: paddings
216
- case 'PADDING':
217
- return this.getPaddingClass();
218
- case 'PADDINGX':
219
- return this.getPaddingXClass();
220
- case 'PADDINGY':
221
- return this.getPaddingYClass();
222
- case 'PADDINGT':
223
- return this.getPaddingTopClass();
224
- case 'PADDINGB':
225
- return this.getPaddingBottomClass();
226
- case 'PADDINGL':
227
- return this.getPaddingLeftClass();
228
- case 'PADDINGR':
229
- return this.getPaddingRightClass();
230
- // case: gap
231
- case 'GAP':
232
- return this.getGapClass();
233
- default:
234
- return ' ';
235
- }
236
- }
237
- // handle color class
238
- // bg color
239
- getBgColorClass() {
240
- if (!this.validateColorType) {
241
- return ' ';
242
- }
243
- return MCLTheme.bgColor[this.classValue];
244
- }
245
- getHoverBgColorClass() {
246
- if (!this.validateColorType) {
247
- return ' ';
248
- }
249
- return MCLTheme.hoverBgColor[this.classValue];
250
- }
251
- getFocusBgColorClass() {
252
- if (!this.validateColorType) {
253
- return ' ';
254
- }
255
- return MCLTheme.focusBgColor[this.classValue];
256
- }
257
- getBeforeBgColorClass() {
258
- if (!this.validateColorType) {
259
- return ' ';
260
- }
261
- return MCLTheme.beforeBgColor[this.classValue];
262
- }
263
- getAfterBgColorClass() {
264
- if (!this.validateColorType) {
265
- return ' ';
266
- }
267
- return MCLTheme.afterBgColor[this.classValue];
268
- }
269
- getActiveBgColorClass() {
270
- if (!this.validateColorType) {
271
- return ' ';
272
- }
273
- return MCLTheme.bgActiveColor[this.classValue];
274
- }
275
- // text color
276
- getTextColorClass() {
277
- if (!this.validateColorType) {
278
- return ' ';
279
- }
280
- return MCLTheme.textColor[this.classValue];
281
- }
282
- getHoverTextColorClass() {
283
- if (!this.validateColorType) {
284
- return ' ';
285
- }
286
- return MCLTheme.hoverTextColor[this.classValue];
287
- }
288
- getFocusTextColorClass() {
289
- if (!this.validateColorType) {
290
- return ' ';
291
- }
292
- return MCLTheme.focusTextColor[this.classValue];
293
- }
294
- getDisabledTextColorClass() {
295
- if (!this.validateColorType) {
296
- return ' ';
297
- }
298
- return MCLTheme.disabledTextColor[this.classValue];
299
- }
300
- // svg color
301
- getSvgFillColorClass() {
302
- if (!this.validateColorType) {
303
- return ' ';
304
- }
305
- return MCLTheme.svgFillColor[this.classValue];
306
- }
307
- // ring color
308
- getRingColorClass() {
309
- if (!this.validateColorType) {
310
- return ' ';
311
- }
312
- return MCLTheme.ringColor[this.classValue];
313
- }
314
- getFocusRingColorClass() {
315
- if (!this.validateColorType) {
316
- return ' ';
317
- }
318
- return MCLTheme.ringFocusColor[this.classValue];
319
- }
320
- getActiveRingColorClass() {
321
- if (!this.validateColorType) {
322
- return ' ';
323
- }
324
- return MCLTheme.ringActiveColor[this.classValue];
325
- }
326
- getRingOffsetColorClass() {
327
- if (!this.validateColorType) {
328
- return ' ';
329
- }
330
- return MCLTheme.ringOffsetColor[this.classValue];
331
- }
332
- // btn & list
333
- getBtnColorClass() {
334
- if (!this.validateColorType) {
335
- return ' ';
336
- }
337
- return MCLTheme.btnColor[this.classValue];
338
- }
339
- getListColorClass() {
340
- if (!this.validateColorType) {
341
- return ' ';
342
- }
343
- return MCLTheme.listColor[this.classValue];
344
- }
345
- // border color
346
- getBorderColorClass() {
347
- if (!this.validateColorType) {
348
- return ' ';
349
- }
350
- return MCLTheme.borderColor[this.classValue];
351
- }
352
- getBorderXColorClass() {
353
- if (!this.validateColorType) {
354
- return ' ';
355
- }
356
- return MCLTheme.borderXColor[this.classValue];
357
- }
358
- getBorderYColorClass() {
359
- if (!this.validateColorType) {
360
- return ' ';
361
- }
362
- return MCLTheme.borderYColor[this.classValue];
363
- }
364
- getBorderTopColorClass() {
365
- if (!this.validateColorType) {
366
- return ' ';
367
- }
368
- return MCLTheme.borderTopColor[this.classValue];
369
- }
370
- getBorderBottomColorClass() {
371
- if (!this.validateColorType) {
372
- return ' ';
373
- }
374
- return MCLTheme.borderBottomColor[this.classValue];
375
- }
376
- getBorderLeftColorClass() {
377
- if (!this.validateColorType) {
378
- return ' ';
379
- }
380
- return MCLTheme.borderLeftColor[this.classValue];
381
- }
382
- getBorderRightColorClass() {
383
- if (!this.validateColorType) {
384
- return ' ';
385
- }
386
- return MCLTheme.borderRightColor[this.classValue];
387
- }
388
- // handle heading classes
389
- getH1Class() {
390
- if (!this.validateHeadingTextSizeType) {
391
- return ' ';
392
- }
393
- return MCLTheme.heading1[this.classValue];
394
- }
395
- getH2Class() {
396
- if (!this.validateHeadingTextSizeType) {
397
- return ' ';
398
- }
399
- return MCLTheme.heading2[this.classValue];
400
- }
401
- getH3Class() {
402
- if (!this.validateHeadingTextSizeType) {
403
- return ' ';
404
- }
405
- return MCLTheme.heading3[this.classValue];
406
- }
407
- getH4Class() {
408
- if (!this.validateHeadingTextSizeType) {
409
- return ' ';
410
- }
411
- return MCLTheme.heading4[this.classValue];
412
- }
413
- // handle body text size classes
414
- getBodyTextSizeClass() {
415
- if (!this.validateBodyTextSizeType) {
416
- return ' ';
417
- }
418
- return MCLTheme.bodyText[this.classValue];
419
- }
420
- // handle font weight classes
421
- getFontWeightClass() {
422
- if (!this.validateFontWeightType) {
423
- return ' ';
424
- }
425
- return MCLTheme.fontweight[this.classValue];
426
- }
427
- // handle text align classes
428
- getTextAlignClass() {
429
- return MCLTheme.textAlign[this.classValue];
430
- }
431
- // handle border width classes
432
- getBorderWidthClass() {
433
- if (!this.validateRangeType) {
434
- return ' ';
435
- }
436
- return MCLTheme.borderWidth[this.classValue];
437
- }
438
- getBorderXWidthClass() {
439
- if (!this.validateRangeType) {
440
- return ' ';
441
- }
442
- return MCLTheme.borderXWidth[this.classValue];
443
- }
444
- getBorderYWidthClass() {
445
- if (!this.validateRangeType) {
446
- return ' ';
447
- }
448
- return MCLTheme.borderYWidth[this.classValue];
449
- }
450
- getBorderTopWidthClass() {
451
- if (!this.validateRangeType) {
452
- return ' ';
453
- }
454
- return MCLTheme.borderTopWidth[this.classValue];
455
- }
456
- getBorderBottomWidthClass() {
457
- if (!this.validateRangeType) {
458
- return ' ';
459
- }
460
- return MCLTheme.borderBottomWidth[this.classValue];
461
- }
462
- getBorderLeftWidthClass() {
463
- if (!this.validateRangeType) {
464
- return ' ';
465
- }
466
- return MCLTheme.borderLeftWidth[this.classValue];
467
- }
468
- getBorderRightWidthClass() {
469
- if (!this.validateRangeType) {
470
- return ' ';
471
- }
472
- return MCLTheme.borderRightWidth[this.classValue];
473
- }
474
- // handle opacity classes
475
- getOpacityClass() {
476
- if (!this.validateOpacityType) {
477
- return ' ';
478
- }
479
- return MCLTheme.opacity[this.classValue];
480
- }
481
- getBgOpacityClass() {
482
- if (!this.validateOpacityType) {
483
- return ' ';
484
- }
485
- return MCLTheme.backgroundOpacity[this.classValue];
486
- }
487
- // handle spacing classes
488
- // margins
489
- getMarginClass() {
490
- if (!this.validateSpaceType) {
491
- return ' ';
492
- }
493
- return MCLTheme.margin[this.classValue];
494
- }
495
- getMarginXClass() {
496
- if (!this.validateSpaceType) {
497
- return ' ';
498
- }
499
- return MCLTheme.marginX[this.classValue];
500
- }
501
- getMarginYClass() {
502
- if (!this.validateSpaceType) {
503
- return ' ';
504
- }
505
- return MCLTheme.marginY[this.classValue];
506
- }
507
- getMarginTopClass() {
508
- if (!this.validateSpaceType) {
509
- return ' ';
510
- }
511
- return MCLTheme.marginTop[this.classValue];
512
- }
513
- getMarginBottomClass() {
514
- if (!this.validateSpaceType) {
515
- return ' ';
516
- }
517
- return MCLTheme.marginBottom[this.classValue];
518
- }
519
- getMarginLeftClass() {
520
- if (!this.validateSpaceType) {
521
- return ' ';
522
- }
523
- return MCLTheme.marginLeft[this.classValue];
524
- }
525
- getMarginRightClass() {
526
- if (!this.validateSpaceType) {
527
- return ' ';
528
- }
529
- return MCLTheme.marginRight[this.classValue];
530
- }
531
- // padding
532
- getPaddingClass() {
533
- if (!this.validateSpaceType) {
534
- return ' ';
535
- }
536
- return MCLTheme.padding[this.classValue];
537
- }
538
- getPaddingXClass() {
539
- if (!this.validateSpaceType) {
540
- return ' ';
541
- }
542
- return MCLTheme.paddingX[this.classValue];
543
- }
544
- getPaddingYClass() {
545
- if (!this.validateSpaceType) {
546
- return ' ';
547
- }
548
- return MCLTheme.paddingY[this.classValue];
549
- }
550
- getPaddingTopClass() {
551
- if (!this.validateSpaceType) {
552
- return ' ';
553
- }
554
- return MCLTheme.paddingTop[this.classValue];
555
- }
556
- getPaddingBottomClass() {
557
- if (!this.validateSpaceType) {
558
- return ' ';
559
- }
560
- return MCLTheme.paddingBottom[this.classValue];
561
- }
562
- getPaddingLeftClass() {
563
- if (!this.validateSpaceType) {
564
- return ' ';
565
- }
566
- return MCLTheme.paddingLeft[this.classValue];
567
- }
568
- getPaddingRightClass() {
569
- if (!this.validateSpaceType) {
570
- return ' ';
571
- }
572
- return MCLTheme.paddingRight[this.classValue];
573
- }
574
- // gap
575
- getGapClass() {
576
- if (!this.validateSpaceType) {
577
- return ' ';
578
- }
579
- return MCLTheme.gap[this.classValue];
580
- }
581
- // input validation
582
- validateColorType() {
583
- const validatorRe = /(primary|secondary|success|info|warning|danger|light-1|light-2|light-3|light-4|dark-1|dark-2|dark-3|dark-4|black|white|transparent)/;
584
- if (typeof this.classValue !== 'string') {
585
- return false;
586
- }
587
- return validatorRe.test(this.classValue);
588
- }
589
- validateSpaceType() {
590
- const validatorRe = /(0|3xs|2xs|xs|sm|md|lg|xl|2xl|3xl)/;
591
- if (typeof this.classValue !== 'string') {
592
- return false;
593
- }
594
- return validatorRe.test(this.classValue);
595
- }
596
- validateHeadingTextSizeType() {
597
- const validatorRe = /(sm|md|lg|xl)/;
598
- if (typeof this.classValue !== 'string') {
599
- return false;
600
- }
601
- return validatorRe.test(this.classValue);
602
- }
603
- validateBodyTextSizeType() {
604
- const validatorRe = /(xs|sm|md|lg|xl)/;
605
- if (typeof this.classValue !== 'string') {
606
- return false;
607
- }
608
- return validatorRe.test(this.classValue);
609
- }
610
- validateFontWeightType() {
611
- const validatorRe = /(light|normal|bold)/;
612
- if (typeof this.classValue !== 'string') {
613
- return false;
614
- }
615
- return validatorRe.test(this.classValue);
616
- }
617
- validateOpacityType() {
618
- const validatorRe = /\b(0|[1-9]0|100)\b/;
619
- if (typeof this.classValue !== 'number') {
620
- return false;
621
- }
622
- return validatorRe.test(this.classValue.toString());
623
- }
624
- validateRangeType() {
625
- const validatorRe = /\b([1-9]|1[0-2])\b/;
626
- if (typeof this.classValue !== 'number') {
627
- return false;
628
- }
629
- return validatorRe.test(this.classValue.toString());
630
- }
631
- validateAlignment() {
632
- const validatorRe = /(left|center|right)/;
633
- if (typeof this.classValue !== 'string') {
634
- return false;
635
- }
636
- return validatorRe.test(this.classValue);
637
- }
638
- dummyMethod() {
639
- return this.getRingOffsetColorClass();
640
- }
641
- }
642
- export default GenerateMCLClass;