@code-coaching/vuetiful 0.23.2 → 0.24.1
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 +12 -23
- package/dist/types/utils/theme/themes.d.ts +39 -0
- package/dist/vuetiful.es.mjs +452 -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 +140 -78
- package/src/utils/theme/themes.ts +127 -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
- /package/src/themes/{theme-vuetiful-0.0.1.css → theme-vuetiful.css} +0 -0
|
@@ -43,8 +43,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
43
43
|
};
|
|
44
44
|
onToggleHandler: () => void;
|
|
45
45
|
onKeyDown: (event: KeyboardEvent) => void;
|
|
46
|
-
|
|
46
|
+
chosenMode: import("vue").Ref<string>;
|
|
47
47
|
iconFill: ComputedRef<string>;
|
|
48
|
+
MODE: {
|
|
49
|
+
LIGHT: string;
|
|
50
|
+
DARK: string;
|
|
51
|
+
};
|
|
48
52
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
49
53
|
bgLight: {
|
|
50
54
|
type: () => CssClasses;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
declare const MODE: {
|
|
2
|
+
LIGHT: string;
|
|
3
|
+
DARK: string;
|
|
4
|
+
};
|
|
5
|
+
export declare type Mode = (typeof MODE)[keyof typeof MODE];
|
|
2
6
|
declare const useDarkMode: () => {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
currentMode: Readonly<Ref<boolean>>;
|
|
6
|
-
isDark: Readonly<Ref<boolean>>;
|
|
7
|
-
getModeOsPrefers: () => boolean;
|
|
8
|
-
getModeUserPrefers: () => boolean | undefined;
|
|
9
|
-
getModeAutoPrefers: () => boolean;
|
|
10
|
-
setModeUserPrefers: (value: boolean) => void;
|
|
11
|
-
setModeCurrent: (value: boolean) => void;
|
|
12
|
-
autoModeWatcher: () => void;
|
|
7
|
+
chosenMode: import("vue").Ref<string>;
|
|
8
|
+
isDark: Readonly<import("vue").Ref<boolean>>;
|
|
13
9
|
initializeMode: () => void;
|
|
10
|
+
applyMode: (value: Mode) => void;
|
|
11
|
+
autoModeWatcher: () => void;
|
|
12
|
+
applyModeSSR: (html: string, mode: Mode) => string;
|
|
13
|
+
getModeFromCookie: (cookies: string) => string;
|
|
14
14
|
MODE: {
|
|
15
|
-
LIGHT:
|
|
16
|
-
DARK:
|
|
15
|
+
LIGHT: string;
|
|
16
|
+
DARK: string;
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
19
|
export { useDarkMode };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { useDarkMode } from './dark-mode.service';
|
|
1
|
+
import { useDarkMode, Mode } from './dark-mode.service';
|
|
2
2
|
import { useDrawer } from './drawer.service';
|
|
3
3
|
import { useHighlight } from './highlight.service';
|
|
4
4
|
import { useRail } from './rail.service';
|
|
5
5
|
import { useSettings, VuetifulSettings } from './settings.service';
|
|
6
6
|
export { useDarkMode, useDrawer, useHighlight, useRail, useSettings };
|
|
7
|
-
export type { VuetifulSettings };
|
|
7
|
+
export type { VuetifulSettings, Mode };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
declare type ContrastLevel = 'AA' | 'AAA';
|
|
2
|
+
declare type ContrastSize = 'small' | 'large';
|
|
3
|
+
export interface Report {
|
|
4
|
+
emoji: string;
|
|
5
|
+
note: string;
|
|
6
|
+
}
|
|
7
|
+
export interface PassReport {
|
|
8
|
+
textColor: string;
|
|
9
|
+
backgroundColor: string;
|
|
10
|
+
contrast: number;
|
|
11
|
+
report: Report;
|
|
12
|
+
smallAA: boolean;
|
|
13
|
+
smallAAA: boolean;
|
|
14
|
+
largeAA: boolean;
|
|
15
|
+
largeAAA: boolean;
|
|
16
|
+
fails: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare type Palette = {
|
|
19
|
+
[key: number]: {
|
|
20
|
+
hex: string;
|
|
21
|
+
rgb: string;
|
|
22
|
+
on: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export declare const semanticNames: readonly ["primary", "secondary", "tertiary", "success", "warning", "error", "surface"];
|
|
26
|
+
export declare type SemanticNames = (typeof semanticNames)[number];
|
|
27
|
+
export interface ColorSettings {
|
|
28
|
+
key: SemanticNames;
|
|
29
|
+
label: string;
|
|
30
|
+
hex: string;
|
|
31
|
+
rgb: string;
|
|
32
|
+
on: string;
|
|
33
|
+
}
|
|
34
|
+
declare type Rgb = {
|
|
35
|
+
r: number;
|
|
36
|
+
g: number;
|
|
37
|
+
b: number;
|
|
38
|
+
};
|
|
39
|
+
declare const useColors: () => {
|
|
40
|
+
hexToRgb: (hex: string) => Rgb | null;
|
|
41
|
+
hexToTailwindRgbString: (hex: string) => string;
|
|
42
|
+
rgbToHex: (r: number, g: number, b: number) => string;
|
|
43
|
+
generateA11yOnColor: (hex: string) => '255 255 255' | '0 0 0';
|
|
44
|
+
lighten: (hex: string, intensity: number) => string;
|
|
45
|
+
darken: (hex: string, intensity: number) => string;
|
|
46
|
+
generatePalette: (baseColor: string) => Palette;
|
|
47
|
+
contrastLevels: Record<ContrastSize, {
|
|
48
|
+
AA: number;
|
|
49
|
+
AAA: number;
|
|
50
|
+
}>;
|
|
51
|
+
getLuminance: {
|
|
52
|
+
(r: Rgb): number;
|
|
53
|
+
(r: number, g: number, b: number): number;
|
|
54
|
+
};
|
|
55
|
+
destringRgb: (rgbString: string) => Rgb;
|
|
56
|
+
handleStringColor: {
|
|
57
|
+
(colorString: string): Rgb;
|
|
58
|
+
(colorString: string, returnType: 'rgb'): Rgb;
|
|
59
|
+
(colorString: string, returnType: 'hex'): string;
|
|
60
|
+
(colorString: string, returnType?: "rgb" | "hex" | undefined): string | Rgb;
|
|
61
|
+
};
|
|
62
|
+
calculateRatio: (luminance1: string | number, luminance2: string | number) => number;
|
|
63
|
+
textPasses: (textColor: string, backgroundColor: string, size: ContrastSize, level: ContrastLevel) => boolean;
|
|
64
|
+
hexValueIsValid: (textColor: string) => boolean;
|
|
65
|
+
getPassReport: (textColor: string, backgroundColor: string) => PassReport;
|
|
66
|
+
hexValuesAreValid: (colors: Array<ColorSettings>) => boolean;
|
|
67
|
+
semanticNames: readonly ["primary", "secondary", "tertiary", "success", "warning", "error", "surface"];
|
|
68
|
+
};
|
|
69
|
+
export { useColors };
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import type { ColorSettings, Palette, PassReport, Report, SemanticNames } from './colors/colors.service';
|
|
2
|
+
import { useColors } from './colors/colors.service';
|
|
3
|
+
import { usePlatform } from './platform/platform.service';
|
|
1
4
|
import ThemeSwitcher from './theme/theme-switcher.vue';
|
|
2
5
|
import { useTheme } from './theme/theme.service';
|
|
3
|
-
export { ThemeSwitcher, useTheme };
|
|
6
|
+
export { ThemeSwitcher, useColors, usePlatform, useTheme };
|
|
7
|
+
export type { ColorSettings, Palette, PassReport, Report, SemanticNames };
|
|
@@ -1,28 +1,17 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
|
-
|
|
3
|
-
name: string;
|
|
4
|
-
url: string;
|
|
5
|
-
}
|
|
2
|
+
import { Theme } from './themes';
|
|
6
3
|
declare const useTheme: () => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
initializeTheme: (callback?: Function | undefined) => void;
|
|
13
|
-
loadTheme: (themeName: string, callback?: Function | undefined) => void;
|
|
14
|
-
saveThemeToStorage: (name: string) => void;
|
|
15
|
-
THEMES: {
|
|
16
|
-
VUETIFUL: string;
|
|
17
|
-
ROCKET: string;
|
|
18
|
-
SAHARA: string;
|
|
19
|
-
SEAFOAM: string;
|
|
20
|
-
SEASONAL: string;
|
|
21
|
-
SKELETON: string;
|
|
22
|
-
VINTAGE: string;
|
|
4
|
+
chosenTheme: Ref<Theme>;
|
|
5
|
+
themes: Theme[];
|
|
6
|
+
THEME: {
|
|
7
|
+
VUETIFUL: Theme;
|
|
8
|
+
ROCKET: Theme;
|
|
23
9
|
};
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
10
|
+
applyThemeSSR: (html: string, theme: Theme) => string;
|
|
11
|
+
applyTheme: (theme: Theme, callback?: Function | undefined) => void;
|
|
12
|
+
getThemeFromCookie: (cookies: string) => Theme;
|
|
13
|
+
initializeTheme: (callback?: Function | undefined) => void;
|
|
14
|
+
changeDataTheme: (name: string) => void;
|
|
15
|
+
registerTheme: (theme: Theme) => void;
|
|
27
16
|
};
|
|
28
17
|
export { useTheme };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ColorSettings } from '../colors/colors.service';
|
|
2
|
+
export declare const themes: Array<Theme>;
|
|
3
|
+
export declare const THEME: {
|
|
4
|
+
VUETIFUL: Theme;
|
|
5
|
+
ROCKET: Theme;
|
|
6
|
+
};
|
|
7
|
+
export interface Theme {
|
|
8
|
+
name: string;
|
|
9
|
+
gradients: Gradients;
|
|
10
|
+
colors: {
|
|
11
|
+
primary: ColorSettings;
|
|
12
|
+
secondary: ColorSettings;
|
|
13
|
+
tertiary: ColorSettings;
|
|
14
|
+
success: ColorSettings;
|
|
15
|
+
warning: ColorSettings;
|
|
16
|
+
error: ColorSettings;
|
|
17
|
+
surface: ColorSettings;
|
|
18
|
+
};
|
|
19
|
+
fonts: Fonts;
|
|
20
|
+
textColorLight: string;
|
|
21
|
+
textColorDark: string;
|
|
22
|
+
roundedBase: string;
|
|
23
|
+
roundedContainer: string;
|
|
24
|
+
borderBase: string;
|
|
25
|
+
customCss: string;
|
|
26
|
+
[key: string]: any;
|
|
27
|
+
}
|
|
28
|
+
export interface Fonts {
|
|
29
|
+
base: string;
|
|
30
|
+
customBase: string;
|
|
31
|
+
baseImports: string;
|
|
32
|
+
headings: string;
|
|
33
|
+
customHeadings: string;
|
|
34
|
+
headingImports: string;
|
|
35
|
+
}
|
|
36
|
+
export interface Gradients {
|
|
37
|
+
light: string;
|
|
38
|
+
dark: string;
|
|
39
|
+
}
|