@bobbykim/manguito-theme 0.7.0 → 0.8.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/CHANGELOG.md +12 -0
- package/index.d.ts +13 -0
- package/index.js +30 -0
- package/lib/collapse/Collapse.vue.d.ts +46 -0
- package/lib/collapse/index.types.d.ts +3 -0
- package/lib/collapse/index.types.js +1 -0
- package/lib/composables/index.d.ts +1 -0
- package/lib/composables/index.js +1 -0
- package/lib/composables/observeVisible.d.ts +1 -0
- package/lib/composables/observeVisible.js +24 -0
- package/lib/directives/index.d.ts +6 -0
- package/lib/directives/index.js +215 -0
- package/lib/directives/index.types.d.ts +14 -0
- package/lib/directives/index.types.js +1 -0
- package/lib/dropdown/DropdownContainer.vue.d.ts +19 -0
- package/lib/dropdown/DropdownContent.vue.d.ts +23 -0
- package/lib/dropdown/index.types.d.ts +4 -0
- package/lib/dropdown/index.types.js +1 -0
- package/lib/modal/Modal.vue.d.ts +112 -0
- package/lib/nav/HamburgerMenu.vue +1 -1
- package/lib/nav/HamburgerMenu.vue.d.ts +44 -0
- package/lib/sidebar/Sidebar.vue.d.ts +121 -0
- package/lib/tooltip/index.d.ts +62 -0
- package/lib/tooltip/index.js +71 -0
- package/package.json +5 -2
- package/theme/index.d.ts +94 -0
- package/theme/index.js +631 -0
- package/theme/theme.d.ts +88 -0
- package/theme/theme.js +831 -0
- package/theme/theme.types.d.ts +21 -0
- package/theme/theme.types.js +1 -0
- package/tsconfig.json +8 -4
- package/tsconfig.vue.json +9 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { ColorPalette, DirectionX } from '../../';
|
|
2
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
3
|
+
visible: {
|
|
4
|
+
type: import("vue").PropType<boolean>;
|
|
5
|
+
default: boolean;
|
|
6
|
+
};
|
|
7
|
+
className: {
|
|
8
|
+
type: import("vue").PropType<string>;
|
|
9
|
+
default: string;
|
|
10
|
+
};
|
|
11
|
+
title: {
|
|
12
|
+
type: import("vue").PropType<string>;
|
|
13
|
+
};
|
|
14
|
+
titleColor: {
|
|
15
|
+
type: import("vue").PropType<ColorPalette>;
|
|
16
|
+
default: string;
|
|
17
|
+
};
|
|
18
|
+
noBackdrop: {
|
|
19
|
+
type: import("vue").PropType<boolean>;
|
|
20
|
+
default: boolean;
|
|
21
|
+
};
|
|
22
|
+
noHeader: {
|
|
23
|
+
type: import("vue").PropType<boolean>;
|
|
24
|
+
default: boolean;
|
|
25
|
+
};
|
|
26
|
+
color: {
|
|
27
|
+
type: import("vue").PropType<ColorPalette>;
|
|
28
|
+
default: string;
|
|
29
|
+
};
|
|
30
|
+
backdropColor: {
|
|
31
|
+
type: import("vue").PropType<ColorPalette>;
|
|
32
|
+
default: string;
|
|
33
|
+
};
|
|
34
|
+
placement: {
|
|
35
|
+
type: import("vue").PropType<DirectionX>;
|
|
36
|
+
default: string;
|
|
37
|
+
};
|
|
38
|
+
width: {
|
|
39
|
+
type: import("vue").PropType<string | number>;
|
|
40
|
+
default: number;
|
|
41
|
+
};
|
|
42
|
+
}, {
|
|
43
|
+
toggle: () => void;
|
|
44
|
+
open: () => void;
|
|
45
|
+
close: (e: Event) => void;
|
|
46
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
47
|
+
open: (...args: any[]) => void;
|
|
48
|
+
close: (...args: any[]) => void;
|
|
49
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
50
|
+
visible: {
|
|
51
|
+
type: import("vue").PropType<boolean>;
|
|
52
|
+
default: boolean;
|
|
53
|
+
};
|
|
54
|
+
className: {
|
|
55
|
+
type: import("vue").PropType<string>;
|
|
56
|
+
default: string;
|
|
57
|
+
};
|
|
58
|
+
title: {
|
|
59
|
+
type: import("vue").PropType<string>;
|
|
60
|
+
};
|
|
61
|
+
titleColor: {
|
|
62
|
+
type: import("vue").PropType<ColorPalette>;
|
|
63
|
+
default: string;
|
|
64
|
+
};
|
|
65
|
+
noBackdrop: {
|
|
66
|
+
type: import("vue").PropType<boolean>;
|
|
67
|
+
default: boolean;
|
|
68
|
+
};
|
|
69
|
+
noHeader: {
|
|
70
|
+
type: import("vue").PropType<boolean>;
|
|
71
|
+
default: boolean;
|
|
72
|
+
};
|
|
73
|
+
color: {
|
|
74
|
+
type: import("vue").PropType<ColorPalette>;
|
|
75
|
+
default: string;
|
|
76
|
+
};
|
|
77
|
+
backdropColor: {
|
|
78
|
+
type: import("vue").PropType<ColorPalette>;
|
|
79
|
+
default: string;
|
|
80
|
+
};
|
|
81
|
+
placement: {
|
|
82
|
+
type: import("vue").PropType<DirectionX>;
|
|
83
|
+
default: string;
|
|
84
|
+
};
|
|
85
|
+
width: {
|
|
86
|
+
type: import("vue").PropType<string | number>;
|
|
87
|
+
default: number;
|
|
88
|
+
};
|
|
89
|
+
}>> & {
|
|
90
|
+
onOpen?: ((...args: any[]) => any) | undefined;
|
|
91
|
+
onClose?: ((...args: any[]) => any) | undefined;
|
|
92
|
+
}, {
|
|
93
|
+
visible: boolean;
|
|
94
|
+
className: string;
|
|
95
|
+
titleColor: ColorPalette;
|
|
96
|
+
noBackdrop: boolean;
|
|
97
|
+
noHeader: boolean;
|
|
98
|
+
color: ColorPalette;
|
|
99
|
+
backdropColor: ColorPalette;
|
|
100
|
+
placement: DirectionX;
|
|
101
|
+
width: string | number;
|
|
102
|
+
}, {}>, {
|
|
103
|
+
header?(_: {
|
|
104
|
+
close: (e: Event) => void;
|
|
105
|
+
status: true;
|
|
106
|
+
}): any;
|
|
107
|
+
body?(_: {
|
|
108
|
+
close: (e: Event) => void;
|
|
109
|
+
status: true;
|
|
110
|
+
}): any;
|
|
111
|
+
footer?(_: {
|
|
112
|
+
close: (e: Event) => void;
|
|
113
|
+
status: true;
|
|
114
|
+
}): any;
|
|
115
|
+
}>;
|
|
116
|
+
export default _default;
|
|
117
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
118
|
+
new (): {
|
|
119
|
+
$slots: S;
|
|
120
|
+
};
|
|
121
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import type { Direction, ColorPalette } from '../../';
|
|
3
|
+
declare const _default: import("vue").DefineComponent<{
|
|
4
|
+
direction: {
|
|
5
|
+
type: PropType<Direction>;
|
|
6
|
+
default: string;
|
|
7
|
+
};
|
|
8
|
+
color: {
|
|
9
|
+
type: PropType<ColorPalette>;
|
|
10
|
+
default: string;
|
|
11
|
+
};
|
|
12
|
+
textColor: {
|
|
13
|
+
type: PropType<ColorPalette>;
|
|
14
|
+
default: string;
|
|
15
|
+
};
|
|
16
|
+
width: {
|
|
17
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
18
|
+
default: number;
|
|
19
|
+
};
|
|
20
|
+
customClass: {
|
|
21
|
+
type: StringConstructor;
|
|
22
|
+
default: string;
|
|
23
|
+
};
|
|
24
|
+
title: {
|
|
25
|
+
type: StringConstructor;
|
|
26
|
+
required: true;
|
|
27
|
+
};
|
|
28
|
+
}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
29
|
+
[key: string]: any;
|
|
30
|
+
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
31
|
+
direction: {
|
|
32
|
+
type: PropType<Direction>;
|
|
33
|
+
default: string;
|
|
34
|
+
};
|
|
35
|
+
color: {
|
|
36
|
+
type: PropType<ColorPalette>;
|
|
37
|
+
default: string;
|
|
38
|
+
};
|
|
39
|
+
textColor: {
|
|
40
|
+
type: PropType<ColorPalette>;
|
|
41
|
+
default: string;
|
|
42
|
+
};
|
|
43
|
+
width: {
|
|
44
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
45
|
+
default: number;
|
|
46
|
+
};
|
|
47
|
+
customClass: {
|
|
48
|
+
type: StringConstructor;
|
|
49
|
+
default: string;
|
|
50
|
+
};
|
|
51
|
+
title: {
|
|
52
|
+
type: StringConstructor;
|
|
53
|
+
required: true;
|
|
54
|
+
};
|
|
55
|
+
}>>, {
|
|
56
|
+
direction: Direction;
|
|
57
|
+
color: ColorPalette;
|
|
58
|
+
textColor: ColorPalette;
|
|
59
|
+
width: string | number;
|
|
60
|
+
customClass: string;
|
|
61
|
+
}, {}>;
|
|
62
|
+
export default _default;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { defineComponent, h, computed } from 'vue';
|
|
2
|
+
import generateClass from '../../';
|
|
3
|
+
export default defineComponent({
|
|
4
|
+
props: {
|
|
5
|
+
direction: {
|
|
6
|
+
type: String,
|
|
7
|
+
default: 'right',
|
|
8
|
+
},
|
|
9
|
+
color: {
|
|
10
|
+
type: String,
|
|
11
|
+
default: 'dark-3',
|
|
12
|
+
},
|
|
13
|
+
textColor: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: 'white',
|
|
16
|
+
},
|
|
17
|
+
width: {
|
|
18
|
+
type: [Number, String],
|
|
19
|
+
default: 80,
|
|
20
|
+
},
|
|
21
|
+
customClass: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: '',
|
|
24
|
+
},
|
|
25
|
+
title: {
|
|
26
|
+
type: String,
|
|
27
|
+
required: true,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
setup(props) {
|
|
31
|
+
const defaultClassList = 'invisible opacity-0 group-hover:visible group-hover:opacity-100 z-[100] tooltip';
|
|
32
|
+
const colorClass = computed(() => {
|
|
33
|
+
/**
|
|
34
|
+
* @param {ColorPalette} color - props
|
|
35
|
+
* @param {ColorPalette} textolor - props
|
|
36
|
+
*/
|
|
37
|
+
const { color, textColor } = props;
|
|
38
|
+
const classArray = [
|
|
39
|
+
generateClass('BGCOLOR', color),
|
|
40
|
+
generateClass('TEXTCOLOR', textColor),
|
|
41
|
+
];
|
|
42
|
+
return classArray.join(' ');
|
|
43
|
+
});
|
|
44
|
+
const tooltipWidth = computed(() => {
|
|
45
|
+
return { width: `${props.width}px` };
|
|
46
|
+
});
|
|
47
|
+
const tooltipDirection = computed(() => {
|
|
48
|
+
switch (props.direction) {
|
|
49
|
+
case 'left':
|
|
50
|
+
return 'tooltip-left';
|
|
51
|
+
case 'top':
|
|
52
|
+
return 'tooltip-top';
|
|
53
|
+
case 'bottom':
|
|
54
|
+
return 'tooltip-bottom';
|
|
55
|
+
default:
|
|
56
|
+
return 'tooltip-right';
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
return () => h('div', {
|
|
60
|
+
class: [
|
|
61
|
+
defaultClassList,
|
|
62
|
+
props.customClass,
|
|
63
|
+
tooltipDirection.value,
|
|
64
|
+
colorClass.value,
|
|
65
|
+
],
|
|
66
|
+
role: 'tooltip',
|
|
67
|
+
innerHTML: props.title,
|
|
68
|
+
style: [tooltipWidth.value],
|
|
69
|
+
});
|
|
70
|
+
},
|
|
71
|
+
});
|
package/package.json
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bobbykim/manguito-theme",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "main theme file for manguito components library. Other MCL components will need to import this file to run.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.ts",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "vue-tsc --project tsconfig.vue.json && tsc"
|
|
12
|
+
},
|
|
10
13
|
"author": {
|
|
11
14
|
"name": "Bobby Kim",
|
|
12
15
|
"url": "https://www.devbobbykim.com/"
|
|
@@ -17,5 +20,5 @@
|
|
|
17
20
|
"url": "https://github.com/bobbykim89/manguito-component-library.git"
|
|
18
21
|
},
|
|
19
22
|
"license": "MIT",
|
|
20
|
-
"gitHead": "
|
|
23
|
+
"gitHead": "97c70699ec57726f77f021927b61f83715847f33"
|
|
21
24
|
}
|
package/theme/index.d.ts
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import MCLTheme from './theme.js';
|
|
2
|
+
import type { ColorPalette, HeadingSize, BodyText, FontWeight, Range, OpacityRange, SpacingLevel, Alignment } from './theme.types';
|
|
3
|
+
/**
|
|
4
|
+
* @TailwindCSS - Good practice is to let all of used classes to be in full instead of generated dynamically using methods such as string literal.
|
|
5
|
+
* @Interface - ClassType to define the case, and Input type to generate tailwind clssname.
|
|
6
|
+
* @Export GenerateMCLClass - extends MCLTheme class
|
|
7
|
+
*/
|
|
8
|
+
export declare const colorType: readonly ["BGCOLOR", "BEFOREBG", "AFTERBG", "HVBGCOLOR", "FCBGCOLOR", "ACTIVEBG", "TEXTCOLOR", "HVTEXTCOLOR", "DISABLEDTEXTCOLOR", "SVGFILL", "RINGCOLOR", "FOCUSRING", "ACTIVERING", "OFFSETRING", "DUMMYCOLOR", "BTNCOLOR", "LISTCOLOR", "BORDER", "BORDERX", "BORDERY", "BORDERT", "BORDERB", "BORDERL", "BORDERR"];
|
|
9
|
+
export declare const textType: readonly ["H1", "H2", "H3", "H4", "BODYTEXT", "FONTWEIGHT", "TEXTALIGN"];
|
|
10
|
+
export declare const borderWidthType: readonly ["BORDERW", "BORDERXW", "BORDERYW", "BORDERTW", "BORDERBW", "BORDERLW", "BORDERRW"];
|
|
11
|
+
export declare const scaleType: readonly ["BGOPACITY", "OPACITY"];
|
|
12
|
+
export declare const spacingType: readonly ["MARGIN", "MARGINX", "MARGINY", "MARGINT", "MARGINB", "MARGINL", "MARGINR", "PADDING", "PADDINGX", "PADDINGY", "PADDINGT", "PADDINGB", "PADDINGL", "PADDINGR", "GAP"];
|
|
13
|
+
declare const allType: readonly ["BGCOLOR", "BEFOREBG", "AFTERBG", "HVBGCOLOR", "FCBGCOLOR", "ACTIVEBG", "TEXTCOLOR", "HVTEXTCOLOR", "DISABLEDTEXTCOLOR", "SVGFILL", "RINGCOLOR", "FOCUSRING", "ACTIVERING", "OFFSETRING", "DUMMYCOLOR", "BTNCOLOR", "LISTCOLOR", "BORDER", "BORDERX", "BORDERY", "BORDERT", "BORDERB", "BORDERL", "BORDERR", "H1", "H2", "H3", "H4", "BODYTEXT", "FONTWEIGHT", "TEXTALIGN", "BORDERW", "BORDERXW", "BORDERYW", "BORDERTW", "BORDERBW", "BORDERLW", "BORDERRW", "BGOPACITY", "OPACITY", "MARGIN", "MARGINX", "MARGINY", "MARGINT", "MARGINB", "MARGINL", "MARGINR", "PADDING", "PADDINGX", "PADDINGY", "PADDINGT", "PADDINGB", "PADDINGL", "PADDINGR", "GAP"];
|
|
14
|
+
export type ClassType = (typeof allType)[number];
|
|
15
|
+
export type ColorClassType = (typeof colorType)[number];
|
|
16
|
+
export type TextClassType = (typeof textType)[number];
|
|
17
|
+
export type BorderWidthClassType = (typeof borderWidthType)[number];
|
|
18
|
+
export type ScaleClassType = (typeof scaleType)[number];
|
|
19
|
+
export type SpacingClassType = (typeof spacingType)[number];
|
|
20
|
+
export type InputType = ColorPalette | HeadingSize | BodyText | FontWeight | Range<1, 12> | OpacityRange | SpacingLevel | Alignment;
|
|
21
|
+
declare class GenerateMCLClass extends MCLTheme {
|
|
22
|
+
classType: ClassType;
|
|
23
|
+
classValue: InputType;
|
|
24
|
+
constructor(classType: ClassType, classValue: InputType);
|
|
25
|
+
generateColorClass(): string;
|
|
26
|
+
generateTextClass(): string;
|
|
27
|
+
generateBorderWidthClass(): string;
|
|
28
|
+
generateScaleClass(): string;
|
|
29
|
+
generateSpacingClass(): string;
|
|
30
|
+
getBgColorClass(): string;
|
|
31
|
+
getHoverBgColorClass(): string;
|
|
32
|
+
getFocusBgColorClass(): string;
|
|
33
|
+
getBeforeBgColorClass(): string;
|
|
34
|
+
getAfterBgColorClass(): string;
|
|
35
|
+
getActiveBgColorClass(): string;
|
|
36
|
+
getTextColorClass(): string;
|
|
37
|
+
getHoverTextColorClass(): string;
|
|
38
|
+
getDisabledTextColorClass(): string;
|
|
39
|
+
getSvgFillColorClass(): string;
|
|
40
|
+
getRingColorClass(): string;
|
|
41
|
+
getFocusRingColorClass(): string;
|
|
42
|
+
getActiveRingColorClass(): string;
|
|
43
|
+
getRingOffsetColorClass(): string;
|
|
44
|
+
getBtnColorClass(): string;
|
|
45
|
+
getListColorClass(): string;
|
|
46
|
+
getBorderColorClass(): string;
|
|
47
|
+
getBorderXColorClass(): string;
|
|
48
|
+
getBorderYColorClass(): string;
|
|
49
|
+
getBorderTopColorClass(): string;
|
|
50
|
+
getBorderBottomColorClass(): string;
|
|
51
|
+
getBorderLeftColorClass(): string;
|
|
52
|
+
getBorderRightColorClass(): string;
|
|
53
|
+
getH1Class(): string;
|
|
54
|
+
getH2Class(): string;
|
|
55
|
+
getH3Class(): string;
|
|
56
|
+
getH4Class(): string;
|
|
57
|
+
getBodyTextSizeClass(): string;
|
|
58
|
+
getFontWeightClass(): string;
|
|
59
|
+
getTextAlignClass(): string;
|
|
60
|
+
getBorderWidthClass(): string;
|
|
61
|
+
getBorderXWidthClass(): string;
|
|
62
|
+
getBorderYWidthClass(): string;
|
|
63
|
+
getBorderTopWidthClass(): string;
|
|
64
|
+
getBorderBottomWidthClass(): string;
|
|
65
|
+
getBorderLeftWidthClass(): string;
|
|
66
|
+
getBorderRightWidthClass(): string;
|
|
67
|
+
getOpacityClass(): string;
|
|
68
|
+
getBgOpacityClass(): string;
|
|
69
|
+
getMarginClass(): string;
|
|
70
|
+
getMarginXClass(): string;
|
|
71
|
+
getMarginYClass(): string;
|
|
72
|
+
getMarginTopClass(): string;
|
|
73
|
+
getMarginBottomClass(): string;
|
|
74
|
+
getMarginLeftClass(): string;
|
|
75
|
+
getMarginRightClass(): string;
|
|
76
|
+
getPaddingClass(): string;
|
|
77
|
+
getPaddingXClass(): string;
|
|
78
|
+
getPaddingYClass(): string;
|
|
79
|
+
getPaddingTopClass(): string;
|
|
80
|
+
getPaddingBottomClass(): string;
|
|
81
|
+
getPaddingLeftClass(): string;
|
|
82
|
+
getPaddingRightClass(): string;
|
|
83
|
+
getGapClass(): string;
|
|
84
|
+
validateColorType(): boolean;
|
|
85
|
+
validateSpaceType(): boolean;
|
|
86
|
+
validateHeadingTextSizeType(): boolean;
|
|
87
|
+
validateBodyTextSizeType(): boolean;
|
|
88
|
+
validateFontWeightType(): boolean;
|
|
89
|
+
validateOpacityType(): boolean;
|
|
90
|
+
validateRangeType(): boolean;
|
|
91
|
+
validateAlignment(): boolean;
|
|
92
|
+
dummyMethod(): any;
|
|
93
|
+
}
|
|
94
|
+
export default GenerateMCLClass;
|