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