@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.
Files changed (35) hide show
  1. package/dist/types/components/atoms/VLightSwitch.vue.d.ts +5 -1
  2. package/dist/types/services/dark-mode.service.d.ts +13 -13
  3. package/dist/types/services/index.d.ts +2 -2
  4. package/dist/types/utils/colors/colors.service.d.ts +69 -0
  5. package/dist/types/utils/index.d.ts +5 -1
  6. package/dist/types/utils/theme/theme.service.d.ts +8 -23
  7. package/dist/types/utils/theme/themes.d.ts +35 -0
  8. package/dist/vuetiful.es.mjs +447 -146
  9. package/dist/vuetiful.umd.js +71 -16
  10. package/package.json +1 -1
  11. package/src/components/atoms/VLightSwitch.test.ts +61 -12
  12. package/src/components/atoms/VLightSwitch.vue +13 -19
  13. package/src/components/molecules/VTabs/VTab.test.ts +21 -0
  14. package/src/directives/clipboard.test.ts +2 -2
  15. package/src/services/dark-mode.service.test.ts +58 -210
  16. package/src/services/dark-mode.service.ts +32 -51
  17. package/src/services/drawer.service.test.ts +4 -4
  18. package/src/services/highlight.service.test.ts +3 -3
  19. package/src/services/index.ts +2 -2
  20. package/src/services/rail.service.test.ts +2 -2
  21. package/src/utils/colors/colors.service.ts +293 -0
  22. package/src/utils/index.ts +5 -1
  23. package/src/utils/platform/platform.service.test.ts +3 -3
  24. package/src/utils/theme/callback.test.ts +9 -5
  25. package/src/utils/theme/remove.test.ts +7 -5
  26. package/src/utils/theme/theme-switcher.vue +34 -37
  27. package/src/utils/theme/theme.service.test.ts +160 -58
  28. package/src/utils/theme/theme.service.ts +139 -78
  29. package/src/utils/theme/themes.ts +122 -0
  30. package/dist/types/components/index.test.d.ts +0 -1
  31. package/dist/types/index.test.d.ts +0 -1
  32. package/dist/types/utils/index.test.d.ts +0 -1
  33. package/src/components/index.test.ts +0 -10
  34. package/src/index.test.ts +0 -26
  35. 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 {};
@@ -1,10 +0,0 @@
1
- import { describe, expect, it, vi } from 'vitest';
2
- import * as index from './index';
3
-
4
- describe('src', () => {
5
- Object.entries(index).forEach(([key, value]) => {
6
- it(`${key} is defined`, () => {
7
- expect(value).toBeDefined();
8
- });
9
- });
10
- });
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
- });
@@ -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
- });