mood-ui 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/dist/components/ModoProvider.vue.d.ts +17 -1
- package/dist/config/ModoConfig.d.ts +24 -0
- package/dist/config/createModoUI.d.ts +68 -0
- package/dist/config/surfaces.d.ts +22 -0
- package/dist/index.d.ts +2 -10
- package/dist/mood-ui.cjs +3 -3
- package/dist/mood-ui.cjs.map +1 -1
- package/dist/mood-ui.css +2 -1
- package/dist/mood-ui.mjs +3033 -2895
- package/dist/mood-ui.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ModoColor, ModoHalo, ModoRadius, ModoSize, ModoTheme } from '../config/ModoConfig';
|
|
1
|
+
import { ModoColor, ModoHalo, ModoRadius, ModoSize, ModoTheme, ModoSurfaces } from '../config/ModoConfig';
|
|
2
2
|
import { PartialLocale } from '../config/ModoLocale';
|
|
3
3
|
import { ModoPalette } from '../config/palettes';
|
|
4
4
|
type __VLS_Props = {
|
|
@@ -28,6 +28,22 @@ type __VLS_Props = {
|
|
|
28
28
|
default?: Partial<ModoPalette>;
|
|
29
29
|
primary?: Partial<ModoPalette>;
|
|
30
30
|
};
|
|
31
|
+
/**
|
|
32
|
+
* Override surface tokens (backgrounds, card, popover, border, muted…)
|
|
33
|
+
* for **light mode**. Any valid CSS color string is accepted.
|
|
34
|
+
* Only the keys you provide are overridden; the rest keep their defaults.
|
|
35
|
+
*/
|
|
36
|
+
surfaces?: ModoSurfaces;
|
|
37
|
+
/**
|
|
38
|
+
* Override surface tokens for **dark mode**.
|
|
39
|
+
* Applied automatically when the resolved theme is `'dark'`.
|
|
40
|
+
* Use the built-in `darkSurfaces` presets from `mood-ui` or build your own:
|
|
41
|
+
* ```ts
|
|
42
|
+
* import { darkSurfaces } from 'mood-ui';
|
|
43
|
+
* // <ModoProvider :darkSurfaces="darkSurfaces.navy" />
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
darkSurfaces?: ModoSurfaces;
|
|
31
47
|
/**
|
|
32
48
|
* Deep-partial override of the design-system copy (aria labels, empty
|
|
33
49
|
* states, reject messages, etc.). Cascades like palettes: inherits from
|
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
import { InjectionKey, Ref } from 'vue';
|
|
2
2
|
import { ModoPalette } from './palettes';
|
|
3
|
+
/**
|
|
4
|
+
* Surface tokens — backgrounds, cards, popovers, borders and neutral fills.
|
|
5
|
+
* Each value is any valid CSS color string (hex, oklch(), hsl(), rgb()…).
|
|
6
|
+
* Partial: only override the tokens you want to change.
|
|
7
|
+
*/
|
|
8
|
+
export interface ModoSurfaces {
|
|
9
|
+
background?: string;
|
|
10
|
+
foreground?: string;
|
|
11
|
+
card?: string;
|
|
12
|
+
cardForeground?: string;
|
|
13
|
+
popover?: string;
|
|
14
|
+
popoverForeground?: string;
|
|
15
|
+
secondary?: string;
|
|
16
|
+
secondaryForeground?: string;
|
|
17
|
+
muted?: string;
|
|
18
|
+
mutedForeground?: string;
|
|
19
|
+
accent?: string;
|
|
20
|
+
accentForeground?: string;
|
|
21
|
+
border?: string;
|
|
22
|
+
input?: string;
|
|
23
|
+
ring?: string;
|
|
24
|
+
}
|
|
3
25
|
export type ModoColor = 'default' | 'primary' | 'danger' | 'success' | 'warning';
|
|
4
26
|
export type ModoRadius = 'none' | 'small' | 'medium' | 'large' | 'full';
|
|
5
27
|
/**
|
|
@@ -27,6 +49,8 @@ export interface ModoConfig {
|
|
|
27
49
|
default: ModoPalette;
|
|
28
50
|
primary: ModoPalette;
|
|
29
51
|
};
|
|
52
|
+
surfaces?: ModoSurfaces;
|
|
53
|
+
darkSurfaces?: ModoSurfaces;
|
|
30
54
|
}
|
|
31
55
|
export declare const MODO_CONFIG: InjectionKey<Ref<ModoConfig>>;
|
|
32
56
|
export declare const defaultModoConfig: ModoConfig;
|
|
@@ -46,6 +46,40 @@ export declare function createModoUI(options?: ModoUIOptions): {
|
|
|
46
46
|
950: string;
|
|
47
47
|
};
|
|
48
48
|
};
|
|
49
|
+
surfaces?: {
|
|
50
|
+
background?: string | undefined;
|
|
51
|
+
foreground?: string | undefined;
|
|
52
|
+
card?: string | undefined;
|
|
53
|
+
cardForeground?: string | undefined;
|
|
54
|
+
popover?: string | undefined;
|
|
55
|
+
popoverForeground?: string | undefined;
|
|
56
|
+
secondary?: string | undefined;
|
|
57
|
+
secondaryForeground?: string | undefined;
|
|
58
|
+
muted?: string | undefined;
|
|
59
|
+
mutedForeground?: string | undefined;
|
|
60
|
+
accent?: string | undefined;
|
|
61
|
+
accentForeground?: string | undefined;
|
|
62
|
+
border?: string | undefined;
|
|
63
|
+
input?: string | undefined;
|
|
64
|
+
ring?: string | undefined;
|
|
65
|
+
} | undefined;
|
|
66
|
+
darkSurfaces?: {
|
|
67
|
+
background?: string | undefined;
|
|
68
|
+
foreground?: string | undefined;
|
|
69
|
+
card?: string | undefined;
|
|
70
|
+
cardForeground?: string | undefined;
|
|
71
|
+
popover?: string | undefined;
|
|
72
|
+
popoverForeground?: string | undefined;
|
|
73
|
+
secondary?: string | undefined;
|
|
74
|
+
secondaryForeground?: string | undefined;
|
|
75
|
+
muted?: string | undefined;
|
|
76
|
+
mutedForeground?: string | undefined;
|
|
77
|
+
accent?: string | undefined;
|
|
78
|
+
accentForeground?: string | undefined;
|
|
79
|
+
border?: string | undefined;
|
|
80
|
+
input?: string | undefined;
|
|
81
|
+
ring?: string | undefined;
|
|
82
|
+
} | undefined;
|
|
49
83
|
}, ModoConfig | {
|
|
50
84
|
color: import('./ModoConfig').ModoColor;
|
|
51
85
|
radius: import('./ModoConfig').ModoRadius;
|
|
@@ -80,6 +114,40 @@ export declare function createModoUI(options?: ModoUIOptions): {
|
|
|
80
114
|
950: string;
|
|
81
115
|
};
|
|
82
116
|
};
|
|
117
|
+
surfaces?: {
|
|
118
|
+
background?: string | undefined;
|
|
119
|
+
foreground?: string | undefined;
|
|
120
|
+
card?: string | undefined;
|
|
121
|
+
cardForeground?: string | undefined;
|
|
122
|
+
popover?: string | undefined;
|
|
123
|
+
popoverForeground?: string | undefined;
|
|
124
|
+
secondary?: string | undefined;
|
|
125
|
+
secondaryForeground?: string | undefined;
|
|
126
|
+
muted?: string | undefined;
|
|
127
|
+
mutedForeground?: string | undefined;
|
|
128
|
+
accent?: string | undefined;
|
|
129
|
+
accentForeground?: string | undefined;
|
|
130
|
+
border?: string | undefined;
|
|
131
|
+
input?: string | undefined;
|
|
132
|
+
ring?: string | undefined;
|
|
133
|
+
} | undefined;
|
|
134
|
+
darkSurfaces?: {
|
|
135
|
+
background?: string | undefined;
|
|
136
|
+
foreground?: string | undefined;
|
|
137
|
+
card?: string | undefined;
|
|
138
|
+
cardForeground?: string | undefined;
|
|
139
|
+
popover?: string | undefined;
|
|
140
|
+
popoverForeground?: string | undefined;
|
|
141
|
+
secondary?: string | undefined;
|
|
142
|
+
secondaryForeground?: string | undefined;
|
|
143
|
+
muted?: string | undefined;
|
|
144
|
+
mutedForeground?: string | undefined;
|
|
145
|
+
accent?: string | undefined;
|
|
146
|
+
accentForeground?: string | undefined;
|
|
147
|
+
border?: string | undefined;
|
|
148
|
+
input?: string | undefined;
|
|
149
|
+
ring?: string | undefined;
|
|
150
|
+
} | undefined;
|
|
83
151
|
}>;
|
|
84
152
|
set(next: Partial<ModoUIOptions>): void;
|
|
85
153
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ModoSurfaces } from './ModoConfig';
|
|
2
|
+
/**
|
|
3
|
+
* Converts a ModoSurfaces object into a CSS-vars record ready to be
|
|
4
|
+
* spread onto an element's `style` binding.
|
|
5
|
+
* Accepts any CSS color string: hex, oklch(), hsl(), rgb(), etc.
|
|
6
|
+
*/
|
|
7
|
+
export declare function surfacesToCssVars(surfaces: ModoSurfaces): Record<string, string>;
|
|
8
|
+
export declare const darkSurfaces: {
|
|
9
|
+
/** Built-in default — near-black with slate undertone */
|
|
10
|
+
default: ModoSurfaces;
|
|
11
|
+
/** Deep blue-navy surfaces */
|
|
12
|
+
navy: ModoSurfaces;
|
|
13
|
+
/** Pure neutral zinc */
|
|
14
|
+
zinc: ModoSurfaces;
|
|
15
|
+
/** Warm brownish/charcoal dark */
|
|
16
|
+
charcoal: ModoSurfaces;
|
|
17
|
+
/** Very deep with subtle indigo tint */
|
|
18
|
+
midnight: ModoSurfaces;
|
|
19
|
+
/** Subtle green undertone, natural feel */
|
|
20
|
+
forest: ModoSurfaces;
|
|
21
|
+
};
|
|
22
|
+
export type DarkSurfacePreset = keyof typeof darkSurfaces;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Public entry point of the `modo-ui` package.
|
|
3
|
-
*
|
|
4
|
-
* This module re-exports every component, composable and type that is
|
|
5
|
-
* intended to be consumed by external apps. Internal helpers stay
|
|
6
|
-
* unexported on purpose — anything not listed here is private.
|
|
7
|
-
*
|
|
8
|
-
* Phase 8 (lib export) builds against this file via `vite build --lib`.
|
|
9
|
-
*/
|
|
10
1
|
export { default as ModoProvider } from './components/ModoProvider.vue';
|
|
11
|
-
export { MODO_CONFIG, defaultModoConfig, type ModoColor, type ModoRadius, type ModoSize, type ModoTheme, type ModoHalo, type ModoConfig, } from './config/ModoConfig';
|
|
2
|
+
export { MODO_CONFIG, defaultModoConfig, type ModoColor, type ModoRadius, type ModoSize, type ModoTheme, type ModoHalo, type ModoConfig, type ModoSurfaces, } from './config/ModoConfig';
|
|
3
|
+
export { surfacesToCssVars, darkSurfaces, type DarkSurfacePreset, } from './config/surfaces';
|
|
12
4
|
export { MODO_LOCALE, defaultLocale, mergeLocale, type ModoLocale, type PartialLocale, } from './config/ModoLocale';
|
|
13
5
|
export { defaultPalettes, paletteFromHex, mergePalettes, palettesToCssVars, semanticTokensFromPalettes, type ModoPalette, type ModoPalettes, type PaletteShade, } from './config/palettes';
|
|
14
6
|
export { useModoConfig, useResolvedColor, useResolvedRadius, useResolvedSize, useResolvedTheme, useResolvedHalo, useModoLocale, useLocaleString, } from './composables/useModoConfig';
|