@code-coaching/vuetiful 0.23.1 → 0.23.2
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/style.css +1 -1
- package/dist/types/components/VBootstrap.vue.d.ts +1 -1
- package/dist/types/components/atoms/VAvatar.vue.d.ts +1 -1
- package/dist/types/components/atoms/VLightSwitch.vue.d.ts +2 -2
- package/dist/types/components/atoms/index.d.ts +13 -13
- package/dist/types/components/index.d.ts +2 -2
- package/dist/types/components/molecules/VAlert.vue.d.ts +1 -1
- package/dist/types/components/molecules/VCodeBlock.vue.d.ts +2 -2
- package/dist/types/components/molecules/VDrawer.vue.d.ts +1 -1
- package/dist/types/components/molecules/VListbox/VListbox.vue.d.ts +1 -1
- package/dist/types/components/molecules/VRail/VRail.vue.d.ts +1 -1
- package/dist/types/components/molecules/VRail/VRailTile.vue.d.ts +1 -1
- package/dist/types/components/molecules/index.d.ts +21 -21
- package/dist/types/directives/clipboard.d.ts +1 -1
- package/dist/types/directives/index.d.ts +1 -1
- package/dist/types/index.d.ts +6 -6
- package/dist/types/props/props.d.ts +1 -1
- package/dist/types/services/dark-mode.service.d.ts +1 -1
- package/dist/types/services/drawer.service.d.ts +1 -1
- package/dist/types/services/index.d.ts +5 -5
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types/utils/index.d.ts +2 -2
- package/dist/types/utils/theme/theme-switcher.vue.d.ts +1 -1
- package/dist/types/utils/theme/theme.service.d.ts +1 -1
- package/dist/vuetiful.es.mjs +12 -18
- package/dist/vuetiful.umd.js +3 -3
- package/package.json +1 -1
- package/src/assets/main.css +6 -6
- package/src/components/VBootstrap.vue +43 -43
- package/src/components/atoms/VAvatar.test.ts +71 -71
- package/src/components/atoms/VAvatar.vue +22 -23
- package/src/components/atoms/VBadge.test.ts +11 -11
- package/src/components/atoms/VBadge.vue +2 -2
- package/src/components/atoms/VButton.test.ts +82 -82
- package/src/components/atoms/VButton.vue +20 -21
- package/src/components/atoms/VChip.test.ts +11 -11
- package/src/components/atoms/VChip.vue +3 -3
- package/src/components/atoms/VLightSwitch.test.ts +6 -6
- package/src/components/atoms/VLightSwitch.vue +26 -31
- package/src/components/atoms/VRadio/VRadioDescription.test.ts +13 -13
- package/src/components/atoms/VRadio/VRadioDescription.vue +2 -2
- package/src/components/atoms/VRadio/VRadioGroup.test.ts +40 -40
- package/src/components/atoms/VRadio/VRadioGroup.vue +19 -22
- package/src/components/atoms/VRadio/VRadioItem.test.ts +67 -67
- package/src/components/atoms/VRadio/VRadioItem.vue +10 -13
- package/src/components/atoms/VRadio/VRadioLabel.test.ts +13 -13
- package/src/components/atoms/VRadio/VRadioLabel.vue +5 -3
- package/src/components/atoms/VSwitch/VSwitch.test.ts +33 -33
- package/src/components/atoms/VSwitch/VSwitch.vue +24 -27
- package/src/components/atoms/VSwitch/VSwitchDescription.test.ts +13 -13
- package/src/components/atoms/VSwitch/VSwitchDescription.vue +2 -2
- package/src/components/atoms/VSwitch/VSwitchGroup.test.ts +9 -9
- package/src/components/atoms/VSwitch/VSwitchGroup.vue +2 -2
- package/src/components/atoms/VSwitch/VSwitchLabel.test.ts +19 -19
- package/src/components/atoms/VSwitch/VSwitchLabel.vue +2 -2
- package/src/components/atoms/index.ts +13 -13
- package/src/components/index.test.ts +3 -3
- package/src/components/index.ts +2 -2
- package/src/components/molecules/VAccordion/VAccordion.test.ts +11 -17
- package/src/components/molecules/VAccordion/VAccordion.vue +3 -3
- package/src/components/molecules/VAccordion/VAccordionItem.test.ts +55 -55
- package/src/components/molecules/VAccordion/VAccordionItem.vue +9 -22
- package/src/components/molecules/VAlert.test.ts +38 -38
- package/src/components/molecules/VAlert.vue +25 -47
- package/src/components/molecules/VCard/VCard.test.ts +25 -25
- package/src/components/molecules/VCard/VCard.vue +13 -15
- package/src/components/molecules/VCard/VCardBody.test.ts +14 -14
- package/src/components/molecules/VCard/VCardBody.vue +4 -8
- package/src/components/molecules/VCard/VCardFooter.test.ts +22 -22
- package/src/components/molecules/VCard/VCardFooter.vue +10 -8
- package/src/components/molecules/VCard/VCardHeader.test.ts +25 -25
- package/src/components/molecules/VCard/VCardHeader.vue +7 -8
- package/src/components/molecules/VCodeBlock.test.ts +63 -63
- package/src/components/molecules/VCodeBlock.vue +27 -34
- package/src/components/molecules/VDrawer.test.ts +5 -5
- package/src/components/molecules/VDrawer.vue +10 -10
- package/src/components/molecules/VListbox/VListbox.test.ts +53 -53
- package/src/components/molecules/VListbox/VListbox.vue +31 -32
- package/src/components/molecules/VListbox/VListboxButton.test.ts +13 -13
- package/src/components/molecules/VListbox/VListboxButton.vue +5 -5
- package/src/components/molecules/VListbox/VListboxItem.test.ts +25 -25
- package/src/components/molecules/VListbox/VListboxItem.vue +7 -8
- package/src/components/molecules/VListbox/VListboxItems.test.ts +14 -14
- package/src/components/molecules/VListbox/VListboxItems.vue +9 -11
- package/src/components/molecules/VListbox/VListboxLabel.test.ts +10 -10
- package/src/components/molecules/VListbox/VListboxLabel.vue +2 -2
- package/src/components/molecules/VPreview.test.ts +26 -26
- package/src/components/molecules/VPreview.vue +22 -27
- package/src/components/molecules/VRail/VRail.test.ts +5 -5
- package/src/components/molecules/VRail/VRail.vue +7 -7
- package/src/components/molecules/VRail/VRailTile.test.ts +26 -28
- package/src/components/molecules/VRail/VRailTile.vue +13 -11
- package/src/components/molecules/VShell.test.ts +5 -5
- package/src/components/molecules/VShell.vue +11 -20
- package/src/components/molecules/VTabs/VTab.test.ts +48 -52
- package/src/components/molecules/VTabs/VTab.vue +13 -17
- package/src/components/molecules/VTabs/VTabPanel.test.ts +8 -8
- package/src/components/molecules/VTabs/VTabPanel.vue +1 -1
- package/src/components/molecules/VTabs/VTabs.test.ts +36 -36
- package/src/components/molecules/VTabs/VTabs.vue +18 -22
- package/src/components/molecules/index.ts +21 -21
- package/src/directives/clipboard.test.ts +9 -9
- package/src/directives/clipboard.ts +2 -2
- package/src/directives/index.ts +1 -1
- package/src/env.d.ts +2 -2
- package/src/index.test.ts +6 -6
- package/src/index.ts +7 -7
- package/src/props/index.ts +1 -1
- package/src/props/props.ts +44 -44
- package/src/services/dark-mode.service.test.ts +115 -93
- package/src/services/dark-mode.service.ts +9 -9
- package/src/services/drawer.service.test.ts +21 -21
- package/src/services/drawer.service.ts +10 -10
- package/src/services/highlight.service.test.ts +12 -12
- package/src/services/highlight.service.ts +1 -1
- package/src/services/index.ts +5 -5
- package/src/services/rail.service.test.ts +7 -7
- package/src/services/rail.service.ts +2 -2
- package/src/services/settings.service.test.ts +5 -5
- package/src/services/settings.service.ts +1 -1
- package/src/styles/all.css +7 -7
- package/src/styles/elements/buttons.css +1 -1
- package/src/styles/elements/forms.css +7 -7
- package/src/styles/elements.css +13 -13
- package/src/styles/transitions.css +2 -2
- package/src/styles/typography.css +5 -5
- package/src/themes/theme-rocket.css +10 -10
- package/src/themes/theme-sahara.css +13 -13
- package/src/themes/theme-seafoam.css +13 -13
- package/src/themes/theme-seasonal.css +4 -4
- package/src/themes/theme-skeleton.css +7 -7
- package/src/themes/theme-vintage.css +12 -12
- package/src/themes/theme-vuetiful-0.0.1.css +13 -13
- package/src/types/index.ts +46 -46
- package/src/types/tailwind.ts +2 -21
- package/src/utils/index.test.ts +3 -3
- package/src/utils/index.ts +2 -2
- package/src/utils/platform/platform.service.test.ts +6 -6
- package/src/utils/platform/platform.service.ts +1 -1
- package/src/utils/theme/callback.test.ts +6 -6
- package/src/utils/theme/remove.test.ts +8 -8
- package/src/utils/theme/theme-switcher.vue +10 -13
- package/src/utils/theme/theme.service.test.ts +69 -61
- package/src/utils/theme/theme.service.ts +19 -20
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { readonly, Ref, ref } from
|
|
2
|
-
import { usePlatform } from
|
|
1
|
+
import { readonly, Ref, ref } from 'vue';
|
|
2
|
+
import { usePlatform } from '../platform/platform.service';
|
|
3
3
|
|
|
4
4
|
const { isBrowser } = usePlatform();
|
|
5
5
|
|
|
@@ -9,13 +9,13 @@ export interface Theme {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
const THEMES = {
|
|
12
|
-
VUETIFUL:
|
|
13
|
-
ROCKET:
|
|
14
|
-
SAHARA:
|
|
15
|
-
SEAFOAM:
|
|
16
|
-
SEASONAL:
|
|
17
|
-
SKELETON:
|
|
18
|
-
VINTAGE:
|
|
12
|
+
VUETIFUL: 'vuetiful',
|
|
13
|
+
ROCKET: 'rocket',
|
|
14
|
+
SAHARA: 'sahara',
|
|
15
|
+
SEAFOAM: 'seafoam',
|
|
16
|
+
SEASONAL: 'seasonal',
|
|
17
|
+
SKELETON: 'skeleton',
|
|
18
|
+
VINTAGE: 'vintage',
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
const builtInUrl = (name: string): string => {
|
|
@@ -43,14 +43,14 @@ const useTheme = () => {
|
|
|
43
43
|
if (!theme) return;
|
|
44
44
|
|
|
45
45
|
if (isBrowser) {
|
|
46
|
-
localStorage.setItem(
|
|
47
|
-
document.body.setAttribute(
|
|
46
|
+
localStorage.setItem('vuetiful-theme', theme.name);
|
|
47
|
+
document.body.setAttribute('data-theme', theme.name);
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
50
|
|
|
51
51
|
const initializeTheme = (callback?: Function): void => {
|
|
52
52
|
if (isBrowser) {
|
|
53
|
-
const storedTheme = localStorage.getItem(
|
|
53
|
+
const storedTheme = localStorage.getItem('vuetiful-theme');
|
|
54
54
|
if (storedTheme) loadTheme(storedTheme, callback);
|
|
55
55
|
else loadTheme(defaultTheme, callback);
|
|
56
56
|
}
|
|
@@ -58,27 +58,26 @@ const useTheme = () => {
|
|
|
58
58
|
|
|
59
59
|
const loadTheme = (themeName: string, callback?: Function) => {
|
|
60
60
|
let themeToLoad = themes.value.find((t) => t.name === themeName);
|
|
61
|
-
if (!themeToLoad)
|
|
62
|
-
themeToLoad = themes.value.find((t) => t.name === defaultTheme) || themes.value[0];
|
|
61
|
+
if (!themeToLoad) themeToLoad = themes.value.find((t) => t.name === defaultTheme) || themes.value[0];
|
|
63
62
|
|
|
64
63
|
const theme: Theme = themeToLoad;
|
|
65
64
|
chosenTheme.value = theme.name;
|
|
66
65
|
|
|
67
|
-
const existingStyle = document.getElementById(
|
|
66
|
+
const existingStyle = document.getElementById('theme');
|
|
68
67
|
let themeUrl = theme.url;
|
|
69
68
|
|
|
70
|
-
const link = document.createElement(
|
|
71
|
-
link.id =
|
|
69
|
+
const link = document.createElement('link');
|
|
70
|
+
link.id = 'theme';
|
|
72
71
|
link.href = themeUrl;
|
|
73
|
-
link.type =
|
|
74
|
-
link.rel =
|
|
72
|
+
link.type = 'text/css';
|
|
73
|
+
link.rel = 'stylesheet';
|
|
75
74
|
link.onload = () => {
|
|
76
75
|
if (existingStyle) existingStyle.remove();
|
|
77
76
|
saveThemeToStorage(theme.name);
|
|
78
77
|
if (callback) callback();
|
|
79
78
|
};
|
|
80
79
|
|
|
81
|
-
const head = document.querySelector(
|
|
80
|
+
const head = document.querySelector('head');
|
|
82
81
|
if (head) head.appendChild(link);
|
|
83
82
|
};
|
|
84
83
|
|