@code-coaching/vuetiful 0.23.1 → 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/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 +7 -3
- 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 +13 -13
- package/dist/types/services/drawer.service.d.ts +1 -1
- package/dist/types/services/index.d.ts +6 -6
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types/utils/colors/colors.service.d.ts +69 -0
- package/dist/types/utils/index.d.ts +7 -3
- package/dist/types/utils/theme/theme-switcher.vue.d.ts +1 -1
- package/dist/types/utils/theme/theme.service.d.ts +9 -24
- package/dist/types/utils/theme/themes.d.ts +35 -0
- package/dist/vuetiful.es.mjs +456 -161
- package/dist/vuetiful.umd.js +71 -16
- 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 +63 -14
- package/src/components/atoms/VLightSwitch.vue +35 -46
- 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.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 +69 -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.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 +64 -194
- package/src/services/dark-mode.service.ts +35 -54
- 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 +6 -6
- 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/colors/colors.service.ts +293 -0
- package/src/utils/index.ts +7 -3
- 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 +11 -7
- package/src/utils/theme/remove.test.ts +11 -9
- package/src/utils/theme/theme-switcher.vue +43 -49
- package/src/utils/theme/theme.service.test.ts +194 -84
- package/src/utils/theme/theme.service.ts +141 -81
- 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
|
@@ -1,73 +1,58 @@
|
|
|
1
|
-
import { computed, readonly,
|
|
2
|
-
import { usePlatform } from
|
|
1
|
+
import { computed, readonly, ref } from 'vue';
|
|
2
|
+
import { usePlatform } from '../utils/platform/platform.service';
|
|
3
3
|
|
|
4
4
|
const { isBrowser } = usePlatform();
|
|
5
5
|
|
|
6
6
|
const MODE = {
|
|
7
|
-
LIGHT:
|
|
8
|
-
DARK:
|
|
7
|
+
LIGHT: 'light',
|
|
8
|
+
DARK: 'dark',
|
|
9
9
|
};
|
|
10
|
+
export type Mode = (typeof MODE)[keyof typeof MODE];
|
|
10
11
|
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const isDark = computed(() => currentMode.value === MODE.DARK);
|
|
12
|
+
const defaultMode = MODE.DARK;
|
|
13
|
+
const chosenMode = ref(defaultMode);
|
|
14
|
+
const isDark = computed(() => chosenMode.value === MODE.DARK);
|
|
15
15
|
|
|
16
16
|
const useDarkMode = () => {
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
if (
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
const getModeUserPrefers = (): boolean | undefined => {
|
|
25
|
-
if (isBrowser) {
|
|
26
|
-
const mode = localStorage.getItem("modeUserPrefers");
|
|
27
|
-
if (mode !== null) modeUserPrefers.value = mode === "true";
|
|
17
|
+
const getModeFromCookie = (cookies: string) => {
|
|
18
|
+
const cookie = cookies.split(';').find((c) => c.trim().startsWith('vuetiful-mode='));
|
|
19
|
+
if (cookie) {
|
|
20
|
+
const value = cookie.split('=')[1];
|
|
21
|
+
return value;
|
|
28
22
|
}
|
|
29
|
-
return
|
|
23
|
+
return defaultMode;
|
|
30
24
|
};
|
|
31
25
|
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
if (user === undefined) return os;
|
|
36
|
-
return user;
|
|
26
|
+
const applyModeSSR = (html: string, mode: Mode): string => {
|
|
27
|
+
if (mode === MODE.DARK) html = html.replace('<html', '<html class="dark"');
|
|
28
|
+
return html;
|
|
37
29
|
};
|
|
38
30
|
|
|
39
|
-
const
|
|
40
|
-
modeOsPrefers.value = value;
|
|
41
|
-
if (isBrowser) {
|
|
42
|
-
localStorage.setItem("modeOsPrefers", value.toString());
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
const setModeUserPrefers = (value: boolean): void => {
|
|
46
|
-
modeUserPrefers.value = value;
|
|
31
|
+
const initializeMode = () => {
|
|
47
32
|
if (isBrowser) {
|
|
48
|
-
|
|
33
|
+
const mode = getModeFromCookie(document.cookie);
|
|
34
|
+
applyMode(mode);
|
|
49
35
|
}
|
|
50
36
|
};
|
|
51
37
|
|
|
52
|
-
const
|
|
38
|
+
const applyMode = (value: Mode) => {
|
|
53
39
|
const elemHtmlClasses = document.documentElement.classList;
|
|
54
|
-
const classDark =
|
|
40
|
+
const classDark = 'dark';
|
|
55
41
|
value === MODE.LIGHT ? elemHtmlClasses.remove(classDark) : elemHtmlClasses.add(classDark);
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
const mode = getModeAutoPrefers();
|
|
61
|
-
setModeCurrent(mode);
|
|
42
|
+
if (isBrowser) {
|
|
43
|
+
document.cookie = `vuetiful-mode=${value};path=/;max-age=31536000;SameSite=Lax`;
|
|
44
|
+
}
|
|
45
|
+
chosenMode.value = value;
|
|
62
46
|
};
|
|
63
47
|
|
|
64
48
|
const autoModeWatcher = (): void => {
|
|
65
|
-
const mql = window.matchMedia(
|
|
49
|
+
const mql = window.matchMedia('(prefers-color-scheme: light)');
|
|
66
50
|
const setMode = (value: boolean) => {
|
|
67
51
|
const elemHtmlClasses = document.documentElement.classList;
|
|
68
52
|
const classDark = `dark`;
|
|
69
|
-
value
|
|
70
|
-
|
|
53
|
+
const mode = value ? MODE.LIGHT : MODE.DARK;
|
|
54
|
+
mode === MODE.LIGHT ? elemHtmlClasses.remove(classDark) : elemHtmlClasses.add(classDark);
|
|
55
|
+
applyMode(mode);
|
|
71
56
|
};
|
|
72
57
|
setMode(mql.matches);
|
|
73
58
|
mql.onchange = () => {
|
|
@@ -76,17 +61,13 @@ const useDarkMode = () => {
|
|
|
76
61
|
};
|
|
77
62
|
|
|
78
63
|
return {
|
|
79
|
-
|
|
80
|
-
modeUserPrefers: readonly(modeUserPrefers),
|
|
81
|
-
currentMode: readonly(currentMode),
|
|
64
|
+
chosenMode,
|
|
82
65
|
isDark: readonly(isDark),
|
|
83
|
-
getModeOsPrefers,
|
|
84
|
-
getModeUserPrefers,
|
|
85
|
-
getModeAutoPrefers,
|
|
86
|
-
setModeUserPrefers,
|
|
87
|
-
setModeCurrent,
|
|
88
|
-
autoModeWatcher,
|
|
89
66
|
initializeMode,
|
|
67
|
+
applyMode,
|
|
68
|
+
autoModeWatcher,
|
|
69
|
+
applyModeSSR,
|
|
70
|
+
getModeFromCookie,
|
|
90
71
|
MODE,
|
|
91
72
|
};
|
|
92
73
|
};
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { describe, expect,
|
|
2
|
-
import { useDrawer } from
|
|
1
|
+
import { describe, expect, test } from 'vitest';
|
|
2
|
+
import { useDrawer } from './drawer.service';
|
|
3
3
|
|
|
4
4
|
const { drawer, open, close } = useDrawer();
|
|
5
5
|
|
|
6
|
-
describe(
|
|
7
|
-
describe(
|
|
8
|
-
|
|
9
|
-
expect(drawer.id).toBe(
|
|
6
|
+
describe('useDrawer', () => {
|
|
7
|
+
describe('defaults', () => {
|
|
8
|
+
test('should have the default values', () => {
|
|
9
|
+
expect(drawer.id).toBe('default');
|
|
10
10
|
expect(drawer.open).toBe(false);
|
|
11
|
-
expect(drawer.position).toBe(
|
|
11
|
+
expect(drawer.position).toBe('left');
|
|
12
12
|
expect(drawer.duration).toBe(300);
|
|
13
|
-
expect(drawer.regionBackdrop).toBe(
|
|
14
|
-
expect(drawer.regionDrawer).toBe(
|
|
13
|
+
expect(drawer.regionBackdrop).toBe('');
|
|
14
|
+
expect(drawer.regionDrawer).toBe('');
|
|
15
15
|
});
|
|
16
16
|
});
|
|
17
17
|
|
|
18
|
-
describe(
|
|
19
|
-
|
|
18
|
+
describe('open', () => {
|
|
19
|
+
test('should use the settings', () => {
|
|
20
20
|
open({
|
|
21
|
-
id:
|
|
21
|
+
id: 'test',
|
|
22
22
|
open: true,
|
|
23
|
-
position:
|
|
23
|
+
position: 'right',
|
|
24
24
|
duration: 150,
|
|
25
|
-
regionBackdrop:
|
|
26
|
-
regionDrawer:
|
|
25
|
+
regionBackdrop: 'backdrop',
|
|
26
|
+
regionDrawer: 'drawer',
|
|
27
27
|
});
|
|
28
|
-
expect(drawer.id).toBe(
|
|
28
|
+
expect(drawer.id).toBe('test');
|
|
29
29
|
expect(drawer.open).toBe(true);
|
|
30
|
-
expect(drawer.position).toBe(
|
|
30
|
+
expect(drawer.position).toBe('right');
|
|
31
31
|
expect(drawer.duration).toBe(150);
|
|
32
|
-
expect(drawer.regionBackdrop).toBe(
|
|
33
|
-
expect(drawer.regionDrawer).toBe(
|
|
32
|
+
expect(drawer.regionBackdrop).toBe('backdrop');
|
|
33
|
+
expect(drawer.regionDrawer).toBe('drawer');
|
|
34
34
|
});
|
|
35
35
|
});
|
|
36
36
|
|
|
37
|
-
describe(
|
|
38
|
-
|
|
37
|
+
describe('close', () => {
|
|
38
|
+
test('should set the drawer to close', () => {
|
|
39
39
|
open();
|
|
40
40
|
expect(drawer.open).toBe(true);
|
|
41
41
|
close();
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { reactive, readonly } from
|
|
1
|
+
import { reactive, readonly } from 'vue';
|
|
2
2
|
|
|
3
3
|
export interface DrawerSettings {
|
|
4
4
|
id?: string;
|
|
5
5
|
open?: boolean;
|
|
6
6
|
|
|
7
|
-
position?:
|
|
7
|
+
position?: 'left' | 'top' | 'right' | 'bottom';
|
|
8
8
|
duration?: 150 | 300;
|
|
9
9
|
|
|
10
10
|
regionBackdrop?: string;
|
|
@@ -14,22 +14,22 @@ export interface DrawerSettings {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
const drawer = reactive<DrawerSettings>({
|
|
17
|
-
id:
|
|
17
|
+
id: 'default',
|
|
18
18
|
open: false,
|
|
19
|
-
position:
|
|
19
|
+
position: 'left',
|
|
20
20
|
duration: 300,
|
|
21
|
-
regionBackdrop:
|
|
22
|
-
regionDrawer:
|
|
21
|
+
regionBackdrop: '',
|
|
22
|
+
regionDrawer: '',
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
const useDrawer = () => {
|
|
26
26
|
const open = (settings?: DrawerSettings) => {
|
|
27
27
|
drawer.open = true;
|
|
28
|
-
drawer.id = settings?.id ??
|
|
28
|
+
drawer.id = settings?.id ?? 'default';
|
|
29
29
|
drawer.duration = settings?.duration ?? 300;
|
|
30
|
-
drawer.regionBackdrop = settings?.regionBackdrop ??
|
|
31
|
-
drawer.regionDrawer = settings?.regionDrawer ??
|
|
32
|
-
drawer.position = settings?.position ??
|
|
30
|
+
drawer.regionBackdrop = settings?.regionBackdrop ?? '';
|
|
31
|
+
drawer.regionDrawer = settings?.regionDrawer ?? '';
|
|
32
|
+
drawer.position = settings?.position ?? 'left';
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
const close = () => {
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { describe, expect,
|
|
2
|
-
import { useHighlight } from
|
|
1
|
+
import { describe, expect, test } from 'vitest';
|
|
2
|
+
import { useHighlight } from './highlight.service';
|
|
3
3
|
|
|
4
4
|
const { highlight } = useHighlight();
|
|
5
5
|
|
|
6
|
-
describe(
|
|
7
|
-
describe(
|
|
8
|
-
describe(
|
|
9
|
-
|
|
10
|
-
expect(highlight(" const name = 'John Duck' ",
|
|
11
|
-
'<span class="hljs-keyword">const</span> name = <span class="hljs-string">'John Duck'</span>'
|
|
6
|
+
describe('useHighlight', () => {
|
|
7
|
+
describe('highlight', () => {
|
|
8
|
+
describe('given a known language is passed', () => {
|
|
9
|
+
test('should trim and highlight the code', () => {
|
|
10
|
+
expect(highlight(" const name = 'John Duck' ", 'javascript')).toEqual(
|
|
11
|
+
'<span class="hljs-keyword">const</span> name = <span class="hljs-string">'John Duck'</span>',
|
|
12
12
|
);
|
|
13
13
|
});
|
|
14
14
|
});
|
|
15
15
|
|
|
16
|
-
describe(
|
|
17
|
-
|
|
18
|
-
expect(highlight(" const name = 'John Duck' ",
|
|
19
|
-
'<span class="hljs-keyword">const</span> <span class="hljs-keyword">name</span> = <span class="hljs-string">'John Duck'</span>'
|
|
16
|
+
describe('given an unknown language is passed', () => {
|
|
17
|
+
test('should trim and auto highlight the code', () => {
|
|
18
|
+
expect(highlight(" const name = 'John Duck' ", 'unknown')).toEqual(
|
|
19
|
+
'<span class="hljs-keyword">const</span> <span class="hljs-keyword">name</span> = <span class="hljs-string">'John Duck'</span>',
|
|
20
20
|
);
|
|
21
21
|
});
|
|
22
22
|
});
|
package/src/services/index.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { useDarkMode } from
|
|
2
|
-
import { useDrawer } from
|
|
3
|
-
import { useHighlight } from
|
|
4
|
-
import { useRail } from
|
|
5
|
-
import { useSettings, VuetifulSettings } from
|
|
1
|
+
import { useDarkMode, Mode } from './dark-mode.service';
|
|
2
|
+
import { useDrawer } from './drawer.service';
|
|
3
|
+
import { useHighlight } from './highlight.service';
|
|
4
|
+
import { useRail } from './rail.service';
|
|
5
|
+
import { useSettings, VuetifulSettings } from './settings.service';
|
|
6
6
|
|
|
7
7
|
export { useDarkMode, useDrawer, useHighlight, useRail, useSettings };
|
|
8
|
-
export type { VuetifulSettings };
|
|
8
|
+
export type { VuetifulSettings, Mode };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { describe, expect,
|
|
2
|
-
import { useRail } from
|
|
1
|
+
import { describe, expect, test } from 'vitest';
|
|
2
|
+
import { useRail } from './rail.service';
|
|
3
3
|
|
|
4
4
|
const { selectedRailTile } = useRail();
|
|
5
5
|
|
|
6
|
-
describe(
|
|
7
|
-
describe(
|
|
8
|
-
|
|
9
|
-
selectedRailTile.value =
|
|
10
|
-
expect(selectedRailTile.value).toBe(
|
|
6
|
+
describe('useRail', () => {
|
|
7
|
+
describe('selectedRailTile', () => {
|
|
8
|
+
test('should expose selectedRailTile', () => {
|
|
9
|
+
selectedRailTile.value = 'John Duck';
|
|
10
|
+
expect(selectedRailTile.value).toBe('John Duck');
|
|
11
11
|
});
|
|
12
12
|
});
|
|
13
13
|
});
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { afterEach, describe, expect, test, vi } from
|
|
1
|
+
import { afterEach, describe, expect, test, vi } from 'vitest';
|
|
2
2
|
|
|
3
|
-
describe(
|
|
3
|
+
describe('useSettings', () => {
|
|
4
4
|
afterEach(() => {
|
|
5
5
|
vi.resetModules();
|
|
6
6
|
});
|
|
7
|
-
describe(
|
|
8
|
-
test(
|
|
9
|
-
const { useSettings } = await import(
|
|
7
|
+
describe('updateSettings', () => {
|
|
8
|
+
test('should update settings', async () => {
|
|
9
|
+
const { useSettings } = await import('./settings.service');
|
|
10
10
|
const { updateSettings, settings } = useSettings();
|
|
11
11
|
|
|
12
12
|
expect(settings.global.unstyled).toBe(false);
|
package/src/styles/all.css
CHANGED
|
@@ -3,22 +3,22 @@
|
|
|
3
3
|
/* NOTE: The order shown below is required */
|
|
4
4
|
|
|
5
5
|
/* Tailwind Directives */
|
|
6
|
-
@import
|
|
6
|
+
@import 'tailwind.css';
|
|
7
7
|
|
|
8
8
|
/* Global Styles */
|
|
9
|
-
@import
|
|
9
|
+
@import 'core.css';
|
|
10
10
|
|
|
11
11
|
/* Typographical Settings */
|
|
12
|
-
@import
|
|
12
|
+
@import 'typography.css';
|
|
13
13
|
|
|
14
14
|
/* Imports all Tailwind Elements */
|
|
15
|
-
@import
|
|
15
|
+
@import 'elements.css';
|
|
16
16
|
|
|
17
17
|
/* Imports all Variant Styles */
|
|
18
|
-
@import
|
|
18
|
+
@import 'variants.css';
|
|
19
19
|
|
|
20
20
|
/* Imports all Transitions */
|
|
21
|
-
@import
|
|
21
|
+
@import 'transitions.css';
|
|
22
22
|
|
|
23
23
|
/* Imports all Component Styles */
|
|
24
|
-
@import
|
|
24
|
+
@import '../../dist/style.css';
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
|
|
49
49
|
/* Range Input */
|
|
50
50
|
/* https://developer.mozilla.org/en-US/docs/Web/CSS/accent-color */
|
|
51
|
-
[type=
|
|
51
|
+
[type='range'] {
|
|
52
52
|
@apply w-full accent-surface-900 dark:accent-surface-50;
|
|
53
53
|
}
|
|
54
54
|
|
|
@@ -138,23 +138,23 @@
|
|
|
138
138
|
/* === Specialized === */
|
|
139
139
|
|
|
140
140
|
/* File Inputs */
|
|
141
|
-
.input[type=
|
|
141
|
+
.input[type='file'] {
|
|
142
142
|
@apply p-1;
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
/* Color Picker */
|
|
146
146
|
/* https://stackoverflow.com/questions/11167281/webkit-css-to-control-the-box-around-the-color-in-an-inputtype-color */
|
|
147
|
-
.input[type=
|
|
147
|
+
.input[type='color'] {
|
|
148
148
|
@apply h-10 w-10 cursor-pointer overflow-hidden border-none rounded-token;
|
|
149
149
|
-webkit-appearance: none; /* WebKit Only */
|
|
150
150
|
}
|
|
151
|
-
.input[type=
|
|
151
|
+
.input[type='color']::-webkit-color-swatch-wrapper {
|
|
152
152
|
@apply p-0;
|
|
153
153
|
}
|
|
154
|
-
.input[type=
|
|
154
|
+
.input[type='color']::-webkit-color-swatch {
|
|
155
155
|
@apply border-none hover:brightness-110;
|
|
156
156
|
}
|
|
157
|
-
.input[type=
|
|
157
|
+
.input[type='color']::-moz-color-swatch {
|
|
158
158
|
@apply border-none;
|
|
159
159
|
}
|
|
160
160
|
|
|
@@ -263,7 +263,7 @@
|
|
|
263
263
|
/* Blur */
|
|
264
264
|
@apply backdrop-blur;
|
|
265
265
|
}
|
|
266
|
-
.variant-form-material[type=
|
|
266
|
+
.variant-form-material[type='file'] {
|
|
267
267
|
@apply !py-1.5;
|
|
268
268
|
}
|
|
269
269
|
}
|
package/src/styles/elements.css
CHANGED
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
/* Import AFTER your theme, but BEFORE your global stylesheet. */
|
|
3
3
|
/* Recommended as the LAST stylesheet in the set */
|
|
4
4
|
|
|
5
|
-
@import
|
|
6
|
-
@import
|
|
7
|
-
@import
|
|
8
|
-
@import
|
|
9
|
-
@import
|
|
10
|
-
@import
|
|
11
|
-
@import
|
|
12
|
-
@import
|
|
13
|
-
@import
|
|
14
|
-
@import
|
|
15
|
-
@import
|
|
5
|
+
@import 'elements/alerts.css';
|
|
6
|
+
@import 'elements/badges.css';
|
|
7
|
+
@import 'elements/breadcrumbs.css';
|
|
8
|
+
@import 'elements/buttons.css';
|
|
9
|
+
@import 'elements/cards.css';
|
|
10
|
+
@import 'elements/chips.css';
|
|
11
|
+
@import 'elements/forms.css';
|
|
12
|
+
@import 'elements/lists.css';
|
|
13
|
+
@import 'elements/logo-clouds.css';
|
|
14
|
+
@import 'elements/placeholders.css';
|
|
15
|
+
@import 'elements/tables.css';
|
|
16
16
|
|
|
17
17
|
/* Utilities */
|
|
18
|
-
@import
|
|
19
|
-
@import
|
|
18
|
+
@import 'elements/modals.css';
|
|
19
|
+
@import 'elements/popups.css';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@import
|
|
2
|
-
@import
|
|
1
|
+
@import 'transitions/fade.css';
|
|
2
|
+
@import 'transitions/slide.css';
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
@apply text-base;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
a:not(.unstyled):not(.permalink):is(:not(.prose *)):not(.btn):not(.btn-icon):not(.app-bar a):not(
|
|
37
|
-
.
|
|
38
|
-
):not(
|
|
36
|
+
a:not(.unstyled):not(.permalink):is(:not(.prose *)):not(.btn):not(.btn-icon):not(.app-bar a):not(.logo-item):not(
|
|
37
|
+
a.card
|
|
38
|
+
):not(.list-nav a) {
|
|
39
39
|
@apply text-primary-700 underline hover:brightness-110 dark:text-primary-500;
|
|
40
40
|
}
|
|
41
41
|
|
|
@@ -79,10 +79,10 @@
|
|
|
79
79
|
@apply absolute left-1 font-mono;
|
|
80
80
|
}
|
|
81
81
|
ins:not(.unstyled):is(:not(.prose *))::before {
|
|
82
|
-
content:
|
|
82
|
+
content: '+';
|
|
83
83
|
}
|
|
84
84
|
del:not(.unstyled):is(:not(.prose *))::before {
|
|
85
|
-
content:
|
|
85
|
+
content: '−';
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
ins:not(.unstyled):is(:not(.prose *)) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/* https://fonts.google.com/specimen/Space+Grotesk */
|
|
2
|
-
@import url(
|
|
2
|
+
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap');
|
|
3
3
|
/* https://fonts.google.com/specimen/Roboto?query=roboto */
|
|
4
|
-
@import url(
|
|
4
|
+
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');
|
|
5
5
|
|
|
6
6
|
:root {
|
|
7
7
|
/* =~= Theme Properties =~= */
|
|
8
|
-
--theme-font-family-base:
|
|
9
|
-
--theme-font-family-heading:
|
|
8
|
+
--theme-font-family-base: 'Roboto', sans-serif;
|
|
9
|
+
--theme-font-family-heading: 'Space Grotesk', sans-serif;
|
|
10
10
|
--theme-font-color-base: var(--color-primary-900);
|
|
11
11
|
--theme-font-color-dark: var(--color-primary-100);
|
|
12
12
|
--theme-rounded-base: 0px;
|
|
@@ -100,12 +100,12 @@
|
|
|
100
100
|
--color-surface-900: 49 57 68; /* ⬅ #313944 */
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
[data-theme=
|
|
104
|
-
[data-theme=
|
|
105
|
-
[data-theme=
|
|
106
|
-
[data-theme=
|
|
107
|
-
[data-theme=
|
|
108
|
-
[data-theme=
|
|
103
|
+
[data-theme='rocket'] h1,
|
|
104
|
+
[data-theme='rocket'] h2,
|
|
105
|
+
[data-theme='rocket'] h3,
|
|
106
|
+
[data-theme='rocket'] h4,
|
|
107
|
+
[data-theme='rocket'] h5,
|
|
108
|
+
[data-theme='rocket'] h6 {
|
|
109
109
|
font-weight: bold;
|
|
110
110
|
}
|
|
111
111
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/* https://fonts.google.com/specimen/Raleway */
|
|
2
|
-
@import url(
|
|
2
|
+
@import url('https://fonts.googleapis.com/css2?family=Raleway:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');
|
|
3
3
|
/* https://fonts.google.com/specimen/Lato?query=lato¬o.query=Abril */
|
|
4
|
-
@import url(
|
|
4
|
+
@import url('https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&display=swap');
|
|
5
5
|
|
|
6
6
|
:root {
|
|
7
7
|
/* =~= Theme Styles =~= */
|
|
8
|
-
--theme-font-family-base:
|
|
9
|
-
--theme-font-family-heading:
|
|
8
|
+
--theme-font-family-base: 'Lato', sans-serif;
|
|
9
|
+
--theme-font-family-heading: 'Raleway', sans-serif;
|
|
10
10
|
--theme-font-color-base: var(--color-secondary-900);
|
|
11
11
|
--theme-font-color-dark: var(--color-primary-100);
|
|
12
12
|
--theme-rounded-base: 9999px;
|
|
@@ -100,27 +100,27 @@
|
|
|
100
100
|
--color-surface-900: 107 38 49; /* ⬅ #6b2631 */
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
[data-theme=
|
|
104
|
-
[data-theme=
|
|
105
|
-
[data-theme=
|
|
106
|
-
[data-theme=
|
|
107
|
-
[data-theme=
|
|
108
|
-
[data-theme=
|
|
103
|
+
[data-theme='sahara'] h1,
|
|
104
|
+
[data-theme='sahara'] h2,
|
|
105
|
+
[data-theme='sahara'] h3,
|
|
106
|
+
[data-theme='sahara'] h4,
|
|
107
|
+
[data-theme='sahara'] h5,
|
|
108
|
+
[data-theme='sahara'] h6 {
|
|
109
109
|
font-weight: 600;
|
|
110
110
|
}
|
|
111
|
-
[data-theme=
|
|
111
|
+
[data-theme='sahara'] p {
|
|
112
112
|
font-weight: 400;
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
/* Applied to body with `<body data-theme="sahara">` */
|
|
116
116
|
/* Created with: https://csshero.org/mesher/ */
|
|
117
|
-
[data-theme=
|
|
117
|
+
[data-theme='sahara'] {
|
|
118
118
|
/* prettier-ignore */
|
|
119
119
|
background-image:
|
|
120
120
|
radial-gradient(at 100% 36%, hsla(37,81%,56%,0.15) 0px, transparent 50%),
|
|
121
121
|
radial-gradient(at 7% 0%, hsla(37,81%,56%,0.20) 0px, transparent 50%);
|
|
122
122
|
}
|
|
123
|
-
.dark [data-theme=
|
|
123
|
+
.dark [data-theme='sahara'] {
|
|
124
124
|
/* prettier-ignore */
|
|
125
125
|
background-image:
|
|
126
126
|
radial-gradient(at 100% 36%, hsla(37,81%,56%,0.15) 0px, transparent 50%),
|