@code-coaching/vuetiful 0.23.2 → 0.24.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/dist/types/components/atoms/VLightSwitch.vue.d.ts +5 -1
- package/dist/types/services/dark-mode.service.d.ts +13 -13
- package/dist/types/services/index.d.ts +2 -2
- package/dist/types/utils/colors/colors.service.d.ts +69 -0
- package/dist/types/utils/index.d.ts +5 -1
- package/dist/types/utils/theme/theme.service.d.ts +8 -23
- package/dist/types/utils/theme/themes.d.ts +35 -0
- package/dist/vuetiful.es.mjs +447 -146
- package/dist/vuetiful.umd.js +71 -16
- package/package.json +1 -1
- package/src/components/atoms/VLightSwitch.test.ts +61 -12
- package/src/components/atoms/VLightSwitch.vue +13 -19
- package/src/components/molecules/VTabs/VTab.test.ts +21 -0
- package/src/directives/clipboard.test.ts +2 -2
- package/src/services/dark-mode.service.test.ts +58 -210
- package/src/services/dark-mode.service.ts +32 -51
- package/src/services/drawer.service.test.ts +4 -4
- package/src/services/highlight.service.test.ts +3 -3
- package/src/services/index.ts +2 -2
- package/src/services/rail.service.test.ts +2 -2
- package/src/utils/colors/colors.service.ts +293 -0
- package/src/utils/index.ts +5 -1
- package/src/utils/platform/platform.service.test.ts +3 -3
- package/src/utils/theme/callback.test.ts +9 -5
- package/src/utils/theme/remove.test.ts +7 -5
- package/src/utils/theme/theme-switcher.vue +34 -37
- package/src/utils/theme/theme.service.test.ts +160 -58
- package/src/utils/theme/theme.service.ts +139 -78
- package/src/utils/theme/themes.ts +122 -0
- package/dist/types/components/index.test.d.ts +0 -1
- package/dist/types/index.test.d.ts +0 -1
- package/dist/types/utils/index.test.d.ts +0 -1
- package/src/components/index.test.ts +0 -10
- package/src/index.test.ts +0 -26
- package/src/utils/index.test.ts +0 -11
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { ColorSettings } from '../colors/colors.service';
|
|
2
|
+
|
|
3
|
+
export const themes: Array<Theme> = [
|
|
4
|
+
{
|
|
5
|
+
name: 'vuetiful',
|
|
6
|
+
gradients: {
|
|
7
|
+
light:
|
|
8
|
+
'radial-gradient(at 76% 0%, hsla(189,100%,56%,0.36) 0px, transparent 50%), radial-gradient(at 1% 0%, hsla(340,100%,76%,0.26) 0px, transparent 50%), radial-gradient(at 20% 100%, hsla(241,100%,70%,0.47) 0px, transparent 50%)',
|
|
9
|
+
dark: 'radial-gradient(at 76% 0%, hsla(189,100%,56%,0.20) 0px, transparent 50%), radial-gradient(at 1% 0%, hsla(340,100%,76%,0.15) 0px, transparent 50%), radial-gradient(at 20% 100%, hsla(241,100%,70%,0.30) 0px, transparent 50%)',
|
|
10
|
+
},
|
|
11
|
+
colors: {
|
|
12
|
+
primary: { key: 'primary', label: 'Primary', hex: '#EC4899', rgb: '0 0 0', on: '0 0 0' },
|
|
13
|
+
secondary: { key: 'secondary', label: 'Secondary', hex: '#06B6D4', rgb: '0 0 0', on: '0 0 0' },
|
|
14
|
+
tertiary: { key: 'tertiary', label: 'Tertiary', hex: '#14B8A6', rgb: '0 0 0', on: '0 0 0' },
|
|
15
|
+
success: { key: 'success', label: 'Success', hex: '#84CC16', rgb: '0 0 0', on: '0 0 0' },
|
|
16
|
+
warning: { key: 'warning', label: 'Warning', hex: '#EAB308', rgb: '0 0 0', on: '0 0 0' },
|
|
17
|
+
error: { key: 'error', label: 'Error', hex: '#EF4444', rgb: '0 0 0', on: '255 255 255' },
|
|
18
|
+
surface: { key: 'surface', label: 'Surface', hex: '#6366F1', rgb: '0 0 0', on: '255 255 255' },
|
|
19
|
+
},
|
|
20
|
+
fonts: {
|
|
21
|
+
base: 'system',
|
|
22
|
+
customBase: 'Quicksand',
|
|
23
|
+
baseImports:
|
|
24
|
+
'@import url("https://fonts.googleapis.com/css2?family=Quicksand:wght@300;400;500;600;700&display=swap");',
|
|
25
|
+
headings: 'system',
|
|
26
|
+
customHeadings: 'Quicksand',
|
|
27
|
+
headingImports: '',
|
|
28
|
+
},
|
|
29
|
+
textColorLight: '0 0 0',
|
|
30
|
+
textColorDark: '255 255 255',
|
|
31
|
+
roundedBase: '12px',
|
|
32
|
+
roundedContainer: '12px',
|
|
33
|
+
borderBase: '0px',
|
|
34
|
+
customCss: `
|
|
35
|
+
[data-theme="vuetiful"] h1,
|
|
36
|
+
[data-theme="vuetiful"] h2,
|
|
37
|
+
[data-theme="vuetiful"] h3,
|
|
38
|
+
[data-theme="vuetiful"] h4,
|
|
39
|
+
[data-theme="vuetiful"] h5,
|
|
40
|
+
[data-theme="vuetiful"] h6,
|
|
41
|
+
[data-theme="vuetiful"] a,
|
|
42
|
+
[data-theme="vuetiful"] button {
|
|
43
|
+
font-weight: bold;
|
|
44
|
+
}`,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: 'rocket',
|
|
48
|
+
gradients: {
|
|
49
|
+
light:
|
|
50
|
+
'radial-gradient(at 0% 0%, rgba(var(--color-secondary-500) / 0.33) 0px, transparent 50%), radial-gradient(at 98% 1%, rgba(var(--color-error-500) / 0.33) 0px, transparent 50%)',
|
|
51
|
+
dark: 'radial-gradient(at 0% 0%, rgba(var(--color-secondary-500) / 0.33) 0px, transparent 50%), radial-gradient(at 98% 1%, rgba(var(--color-error-500) / 0.33) 0px, transparent 50%)',
|
|
52
|
+
},
|
|
53
|
+
colors: {
|
|
54
|
+
primary: { key: 'primary', label: 'Primary', hex: '#06b6d4', rgb: '0 0 0', on: '0 0 0' },
|
|
55
|
+
secondary: { key: 'secondary', label: 'Secondary', hex: '#3b82f6', rgb: '0 0 0', on: '255 255 255' },
|
|
56
|
+
tertiary: { key: 'tertiary', label: 'Tertiary', hex: '#3b82f6', rgb: '0 0 0', on: '255 255 255' },
|
|
57
|
+
success: { key: 'success', label: 'Success', hex: '#4ccb15', rgb: '0 0 0', on: '0 0 0' },
|
|
58
|
+
warning: { key: 'warning', label: 'Warning', hex: '#f4c12a', rgb: '0 0 0', on: '0 0 0' },
|
|
59
|
+
error: { key: 'error', label: 'Error', hex: '#b52c55', rgb: '0 0 0', on: '255 255 255' },
|
|
60
|
+
surface: { key: 'surface', label: 'Surface', hex: '#64748b', rgb: '0 0 0', on: '255 255 255' },
|
|
61
|
+
},
|
|
62
|
+
fonts: {
|
|
63
|
+
base: 'system',
|
|
64
|
+
customBase: 'Roboto',
|
|
65
|
+
baseImports: '@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap");',
|
|
66
|
+
headings: 'system',
|
|
67
|
+
customHeadings: 'Space Grotesk',
|
|
68
|
+
headingImports:
|
|
69
|
+
'@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap");',
|
|
70
|
+
},
|
|
71
|
+
textColorLight: '0 0 0',
|
|
72
|
+
textColorDark: '255 255 255',
|
|
73
|
+
roundedBase: '0px',
|
|
74
|
+
roundedContainer: '0px',
|
|
75
|
+
borderBase: '0px',
|
|
76
|
+
customCss: `
|
|
77
|
+
[data-theme='rocket'] h1,
|
|
78
|
+
[data-theme='rocket'] h2,
|
|
79
|
+
[data-theme='rocket'] h3,
|
|
80
|
+
[data-theme='rocket'] h4,
|
|
81
|
+
[data-theme='rocket'] h5,
|
|
82
|
+
[data-theme='rocket'] h6 {
|
|
83
|
+
font-weight: bold;
|
|
84
|
+
}`,
|
|
85
|
+
},
|
|
86
|
+
];
|
|
87
|
+
|
|
88
|
+
export interface Theme {
|
|
89
|
+
name: string;
|
|
90
|
+
gradients: Gradients;
|
|
91
|
+
colors: {
|
|
92
|
+
primary: ColorSettings;
|
|
93
|
+
secondary: ColorSettings;
|
|
94
|
+
tertiary: ColorSettings;
|
|
95
|
+
success: ColorSettings;
|
|
96
|
+
warning: ColorSettings;
|
|
97
|
+
error: ColorSettings;
|
|
98
|
+
surface: ColorSettings;
|
|
99
|
+
};
|
|
100
|
+
fonts: Fonts;
|
|
101
|
+
textColorLight: string;
|
|
102
|
+
textColorDark: string;
|
|
103
|
+
roundedBase: string;
|
|
104
|
+
roundedContainer: string;
|
|
105
|
+
borderBase: string;
|
|
106
|
+
customCss: string;
|
|
107
|
+
[key: string]: any;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export interface Fonts {
|
|
111
|
+
base: string;
|
|
112
|
+
customBase: string;
|
|
113
|
+
baseImports: string;
|
|
114
|
+
headings: string;
|
|
115
|
+
customHeadings: string;
|
|
116
|
+
headingImports: string;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export interface Gradients {
|
|
120
|
+
light: string;
|
|
121
|
+
dark: string;
|
|
122
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/src/index.test.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it, vi } from 'vitest';
|
|
2
|
-
import * as components from './components';
|
|
3
|
-
import plugin, * as index from './index';
|
|
4
|
-
|
|
5
|
-
describe('src', () => {
|
|
6
|
-
Object.entries(index).forEach(([key, value]) => {
|
|
7
|
-
it(`${key} is defined`, () => {
|
|
8
|
-
expect(value).toBeDefined();
|
|
9
|
-
});
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
describe('given install is called', () => {
|
|
13
|
-
it('should register all components', () => {
|
|
14
|
-
const app = {
|
|
15
|
-
component: vi.fn(),
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
plugin.install(app);
|
|
19
|
-
|
|
20
|
-
for (const key in components) {
|
|
21
|
-
// @ts-expect-error
|
|
22
|
-
expect(app.component).toHaveBeenCalledWith(key, components[key]);
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
});
|
|
26
|
-
});
|
package/src/utils/index.test.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// test that all exports are defined
|
|
2
|
-
import * as utils from './index';
|
|
3
|
-
import { describe, it, expect } from 'vitest';
|
|
4
|
-
|
|
5
|
-
describe('utils', () => {
|
|
6
|
-
Object.entries(utils).forEach(([key, value]) => {
|
|
7
|
-
it(`${key} is defined`, () => {
|
|
8
|
-
expect(value).toBeDefined();
|
|
9
|
-
});
|
|
10
|
-
});
|
|
11
|
-
});
|