@breadstone/mosaik-elements-foundation 0.0.218 → 0.0.221
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/Controls/Behaviors/Abstracts/Behavior.d.ts +1 -1
- package/Controls/Behaviors/Alignable.d.ts +6 -0
- package/Controls/Behaviors/Alignable.d.ts.map +1 -1
- package/Controls/Behaviors/Alignable.js +12 -3
- package/Controls/Behaviors/Alignable.js.map +1 -1
- package/Controls/Behaviors/Animatable.d.ts +6 -0
- package/Controls/Behaviors/Animatable.d.ts.map +1 -1
- package/Controls/Behaviors/Animatable.js +12 -2
- package/Controls/Behaviors/Animatable.js.map +1 -1
- package/Controls/Behaviors/Appearanceable.d.ts +6 -0
- package/Controls/Behaviors/Appearanceable.d.ts.map +1 -1
- package/Controls/Behaviors/Appearanceable.js +10 -1
- package/Controls/Behaviors/Appearanceable.js.map +1 -1
- package/Controls/Behaviors/Attachable.d.ts +6 -0
- package/Controls/Behaviors/Attachable.d.ts.map +1 -1
- package/Controls/Behaviors/Attachable.js +10 -1
- package/Controls/Behaviors/Attachable.js.map +1 -1
- package/Controls/Behaviors/AutoCompleteable.d.ts +6 -0
- package/Controls/Behaviors/AutoCompleteable.d.ts.map +1 -1
- package/Controls/Behaviors/AutoCompleteable.js +25 -8
- package/Controls/Behaviors/AutoCompleteable.js.map +1 -1
- package/Controls/Behaviors/Boundable.d.ts +6 -0
- package/Controls/Behaviors/Boundable.d.ts.map +1 -1
- package/Controls/Behaviors/Boundable.js +12 -2
- package/Controls/Behaviors/Boundable.js.map +1 -1
- package/Controls/Behaviors/Busyable.d.ts +6 -0
- package/Controls/Behaviors/Busyable.d.ts.map +1 -1
- package/Controls/Behaviors/Busyable.js +10 -1
- package/Controls/Behaviors/Busyable.js.map +1 -1
- package/Controls/Behaviors/Checkable.d.ts +6 -0
- package/Controls/Behaviors/Checkable.d.ts.map +1 -1
- package/Controls/Behaviors/Checkable.js +10 -1
- package/Controls/Behaviors/Checkable.js.map +1 -1
- package/Controls/Behaviors/Clearable.d.ts +6 -0
- package/Controls/Behaviors/Clearable.d.ts.map +1 -1
- package/Controls/Behaviors/Clearable.js +10 -1
- package/Controls/Behaviors/Clearable.js.map +1 -1
- package/Controls/Behaviors/Closeable.d.ts +6 -0
- package/Controls/Behaviors/Closeable.d.ts.map +1 -1
- package/Controls/Behaviors/Closeable.js +10 -1
- package/Controls/Behaviors/Closeable.js.map +1 -1
- package/Controls/Behaviors/ContentAlignable.d.ts +6 -0
- package/Controls/Behaviors/ContentAlignable.d.ts.map +1 -1
- package/Controls/Behaviors/ContentAlignable.js +12 -2
- package/Controls/Behaviors/ContentAlignable.js.map +1 -1
- package/Controls/Behaviors/Dimensionable.d.ts +6 -0
- package/Controls/Behaviors/Dimensionable.d.ts.map +1 -1
- package/Controls/Behaviors/Dimensionable.js +12 -2
- package/Controls/Behaviors/Dimensionable.js.map +1 -1
- package/Controls/Behaviors/Disableable.d.ts +6 -0
- package/Controls/Behaviors/Disableable.d.ts.map +1 -1
- package/Controls/Behaviors/Disableable.js +10 -1
- package/Controls/Behaviors/Disableable.js.map +1 -1
- package/Controls/Behaviors/DropDownable.d.ts +6 -0
- package/Controls/Behaviors/DropDownable.d.ts.map +1 -1
- package/Controls/Behaviors/DropDownable.js +22 -7
- package/Controls/Behaviors/DropDownable.js.map +1 -1
- package/Controls/Behaviors/Elevatable.d.ts +6 -0
- package/Controls/Behaviors/Elevatable.d.ts.map +1 -1
- package/Controls/Behaviors/Elevatable.js +10 -1
- package/Controls/Behaviors/Elevatable.js.map +1 -1
- package/Controls/Behaviors/Filterable.d.ts +6 -0
- package/Controls/Behaviors/Filterable.d.ts.map +1 -1
- package/Controls/Behaviors/Filterable.js +16 -4
- package/Controls/Behaviors/Filterable.js.map +1 -1
- package/Controls/Behaviors/Fitable.d.ts +6 -0
- package/Controls/Behaviors/Fitable.d.ts.map +1 -1
- package/Controls/Behaviors/Fitable.js +10 -1
- package/Controls/Behaviors/Fitable.js.map +1 -1
- package/Controls/Behaviors/Focusable.d.ts +6 -0
- package/Controls/Behaviors/Focusable.d.ts.map +1 -1
- package/Controls/Behaviors/Focusable.js +10 -1
- package/Controls/Behaviors/Focusable.js.map +1 -1
- package/Controls/Behaviors/FormAssociatable.d.ts +6 -0
- package/Controls/Behaviors/FormAssociatable.d.ts.map +1 -1
- package/Controls/Behaviors/FormAssociatable.js +10 -1
- package/Controls/Behaviors/FormAssociatable.js.map +1 -1
- package/Controls/Behaviors/Gapable.d.ts +6 -0
- package/Controls/Behaviors/Gapable.d.ts.map +1 -1
- package/Controls/Behaviors/Gapable.js +10 -1
- package/Controls/Behaviors/Gapable.js.map +1 -1
- package/Controls/Behaviors/Iconable.d.ts +6 -0
- package/Controls/Behaviors/Iconable.d.ts.map +1 -1
- package/Controls/Behaviors/Iconable.js +14 -3
- package/Controls/Behaviors/Iconable.js.map +1 -1
- package/Controls/Behaviors/Insetable.d.ts +6 -0
- package/Controls/Behaviors/Insetable.d.ts.map +1 -1
- package/Controls/Behaviors/Insetable.js +10 -1
- package/Controls/Behaviors/Insetable.js.map +1 -1
- package/Controls/Behaviors/Invalidable.d.ts +6 -0
- package/Controls/Behaviors/Invalidable.d.ts.map +1 -1
- package/Controls/Behaviors/Invalidable.js +10 -1
- package/Controls/Behaviors/Invalidable.js.map +1 -1
- package/Controls/Behaviors/Labelable.d.ts +6 -0
- package/Controls/Behaviors/Labelable.d.ts.map +1 -1
- package/Controls/Behaviors/Labelable.js +10 -1
- package/Controls/Behaviors/Labelable.js.map +1 -1
- package/Controls/Behaviors/Localeable.d.ts +6 -0
- package/Controls/Behaviors/Localeable.d.ts.map +1 -1
- package/Controls/Behaviors/Localeable.js +10 -1
- package/Controls/Behaviors/Localeable.js.map +1 -1
- package/Controls/Behaviors/Orientable.d.ts +6 -0
- package/Controls/Behaviors/Orientable.d.ts.map +1 -1
- package/Controls/Behaviors/Orientable.js +10 -1
- package/Controls/Behaviors/Orientable.js.map +1 -1
- package/Controls/Behaviors/Reversible.d.ts +6 -0
- package/Controls/Behaviors/Reversible.d.ts.map +1 -1
- package/Controls/Behaviors/Reversible.js +10 -1
- package/Controls/Behaviors/Reversible.js.map +1 -1
- package/Controls/Behaviors/Selectable.d.ts +6 -0
- package/Controls/Behaviors/Selectable.d.ts.map +1 -1
- package/Controls/Behaviors/Selectable.js +10 -1
- package/Controls/Behaviors/Selectable.js.map +1 -1
- package/Controls/Behaviors/Shortcutable.d.ts +6 -0
- package/Controls/Behaviors/Shortcutable.d.ts.map +1 -1
- package/Controls/Behaviors/Shortcutable.js +10 -1
- package/Controls/Behaviors/Shortcutable.js.map +1 -1
- package/Controls/Behaviors/Sizeable.d.ts +6 -0
- package/Controls/Behaviors/Sizeable.d.ts.map +1 -1
- package/Controls/Behaviors/Sizeable.js +10 -1
- package/Controls/Behaviors/Sizeable.js.map +1 -1
- package/Controls/Behaviors/Stickable.d.ts +6 -0
- package/Controls/Behaviors/Stickable.d.ts.map +1 -1
- package/Controls/Behaviors/Stickable.js +10 -1
- package/Controls/Behaviors/Stickable.js.map +1 -1
- package/Controls/Behaviors/TextFormattable.d.ts +6 -0
- package/Controls/Behaviors/TextFormattable.d.ts.map +1 -1
- package/Controls/Behaviors/TextFormattable.js +10 -1
- package/Controls/Behaviors/TextFormattable.js.map +1 -1
- package/Controls/Behaviors/TextOverflowable.d.ts +6 -0
- package/Controls/Behaviors/TextOverflowable.d.ts.map +1 -1
- package/Controls/Behaviors/TextOverflowable.js +10 -1
- package/Controls/Behaviors/TextOverflowable.js.map +1 -1
- package/Controls/Behaviors/Themeable.d.ts +6 -0
- package/Controls/Behaviors/Themeable.d.ts.map +1 -1
- package/Controls/Behaviors/Themeable.js +13 -4
- package/Controls/Behaviors/Themeable.js.map +1 -1
- package/Controls/Behaviors/Valueable.d.ts +6 -0
- package/Controls/Behaviors/Valueable.d.ts.map +1 -1
- package/Controls/Behaviors/Valueable.js +10 -1
- package/Controls/Behaviors/Valueable.js.map +1 -1
- package/Controls/Behaviors/Variantable.d.ts +6 -0
- package/Controls/Behaviors/Variantable.d.ts.map +1 -1
- package/Controls/Behaviors/Variantable.js +10 -1
- package/Controls/Behaviors/Variantable.js.map +1 -1
- package/Controls/Components/Charts/ChartElement.js +1 -1
- package/Controls/Components/Charts/ChartElement.js.map +1 -1
- package/Index.d.ts +32 -59
- package/Index.d.ts.map +1 -1
- package/Index.js +30 -29
- package/Index.js.map +1 -1
- package/Routing/PathToRegexp.d.ts +1 -1
- package/Theming/IThemeApplicator.d.ts +100 -0
- package/Theming/IThemeApplicator.d.ts.map +1 -0
- package/Theming/IThemeApplicator.js +3 -0
- package/Theming/IThemeApplicator.js.map +1 -0
- package/Theming/IThemeService.d.ts +256 -0
- package/Theming/IThemeService.d.ts.map +1 -0
- package/Theming/IThemeService.js +11 -0
- package/Theming/IThemeService.js.map +1 -0
- package/Theming/Theme.d.ts +37 -7
- package/Theming/Theme.d.ts.map +1 -1
- package/Theming/Theme.js +42 -48
- package/Theming/Theme.js.map +1 -1
- package/Theming/Theme2Element.d.ts +6 -21
- package/Theming/Theme2Element.d.ts.map +1 -1
- package/Theming/Theme2Element.js +38 -123
- package/Theming/Theme2Element.js.map +1 -1
- package/Theming/ThemeApplicator.d.ts +178 -0
- package/Theming/ThemeApplicator.d.ts.map +1 -0
- package/Theming/ThemeApplicator.js +366 -0
- package/Theming/ThemeApplicator.js.map +1 -0
- package/Theming/ThemeService.d.ts +300 -0
- package/Theming/ThemeService.d.ts.map +1 -0
- package/Theming/ThemeService.js +581 -0
- package/Theming/ThemeService.js.map +1 -0
- package/custom-elements.json +0 -310
- package/package.json +3 -3
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
import type { ITheme, ThemeMode, ThemeScheme, ThemeSemantic } from '@breadstone/mosaik-themes';
|
|
2
|
+
import type { IEventEmitter, IEventDetail } from '@breadstone/mosaik-elements';
|
|
3
|
+
/**
|
|
4
|
+
* Represents a provider that can supply theme information.
|
|
5
|
+
* This abstraction allows ThemeService to work with theme providers
|
|
6
|
+
* without knowing their concrete implementation (e.g., Theme2Element).
|
|
7
|
+
*
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
export interface IThemeProvider {
|
|
11
|
+
/**
|
|
12
|
+
* Gets the current theme from this provider.
|
|
13
|
+
*/
|
|
14
|
+
readonly theme: ITheme | null;
|
|
15
|
+
/**
|
|
16
|
+
* Applies the complete theme.
|
|
17
|
+
*
|
|
18
|
+
* @param theme - The theme to apply.
|
|
19
|
+
*/
|
|
20
|
+
applyTheme(theme: ITheme): void;
|
|
21
|
+
/**
|
|
22
|
+
* Applies the scheme (light/dark mode color roles) from the theme.
|
|
23
|
+
*
|
|
24
|
+
* @param scheme - The scheme to apply.
|
|
25
|
+
*/
|
|
26
|
+
applyScheme(scheme: ITheme['scheme']): void;
|
|
27
|
+
/**
|
|
28
|
+
* Applies the color palette from the theme.
|
|
29
|
+
*
|
|
30
|
+
* @param palette - The palette to apply.
|
|
31
|
+
*/
|
|
32
|
+
applyPalette(palette: ITheme['palette']): void;
|
|
33
|
+
/**
|
|
34
|
+
* Applies the font family from the theme.
|
|
35
|
+
*
|
|
36
|
+
* @param fontFamily - The font family to apply.
|
|
37
|
+
*/
|
|
38
|
+
applyFontFamily(fontFamily: ITheme['fontFamily']): void;
|
|
39
|
+
/**
|
|
40
|
+
* Applies the typography settings from the theme.
|
|
41
|
+
*
|
|
42
|
+
* @param typography - The typography to apply.
|
|
43
|
+
*/
|
|
44
|
+
applyTypography(typography: ITheme['typography']): void;
|
|
45
|
+
/**
|
|
46
|
+
* Applies the layout settings from the theme.
|
|
47
|
+
*
|
|
48
|
+
* @param layout - The layout to apply.
|
|
49
|
+
*/
|
|
50
|
+
applyLayout(layout: ITheme['layout']): void;
|
|
51
|
+
/**
|
|
52
|
+
* Applies the elevation (shadow) settings from the theme.
|
|
53
|
+
*
|
|
54
|
+
* @param elevation - The elevation to apply.
|
|
55
|
+
*/
|
|
56
|
+
applyElevation(elevation: ITheme['elevation']): void;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Represents the event detail for theme-related events.
|
|
60
|
+
*
|
|
61
|
+
* @public
|
|
62
|
+
*/
|
|
63
|
+
export interface IThemeEventDetail extends IEventDetail {
|
|
64
|
+
readonly theme?: ITheme;
|
|
65
|
+
readonly scheme?: ITheme['scheme'] | Partial<ThemeScheme>;
|
|
66
|
+
readonly palette?: ITheme['palette'] | Partial<ThemeSemantic>;
|
|
67
|
+
readonly mode?: ThemeMode;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Represents the options for setting a CSS variable.
|
|
71
|
+
*
|
|
72
|
+
* @public
|
|
73
|
+
*/
|
|
74
|
+
export interface ISetCssVariableOptions {
|
|
75
|
+
/**
|
|
76
|
+
* The target element to set the CSS variable on.
|
|
77
|
+
* If not provided, only global styles will be applied.
|
|
78
|
+
*/
|
|
79
|
+
readonly element?: HTMLElement;
|
|
80
|
+
/**
|
|
81
|
+
* Whether to apply the variable globally to the document.
|
|
82
|
+
* @default true
|
|
83
|
+
*/
|
|
84
|
+
readonly applyGlobally?: boolean;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Represents the configuration options for the `{@link ThemeService}`.
|
|
88
|
+
*
|
|
89
|
+
* @public
|
|
90
|
+
*/
|
|
91
|
+
export interface IThemeServiceConfig {
|
|
92
|
+
/**
|
|
93
|
+
* The unique ID for the global style element.
|
|
94
|
+
* @default 'mosaik-theme-vars'
|
|
95
|
+
*/
|
|
96
|
+
readonly styleId?: string;
|
|
97
|
+
/**
|
|
98
|
+
* Whether to automatically initialize the service on first access.
|
|
99
|
+
* @default true
|
|
100
|
+
*/
|
|
101
|
+
readonly autoInitialize?: boolean;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* The default configuration for the `{@link ThemeService}`.
|
|
105
|
+
*
|
|
106
|
+
* @public
|
|
107
|
+
*/
|
|
108
|
+
export declare const THEME_SERVICE_DEFAULT_CONFIG: Required<IThemeServiceConfig>;
|
|
109
|
+
/**
|
|
110
|
+
* Represents the `{@link IThemeService}` interface.
|
|
111
|
+
* Provides methods for applying theme-related CSS variables to the document.
|
|
112
|
+
*
|
|
113
|
+
* @public
|
|
114
|
+
*/
|
|
115
|
+
export interface IThemeService {
|
|
116
|
+
/**
|
|
117
|
+
* Gets whether the service has been initialized.
|
|
118
|
+
*/
|
|
119
|
+
readonly isInitialized: boolean;
|
|
120
|
+
/**
|
|
121
|
+
* Gets the currently applied theme, if any.
|
|
122
|
+
*/
|
|
123
|
+
readonly currentTheme: ITheme | null;
|
|
124
|
+
/**
|
|
125
|
+
* Event emitter that fires when the theme changes.
|
|
126
|
+
*/
|
|
127
|
+
readonly themeChanged: IEventEmitter<IThemeEventDetail>;
|
|
128
|
+
/**
|
|
129
|
+
* Event emitter that fires when the scheme changes.
|
|
130
|
+
*/
|
|
131
|
+
readonly schemeChanged: IEventEmitter<IThemeEventDetail>;
|
|
132
|
+
/**
|
|
133
|
+
* Event emitter that fires when the palette changes.
|
|
134
|
+
*/
|
|
135
|
+
readonly paletteChanged: IEventEmitter<IThemeEventDetail>;
|
|
136
|
+
/**
|
|
137
|
+
* Initializes the service.
|
|
138
|
+
* Must be called before applying any theme properties (unless autoInitialize is enabled).
|
|
139
|
+
*/
|
|
140
|
+
initialize(): void;
|
|
141
|
+
/**
|
|
142
|
+
* Disposes of the service and cleans up resources.
|
|
143
|
+
*/
|
|
144
|
+
dispose(): void;
|
|
145
|
+
/**
|
|
146
|
+
* Registers a theme provider with the service.
|
|
147
|
+
*
|
|
148
|
+
* @param provider - The theme provider to register.
|
|
149
|
+
*/
|
|
150
|
+
registerProvider(provider: IThemeProvider): void;
|
|
151
|
+
/**
|
|
152
|
+
* Unregisters a theme provider from the service.
|
|
153
|
+
*
|
|
154
|
+
* @param provider - The theme provider to unregister.
|
|
155
|
+
*/
|
|
156
|
+
unregisterProvider(provider: IThemeProvider): void;
|
|
157
|
+
/**
|
|
158
|
+
* Gets the current theme from the first registered provider.
|
|
159
|
+
*
|
|
160
|
+
* @returns The current theme.
|
|
161
|
+
* @throws Error if no theme is set.
|
|
162
|
+
*/
|
|
163
|
+
getTheme(): ITheme;
|
|
164
|
+
/**
|
|
165
|
+
* Gets the current theme name from the document element.
|
|
166
|
+
*
|
|
167
|
+
* @returns The current theme name or `null` if not set.
|
|
168
|
+
*/
|
|
169
|
+
getDocumentTheme(): string | null;
|
|
170
|
+
/**
|
|
171
|
+
* Gets the current theme mode from the document element.
|
|
172
|
+
*
|
|
173
|
+
* @returns The current theme mode or `null` if not set.
|
|
174
|
+
*/
|
|
175
|
+
getDocumentThemeMode(): ThemeMode | null;
|
|
176
|
+
/**
|
|
177
|
+
* Applies the complete theme to all registered providers.
|
|
178
|
+
*
|
|
179
|
+
* @param theme - The theme to apply.
|
|
180
|
+
*/
|
|
181
|
+
applyTheme(theme: ITheme): void;
|
|
182
|
+
/**
|
|
183
|
+
* Applies the scheme (light/dark mode color roles) from the theme.
|
|
184
|
+
*
|
|
185
|
+
* @param scheme - The scheme to apply.
|
|
186
|
+
* @param themeName - The name of the theme for CSS variable prefixing.
|
|
187
|
+
*/
|
|
188
|
+
applyScheme(scheme: ITheme['scheme'], themeName: string): void;
|
|
189
|
+
/**
|
|
190
|
+
* Applies the color palette from the theme.
|
|
191
|
+
*
|
|
192
|
+
* @param palette - The palette to apply.
|
|
193
|
+
* @param themeName - The name of the theme for CSS variable prefixing.
|
|
194
|
+
*/
|
|
195
|
+
applyPalette(palette: ITheme['palette'], themeName: string): void;
|
|
196
|
+
/**
|
|
197
|
+
* Applies the font family from the theme.
|
|
198
|
+
*
|
|
199
|
+
* @param fontFamily - The font family to apply.
|
|
200
|
+
* @param themeName - The name of the theme for CSS variable prefixing.
|
|
201
|
+
* @param typographyKeys - The typography keys to apply the font family to.
|
|
202
|
+
*/
|
|
203
|
+
applyFontFamily(fontFamily: ITheme['fontFamily'], themeName: string, typographyKeys: Array<string>): void;
|
|
204
|
+
/**
|
|
205
|
+
* Applies the typography settings from the theme.
|
|
206
|
+
*
|
|
207
|
+
* @param typography - The typography settings to apply.
|
|
208
|
+
* @param themeName - The name of the theme for CSS variable prefixing.
|
|
209
|
+
* @param fontFamily - The font family to use in shorthand typography values.
|
|
210
|
+
*/
|
|
211
|
+
applyTypography(typography: ITheme['typography'], themeName: string, fontFamily: string): void;
|
|
212
|
+
/**
|
|
213
|
+
* Applies the layout settings from the theme.
|
|
214
|
+
*
|
|
215
|
+
* @param layout - The layout settings to apply.
|
|
216
|
+
* @param themeName - The name of the theme for CSS variable prefixing.
|
|
217
|
+
*/
|
|
218
|
+
applyLayout(layout: ITheme['layout'], themeName: string): void;
|
|
219
|
+
/**
|
|
220
|
+
* Applies the elevation (shadow) settings from the theme.
|
|
221
|
+
*
|
|
222
|
+
* @param elevation - The elevation settings to apply.
|
|
223
|
+
* @param themeName - The name of the theme for CSS variable prefixing.
|
|
224
|
+
*/
|
|
225
|
+
applyElevation(elevation: ITheme['elevation'], themeName: string): void;
|
|
226
|
+
/**
|
|
227
|
+
* Replaces the scheme with the specified key.
|
|
228
|
+
* This is useful when you want to replace a specific scheme in the theme.
|
|
229
|
+
*
|
|
230
|
+
* @param mode - The theme mode to replace.
|
|
231
|
+
* @param scheme - The scheme color roles to replace.
|
|
232
|
+
*/
|
|
233
|
+
replaceScheme(mode: ThemeMode, scheme: Partial<ThemeScheme>): void;
|
|
234
|
+
/**
|
|
235
|
+
* Replaces the palette with the specified key.
|
|
236
|
+
* This is useful when you want to replace a specific palette in the theme.
|
|
237
|
+
*
|
|
238
|
+
* @param mode - The theme mode to replace.
|
|
239
|
+
* @param semantic - The semantic color roles to replace.
|
|
240
|
+
*/
|
|
241
|
+
replacePalette(mode: ThemeMode, semantic: Partial<ThemeSemantic>): void;
|
|
242
|
+
/**
|
|
243
|
+
* Sets a CSS variable.
|
|
244
|
+
*
|
|
245
|
+
* @param property - The CSS variable name (e.g., `--my-var`).
|
|
246
|
+
* @param value - The value to set.
|
|
247
|
+
* @param options - Optional settings for where to apply the variable.
|
|
248
|
+
*/
|
|
249
|
+
setCssVariable(property: string, value: string, options?: ISetCssVariableOptions): void;
|
|
250
|
+
/**
|
|
251
|
+
* Gets the current theme mode from the document.
|
|
252
|
+
*
|
|
253
|
+
* @returns The current theme mode ('light' or 'dark').\n */
|
|
254
|
+
getCurrentThemeMode(): 'light' | 'dark';
|
|
255
|
+
}
|
|
256
|
+
//# sourceMappingURL=IThemeService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IThemeService.d.ts","sourceRoot":"","sources":["../../src/Theming/IThemeService.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/F,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAI/E;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAE3B;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAE9B;;;;OAIG;IACH,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAEhC;;;;OAIG;IACH,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;IAE5C;;;;OAIG;IACH,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC;IAE/C;;;;OAIG;IACH,eAAe,CAAC,UAAU,EAAE,MAAM,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC;IAExD;;;;OAIG;IACH,eAAe,CAAC,UAAU,EAAE,MAAM,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC;IAExD;;;;OAIG;IACH,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;IAE5C;;;;OAIG;IACH,cAAc,CAAC,SAAS,EAAE,MAAM,CAAC,WAAW,C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AAI,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC;IAEnE;;;;;;OAMG;IACH,cAAc,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC;IAExE;;;;;;OAMG;IACH,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,sBAAsB,GAAG,IAAI,CAAC;IAExF;;;oEAGgE;IAChE,mBAAmB,IAAI,OAAO,GAAG,MAAM,CAAC;CAE3C"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// #region Imports
|
|
2
|
+
/**
|
|
3
|
+
* The default configuration for the `{@link ThemeService}`.
|
|
4
|
+
*
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export const THEME_SERVICE_DEFAULT_CONFIG = {
|
|
8
|
+
styleId: 'mosaik-theme-vars',
|
|
9
|
+
autoInitialize: true
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=IThemeService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IThemeService.js","sourceRoot":"","sources":["../../src/Theming/IThemeService.ts"],"names":[],"mappings":"AAAA,kBAAkB;AA8HlB;;;;GAIG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAkC;IACvE,OAAO,EAAE,mBAAmB;IAC5B,cAAc,EAAE,IAAI;CACvB,CAAC"}
|
package/Theming/Theme.d.ts
CHANGED
|
@@ -1,57 +1,67 @@
|
|
|
1
1
|
import type { ITheme, ThemeMode, ThemeScheme, ThemeSemantic } from '@breadstone/mosaik-themes';
|
|
2
2
|
import type { Theme2Element } from './Theme2Element';
|
|
3
|
-
import {
|
|
3
|
+
import type { IEventEmitter, IEventDetail } from '@breadstone/mosaik-elements';
|
|
4
|
+
import type { IThemeEventDetail } from './IThemeService';
|
|
4
5
|
/**
|
|
5
6
|
* The `Theme` class.
|
|
6
7
|
*
|
|
8
|
+
* @deprecated Use {@link ThemeService.instance} instead. This class is maintained for backwards compatibility only.
|
|
7
9
|
* @public
|
|
8
10
|
*/
|
|
9
11
|
export declare class Theme {
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated Use {@link ThemeService.instance.registerProvider} instead.
|
|
14
|
+
*/
|
|
10
15
|
private static readonly _themeElements;
|
|
11
|
-
private readonly _themeChanged;
|
|
12
|
-
private readonly _schemeChanged;
|
|
13
|
-
private readonly _paletteChanged;
|
|
14
16
|
/**
|
|
15
17
|
* Constructs a new instance of the `Theme` class.
|
|
16
18
|
*
|
|
19
|
+
* @deprecated Use {@link ThemeService.instance} instead.
|
|
17
20
|
* @public
|
|
18
21
|
*/
|
|
19
22
|
constructor();
|
|
20
23
|
/**
|
|
24
|
+
* @deprecated Use {@link ThemeService.instance.themeChanged} instead.
|
|
21
25
|
* @public
|
|
22
26
|
* @readonly
|
|
23
27
|
* @eventProperty
|
|
24
28
|
*/
|
|
25
|
-
get themeChanged(): IEventEmitter<IEventDetail>;
|
|
29
|
+
get themeChanged(): IEventEmitter<IEventDetail | IThemeEventDetail>;
|
|
26
30
|
/**
|
|
31
|
+
* @deprecated Use {@link ThemeService.instance.schemeChanged} instead.
|
|
27
32
|
* @public
|
|
28
33
|
* @readonly
|
|
29
34
|
* @eventProperty
|
|
30
35
|
*/
|
|
31
|
-
get schemeChanged(): IEventEmitter<IEventDetail>;
|
|
36
|
+
get schemeChanged(): IEventEmitter<IEventDetail | IThemeEventDetail>;
|
|
32
37
|
/**
|
|
38
|
+
* @deprecated Use {@link ThemeService.instance.paletteChanged} instead.
|
|
33
39
|
* @public
|
|
34
40
|
* @readonly
|
|
35
41
|
* @eventProperty
|
|
36
42
|
*/
|
|
37
|
-
get paletteChanged(): IEventEmitter<IEventDetail>;
|
|
43
|
+
get paletteChanged(): IEventEmitter<IEventDetail | IThemeEventDetail>;
|
|
38
44
|
/**
|
|
45
|
+
* @deprecated Use {@link ThemeService.instance.registerProvider} instead.
|
|
39
46
|
* @public
|
|
40
47
|
* @static
|
|
41
48
|
*/
|
|
42
49
|
static register(element: Theme2Element): void;
|
|
43
50
|
/**
|
|
51
|
+
* @deprecated Use {@link ThemeService.instance.unregisterProvider} instead.
|
|
44
52
|
* @public
|
|
45
53
|
* @static
|
|
46
54
|
*/
|
|
47
55
|
static unregister(element: Theme2Element): void;
|
|
48
56
|
/**
|
|
57
|
+
* @deprecated Use {@link ThemeService.instance.getTheme} instead.
|
|
49
58
|
* @public
|
|
50
59
|
*/
|
|
51
60
|
getTheme(): ITheme;
|
|
52
61
|
/**
|
|
53
62
|
* Gets the current theme name from the document element.
|
|
54
63
|
*
|
|
64
|
+
* @deprecated Use {@link ThemeService.instance.getDocumentTheme} instead.
|
|
55
65
|
* @public
|
|
56
66
|
* @returns The current theme name or `null` if not set.
|
|
57
67
|
*/
|
|
@@ -59,6 +69,7 @@ export declare class Theme {
|
|
|
59
69
|
/**
|
|
60
70
|
* Gets the current theme mode from the document element.
|
|
61
71
|
*
|
|
72
|
+
* @deprecated Use {@link ThemeService.instance.getDocumentThemeMode} instead.
|
|
62
73
|
* @public
|
|
63
74
|
* @returns The current theme mode or `null` if not set.
|
|
64
75
|
*/
|
|
@@ -66,6 +77,7 @@ export declare class Theme {
|
|
|
66
77
|
/**
|
|
67
78
|
* Applies the specified theme.
|
|
68
79
|
*
|
|
80
|
+
* @deprecated Use {@link ThemeService.instance.applyTheme} instead.
|
|
69
81
|
* @public
|
|
70
82
|
* @param theme The theme to apply.
|
|
71
83
|
*/
|
|
@@ -73,6 +85,7 @@ export declare class Theme {
|
|
|
73
85
|
/**
|
|
74
86
|
* Applies the specified scheme.
|
|
75
87
|
*
|
|
88
|
+
* @deprecated Use {@link ThemeService.instance.applyScheme} instead.
|
|
76
89
|
* @public
|
|
77
90
|
* @param scheme The scheme to apply.
|
|
78
91
|
*/
|
|
@@ -80,6 +93,7 @@ export declare class Theme {
|
|
|
80
93
|
/**
|
|
81
94
|
* Applies the specified palette.
|
|
82
95
|
*
|
|
96
|
+
* @deprecated Use {@link ThemeService.instance.applyPalette} instead.
|
|
83
97
|
* @public
|
|
84
98
|
* @param palette The palette to apply.
|
|
85
99
|
*/
|
|
@@ -87,6 +101,7 @@ export declare class Theme {
|
|
|
87
101
|
/**
|
|
88
102
|
* Applies the specified font family.
|
|
89
103
|
*
|
|
104
|
+
* @deprecated Use {@link ThemeService.instance.applyFontFamily} instead.
|
|
90
105
|
* @public
|
|
91
106
|
* @param fontFamily The font family to apply.
|
|
92
107
|
*/
|
|
@@ -94,6 +109,7 @@ export declare class Theme {
|
|
|
94
109
|
/**
|
|
95
110
|
* Applies the specified typography.
|
|
96
111
|
*
|
|
112
|
+
* @deprecated Use {@link ThemeService.instance.applyTypography} instead.
|
|
97
113
|
* @public
|
|
98
114
|
* @param typography The typography to apply.
|
|
99
115
|
*/
|
|
@@ -101,6 +117,7 @@ export declare class Theme {
|
|
|
101
117
|
/**
|
|
102
118
|
* Applies the specified layout.
|
|
103
119
|
*
|
|
120
|
+
* @deprecated Use {@link ThemeService.instance.applyLayout} instead.
|
|
104
121
|
* @public
|
|
105
122
|
* @param layout The layout to apply.
|
|
106
123
|
*/
|
|
@@ -108,6 +125,7 @@ export declare class Theme {
|
|
|
108
125
|
/**
|
|
109
126
|
* Applies the specified elevation.
|
|
110
127
|
*
|
|
128
|
+
* @deprecated Use {@link ThemeService.instance.applyElevation} instead.
|
|
111
129
|
* @public
|
|
112
130
|
* @param elevation The elevation to apply.
|
|
113
131
|
*/
|
|
@@ -116,6 +134,7 @@ export declare class Theme {
|
|
|
116
134
|
* Replaces the scheme with the specified key.
|
|
117
135
|
* This is useful when you want to replace a specific scheme in the theme.
|
|
118
136
|
*
|
|
137
|
+
* @deprecated Use {@link ThemeService.instance.replaceScheme} instead.
|
|
119
138
|
* @public
|
|
120
139
|
* @param mode The theme mode to replace.
|
|
121
140
|
* @param scheme The scheme color roles to replace.
|
|
@@ -125,6 +144,7 @@ export declare class Theme {
|
|
|
125
144
|
* Replaces the palette with the specified key.
|
|
126
145
|
* This is useful when you want to replace a specific palette in the theme.
|
|
127
146
|
*
|
|
147
|
+
* @deprecated Use {@link ThemeService.instance.replacePalette} instead.
|
|
128
148
|
* @public
|
|
129
149
|
* @param mode The theme mode to replace.
|
|
130
150
|
* @param semantic The semantic color roles to replace.
|
|
@@ -132,12 +152,22 @@ export declare class Theme {
|
|
|
132
152
|
replacePalette(mode: ThemeMode, semantic: Partial<ThemeSemantic>): void;
|
|
133
153
|
}
|
|
134
154
|
/**
|
|
155
|
+
* @deprecated Use {@link ThemeService.instance} instead. This class is maintained for backwards compatibility only.
|
|
135
156
|
* @public
|
|
136
157
|
*/
|
|
137
158
|
export declare class ThemeServiceLocator {
|
|
138
159
|
private static _current;
|
|
160
|
+
/**
|
|
161
|
+
* @deprecated Use {@link ThemeService.instance} instead.
|
|
162
|
+
*/
|
|
139
163
|
static get current(): Theme;
|
|
164
|
+
/**
|
|
165
|
+
* @deprecated Use {@link ThemeService.instance} instead.
|
|
166
|
+
*/
|
|
140
167
|
static isSet(): boolean;
|
|
168
|
+
/**
|
|
169
|
+
* @deprecated Use {@link ThemeService.instance} instead.
|
|
170
|
+
*/
|
|
141
171
|
static set(current: Theme): void;
|
|
142
172
|
}
|
|
143
173
|
//# sourceMappingURL=Theme.d.ts.map
|
package/Theming/Theme.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Theme.d.ts","sourceRoot":"","sources":["../../src/Theming/Theme.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"Theme.d.ts","sourceRoot":"","sources":["../../src/Theming/Theme.ts"],"names":[],"mappings":"AAGA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