@codemonster-ru/vueforge-core 1.3.3 → 1.4.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 +63 -7
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/plugin.d.ts +3 -3
- package/dist/plugin.d.ts.map +1 -1
- package/dist/providers/VfThemeProvider.vue.d.ts +2 -4
- package/dist/providers/VfThemeProvider.vue.d.ts.map +1 -1
- package/dist/providers/vueForgeConfig.d.ts +7 -1
- package/dist/providers/vueForgeConfig.d.ts.map +1 -1
- package/dist/types/theme.d.ts +3 -0
- package/dist/types/theme.d.ts.map +1 -1
- package/dist/vueforge-core.js +697 -688
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ Stable foundation layer for the VueForge design system.
|
|
|
8
8
|
|
|
9
9
|
## Current scope
|
|
10
10
|
|
|
11
|
-
Version `1.3.
|
|
11
|
+
Version `1.3.x` focuses on:
|
|
12
12
|
|
|
13
13
|
- Vue 3 library build with Vite
|
|
14
14
|
- TypeScript declarations
|
|
@@ -21,22 +21,75 @@ Version `1.3.0` focuses on:
|
|
|
21
21
|
|
|
22
22
|
```ts
|
|
23
23
|
import { createApp } from "vue";
|
|
24
|
-
import
|
|
24
|
+
import VueForgeCore from "@codemonster-ru/vueforge-core";
|
|
25
25
|
|
|
26
26
|
const app = createApp(App);
|
|
27
27
|
|
|
28
|
-
app.use(
|
|
28
|
+
app.use(VueForgeCore);
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Recommended Theme Setup
|
|
32
|
+
|
|
33
|
+
VueForge theme setup has two layers that work together:
|
|
34
|
+
|
|
35
|
+
- token preset configuration through `app.use(VueForgeCore, { theme })`
|
|
36
|
+
- theme mode selection through `VfThemeProvider` and `useTheme()`
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
import { createApp } from "vue";
|
|
40
|
+
import App from "./App.vue";
|
|
41
|
+
import VueForgeCore, {
|
|
42
|
+
defaultThemePreset,
|
|
43
|
+
} from "@codemonster-ru/vueforge-core";
|
|
44
|
+
|
|
45
|
+
const app = createApp(App);
|
|
46
|
+
|
|
47
|
+
app.use(VueForgeCore, {
|
|
48
|
+
theme: {
|
|
49
|
+
preset: defaultThemePreset,
|
|
50
|
+
extend: {
|
|
51
|
+
colorPrimary: "#ff5a36",
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
defaultTheme: "system",
|
|
55
|
+
themeStorageKey: "vf-theme",
|
|
56
|
+
});
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
```vue
|
|
60
|
+
<script setup lang="ts">
|
|
61
|
+
import { VfThemeProvider } from "@codemonster-ru/vueforge-core";
|
|
62
|
+
</script>
|
|
63
|
+
|
|
64
|
+
<template>
|
|
65
|
+
<VfThemeProvider>
|
|
66
|
+
<App />
|
|
67
|
+
</VfThemeProvider>
|
|
68
|
+
</template>
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
```ts
|
|
72
|
+
import { useTheme } from "@codemonster-ru/vueforge-core";
|
|
73
|
+
|
|
74
|
+
const { theme, resolvedTheme, setTheme, toggleTheme } = useTheme();
|
|
75
|
+
|
|
76
|
+
setTheme("dark");
|
|
77
|
+
setTheme("light");
|
|
78
|
+
setTheme("system");
|
|
79
|
+
toggleTheme();
|
|
29
80
|
```
|
|
30
81
|
|
|
31
82
|
## Theme Overrides
|
|
32
83
|
|
|
33
84
|
```ts
|
|
34
85
|
import { createApp } from "vue";
|
|
35
|
-
import
|
|
86
|
+
import VueForgeCore, {
|
|
87
|
+
defaultThemePreset,
|
|
88
|
+
} from "@codemonster-ru/vueforge-core";
|
|
36
89
|
|
|
37
90
|
const app = createApp(App);
|
|
38
91
|
|
|
39
|
-
app.use(
|
|
92
|
+
app.use(VueForgeCore, {
|
|
40
93
|
theme: {
|
|
41
94
|
preset: defaultThemePreset,
|
|
42
95
|
extend: {
|
|
@@ -46,6 +99,9 @@ app.use(VueForge, {
|
|
|
46
99
|
});
|
|
47
100
|
```
|
|
48
101
|
|
|
102
|
+
`VfThemeProvider` reads theme-mode defaults from the plugin config when its own
|
|
103
|
+
props are not set. Provider props still win when you need local overrides.
|
|
104
|
+
|
|
49
105
|
For the full theme runtime and preset API, see [Theme API](./docs/theme-api.md).
|
|
50
106
|
|
|
51
107
|
## Theme Architecture
|
|
@@ -69,7 +125,7 @@ This means `vueforge-core` is still the easiest way to consume the default VueFo
|
|
|
69
125
|
Use the full package when you need VueForge components, styles, and theme runtime together.
|
|
70
126
|
|
|
71
127
|
```ts
|
|
72
|
-
import
|
|
128
|
+
import VueForgeCore from "@codemonster-ru/vueforge-core";
|
|
73
129
|
```
|
|
74
130
|
|
|
75
131
|
Use foundation-only entry points when another package, such as `vueforge-layouts`, needs shared responsive or platform helpers without depending on the full UI surface.
|
|
@@ -96,7 +152,7 @@ Available subpaths:
|
|
|
96
152
|
### Stability
|
|
97
153
|
|
|
98
154
|
- Stable UI API: components exported from the root package
|
|
99
|
-
- Stable theme API: `
|
|
155
|
+
- Stable theme API: `VueForgeCore`, `createVueForgeCore`, `VfThemeProvider`, `useTheme`, `defaultThemePreset`, `createThemePreset`
|
|
100
156
|
- Stable foundation API: breakpoint constants and foundation composables from `./foundation`
|
|
101
157
|
|
|
102
158
|
For the full foundation contract, see [Foundation API](./docs/foundation-api.md).
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { default,
|
|
1
|
+
export { default, VueForgeCore, createVueForgeCore } from './plugin';
|
|
2
2
|
export { default as VfThemeProvider } from './providers/VfThemeProvider.vue';
|
|
3
3
|
export { VfAccordion, VfAlert, VfBadge, VfButton, VfCard, VfCheckbox, VfDrawer, VfDialog, VfDivider, VfDropdown, VfIconButton, VfInput, VfLink, VfNavMenu, VfPanel, VfPopover, VfRadio, VfSwitch, VfTag, VfTabs, VfTextarea, VfTooltip, } from './components';
|
|
4
4
|
export { useClickOutside, useDisclosure, useEscapeKey, useFloating, useFocusTrap, useId, useTheme, } from './composables';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,gCAAgC,CAAC;AACxC,OAAO,+BAA+B,CAAC;AACvC,OAAO,yBAAyB,CAAC;AAEjC,OAAO,EAAE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,gCAAgC,CAAC;AACxC,OAAO,+BAA+B,CAAC;AACvC,OAAO,yBAAyB,CAAC;AAEjC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EACL,WAAW,EACX,OAAO,EACP,OAAO,EACP,QAAQ,EACR,MAAM,EACN,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,UAAU,EACV,YAAY,EACZ,OAAO,EACP,MAAM,EACN,SAAS,EACT,OAAO,EACP,SAAS,EACT,OAAO,EACP,QAAQ,EACR,KAAK,EACL,MAAM,EACN,UAAU,EACV,SAAS,GACV,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,eAAe,EACf,aAAa,EACb,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,KAAK,EACL,QAAQ,GACT,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,aAAa,EACb,eAAe,EACf,eAAe,EACf,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,aAAa,GACd,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACvE,YAAY,EACV,WAAW,EACX,eAAe,EACf,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,EACnB,cAAc,EACd,aAAa,EACb,SAAS,EACT,kBAAkB,EAClB,UAAU,GACX,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACV,eAAe,EACf,aAAa,EACb,cAAc,EACd,WAAW,EACX,aAAa,EACb,oBAAoB,EACpB,oBAAoB,EACpB,aAAa,EACb,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,cAAc,CAAC"}
|
package/dist/plugin.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare function
|
|
2
|
-
export declare const
|
|
3
|
-
export default
|
|
1
|
+
export declare function createVueForgeCore(): import('vue').ObjectPlugin<any[]>;
|
|
2
|
+
export declare const VueForgeCore: import('vue').ObjectPlugin<any[]>;
|
|
3
|
+
export default VueForgeCore;
|
|
4
4
|
//# sourceMappingURL=plugin.d.ts.map
|
package/dist/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAKA,wBAAgB,
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAKA,wBAAgB,kBAAkB,sCAqBjC;AAED,eAAO,MAAM,YAAY,mCAAuB,CAAC;AAEjD,eAAe,YAAY,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { VfThemeProviderProps } from '../types/theme';
|
|
2
2
|
declare function __VLS_template(): {
|
|
3
3
|
attrs: Partial<{}>;
|
|
4
4
|
slots: {
|
|
@@ -8,9 +8,7 @@ declare function __VLS_template(): {
|
|
|
8
8
|
rootEl: any;
|
|
9
9
|
};
|
|
10
10
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
11
|
-
declare const __VLS_component: import('vue').DefineComponent<VfThemeProviderProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<VfThemeProviderProps> & Readonly<{}>, {
|
|
12
|
-
defaultTheme: VfThemeMode;
|
|
13
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const __VLS_component: import('vue').DefineComponent<VfThemeProviderProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<VfThemeProviderProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
14
12
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
15
13
|
export default _default;
|
|
16
14
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VfThemeProvider.vue.d.ts","sourceRoot":"","sources":["../../src/providers/VfThemeProvider.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"VfThemeProvider.vue.d.ts","sourceRoot":"","sources":["../../src/providers/VfThemeProvider.vue"],"names":[],"mappings":"AA4KA,OAAO,KAAK,EAGV,oBAAoB,EACrB,MAAM,eAAe,CAAC;AA8IvB,iBAAS,cAAc;WAoBT,OAAO,IAA6B;;yBAVrB,GAAG;;;;EAe/B;AAQD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,oTAMnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAQpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { InjectionKey } from 'vue';
|
|
2
|
-
import { VfResolvedThemeConfig } from '../types/theme';
|
|
2
|
+
import { VfResolvedThemeConfig, VfThemeMode } from '../types/theme';
|
|
3
|
+
export interface VfVueForgeThemeModeDefaults {
|
|
4
|
+
defaultTheme?: VfThemeMode;
|
|
5
|
+
storageKey?: string;
|
|
6
|
+
attribute?: string;
|
|
7
|
+
}
|
|
3
8
|
export interface VfVueForgeRuntimeConfig {
|
|
4
9
|
theme: VfResolvedThemeConfig;
|
|
10
|
+
themeMode: VfVueForgeThemeModeDefaults;
|
|
5
11
|
}
|
|
6
12
|
export declare const vueForgeConfigKey: InjectionKey<VfVueForgeRuntimeConfig>;
|
|
7
13
|
//# sourceMappingURL=vueForgeConfig.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vueForgeConfig.d.ts","sourceRoot":"","sources":["../../src/providers/vueForgeConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,KAAK,CAAC;AACxC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"vueForgeConfig.d.ts","sourceRoot":"","sources":["../../src/providers/vueForgeConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,KAAK,CAAC;AACxC,OAAO,KAAK,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAExE,MAAM,WAAW,2BAA2B;IAC1C,YAAY,CAAC,EAAE,WAAW,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,qBAAqB,CAAC;IAC7B,SAAS,EAAE,2BAA2B,CAAC;CACxC;AAED,eAAO,MAAM,iBAAiB,EAAE,YAAY,CAAC,uBAAuB,CAC1C,CAAC"}
|
package/dist/types/theme.d.ts
CHANGED
|
@@ -3,6 +3,9 @@ import { VfResolvedTheme, VfThemeConfig, VfThemeMode } from '@codemonster-ru/vue
|
|
|
3
3
|
export type { VfResolvedTheme, VfResolvedThemeConfig, VfResolvedThemePreset, VfResolvedThemePresetOptions, VfThemeConfig, VfThemeMode, VfThemePreset, VfThemePresetOptions, VfThemeTokens, } from '@codemonster-ru/vueforge-theme';
|
|
4
4
|
export interface VfVueForgeOptions {
|
|
5
5
|
theme?: VfThemeConfig;
|
|
6
|
+
defaultTheme?: VfThemeMode;
|
|
7
|
+
themeStorageKey?: string;
|
|
8
|
+
themeAttribute?: string;
|
|
6
9
|
}
|
|
7
10
|
export interface VfThemeContext {
|
|
8
11
|
mode: Ref<VfThemeMode>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/types/theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC7C,OAAO,KAAK,EACV,eAAe,EACf,aAAa,EACb,WAAW,EACZ,MAAM,gCAAgC,CAAC;AAExC,YAAY,EACV,eAAe,EACf,qBAAqB,EACrB,qBAAqB,EACrB,4BAA4B,EAC5B,aAAa,EACb,WAAW,EACX,aAAa,EACb,oBAAoB,EACpB,aAAa,GACd,MAAM,gCAAgC,CAAC;AAExC,MAAM,WAAW,iBAAiB;IAChC,KAAK,CAAC,EAAE,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/types/theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC7C,OAAO,KAAK,EACV,eAAe,EACf,aAAa,EACb,WAAW,EACZ,MAAM,gCAAgC,CAAC;AAExC,YAAY,EACV,eAAe,EACf,qBAAqB,EACrB,qBAAqB,EACrB,4BAA4B,EAC5B,aAAa,EACb,WAAW,EACX,aAAa,EACb,oBAAoB,EACpB,aAAa,GACd,MAAM,gCAAgC,CAAC;AAExC,MAAM,WAAW,iBAAiB;IAChC,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,YAAY,CAAC,EAAE,WAAW,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC;IACvB,aAAa,EAAE,GAAG,CAAC,eAAe,CAAC,CAAC;IACpC,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;IACvC,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,MAAM,WAAW,oBAAoB;IACnC,YAAY,CAAC,EAAE,WAAW,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,mBAAmB,GAAG,YAAY,CAAC,cAAc,CAAC,CAAC"}
|