vuetiwatch 0.1.0 → 0.2.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/README.md +200 -17
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/plugin.d.ts +77 -7
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +104 -15
- package/dist/plugin.js.map +1 -1
- package/dist/registry.d.ts +1 -1
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +6 -1
- package/dist/registry.js.map +1 -1
- package/dist/styles/atlas.css +99 -0
- package/dist/styles/atlas.min.css +1 -0
- package/dist/styles/atlasDark.css +99 -0
- package/dist/styles/atlasDark.min.css +1 -0
- package/dist/styles/atlasSepia.css +99 -0
- package/dist/styles/atlasSepia.min.css +1 -0
- package/dist/styles/aurora.css +97 -4
- package/dist/styles/aurora.min.css +1 -1
- package/dist/styles/brutalist.css +5 -0
- package/dist/styles/brutalist.min.css +1 -1
- package/dist/styles/calm.css +0 -4
- package/dist/styles/calm.min.css +1 -1
- package/dist/styles/candy.css +71 -0
- package/dist/styles/candy.min.css +1 -0
- package/dist/styles/clay.css +13 -0
- package/dist/styles/clay.min.css +1 -1
- package/dist/styles/core.css +239 -36
- package/dist/styles/core.min.css +1 -1
- package/dist/styles/graphite.css +29 -0
- package/dist/styles/graphite.min.css +1 -0
- package/dist/styles/morph.css +12 -0
- package/dist/styles/morph.min.css +1 -1
- package/dist/styles/neon.css +8 -0
- package/dist/styles/neon.min.css +1 -1
- package/dist/styles/sketchy.css +4 -0
- package/dist/styles/sketchy.min.css +1 -1
- package/dist/styles/soft.css +1 -12
- package/dist/styles/soft.min.css +1 -1
- package/dist/styles.css +577 -52
- package/dist/styles.min.css +1 -1
- package/dist/themes/atlas.d.ts +38 -0
- package/dist/themes/atlas.d.ts.map +1 -0
- package/dist/themes/atlas.js +203 -0
- package/dist/themes/atlas.js.map +1 -0
- package/dist/themes/atlasDark.d.ts +8 -0
- package/dist/themes/atlasDark.d.ts.map +1 -0
- package/dist/themes/atlasDark.js +64 -0
- package/dist/themes/atlasDark.js.map +1 -0
- package/dist/themes/atlasSepia.d.ts +11 -0
- package/dist/themes/atlasSepia.d.ts.map +1 -0
- package/dist/themes/atlasSepia.js +60 -0
- package/dist/themes/atlasSepia.js.map +1 -0
- package/dist/themes/aurora.d.ts.map +1 -1
- package/dist/themes/aurora.js +27 -2
- package/dist/themes/aurora.js.map +1 -1
- package/dist/themes/brutalist.d.ts.map +1 -1
- package/dist/themes/brutalist.js +26 -0
- package/dist/themes/brutalist.js.map +1 -1
- package/dist/themes/calm.d.ts.map +1 -1
- package/dist/themes/calm.js +22 -2
- package/dist/themes/calm.js.map +1 -1
- package/dist/themes/candy.d.ts +20 -0
- package/dist/themes/candy.d.ts.map +1 -0
- package/dist/themes/candy.js +142 -0
- package/dist/themes/candy.js.map +1 -0
- package/dist/themes/classic.d.ts.map +1 -1
- package/dist/themes/classic.js +2 -0
- package/dist/themes/classic.js.map +1 -1
- package/dist/themes/clay.d.ts.map +1 -1
- package/dist/themes/clay.js +22 -0
- package/dist/themes/clay.js.map +1 -1
- package/dist/themes/darkGlass.d.ts.map +1 -1
- package/dist/themes/darkGlass.js +21 -0
- package/dist/themes/darkGlass.js.map +1 -1
- package/dist/themes/graphite.d.ts +13 -0
- package/dist/themes/graphite.d.ts.map +1 -0
- package/dist/themes/graphite.js +147 -0
- package/dist/themes/graphite.js.map +1 -0
- package/dist/themes/index.d.ts +5 -0
- package/dist/themes/index.d.ts.map +1 -1
- package/dist/themes/index.js +5 -0
- package/dist/themes/index.js.map +1 -1
- package/dist/themes/liquidGlass.d.ts.map +1 -1
- package/dist/themes/liquidGlass.js +27 -3
- package/dist/themes/liquidGlass.js.map +1 -1
- package/dist/themes/lux.d.ts.map +1 -1
- package/dist/themes/lux.js +21 -2
- package/dist/themes/lux.js.map +1 -1
- package/dist/themes/morph.d.ts.map +1 -1
- package/dist/themes/morph.js +23 -3
- package/dist/themes/morph.js.map +1 -1
- package/dist/themes/neon.d.ts.map +1 -1
- package/dist/themes/neon.js +22 -0
- package/dist/themes/neon.js.map +1 -1
- package/dist/themes/paper.d.ts.map +1 -1
- package/dist/themes/paper.js +16 -0
- package/dist/themes/paper.js.map +1 -1
- package/dist/themes/sketchy.d.ts.map +1 -1
- package/dist/themes/sketchy.js +17 -0
- package/dist/themes/sketchy.js.map +1 -1
- package/dist/themes/slate.d.ts.map +1 -1
- package/dist/themes/slate.js +22 -1
- package/dist/themes/slate.js.map +1 -1
- package/dist/themes/soft.d.ts.map +1 -1
- package/dist/themes/soft.js +21 -2
- package/dist/themes/soft.js.map +1 -1
- package/dist/types.d.ts +40 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/util/defaults.d.ts.map +1 -1
- package/dist/util/defaults.js +11 -1
- package/dist/util/defaults.js.map +1 -1
- package/dist/util/defineTheme.d.ts.map +1 -1
- package/dist/util/defineTheme.js +11 -5
- package/dist/util/defineTheme.js.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +8 -2
- package/src/plugin.ts +214 -21
- package/src/registry.ts +10 -0
- package/src/styles/core.css +563 -35
- package/src/styles/index.css +4 -0
- package/src/styles/themes/_atlas.css +194 -0
- package/src/styles/themes/atlas.css +2 -0
- package/src/styles/themes/atlasDark.css +2 -0
- package/src/styles/themes/atlasSepia.css +2 -0
- package/src/styles/themes/aurora.css +151 -7
- package/src/styles/themes/brutalist.css +5 -3
- package/src/styles/themes/calm.css +0 -7
- package/src/styles/themes/candy.css +113 -0
- package/src/styles/themes/clay.css +24 -0
- package/src/styles/themes/graphite.css +63 -0
- package/src/styles/themes/liquidGlass.css +0 -2
- package/src/styles/themes/lux.css +0 -4
- package/src/styles/themes/morph.css +22 -0
- package/src/styles/themes/neon.css +8 -3
- package/src/styles/themes/paper.css +0 -2
- package/src/styles/themes/sketchy.css +9 -0
- package/src/styles/themes/slate.css +0 -4
- package/src/styles/themes/soft.css +1 -12
- package/src/themes/atlas.ts +211 -0
- package/src/themes/atlasDark.ts +64 -0
- package/src/themes/atlasSepia.ts +60 -0
- package/src/themes/aurora.ts +30 -2
- package/src/themes/brutalist.ts +29 -0
- package/src/themes/calm.ts +25 -2
- package/src/themes/candy.ts +144 -0
- package/src/themes/classic.ts +3 -0
- package/src/themes/clay.ts +24 -0
- package/src/themes/darkGlass.ts +24 -0
- package/src/themes/graphite.ts +150 -0
- package/src/themes/index.ts +5 -0
- package/src/themes/liquidGlass.ts +30 -3
- package/src/themes/lux.ts +24 -2
- package/src/themes/morph.ts +25 -3
- package/src/themes/neon.ts +25 -0
- package/src/themes/paper.ts +19 -0
- package/src/themes/sketchy.ts +20 -0
- package/src/themes/slate.ts +25 -1
- package/src/themes/soft.ts +24 -2
- package/src/types.ts +41 -0
- package/src/util/defaults.ts +12 -1
- package/src/util/defineTheme.ts +11 -5
package/dist/themes/slate.js
CHANGED
|
@@ -34,8 +34,16 @@ export const slate = defineTheme({
|
|
|
34
34
|
warning: '#B7791F',
|
|
35
35
|
'on-surface': '#1A202C',
|
|
36
36
|
'on-background': '#1A202C',
|
|
37
|
+
// Vuetify picks the label colour by luminance and settles for
|
|
38
|
+
// about 3:1, which is the bar for large text rather than for a
|
|
39
|
+
// button label. Measured on the filled buttons: warning 3.6:1 → 4.5:1.
|
|
40
|
+
'on-warning': '#1A202C',
|
|
37
41
|
},
|
|
38
42
|
variables: {
|
|
43
|
+
/* A panel standing on its own — a bare list, sheet, banner or table.
|
|
44
|
+
Core owns the selector; this is what it draws with. */
|
|
45
|
+
'vw-panel-border': 'var(--v-vw-border-width) solid rgba(var(--v-border-color), var(--v-border-opacity))',
|
|
46
|
+
'vw-panel-shadow': '0 1px 2px rgba(var(--v-shadow-color), 0.05)',
|
|
39
47
|
'border-color': '#1A202C',
|
|
40
48
|
'border-opacity': 0.14,
|
|
41
49
|
'shadow-color': '#1A202C',
|
|
@@ -54,11 +62,24 @@ export const slate = defineTheme({
|
|
|
54
62
|
'vw-list-bar': '3px',
|
|
55
63
|
'vw-list-bar-color': 'rgb(var(--v-theme-primary))',
|
|
56
64
|
'vw-tab-slider-height': '3px',
|
|
65
|
+
// Dashboard: short, unremarkable, out of the way of the data.
|
|
66
|
+
'vw-motion-duration': '120ms',
|
|
67
|
+
'vw-press-scale': '0.98',
|
|
68
|
+
'vw-pop-scale': '1.12',
|
|
69
|
+
'vw-pop-duration': '160ms',
|
|
70
|
+
'vw-focus-ring': '2px solid rgb(var(--v-theme-primary))',
|
|
71
|
+
// Dense and structural: a 2px rule and a square dot.
|
|
72
|
+
'vw-timeline-line': 'rgba(var(--v-theme-primary), 0.35)',
|
|
73
|
+
'vw-timeline-line-width': '2px',
|
|
74
|
+
'vw-radius-dot': '3px',
|
|
57
75
|
},
|
|
58
76
|
},
|
|
59
77
|
defaults: [
|
|
60
78
|
{
|
|
61
|
-
|
|
79
|
+
// No `density` on the button: Vuetify subtracts it from the size
|
|
80
|
+
// height, and a comfortable `x-small` ends up shorter than its own
|
|
81
|
+
// label. Everything else in the theme stays compact.
|
|
82
|
+
VBtn: { variant: 'flat' },
|
|
62
83
|
VCard: { variant: 'outlined' },
|
|
63
84
|
VAlert: { variant: 'tonal', density: 'compact' },
|
|
64
85
|
VChip: { variant: 'tonal', size: 'small' },
|
package/dist/themes/slate.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slate.js","sourceRoot":"","sources":["../../src/themes/slate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAEpD;;;;GAIG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,WAAW,CAAC;IAC/B,IAAI,EAAE,OAAO;IACb,IAAI,EAAE;QACJ,KAAK,EAAE,OAAO;QACd,WAAW,EAAE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.d.ts","sourceRoot":"","sources":["../../src/themes/soft.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,eAAO,MAAM,IAAI,+CAiGf,CAAA"}
|
package/dist/themes/soft.js
CHANGED
|
@@ -12,7 +12,7 @@ export const soft = defineTheme({
|
|
|
12
12
|
description: 'Pastel palette, large radii and diffuse shadows. Friendly and unhurried.',
|
|
13
13
|
dark: false,
|
|
14
14
|
iconStyle: 'filled',
|
|
15
|
-
swatch: ['#F7F5FF', '#FFFFFF', '#
|
|
15
|
+
swatch: ['#F7F5FF', '#FFFFFF', '#705EEF', '#F08CA8'],
|
|
16
16
|
fonts: ['Nunito'],
|
|
17
17
|
},
|
|
18
18
|
theme: {
|
|
@@ -24,7 +24,7 @@ export const soft = defineTheme({
|
|
|
24
24
|
'surface-light': '#EAE3FF',
|
|
25
25
|
'surface-variant': '#4A4458',
|
|
26
26
|
'on-surface-variant': '#F7F5FF',
|
|
27
|
-
primary: '#
|
|
27
|
+
primary: '#705EEF',
|
|
28
28
|
'primary-darken-1': '#5F4DE0',
|
|
29
29
|
secondary: '#F08CA8',
|
|
30
30
|
'secondary-darken-1': '#DB6C8B',
|
|
@@ -34,8 +34,18 @@ export const soft = defineTheme({
|
|
|
34
34
|
warning: '#F5B851',
|
|
35
35
|
'on-surface': '#2E2A3B',
|
|
36
36
|
'on-background': '#2E2A3B',
|
|
37
|
+
// Vuetify's automatic pick lands on white here, which is worse by
|
|
38
|
+
// both models — this reads w6.0/a56 against w2.3/a50.
|
|
39
|
+
'on-secondary': '#2E2A3B',
|
|
40
|
+
// Vuetify picks the label colour by luminance and settles for
|
|
41
|
+
// about 3:1, which is the bar for large text rather than for a
|
|
42
|
+
// button label. Measured on the filled buttons: error 2.8:1 → 4.9:1.
|
|
43
|
+
'on-error': '#2E2A3B',
|
|
37
44
|
},
|
|
38
45
|
variables: {
|
|
46
|
+
/* A panel standing on its own — a bare list, sheet, banner or table.
|
|
47
|
+
Core owns the selector; this is what it draws with. */
|
|
48
|
+
'vw-panel-shadow': '0 2px 4px rgba(var(--v-theme-primary), 0.06), 0 12px 28px rgba(var(--v-theme-primary), 0.1)',
|
|
39
49
|
'border-color': '#5F4DE0',
|
|
40
50
|
'border-opacity': 0.1,
|
|
41
51
|
'shadow-color': '#4A3F8C',
|
|
@@ -49,6 +59,15 @@ export const soft = defineTheme({
|
|
|
49
59
|
'vw-btn-transform': 'none',
|
|
50
60
|
'vw-btn-tracking': '0',
|
|
51
61
|
'vw-btn-weight': '700',
|
|
62
|
+
// Unhurried, with a little give.
|
|
63
|
+
'vw-motion-duration': '250ms',
|
|
64
|
+
'vw-press-scale': '0.97',
|
|
65
|
+
'vw-hover-lift': '2px',
|
|
66
|
+
'vw-pop-scale': '1.22',
|
|
67
|
+
'vw-pop-duration': '260ms',
|
|
68
|
+
// Thick and pastel, matching the radii.
|
|
69
|
+
'vw-timeline-line': 'rgba(var(--v-theme-primary), 0.25)',
|
|
70
|
+
'vw-timeline-line-width': '5px',
|
|
52
71
|
},
|
|
53
72
|
},
|
|
54
73
|
defaults: [
|
package/dist/themes/soft.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"soft.js","sourceRoot":"","sources":["../../src/themes/soft.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAEpD;;;;GAIG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,WAAW,CAAC;IAC9B,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM;QACb,WAAW,EAAE,0EAA0E;QACvF,IAAI,EAAE,KAAK;QACX,SAAS,EAAE,QAAQ;QACnB,MAAM,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC;QACpD,KAAK,EAAE,CAAC,QAAQ,CAAC;KAClB;IACD,KAAK,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,EAAE,CAAC;QAClC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;QACpB;YACE,oEAAoE;YACpE,wEAAwE;YACxE,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE;YACxB,OAAO,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE;YACxC,+DAA+D;YAC/D,kDAAkD;YAClD,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE;SACxC;QACD,KAAK,CAAC;YACJ,qDAAqD;YACrD,QAAQ,EAAE,kBAAkB;YAC5B,QAAQ,EAAE,gBAAgB;YAC1B,UAAU,EAAE,kBAAkB;YAC9B,WAAW,EAAE,oBAAoB;YACjC,UAAU,EAAE,WAAW;YACvB,WAAW,EAAE,mBAAmB;YAChC,KAAK,EAAE,kBAAkB;SAC1B,CAAC;KACH;CACF,CAAC,CAAA"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
import type { createVuetify, ThemeDefinition } from 'vuetify';
|
|
2
2
|
/** Global component defaults, same shape as `createVuetify({ defaults })`. */
|
|
3
3
|
export type VuetiwatchDefaults = NonNullable<NonNullable<Parameters<typeof createVuetify>[0]>['defaults']>;
|
|
4
|
+
/**
|
|
5
|
+
* A named set of colours a theme offers as an alternative to its own.
|
|
6
|
+
*
|
|
7
|
+
* Presets rather than a colour picker on purpose: an accent has to clear
|
|
8
|
+
* contrast against the theme's ground, and a slider hands that problem to
|
|
9
|
+
* whoever drags it. Each entry here is measured.
|
|
10
|
+
*/
|
|
11
|
+
export interface VuetiwatchAccent {
|
|
12
|
+
/** Shared across a family, so the choice survives a light/dark switch. */
|
|
13
|
+
id: string;
|
|
14
|
+
title: string;
|
|
15
|
+
/** Written over the theme's own colours — `primary` and its companions. */
|
|
16
|
+
colors: Record<string, string>;
|
|
17
|
+
}
|
|
4
18
|
export interface VuetiwatchMeta {
|
|
5
19
|
/** Human readable name, for theme pickers. */
|
|
6
20
|
title: string;
|
|
@@ -21,6 +35,32 @@ export interface VuetiwatchMeta {
|
|
|
21
35
|
* the playground's navigation demo.
|
|
22
36
|
*/
|
|
23
37
|
iconStyle: 'outline' | 'filled';
|
|
38
|
+
/**
|
|
39
|
+
* Themes that are one design on different grounds — `atlas`, `atlasDark`
|
|
40
|
+
* and `atlasSepia` all carry `family: 'atlas'`.
|
|
41
|
+
*
|
|
42
|
+
* It exists so an app can offer the choice: `useVuetiwatch().siblings`
|
|
43
|
+
* returns the variants of whatever is running, which is everything a
|
|
44
|
+
* light/dark switch needs. Vuetify's own `ThemeDefinition` is one mode by
|
|
45
|
+
* definition, so a pair of registered themes is how the switch is built.
|
|
46
|
+
*/
|
|
47
|
+
family?: string;
|
|
48
|
+
/** This variant's name within its family — 'Light', 'Dark', 'Sepia'. */
|
|
49
|
+
variant?: string;
|
|
50
|
+
/**
|
|
51
|
+
* Alternative accents, applied through `useVuetiwatch().setAccent()`.
|
|
52
|
+
* The first is the theme's own, so a picker can show it selected.
|
|
53
|
+
*/
|
|
54
|
+
accents?: VuetiwatchAccent[];
|
|
55
|
+
/**
|
|
56
|
+
* Opts the theme out of the Vuetiwatch core stylesheet, so it renders as
|
|
57
|
+
* stock Vuetify and nothing in this package reaches it.
|
|
58
|
+
*
|
|
59
|
+
* Only `classic` sets it. The set needs one theme that is the control —
|
|
60
|
+
* a reference point you can switch to and see exactly what the others
|
|
61
|
+
* added — and that only means something if it is untouched.
|
|
62
|
+
*/
|
|
63
|
+
stock?: boolean;
|
|
24
64
|
/**
|
|
25
65
|
* Web fonts the theme expects. The package never loads them for you —
|
|
26
66
|
* add them yourself (Google Fonts, Fontsource, self-hosted) for the full
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAA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M,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC/B;AAED,MAAM,WAAW,cAAc;IAC7B,8CAA8C;IAC9C,KAAK,EAAE,MAAM,CAAA;IACb,kDAAkD;IAClD,WAAW,EAAE,MAAM,CAAA;IACnB,+CAA+C;IAC/C,IAAI,EAAE,OAAO,CAAA;IACb,+DAA+D;IAC/D,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;IACxC;;;;;;;;;OASG;IACH,SAAS,EAAE,SAAS,GAAG,QAAQ,CAAA;IAC/B;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,wEAAwE;IACxE,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;;OAGG;IACH,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAA;IAC5B;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;IACf;;;;OAIG;IACH,KAAK,EAAE,MAAM,EAAE,CAAA;CAChB;AAED,MAAM,WAAW,eAAe,CAAC,IAAI,SAAS,MAAM,GAAG,MAAM;IAC3D,0DAA0D;IAC1D,IAAI,EAAE,IAAI,CAAA;IACV,IAAI,EAAE,cAAc,CAAA;IACpB,4DAA4D;IAC5D,KAAK,EAAE,eAAe,CAAA;IACtB,6DAA6D;IAC7D,QAAQ,EAAE,kBAAkB,CAAA;CAC7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/util/defaults.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAGrD,KAAK,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/util/defaults.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,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oEAAoE;IACpE,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B;AAED,0EAA0E;AAC1E,wBAAgB,KAAK,CAAE,GAAG,EAAE,eAAe,GAAG,kBAAkB,CA6C/D"}
|
package/dist/util/defaults.js
CHANGED
|
@@ -7,7 +7,17 @@ const FIELD_COMPONENTS = [
|
|
|
7
7
|
'VAutocomplete',
|
|
8
8
|
'VCombobox',
|
|
9
9
|
'VFileInput',
|
|
10
|
+
'VNumberInput',
|
|
10
11
|
];
|
|
12
|
+
/**
|
|
13
|
+
* The same list plus the one field that takes `variant` and `density` but
|
|
14
|
+
* none of the icons: the OTP input has no clear button to name.
|
|
15
|
+
*
|
|
16
|
+
* Both exist because a theme states its input style once. A field left out
|
|
17
|
+
* of it does not fall back to something neutral — it keeps Vuetify's filled
|
|
18
|
+
* variant and stands out as the one control the theme forgot.
|
|
19
|
+
*/
|
|
20
|
+
const FIELD_STYLED = [...FIELD_COMPONENTS, 'VOtpInput'];
|
|
11
21
|
/** The subset of those that opens a menu, and so draws a dropdown glyph. */
|
|
12
22
|
const MENU_COMPONENTS = [
|
|
13
23
|
'VSelect',
|
|
@@ -36,7 +46,7 @@ const spread = (names, props) => Object.fromEntries(names.map(name => [name, pro
|
|
|
36
46
|
* Applies the same props to every field-based input, so a theme states its
|
|
37
47
|
* input style once instead of six times.
|
|
38
48
|
*/
|
|
39
|
-
export const fields = (props) => spread(
|
|
49
|
+
export const fields = (props) => spread(FIELD_STYLED, props);
|
|
40
50
|
/** Applies the same props to checkboxes, radio groups and switches. */
|
|
41
51
|
export const controls = (props) => spread(CONTROL_COMPONENTS, props);
|
|
42
52
|
/** Applies the same props to app bars and toolbars. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.js","sourceRoot":"","sources":["../../src/util/defaults.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAItC,8EAA8E;AAC9E,MAAM,gBAAgB,GAAG;IACvB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WAAW,EAAE,CAAC,CAAA;IAC1E,GAAG,CAAC,CAAC,OAAO,EAAE,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,GAAG,CAAC,KAAK,EAAE,CAAC,CAAA;IAClD,GAAG,CAAC,CAAC,cAAc,CAAC,EAAE,EAAE,OAAO,EAAE,GAAG,CAAC,iBAAiB,EAAE,CAAC,CAAA;IAEzD,OAAO,GAAG,CAAA;AACZ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defineTheme.d.ts","sourceRoot":"","sources":["../../src/util/defineTheme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"defineTheme.d.ts","sourceRoot":"","sources":["../../src/util/defineTheme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAmBtF,MAAM,WAAW,kBAAkB,CAAC,IAAI,SAAS,MAAM,GAAG,MAAM;IAC9D,IAAI,EAAE,IAAI,CAAA;IACV,IAAI,EAAE,cAAc,CAAA;IACpB;;;;;OAKG;IACH,KAAK,EAAE,eAAe,CAAA;IACtB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,kBAAkB,GAAG,kBAAkB,EAAE,CAAA;CACrD;AAED,wBAAgB,WAAW,CAAC,KAAK,CAAC,IAAI,SAAS,MAAM,EACnD,OAAO,EAAE,kBAAkB,CAAC,IAAI,CAAC,GAChC,eAAe,CAAC,IAAI,CAAC,CAcvB"}
|
package/dist/util/defineTheme.js
CHANGED
|
@@ -2,14 +2,17 @@ import { combine } from './defaults.js';
|
|
|
2
2
|
/**
|
|
3
3
|
* Applied under every theme's own defaults.
|
|
4
4
|
*
|
|
5
|
-
* A
|
|
6
|
-
* dead grey whatever the palette —
|
|
7
|
-
*
|
|
8
|
-
*
|
|
5
|
+
* A control with no `color` falls back to `surface-variant`, which reads as
|
|
6
|
+
* dead grey whatever the palette — and on a date picker Vuetify then writes
|
|
7
|
+
* `on-surface` over that grey rather than `on-surface-variant`, so the
|
|
8
|
+
* selected day comes out near-black on dark grey at about 1.6:1. The
|
|
9
|
+
* controls whose whole job is to show a value are coloured here once, and a
|
|
10
|
+
* theme overrides this the way it overrides anything else.
|
|
9
11
|
*/
|
|
10
12
|
const baseDefaults = {
|
|
11
13
|
VSlider: { color: 'primary' },
|
|
12
14
|
VRangeSlider: { color: 'primary' },
|
|
15
|
+
VDatePicker: { color: 'primary' },
|
|
13
16
|
};
|
|
14
17
|
export function defineTheme(options) {
|
|
15
18
|
const layers = options.defaults
|
|
@@ -19,7 +22,10 @@ export function defineTheme(options) {
|
|
|
19
22
|
name: options.name,
|
|
20
23
|
meta: options.meta,
|
|
21
24
|
theme: options.theme,
|
|
22
|
-
|
|
25
|
+
// A theme that declared itself stock gets nothing at all — not even the
|
|
26
|
+
// base layer above. It is the control, and a control with one prop set
|
|
27
|
+
// is not a control.
|
|
28
|
+
defaults: options.meta.stock ? combine(...layers) : combine(baseDefaults, ...layers),
|
|
23
29
|
};
|
|
24
30
|
}
|
|
25
31
|
//# sourceMappingURL=defineTheme.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defineTheme.js","sourceRoot":"","sources":["../../src/util/defineTheme.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAEvC
|
|
1
|
+
{"version":3,"file":"defineTheme.js","sourceRoot":"","sources":["../../src/util/defineTheme.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAEvC;;;;;;;;;GASG;AACH,MAAM,YAAY,GAAuB;IACvC,OAAO,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE;IAC7B,YAAY,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE;IAClC,WAAW,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE;CAClC,CAAA;AAoBD,MAAM,UAAU,WAAW,CACzB,OAAiC;IAEjC,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ;QAC7B,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE;QAC3B,CAAC,CAAC,EAAE,CAAA;IAEN,OAAO;QACL,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,wEAAwE;QACxE,uEAAuE;QACvE,oBAAoB;QACpB,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,EAAE,GAAG,MAAM,CAAC;KACrF,CAAA;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vuetiwatch",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"description": "Free, plug-and-play themes for Vuetify 4
|
|
5
|
+
"description": "Free, plug-and-play themes for Vuetify 4 — a Bootswatch for Vuetify",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "j-tap",
|
|
8
8
|
"homepage": "https://j-tap.github.io/vuetiwatch/",
|
package/src/index.ts
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
export {
|
|
2
|
+
atlas,
|
|
3
|
+
atlasDark,
|
|
4
|
+
atlasSepia,
|
|
2
5
|
aurora,
|
|
3
6
|
brutalist,
|
|
4
7
|
calm,
|
|
8
|
+
candy,
|
|
5
9
|
classic,
|
|
6
10
|
clay,
|
|
7
11
|
darkGlass,
|
|
12
|
+
graphite,
|
|
8
13
|
liquidGlass,
|
|
9
14
|
lux,
|
|
10
15
|
morph,
|
|
@@ -20,15 +25,16 @@ export {
|
|
|
20
25
|
vuetiwatchMeta,
|
|
21
26
|
vuetiwatchThemes,
|
|
22
27
|
} from './registry.js'
|
|
23
|
-
export { createVuetiwatch } from './plugin.js'
|
|
28
|
+
export { createVuetiwatch, useVuetiwatch } from './plugin.js'
|
|
24
29
|
export { defineTheme } from './util/defineTheme.js'
|
|
25
30
|
export { bars, combine, controls, fields, icons, surfaces, tables } from './util/defaults.js'
|
|
26
31
|
|
|
27
|
-
export type { VuetiwatchOptions } from './plugin.js'
|
|
32
|
+
export type { Vuetiwatch, VuetiwatchOptions } from './plugin.js'
|
|
28
33
|
export type { VuetiwatchThemeName } from './registry.js'
|
|
29
34
|
export type { DefineThemeOptions } from './util/defineTheme.js'
|
|
30
35
|
export type { VuetiwatchIcons } from './util/defaults.js'
|
|
31
36
|
export type {
|
|
37
|
+
VuetiwatchAccent,
|
|
32
38
|
VuetiwatchDefaults,
|
|
33
39
|
VuetiwatchMeta,
|
|
34
40
|
VuetiwatchTheme,
|
package/src/plugin.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { watch } from 'vue'
|
|
2
|
-
import type { App, Plugin } from 'vue'
|
|
3
|
-
import type { VuetiwatchDefaults, VuetiwatchTheme } from './types.js'
|
|
1
|
+
import { computed, inject, ref, watch } from 'vue'
|
|
2
|
+
import type { App, ComputedRef, Plugin, Ref } from 'vue'
|
|
3
|
+
import type { VuetiwatchAccent, VuetiwatchDefaults, VuetiwatchTheme } from './types.js'
|
|
4
4
|
import { combine } from './util/defaults.js'
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -10,9 +10,100 @@ import { combine } from './util/defaults.js'
|
|
|
10
10
|
*/
|
|
11
11
|
interface VuetifyLike {
|
|
12
12
|
defaults: { value: VuetiwatchDefaults }
|
|
13
|
-
theme: {
|
|
13
|
+
theme: {
|
|
14
|
+
global: { name: { value: string } }
|
|
15
|
+
/** Present in Vuetify 4; the name ref is assigned directly without it. */
|
|
16
|
+
change?: (name: string) => void
|
|
17
|
+
/** The live definitions. Reactive, which is what makes accents work. */
|
|
18
|
+
themes?: { value: Record<string, { colors?: Record<string, string> }> }
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Anything that might carry viewport coordinates. Partial on purpose: a
|
|
24
|
+
* list item hands its handler `MouseEvent | KeyboardEvent`, and a keyboard
|
|
25
|
+
* activation should not have to be filtered out by every caller.
|
|
26
|
+
*/
|
|
27
|
+
interface Point {
|
|
28
|
+
clientX?: number
|
|
29
|
+
clientY?: number
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Same-document view transitions, Baseline since October 2025. Declared
|
|
34
|
+
* here rather than relied on from `lib.dom` so the package builds against
|
|
35
|
+
* older TypeScript DOM libraries too.
|
|
36
|
+
*/
|
|
37
|
+
type ViewTransitionDocument = Document & {
|
|
38
|
+
startViewTransition?: (callback: () => void) => {
|
|
39
|
+
finished?: Promise<unknown>
|
|
40
|
+
ready?: Promise<unknown>
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface Vuetiwatch {
|
|
45
|
+
/** The themes handed to the plugin, in the order a picker should show them. */
|
|
46
|
+
themes: readonly VuetiwatchTheme[]
|
|
47
|
+
/** The active theme, or `undefined` while a theme outside the list is on. */
|
|
48
|
+
current: ComputedRef<VuetiwatchTheme | undefined>
|
|
49
|
+
/**
|
|
50
|
+
* The variants of the active theme's family, in registration order, or an
|
|
51
|
+
* empty array when it has none. This is what a light/dark switch iterates
|
|
52
|
+
* over — the family is declared in each theme's `meta`, so the app never
|
|
53
|
+
* has to know which themes belong together.
|
|
54
|
+
*/
|
|
55
|
+
siblings: ComputedRef<readonly VuetiwatchTheme[]>
|
|
56
|
+
/**
|
|
57
|
+
* Switches theme through a view transition when the browser has one.
|
|
58
|
+
*
|
|
59
|
+
* Pass the event that triggered it and the new theme opens as a circle
|
|
60
|
+
* from the pointer; without one it opens from the centre of the screen.
|
|
61
|
+
* Falls back to an instant change where the API is missing, where the
|
|
62
|
+
* user asked for reduced motion, or where `transitions` is off — so it is
|
|
63
|
+
* always safe to call.
|
|
64
|
+
*/
|
|
65
|
+
change: (name: string, event?: Point | Event | null) => void
|
|
66
|
+
/** The accents the active theme offers, or an empty array. */
|
|
67
|
+
accents: ComputedRef<readonly VuetiwatchAccent[]>
|
|
68
|
+
/** The accent in use, by id. `undefined` until one is chosen. */
|
|
69
|
+
accent: Readonly<Ref<string | undefined>>
|
|
70
|
+
/**
|
|
71
|
+
* Repaints the theme in one of its accents.
|
|
72
|
+
*
|
|
73
|
+
* The colours are written into Vuetify's live definitions, which are
|
|
74
|
+
* reactive, so every surface follows within the frame. It is applied to
|
|
75
|
+
* the whole family at once — each variant has its own tone of the same
|
|
76
|
+
* accent — so the choice survives a light/dark switch.
|
|
77
|
+
*/
|
|
78
|
+
setAccent: (id: string) => void
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const injectionKey = Symbol.for('vuetiwatch')
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* The plugin's API, for switching themes and reading the active one.
|
|
85
|
+
*
|
|
86
|
+
* ```ts
|
|
87
|
+
* const { themes, current, change } = useVuetiwatch()
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
export function useVuetiwatch (): Vuetiwatch {
|
|
91
|
+
const api = inject<Vuetiwatch>(injectionKey)
|
|
92
|
+
|
|
93
|
+
if (!api) {
|
|
94
|
+
throw new Error(
|
|
95
|
+
'[vuetiwatch] useVuetiwatch() was called before the plugin was installed. ' +
|
|
96
|
+
'Add app.use(createVuetiwatch(vuetify, { themes })) first.',
|
|
97
|
+
)
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return api
|
|
14
101
|
}
|
|
15
102
|
|
|
103
|
+
const prefersReducedMotion = () =>
|
|
104
|
+
typeof window !== 'undefined' &&
|
|
105
|
+
window.matchMedia?.('(prefers-reduced-motion: reduce)').matches === true
|
|
106
|
+
|
|
16
107
|
export interface VuetiwatchOptions {
|
|
17
108
|
/**
|
|
18
109
|
* Themes to manage — normally the package's `themeList`, or just the ones
|
|
@@ -20,20 +111,36 @@ export interface VuetiwatchOptions {
|
|
|
20
111
|
*
|
|
21
112
|
* Required rather than defaulted, because a default would mean importing
|
|
22
113
|
* the registry here, and a static import cannot be shaken out: every app
|
|
23
|
-
* would carry all
|
|
114
|
+
* would carry all sixteen themes even after passing one.
|
|
24
115
|
*/
|
|
25
116
|
themes: readonly VuetiwatchTheme[]
|
|
26
117
|
/**
|
|
27
|
-
* Apply each theme's component defaults
|
|
28
|
-
*
|
|
118
|
+
* Apply each theme's component defaults.
|
|
119
|
+
*
|
|
120
|
+
* - `'over'` (or `true`) — the theme's values win, so a theme can restyle
|
|
121
|
+
* a component the app never thought about.
|
|
122
|
+
* - `'under'` — yours win, and the theme fills in only what you left
|
|
123
|
+
* unset. Use it when the app owns a decision the theme also has an
|
|
124
|
+
* opinion on: an admin panel with its own density switch, say.
|
|
125
|
+
* - `false` — no theme defaults at all.
|
|
126
|
+
*
|
|
127
|
+
* @default 'over'
|
|
29
128
|
*/
|
|
30
|
-
defaults?: boolean
|
|
129
|
+
defaults?: boolean | 'over' | 'under'
|
|
31
130
|
/**
|
|
32
131
|
* Mirror the active theme name onto `<html data-vuetiwatch="...">`, so
|
|
33
132
|
* you can hang your own CSS off it.
|
|
34
133
|
* @default true
|
|
35
134
|
*/
|
|
36
135
|
attribute?: boolean
|
|
136
|
+
/**
|
|
137
|
+
* Animate theme changes made through `useVuetiwatch().change()`.
|
|
138
|
+
*
|
|
139
|
+
* Only that call is affected — an app switching through Vuetify's own
|
|
140
|
+
* `theme.change()` keeps the instant swap it has today.
|
|
141
|
+
* @default true
|
|
142
|
+
*/
|
|
143
|
+
transitions?: boolean
|
|
37
144
|
}
|
|
38
145
|
|
|
39
146
|
/**
|
|
@@ -48,7 +155,7 @@ export interface VuetiwatchOptions {
|
|
|
48
155
|
* Install it after Vuetify:
|
|
49
156
|
*
|
|
50
157
|
* ```ts
|
|
51
|
-
* app.use(vuetify).use(createVuetiwatch(vuetify))
|
|
158
|
+
* app.use(vuetify).use(createVuetiwatch(vuetify, { themes: themeList }))
|
|
52
159
|
* ```
|
|
53
160
|
*/
|
|
54
161
|
export function createVuetiwatch (
|
|
@@ -59,6 +166,7 @@ export function createVuetiwatch (
|
|
|
59
166
|
themes,
|
|
60
167
|
defaults: applyDefaults = true,
|
|
61
168
|
attribute = true,
|
|
169
|
+
transitions = true,
|
|
62
170
|
} = options
|
|
63
171
|
|
|
64
172
|
// Only the defaults are ever read here, so the closure holds those rather
|
|
@@ -67,7 +175,7 @@ export function createVuetiwatch (
|
|
|
67
175
|
const defaultsByName = new Map(themes.map(theme => [theme.name, theme.defaults]))
|
|
68
176
|
|
|
69
177
|
return {
|
|
70
|
-
install (
|
|
178
|
+
install (app: App) {
|
|
71
179
|
const instance = vuetify as VuetifyLike
|
|
72
180
|
|
|
73
181
|
if (!instance?.theme?.global?.name) {
|
|
@@ -77,32 +185,117 @@ export function createVuetiwatch (
|
|
|
77
185
|
)
|
|
78
186
|
}
|
|
79
187
|
|
|
80
|
-
|
|
81
|
-
|
|
188
|
+
/**
|
|
189
|
+
* Whatever the app configured itself — theme defaults layer on top.
|
|
190
|
+
*
|
|
191
|
+
* Re-read rather than captured once, because `defaults` is a public
|
|
192
|
+
* ref an app is allowed to reassign at runtime. Anything we did not
|
|
193
|
+
* write ourselves is the app speaking, and becomes the new base;
|
|
194
|
+
* without the check, the first theme change after such a reassignment
|
|
195
|
+
* would quietly throw the app's own defaults away.
|
|
196
|
+
*/
|
|
197
|
+
let userDefaults = instance.defaults.value ?? {}
|
|
198
|
+
let applied: VuetiwatchDefaults | undefined
|
|
82
199
|
|
|
83
|
-
// The merge is a pure function of the theme name, so it is computed at
|
|
84
|
-
// most once per theme however often the app switches.
|
|
85
|
-
const merged = new Map<string, VuetiwatchDefaults>()
|
|
86
200
|
const defaultsFor = (name: string) => {
|
|
201
|
+
if (applied && instance.defaults.value !== applied) {
|
|
202
|
+
userDefaults = instance.defaults.value ?? {}
|
|
203
|
+
}
|
|
204
|
+
|
|
87
205
|
const themeDefaults = defaultsByName.get(name)
|
|
88
206
|
|
|
89
207
|
if (!themeDefaults) return userDefaults
|
|
90
208
|
|
|
91
|
-
|
|
209
|
+
return applyDefaults === 'under'
|
|
210
|
+
? combine(themeDefaults, userDefaults)
|
|
211
|
+
: combine(userDefaults, themeDefaults)
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
const apply = (name: string) => {
|
|
215
|
+
if (instance.theme.change) instance.theme.change(name)
|
|
216
|
+
else instance.theme.global.name.value = name
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
const change: Vuetiwatch['change'] = (name, event) => {
|
|
220
|
+
const doc = typeof document !== 'undefined'
|
|
221
|
+
? document as ViewTransitionDocument
|
|
222
|
+
: undefined
|
|
223
|
+
|
|
224
|
+
if (!transitions || !doc?.startViewTransition || prefersReducedMotion()) {
|
|
225
|
+
apply(name)
|
|
92
226
|
|
|
93
|
-
|
|
94
|
-
result = combine(userDefaults, themeDefaults)
|
|
95
|
-
merged.set(name, result)
|
|
227
|
+
return
|
|
96
228
|
}
|
|
97
229
|
|
|
98
|
-
|
|
230
|
+
/**
|
|
231
|
+
* Viewport coordinates, because the transition pseudo-elements are
|
|
232
|
+
* laid out against the viewport rather than against any element.
|
|
233
|
+
*
|
|
234
|
+
* A click synthesised by the keyboard reports 0/0, which would open
|
|
235
|
+
* the wipe from the corner of the screen rather than from anything
|
|
236
|
+
* the user can see — those fall back to the centre.
|
|
237
|
+
*/
|
|
238
|
+
const root = doc.documentElement
|
|
239
|
+
const point = event && 'clientX' in event ? event : undefined
|
|
240
|
+
const fromPointer = !!point?.clientX || !!point?.clientY
|
|
241
|
+
|
|
242
|
+
root.style.setProperty('--vw-origin-x', fromPointer ? `${point?.clientX ?? 0}px` : '50%')
|
|
243
|
+
root.style.setProperty('--vw-origin-y', fromPointer ? `${point?.clientY ?? 0}px` : '50%')
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* A transition interrupted by the next one rejects `ready` and
|
|
247
|
+
* `finished`. Nothing here awaits them, so the rejection would
|
|
248
|
+
* surface as an unhandled one in the console the first time
|
|
249
|
+
* somebody clicks twice quickly — which is exactly what a theme
|
|
250
|
+
* picker invites.
|
|
251
|
+
*/
|
|
252
|
+
const transition = doc.startViewTransition(() => { apply(name) })
|
|
253
|
+
|
|
254
|
+
transition?.ready?.catch(() => {})
|
|
255
|
+
transition?.finished?.catch(() => {})
|
|
99
256
|
}
|
|
100
257
|
|
|
258
|
+
const current = computed(() =>
|
|
259
|
+
themes.find(theme => theme.name === instance.theme.global.name.value),
|
|
260
|
+
)
|
|
261
|
+
|
|
262
|
+
const accent = ref<string>()
|
|
263
|
+
|
|
264
|
+
const setAccent = (id: string) => {
|
|
265
|
+
const definitions = instance.theme.themes?.value
|
|
266
|
+
|
|
267
|
+
if (!definitions) return
|
|
268
|
+
|
|
269
|
+
for (const theme of themes) {
|
|
270
|
+
const preset = theme.meta.accents?.find(item => item.id === id)
|
|
271
|
+
const colors = definitions[theme.name]?.colors
|
|
272
|
+
|
|
273
|
+
if (preset && colors) Object.assign(colors, preset.colors)
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
accent.value = id
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
app.provide<Vuetiwatch>(injectionKey, {
|
|
280
|
+
themes,
|
|
281
|
+
current,
|
|
282
|
+
accents: computed(() => current.value?.meta.accents ?? []),
|
|
283
|
+
accent,
|
|
284
|
+
setAccent,
|
|
285
|
+
siblings: computed(() => {
|
|
286
|
+
const family = current.value?.meta.family
|
|
287
|
+
|
|
288
|
+
return family ? themes.filter(theme => theme.meta.family === family) : []
|
|
289
|
+
}),
|
|
290
|
+
change,
|
|
291
|
+
})
|
|
292
|
+
|
|
101
293
|
watch(
|
|
102
294
|
() => instance.theme.global.name.value,
|
|
103
295
|
name => {
|
|
104
296
|
if (applyDefaults) {
|
|
105
|
-
|
|
297
|
+
applied = defaultsFor(name)
|
|
298
|
+
instance.defaults.value = applied
|
|
106
299
|
}
|
|
107
300
|
|
|
108
301
|
if (attribute && typeof document !== 'undefined') {
|