mediacube-ui-v2 0.0.98 → 0.0.99

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 (49) hide show
  1. package/README.md +37 -47
  2. package/README.template.md +37 -47
  3. package/dist/assets/iconsSprite.svg +1 -1
  4. package/dist/assets/tokens/colors.scss +7 -0
  5. package/dist/mediacube-ui-v2.js +12032 -11710
  6. package/dist/mediacube-ui-v2.umd.cjs +4 -4
  7. package/dist/style.css +1 -1
  8. package/dist/types/assets/tokens/json/colors.json.d.ts +6 -0
  9. package/dist/types/components/elements/McAvatar/McAvatar.vue.d.ts +3 -3
  10. package/dist/types/components/elements/McBadge/McBadge.vue.d.ts +2 -5
  11. package/dist/types/components/elements/McButton/McButton.vue.d.ts +5 -8
  12. package/dist/types/components/elements/McChip/McChip.vue.d.ts +2 -8
  13. package/dist/types/components/elements/McDraggable/McDraggable.vue.d.ts +2 -5
  14. package/dist/types/components/elements/McFieldRadio/McFieldRadio.vue.d.ts +4 -7
  15. package/dist/types/components/elements/McFieldRange/McFieldRange.vue.d.ts +2 -5
  16. package/dist/types/components/elements/McFieldSelect/McFieldSelect.vue.d.ts +7 -7
  17. package/dist/types/components/elements/McFieldText/McFieldText.vue.d.ts +12 -3
  18. package/dist/types/components/elements/McFieldToggle/McFieldToggle.vue.d.ts +3 -6
  19. package/dist/types/components/elements/McNotification/McNotification.vue.d.ts +2 -5
  20. package/dist/types/components/elements/McProgress/McProgress.vue.d.ts +0 -6
  21. package/dist/types/components/elements/McSeparator/McSeparator.vue.d.ts +2 -5
  22. package/dist/types/components/elements/McSlideUpDown/McSlideUpDown.vue.d.ts +1 -1
  23. package/dist/types/components/elements/McSvgIcon/McSvgIcon.vue.d.ts +17 -19
  24. package/dist/types/components/elements/McTitle/McTitle.vue.d.ts +4 -7
  25. package/dist/types/components/elements/McTooltip/McTooltip.vue.d.ts +4 -10
  26. package/dist/types/components/patterns/McFilter/McFilter.vue.d.ts +3 -3
  27. package/dist/types/components/patterns/McFilter/McFilterChip/McFilterChip.vue.d.ts +1 -1
  28. package/dist/types/components/patterns/McFilter/McFilterTags/McFilterTags.vue.d.ts +1 -1
  29. package/dist/types/components/patterns/McOverlay/McOverlay.vue.d.ts +0 -3
  30. package/dist/types/components/patterns/McSideBar/McSideBarButton/McSideBarButton.vue.d.ts +1 -1
  31. package/dist/types/components/patterns/McTab/McTab.vue.d.ts +9 -12
  32. package/dist/types/components/patterns/McTabs/McTabs.vue.d.ts +5 -11
  33. package/dist/types/components/templates/McDrawer/McDrawer.vue.d.ts +3 -3
  34. package/dist/types/components/templates/McDrawer/McDrawerContainer.vue.d.ts +1 -1
  35. package/dist/types/components/templates/McModal/McModal.vue.d.ts +3 -3
  36. package/dist/types/components/templates/McModal/McModalContainer.vue.d.ts +1 -1
  37. package/dist/types/components/templates/McToast/McToast.vue.d.ts +2 -5
  38. package/dist/types/composables/index.d.ts +1 -0
  39. package/dist/types/composables/useHelper.d.ts +10 -0
  40. package/dist/types/composables/useTheme.d.ts +139 -0
  41. package/dist/types/enums/Themes.d.ts +4 -0
  42. package/dist/types/enums/index.d.ts +1 -0
  43. package/dist/types/index.d.ts +2 -1
  44. package/dist/types/types/IDSOptions.d.ts +5 -0
  45. package/dist/types/types/index.d.ts +1 -0
  46. package/dist/types/types/styles/ColorTheme.d.ts +144 -0
  47. package/dist/types/types/styles/Colors.d.ts +4 -0
  48. package/dist/types/utils/index.d.ts +3 -1
  49. package/package.json +2 -1
@@ -7,3 +7,4 @@ export { useModal } from './useModal';
7
7
  export { useRandomNumber } from './useRandomNumber';
8
8
  export { useTooltip } from './useTooltip';
9
9
  export { useToast } from './useToast';
10
+ export { useTheme } from './useTheme';
@@ -11,6 +11,13 @@ declare function pickDeep(object: {
11
11
  declare function hasProperty(object: object, prop: string): boolean;
12
12
  declare function isNumber(payload: any): boolean;
13
13
  declare function upperFirst(str: string): string;
14
+ /**
15
+ * Для создания корректного реактивного результата, overrides - должен быть реактивным
16
+ * На выходе получается реактивный обьект, который при обращении к свойствам, достает значения из overrides или из дефолтных значений
17
+ * */
18
+ declare function mergeReactiveDefaults<T>(defaults: T, overrides: Partial<T>): T;
19
+ declare function setNested(object: any, path: string, value: any): void;
20
+ declare function getNested(object: any, path: string): any;
14
21
  export declare function useHelper(): {
15
22
  isEmpty: typeof isEmpty;
16
23
  isEqual: typeof isEqual;
@@ -21,5 +28,8 @@ export declare function useHelper(): {
21
28
  isNumber: typeof isNumber;
22
29
  upperFirst: typeof upperFirst;
23
30
  pickDeep: typeof pickDeep;
31
+ mergeReactiveDefaults: typeof mergeReactiveDefaults;
32
+ setNested: typeof setNested;
33
+ getNested: typeof getNested;
24
34
  };
25
35
  export {};
@@ -0,0 +1,139 @@
1
+ export declare function useTheme(component?: string): {
2
+ colors: Record<string, string> | {
3
+ main: string;
4
+ purple: string;
5
+ "hover-purple": string;
6
+ "light-purple": string;
7
+ "bg-purple": string;
8
+ "lighter-purple": string;
9
+ black: string;
10
+ "outline-light": string;
11
+ "dark-gray": string;
12
+ gray: string;
13
+ "outline-gray": string;
14
+ "hover-gray": string;
15
+ "light-gray": string;
16
+ "bg-gray": string;
17
+ white: string;
18
+ "hover-blue": string;
19
+ blue: string;
20
+ "light-blue": string;
21
+ "lighter-blue": string;
22
+ "dark-orange": string;
23
+ orange: string;
24
+ yellow: string;
25
+ "dark-red": string;
26
+ red: string;
27
+ "bright-pink": string;
28
+ "pale-pink": string;
29
+ "dark-green": string;
30
+ green: string;
31
+ toxic: string;
32
+ ultraviolet: string;
33
+ pinkish: string;
34
+ azure: string;
35
+ turquoise: string;
36
+ "darken-turquoise": string;
37
+ transparent: string;
38
+ };
39
+ components: {
40
+ badge: {
41
+ variation: string;
42
+ };
43
+ button: {
44
+ variation: string;
45
+ };
46
+ chip: {
47
+ variation: string;
48
+ textColor: string;
49
+ };
50
+ cropper: {
51
+ color: string;
52
+ };
53
+ datepicker: {
54
+ color: string;
55
+ };
56
+ draggable: {
57
+ variation: string;
58
+ };
59
+ checkbox: {
60
+ color: string;
61
+ };
62
+ radio: {
63
+ color: string;
64
+ };
65
+ range: {
66
+ color: string;
67
+ };
68
+ select: {
69
+ color: string;
70
+ selected: string;
71
+ };
72
+ fieldText: {
73
+ color: string;
74
+ };
75
+ fieldToggle: {
76
+ color: string;
77
+ bg: string;
78
+ };
79
+ bottomLoader: {
80
+ border: string;
81
+ };
82
+ noData: {
83
+ link: string;
84
+ };
85
+ notification: {
86
+ variation: string;
87
+ };
88
+ progress: {
89
+ color: string;
90
+ helpText: string;
91
+ };
92
+ separator: {
93
+ color: string;
94
+ };
95
+ spinDigit: {
96
+ color: string;
97
+ };
98
+ spinNumber: {
99
+ color: string;
100
+ };
101
+ title: {
102
+ color: string;
103
+ };
104
+ tooltip: {
105
+ color: string;
106
+ textColor: string;
107
+ };
108
+ dropdown: {
109
+ itemColor: string;
110
+ };
111
+ filter: {
112
+ color: string;
113
+ chipColor: string;
114
+ button: string;
115
+ };
116
+ overlay: {
117
+ bg: string;
118
+ border: string;
119
+ };
120
+ sidebar: {
121
+ chip: string;
122
+ activeLink: string;
123
+ };
124
+ tab: {
125
+ count: string;
126
+ };
127
+ tabs: {
128
+ color: string;
129
+ accentColor: string;
130
+ };
131
+ tableCard: {
132
+ backLink: string;
133
+ };
134
+ toast: {
135
+ variation: string;
136
+ };
137
+ } | undefined;
138
+ component: any;
139
+ };
@@ -0,0 +1,4 @@
1
+ export declare enum Themes {
2
+ Light = "light",
3
+ Dark = "dark"
4
+ }
@@ -14,6 +14,7 @@ export * from './RadioGroup';
14
14
  export * from './Select';
15
15
  export * from './Sidebar';
16
16
  export * from './Tab';
17
+ export * from './Themes';
17
18
  export * from './Title';
18
19
  export * from './Toast';
19
20
  export * from './Tooltip';
@@ -1,4 +1,5 @@
1
1
  import { App } from 'vue';
2
+ import { IDSOptions } from './types';
2
3
  export * from './types';
3
4
  export * from './enums';
4
5
  export * from './components';
@@ -7,6 +8,6 @@ export * from './consts';
7
8
  export * from './utils';
8
9
  export * from './assets/tokens/json';
9
10
  declare const _default: {
10
- install(app: App, options?: {}): void;
11
+ install(app: App, options?: IDSOptions): void;
11
12
  };
12
13
  export default _default;
@@ -1,10 +1,15 @@
1
1
  import { Router } from 'vue-router';
2
2
  import { VueElement } from 'vue';
3
3
  import { IToast } from './IToast';
4
+ import { Themes } from '../enums';
5
+ import { ColorThemes } from '.';
4
6
  export interface IDSOptions {
5
7
  drawerComponents?: Partial<VueElement>;
6
8
  modalComponents?: Partial<VueElement>;
7
9
  toasts?: Partial<IToast>;
8
10
  defaultAvatar?: string | null;
9
11
  router?: null | Router;
12
+ colors?: Record<string, string>;
13
+ themes?: ColorThemes;
14
+ theme?: Themes;
10
15
  }
@@ -25,6 +25,7 @@ export * from './ITooltip';
25
25
  export * from './styles/Alignment';
26
26
  export * from './styles/AvatarSizes';
27
27
  export * from './styles/Colors';
28
+ export * from './styles/ColorTheme';
28
29
  export * from './styles/Durations';
29
30
  export * from './styles/FontSizes';
30
31
  export * from './styles/FontWeights';
@@ -0,0 +1,144 @@
1
+ import { ColorTypes } from '..';
2
+ export interface ColorTheme {
3
+ components: {
4
+ badge: {
5
+ variation: ColorTypes | string;
6
+ };
7
+ button: {
8
+ variation: ColorTypes | string;
9
+ };
10
+ chip: {
11
+ variation: ColorTypes | string;
12
+ textColor: ColorTypes | string;
13
+ };
14
+ cropper: {
15
+ color: ColorTypes | string;
16
+ };
17
+ datepicker: {
18
+ color: ColorTypes | string;
19
+ };
20
+ draggable: {
21
+ variation: ColorTypes | string;
22
+ };
23
+ checkbox: {
24
+ color: ColorTypes | string;
25
+ };
26
+ radio: {
27
+ color: ColorTypes | string;
28
+ };
29
+ range: {
30
+ color: ColorTypes | string;
31
+ };
32
+ select: {
33
+ color: ColorTypes | string;
34
+ selected: ColorTypes | string;
35
+ };
36
+ fieldText: {
37
+ color: ColorTypes | string;
38
+ };
39
+ fieldToggle: {
40
+ color: ColorTypes | string;
41
+ bg: ColorTypes | string;
42
+ };
43
+ bottomLoader: {
44
+ border: ColorTypes | string;
45
+ };
46
+ noData: {
47
+ link: ColorTypes | string;
48
+ };
49
+ notification: {
50
+ variation: ColorTypes | string;
51
+ };
52
+ progress: {
53
+ color: ColorTypes | string;
54
+ helpText: ColorTypes | string;
55
+ };
56
+ separator: {
57
+ color: ColorTypes | string;
58
+ };
59
+ spinDigit: {
60
+ color: ColorTypes | string;
61
+ };
62
+ spinNumber: {
63
+ color: ColorTypes | string;
64
+ };
65
+ title: {
66
+ color: ColorTypes | string;
67
+ };
68
+ tooltip: {
69
+ color: ColorTypes | string;
70
+ textColor: ColorTypes | string;
71
+ };
72
+ dropdown: {
73
+ itemColor: ColorTypes | string;
74
+ };
75
+ filter: {
76
+ color: ColorTypes | string;
77
+ chipColor: ColorTypes | string;
78
+ button: ColorTypes | string;
79
+ };
80
+ overlay: {
81
+ bg: ColorTypes | string;
82
+ border: ColorTypes | string;
83
+ };
84
+ sidebar: {
85
+ chip: ColorTypes | string;
86
+ activeLink: ColorTypes | string;
87
+ };
88
+ tab: {
89
+ count: ColorTypes | string;
90
+ };
91
+ tabs: {
92
+ color: ColorTypes | string;
93
+ accentColor: ColorTypes | string;
94
+ };
95
+ tableCard: {
96
+ backLink: ColorTypes | string;
97
+ };
98
+ toast: {
99
+ variation: ColorTypes | string;
100
+ };
101
+ };
102
+ }
103
+ export interface ColorThemes {
104
+ light: ColorTheme;
105
+ dark: ColorTheme;
106
+ }
107
+ export declare const ThemesColors: {
108
+ main: string;
109
+ purple: string;
110
+ "hover-purple": string;
111
+ "light-purple": string;
112
+ "bg-purple": string;
113
+ "lighter-purple": string;
114
+ black: string;
115
+ "outline-light": string;
116
+ "dark-gray": string;
117
+ gray: string;
118
+ "outline-gray": string;
119
+ "hover-gray": string;
120
+ "light-gray": string;
121
+ "bg-gray": string;
122
+ white: string;
123
+ "hover-blue": string;
124
+ blue: string;
125
+ "light-blue": string;
126
+ "lighter-blue": string;
127
+ "dark-orange": string;
128
+ orange: string;
129
+ yellow: string;
130
+ "dark-red": string;
131
+ red: string;
132
+ "bright-pink": string;
133
+ "pale-pink": string;
134
+ "dark-green": string;
135
+ green: string;
136
+ toxic: string;
137
+ ultraviolet: string;
138
+ pinkish: string;
139
+ azure: string;
140
+ turquoise: string;
141
+ "darken-turquoise": string;
142
+ transparent: string;
143
+ };
144
+ export declare const UiThemes: ColorThemes;
@@ -1,4 +1,5 @@
1
1
  export declare const Colors: {
2
+ main: string;
2
3
  purple: string;
3
4
  "hover-purple": string;
4
5
  "light-purple": string;
@@ -10,6 +11,7 @@ export declare const Colors: {
10
11
  gray: string;
11
12
  "outline-gray": string;
12
13
  "hover-gray": string;
14
+ "light-gray": string;
13
15
  "bg-gray": string;
14
16
  white: string;
15
17
  "hover-blue": string;
@@ -34,6 +36,7 @@ export declare const Colors: {
34
36
  transparent: string;
35
37
  };
36
38
  declare const modes: {
39
+ readonly main: string;
37
40
  readonly purple: string;
38
41
  readonly "hover-purple": string;
39
42
  readonly "light-purple": string;
@@ -45,6 +48,7 @@ declare const modes: {
45
48
  readonly gray: string;
46
49
  readonly "outline-gray": string;
47
50
  readonly "hover-gray": string;
51
+ readonly "light-gray": string;
48
52
  readonly "bg-gray": string;
49
53
  readonly white: string;
50
54
  readonly "hover-blue": string;
@@ -1,2 +1,4 @@
1
1
  export * from './dayjs';
2
- export * from './mcGridColAdaptiveProps';
2
+ export * as mcGridColAdaptiveProps from './mcGridColAdaptiveProps';
3
+ export * as mcSvgIconAdaptiveProps from './mcSvgIconAdaptiveProps';
4
+ export * as mcTitleAdaptiveProps from './mcTitleAdaptiveProps';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mediacube-ui-v2",
3
- "version": "0.0.98",
3
+ "version": "0.0.99",
4
4
  "license": "MIT",
5
5
  "description": "Design system for Mediacube services",
6
6
  "keywords": [
@@ -13,6 +13,7 @@
13
13
  "main": "./dist/mediacube-ui-v2.umd.cjs",
14
14
  "module": "./dist/mediacube-ui-v2.js",
15
15
  "types": "./dist/types/index.d.ts",
16
+ "variables": "./dist/assets/variables.scss",
16
17
  "style": "./dist/style.css",
17
18
  "font": "./dist/assets/fonts/inter/inter.css",
18
19
  "sprite": "./dist/assets/iconsSprite.svg",