@breadstone/mosaik-elements-foundation 0.0.221 → 0.0.222

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.
Files changed (111) hide show
  1. package/Controls/Behaviors/Themeable.js +2 -2
  2. package/Controls/Behaviors/Themeable.js.map +1 -1
  3. package/Controls/Components/Buttons/Button/Themes/ButtonElement.Cosmopolitan.js +26 -26
  4. package/Controls/Components/Buttons/Button/Themes/ButtonElement.Joy.js +27 -27
  5. package/Controls/Components/Buttons/Button/Themes/ButtonElement.Memphis.js +26 -26
  6. package/Controls/Components/Buttons/CompoundButton/Themes/CompoundButtonElement.Cosmopolitan.js +8 -8
  7. package/Controls/Components/Buttons/CompoundButton/Themes/CompoundButtonElement.Joy.js +10 -10
  8. package/Controls/Components/Buttons/CompoundButton/Themes/CompoundButtonElement.Memphis.js +9 -9
  9. package/Controls/Components/Buttons/DropDownButton/Themes/DropDownButtonElement.Cosmopolitan.js +9 -9
  10. package/Controls/Components/Buttons/DropDownButton/Themes/DropDownButtonElement.Joy.js +10 -10
  11. package/Controls/Components/Buttons/DropDownButton/Themes/DropDownButtonElement.Memphis.js +8 -8
  12. package/Controls/Components/Buttons/FloatingActionButton/Themes/FloatingActionButtonElement.Cosmopolitan.js +8 -8
  13. package/Controls/Components/Buttons/FloatingActionButton/Themes/FloatingActionButtonElement.Joy.js +9 -9
  14. package/Controls/Components/Buttons/FloatingActionButton/Themes/FloatingActionButtonElement.Memphis.js +32 -32
  15. package/Controls/Components/Buttons/RepeatButton/Themes/RepeatButtonElement.Cosmopolitan.js +8 -8
  16. package/Controls/Components/Buttons/RepeatButton/Themes/RepeatButtonElement.Joy.js +10 -10
  17. package/Controls/Components/Buttons/RepeatButton/Themes/RepeatButtonElement.Memphis.js +9 -9
  18. package/Controls/Components/Buttons/SplitButton/Themes/SplitButtonElement.Cosmopolitan.js +8 -8
  19. package/Controls/Components/Buttons/SplitButton/Themes/SplitButtonElement.Joy.js +12 -12
  20. package/Controls/Components/Buttons/SplitButton/Themes/SplitButtonElement.Memphis.js +9 -9
  21. package/Controls/Components/Buttons/ToggleButton/Themes/ToggleButtonElement.Cosmopolitan.js +9 -9
  22. package/Controls/Components/Buttons/ToggleButton/Themes/ToggleButtonElement.Joy.js +10 -10
  23. package/Controls/Components/Buttons/ToggleButton/Themes/ToggleButtonElement.Memphis.js +9 -9
  24. package/Controls/Components/Grouping/BannerGroup/Themes/BannerGroupElement.Cosmopolitan.js +1 -1
  25. package/Controls/Components/Grouping/BannerGroup/Themes/BannerGroupElement.Joy.js +1 -1
  26. package/Controls/Components/Grouping/BannerGroup/Themes/BannerGroupElement.Memphis.js +1 -1
  27. package/Controls/Components/Grouping/Expander/ExpanderGroupElement.d.ts +0 -3
  28. package/Controls/Components/Grouping/Expander/ExpanderGroupElement.d.ts.map +1 -1
  29. package/Controls/Components/Grouping/Expander/Themes/ExpanderElement.Cosmopolitan.d.ts.map +1 -1
  30. package/Controls/Components/Grouping/Expander/Themes/ExpanderElement.Cosmopolitan.js +0 -4
  31. package/Controls/Components/Grouping/Expander/Themes/ExpanderElement.Cosmopolitan.js.map +1 -1
  32. package/Controls/Components/Grouping/Expander/Themes/ExpanderElement.Joy.d.ts.map +1 -1
  33. package/Controls/Components/Grouping/Expander/Themes/ExpanderElement.Joy.js +0 -4
  34. package/Controls/Components/Grouping/Expander/Themes/ExpanderElement.Joy.js.map +1 -1
  35. package/Controls/Components/Grouping/Expander/Themes/ExpanderElement.Memphis.d.ts.map +1 -1
  36. package/Controls/Components/Grouping/Expander/Themes/ExpanderElement.Memphis.js +0 -4
  37. package/Controls/Components/Grouping/Expander/Themes/ExpanderElement.Memphis.js.map +1 -1
  38. package/Controls/Components/Inputs/Calendar/Themes/CalendarSubHeaderElement.Cosmopolitan.js +1 -1
  39. package/Controls/Components/Inputs/Calendar/Themes/CalendarSubHeaderElement.Joy.js +1 -1
  40. package/Controls/Components/Inputs/Calendar/Themes/CalendarSubHeaderElement.Memphis.js +1 -1
  41. package/Controls/Components/Inputs/CheckBox/Themes/CheckBoxElement.Joy.js +1 -1
  42. package/Controls/Components/Inputs/Choice/Themes/ChoiceElement.Joy.js +1 -1
  43. package/Controls/Components/Inputs/Radio/Themes/RadioElement.Joy.js +1 -1
  44. package/Controls/Components/Inputs/Radio/Themes/RadioElement.Memphis.js +1 -1
  45. package/Controls/Components/Inputs/ToggleSwitch/Themes/ToggleSwitchElement.Joy.js +1 -1
  46. package/Controls/Components/Layouts/TileManager/Themes/TileManagerTileElement.Cosmopolitan.js +2 -2
  47. package/Controls/Components/Layouts/TileManager/Themes/TileManagerTileElement.Joy.js +2 -2
  48. package/Controls/Components/Layouts/TileManager/Themes/TileManagerTileElement.Memphis.js +2 -2
  49. package/Controls/Components/Media/Avatar/Themes/AvatarElement.Joy.js +3 -3
  50. package/Controls/Components/Media/Avatar/Themes/AvatarElement.Memphis.js +1 -1
  51. package/Controls/Components/Media/Badge/Themes/BadgeElement.Joy.js +4 -4
  52. package/Controls/Components/Media/Chat/Themes/ChatMessageAvatarElement.Joy.js +1 -1
  53. package/Controls/Components/Media/Chat/Themes/ChatMessageAvatarElement.Memphis.js +1 -1
  54. package/Controls/Components/Media/Chip/Themes/ChipElement.Joy.js +4 -4
  55. package/Controls/Components/Media/ColorSwatch/Themes/ColorSwatchElement.Cosmopolitan.js +4 -4
  56. package/Controls/Components/Media/ColorSwatch/Themes/ColorSwatchElement.Joy.js +4 -4
  57. package/Controls/Components/Media/ColorSwatch/Themes/ColorSwatchElement.Memphis.js +4 -4
  58. package/Controls/Components/Media/Persona/Themes/PersonaElement.Joy.js +1 -1
  59. package/Controls/Components/Overlays/Toast/Themes/ToastElement.Memphis.js +1 -1
  60. package/Controls/Components/Primitives/Floating/Themes/FloatingElement.Joy.js +1 -1
  61. package/Controls/Components/Primitives/Floating/Themes/FloatingElement.Memphis.js +1 -1
  62. package/Controls/Components/Primitives/Popup/Themes/PopupElement.Memphis.js +1 -1
  63. package/Controls/Components/Primitives/TickBar/Themes/TickBarElement.Cosmopolitan.js +5 -5
  64. package/Controls/Components/Primitives/TickBar/Themes/TickBarElement.Joy.js +5 -5
  65. package/Controls/Components/Primitives/TickBar/Themes/TickBarElement.Memphis.js +5 -5
  66. package/Controls/Components/Ranges/MeterRing/Themes/MeterRingElement.Cosmopolitan.js +2 -2
  67. package/Controls/Components/Ranges/MeterRing/Themes/MeterRingElement.Joy.js +2 -2
  68. package/Controls/Components/Ranges/MeterRing/Themes/MeterRingElement.Memphis.js +2 -2
  69. package/Controls/Components/Ranges/ProgressBar/Themes/ProgressBarElement.Joy.d.ts.map +1 -1
  70. package/Controls/Components/Ranges/ProgressBar/Themes/ProgressBarElement.Joy.js +7 -4
  71. package/Controls/Components/Ranges/ProgressBar/Themes/ProgressBarElement.Joy.js.map +1 -1
  72. package/Controls/Components/Ranges/ProgressRing/Themes/ProgressRingElement.Cosmopolitan.js +3 -3
  73. package/Controls/Components/Ranges/ProgressRing/Themes/ProgressRingElement.Joy.js +3 -3
  74. package/Controls/Components/Ranges/ProgressRing/Themes/ProgressRingElement.Memphis.js +3 -3
  75. package/Controls/Components/Ranges/ScrubSlider/Themes/ScrubSliderElement.Cosmopolitan.js +2 -2
  76. package/Controls/Components/Ranges/ScrubSlider/Themes/ScrubSliderElement.Joy.js +2 -2
  77. package/Controls/Components/Ranges/ScrubSlider/Themes/ScrubSliderElement.Memphis.js +2 -2
  78. package/Controls/Components/Selectors/ElectronicProgramGuide/Themes/EpgProgramElement.Joy.js +1 -1
  79. package/Controls/Components/Selectors/ElectronicProgramGuide/Themes/EpgProgramElement.Memphis.js +1 -1
  80. package/Controls/Components/Selectors/Menu/Themes/MenuItemElement.Cosmopolitan.js +1 -1
  81. package/Controls/Components/Selectors/Menu/Themes/MenuItemElement.Joy.js +1 -1
  82. package/Controls/Components/Selectors/Menu/Themes/MenuItemElement.Memphis.js +1 -1
  83. package/Controls/Components/Selectors/Segment/Themes/SegmentElement.Joy.js +1 -1
  84. package/Controls/Components/Selectors/Segment/Themes/SegmentElement.Memphis.js +1 -1
  85. package/Controls/Components/Selectors/Tab/Themes/TabElement.Cosmopolitan.js +1 -1
  86. package/Controls/Components/Selectors/Tab/Themes/TabElement.Joy.js +1 -1
  87. package/Controls/Components/Selectors/Tab/Themes/TabElement.Memphis.js +1 -1
  88. package/Controls/Components/Selectors/TabStrip/Themes/TabStripItemElement.Joy.js +1 -1
  89. package/Index.d.ts +1 -1
  90. package/Index.d.ts.map +1 -1
  91. package/Reactivity/Rx/Directives/AsyncDirective.d.ts +1 -1
  92. package/Routing/PathToRegexp.d.ts +1 -1
  93. package/Theming/IThemeElementProps.d.ts +16 -1
  94. package/Theming/IThemeElementProps.d.ts.map +1 -1
  95. package/Theming/IThemeService.d.ts +57 -154
  96. package/Theming/IThemeService.d.ts.map +1 -1
  97. package/Theming/IThemeService.js +3 -1
  98. package/Theming/IThemeService.js.map +1 -1
  99. package/Theming/Theme2Element.d.ts +76 -9
  100. package/Theming/Theme2Element.d.ts.map +1 -1
  101. package/Theming/Theme2Element.js +105 -54
  102. package/Theming/Theme2Element.js.map +1 -1
  103. package/Theming/Theme2ElementTemplate.d.ts +1 -1
  104. package/Theming/Theme2ElementTemplate.d.ts.map +1 -1
  105. package/Theming/Theme2ElementTemplate.js +1 -1
  106. package/Theming/Theme2ElementTemplate.js.map +1 -1
  107. package/Theming/ThemeService.d.ts +118 -67
  108. package/Theming/ThemeService.d.ts.map +1 -1
  109. package/Theming/ThemeService.js +453 -195
  110. package/Theming/ThemeService.js.map +1 -1
  111. package/package.json +3 -3
@@ -1,5 +1,5 @@
1
1
  import type { ITheme, ThemeMode, ThemeScheme, ThemeSemantic } from '@breadstone/mosaik-themes';
2
- import type { IEventEmitter, IEventDetail } from '@breadstone/mosaik-elements';
2
+ import type { IEventDetail } from '@breadstone/mosaik-elements';
3
3
  /**
4
4
  * Represents a provider that can supply theme information.
5
5
  * This abstraction allows ThemeService to work with theme providers
@@ -7,51 +7,71 @@ import type { IEventEmitter, IEventDetail } from '@breadstone/mosaik-elements';
7
7
  *
8
8
  * @public
9
9
  */
10
- export interface IThemeProvider {
10
+ export interface IThemeProvider extends HTMLElement {
11
+ /**
12
+ * Gets the optional theme name for scoped theme management.
13
+ * Providers with the same name share theme state.
14
+ * Providers without a name (null) share the global/default theme state.
15
+ */
16
+ readonly name: string | null;
11
17
  /**
12
18
  * Gets the current theme from this provider.
13
19
  */
14
20
  readonly theme: ITheme | null;
21
+ /**
22
+ * Gets whether this provider applies CSS variables globally to the document.
23
+ * When true, CSS variables are set both on this element and globally.
24
+ * When false (default), CSS variables are set only on this element.
25
+ */
26
+ readonly global: boolean;
15
27
  /**
16
28
  * Applies the complete theme.
29
+ * Called by ThemeService to update the provider's internal state.
30
+ * The provider should NOT set CSS variables - ThemeService handles that.
17
31
  *
18
- * @param theme - The theme to apply.
32
+ * @param theme The theme to apply.
19
33
  */
20
34
  applyTheme(theme: ITheme): void;
21
35
  /**
22
36
  * Applies the scheme (light/dark mode color roles) from the theme.
37
+ * Called by ThemeService to update the provider's internal state.
23
38
  *
24
- * @param scheme - The scheme to apply.
39
+ * @param scheme The scheme to apply.
25
40
  */
26
41
  applyScheme(scheme: ITheme['scheme']): void;
27
42
  /**
28
43
  * Applies the color palette from the theme.
44
+ * Called by ThemeService to update the provider's internal state.
29
45
  *
30
- * @param palette - The palette to apply.
46
+ * @param palette The palette to apply.
31
47
  */
32
48
  applyPalette(palette: ITheme['palette']): void;
33
49
  /**
34
50
  * Applies the font family from the theme.
51
+ * Called by ThemeService to update the provider's internal state.
35
52
  *
36
- * @param fontFamily - The font family to apply.
53
+ * @param fontFamily The font family to apply.
37
54
  */
38
55
  applyFontFamily(fontFamily: ITheme['fontFamily']): void;
39
56
  /**
40
57
  * Applies the typography settings from the theme.
58
+ * Called by ThemeService to update the provider's internal state.
41
59
  *
42
- * @param typography - The typography to apply.
60
+ * @param typography The typography to apply.
43
61
  */
44
62
  applyTypography(typography: ITheme['typography']): void;
45
63
  /**
46
64
  * Applies the layout settings from the theme.
65
+ * Called by ThemeService to update the provider's internal state.
47
66
  *
48
- * @param layout - The layout to apply.
67
+ * @param layout The layout to apply.
49
68
  */
50
69
  applyLayout(layout: ITheme['layout']): void;
51
70
  /**
52
71
  * Applies the elevation (shadow) settings from the theme.
72
+ * Called by ThemeService to update the provider's internal state.
53
73
  *
54
- * @param elevation - The elevation to apply.
74
+ * @param elevation The elevation to apply.
55
75
  */
56
76
  applyElevation(elevation: ITheme['elevation']): void;
57
77
  }
@@ -65,6 +85,7 @@ export interface IThemeEventDetail extends IEventDetail {
65
85
  readonly scheme?: ITheme['scheme'] | Partial<ThemeScheme>;
66
86
  readonly palette?: ITheme['palette'] | Partial<ThemeSemantic>;
67
87
  readonly mode?: ThemeMode;
88
+ readonly name?: string | null;
68
89
  }
69
90
  /**
70
91
  * Represents the options for setting a CSS variable.
@@ -84,173 +105,55 @@ export interface ISetCssVariableOptions {
84
105
  readonly applyGlobally?: boolean;
85
106
  }
86
107
  /**
87
- * Represents the configuration options for the `{@link ThemeService}`.
108
+ * Represents options for theme application methods.
88
109
  *
89
110
  * @public
90
111
  */
91
- export interface IThemeServiceConfig {
92
- /**
93
- * The unique ID for the global style element.
94
- * @default 'mosaik-theme-vars'
95
- */
96
- readonly styleId?: string;
112
+ export interface IThemeApplyOptions {
97
113
  /**
98
- * Whether to automatically initialize the service on first access.
114
+ * Whether to notify registered providers about the change.
115
+ * Set to false when the call originates from a provider to avoid infinite loops.
99
116
  * @default true
100
117
  */
101
- readonly autoInitialize?: boolean;
118
+ readonly notifyProviders?: boolean;
102
119
  }
103
120
  /**
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.
121
+ * Represents the configuration options for the `{@link ThemeService}`.
112
122
  *
113
123
  * @public
114
124
  */
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;
125
+ export interface IThemeServiceConfig {
219
126
  /**
220
- * Applies the elevation (shadow) settings from the theme.
127
+ * The unique ID for the global style element.
221
128
  *
222
- * @param elevation - The elevation settings to apply.
223
- * @param themeName - The name of the theme for CSS variable prefixing.
129
+ * @default 'mosaik-theme-vars'
224
130
  */
225
- applyElevation(elevation: ITheme['elevation'], themeName: string): void;
131
+ readonly styleId?: string;
226
132
  /**
227
- * Replaces the scheme with the specified key.
228
- * This is useful when you want to replace a specific scheme in the theme.
133
+ * Whether to automatically initialize the service on first access.
229
134
  *
230
- * @param mode - The theme mode to replace.
231
- * @param scheme - The scheme color roles to replace.
135
+ * @default true
232
136
  */
233
- replaceScheme(mode: ThemeMode, scheme: Partial<ThemeScheme>): void;
137
+ readonly autoInitialize?: boolean;
234
138
  /**
235
- * Replaces the palette with the specified key.
236
- * This is useful when you want to replace a specific palette in the theme.
139
+ * The default theme to use as a fallback when no theme is set.
140
+ * This is reflected on the document element as `theme` attribute.
237
141
  *
238
- * @param mode - The theme mode to replace.
239
- * @param semantic - The semantic color roles to replace.
142
+ * @default undefined
240
143
  */
241
- replacePalette(mode: ThemeMode, semantic: Partial<ThemeSemantic>): void;
144
+ readonly defaultTheme?: ITheme;
242
145
  /**
243
- * Sets a CSS variable.
146
+ * The default theme mode to apply during initialization.
147
+ * This is reflected on the document element as `theme-mode` attribute.
244
148
  *
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.
149
+ * @default 'light'
248
150
  */
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';
151
+ readonly defaultThemeMode?: ThemeMode;
255
152
  }
153
+ /**
154
+ * The default configuration for the `{@link ThemeService}`.
155
+ *
156
+ * @public
157
+ */
158
+ export declare const THEME_SERVICE_DEFAULT_CONFIG: IThemeServiceConfig;
256
159
  //# sourceMappingURL=IThemeService.d.ts.map
@@ -1 +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;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G;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;CAEtC;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAEhC;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAE1B;;;;OAIG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAElC;;;;;OAKG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAE/B;;;;;OAKG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,SAAS,CAAC;CAEzC;AAED;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,EAAE,mBAK1C,CAAC"}
@@ -6,6 +6,8 @@
6
6
  */
7
7
  export const THEME_SERVICE_DEFAULT_CONFIG = {
8
8
  styleId: 'mosaik-theme-vars',
9
- autoInitialize: true
9
+ autoInitialize: true,
10
+ defaultTheme: undefined,
11
+ defaultThemeMode: 'light'
10
12
  };
11
13
  //# sourceMappingURL=IThemeService.js.map
@@ -1 +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"}
1
+ {"version":3,"file":"IThemeService.js","sourceRoot":"","sources":["../../src/Theming/IThemeService.ts"],"names":[],"mappings":"AAAA,kBAAkB;AAuLlB;;;;GAIG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAwB;IAC7D,OAAO,EAAE,mBAAmB;IAC5B,cAAc,EAAE,IAAI;IACpB,YAAY,EAAE,SAAS;IACvB,gBAAgB,EAAE,OAAO;CAC5B,CAAC"}
@@ -11,8 +11,9 @@ import type { IThemeProvider } from './IThemeService';
11
11
  * @public
12
12
  */
13
13
  export declare class Theme2Element extends CustomElement implements IThemeElementProps, IThemeProvider {
14
+ private _name;
14
15
  private _theme;
15
- private _isInline;
16
+ private _global;
16
17
  /**
17
18
  * @public
18
19
  */
@@ -26,20 +27,32 @@ export declare class Theme2Element extends CustomElement implements IThemeElemen
26
27
  * @readonly
27
28
  */
28
29
  static get is(): string;
30
+ /**
31
+ * Gets or sets the `name` property.
32
+ * When set, this element will only respond to theme changes for this specific name.
33
+ * When null (default), responds to global/default theme changes.
34
+ *
35
+ * @public
36
+ */
37
+ get name(): string | null;
38
+ set name(value: string | null);
29
39
  /**
30
40
  * Gets or sets the `theme` property.
41
+ * If no local theme is set, returns the theme from ThemeService for this element's name.
31
42
  *
32
43
  * @public
33
44
  */
34
45
  get theme(): ITheme | null;
35
46
  set theme(value: ITheme | null);
36
47
  /**
37
- * Gets or sets the `isInline` property.
48
+ * Gets or sets the `global` property.
49
+ * When true, CSS variables are applied both locally and globally.
50
+ * When false (default), CSS variables are only applied locally to this element.
38
51
  *
39
52
  * @public
40
53
  */
41
- get isInline(): boolean;
42
- set isInline(value: boolean);
54
+ get global(): boolean;
55
+ set global(value: boolean);
43
56
  /**
44
57
  * @public
45
58
  * @override
@@ -51,15 +64,69 @@ export declare class Theme2Element extends CustomElement implements IThemeElemen
51
64
  */
52
65
  disconnectedCallback(): void;
53
66
  /**
54
- * @protected
67
+ * Applies the complete theme.
68
+ * Called by ThemeService to update this provider's internal state.
69
+ * CSS variables are handled by ThemeService directly.
70
+ *
71
+ * @public
72
+ * @param theme The theme to apply.
55
73
  */
56
- protected onThemePropertyChanged(prev?: ITheme, next?: ITheme): void;
74
+ applyTheme(theme: ITheme | null): void;
75
+ /**
76
+ * Applies the scheme (light/dark mode color roles) from the theme.
77
+ * Called by ThemeService to update this provider's internal state.
78
+ *
79
+ * @public
80
+ * @param scheme The scheme to apply.
81
+ */
82
+ applyScheme(scheme: ITheme['scheme']): void;
83
+ /**
84
+ * Applies the color palette from the theme.
85
+ * Called by ThemeService to update this provider's internal state.
86
+ *
87
+ * @public
88
+ * @param palette The palette to apply.
89
+ */
90
+ applyPalette(palette: ITheme['palette']): void;
91
+ /**
92
+ * Applies the font family from the theme.
93
+ * Called by ThemeService to update this provider's internal state.
94
+ *
95
+ * @public
96
+ * @param fontFamily The font family to apply.
97
+ */
98
+ applyFontFamily(fontFamily: ITheme['fontFamily']): void;
57
99
  /**
58
- * Gets the current theme name or empty string.
100
+ * Applies the typography settings from the theme.
101
+ * Called by ThemeService to update this provider's internal state.
59
102
  *
60
- * @private
103
+ * @public
104
+ * @param typography The typography settings to apply.
61
105
  */
62
- private getThemeName;
106
+ applyTypography(typography: ITheme['typography']): void;
107
+ /**
108
+ * Applies the layout settings from the theme.
109
+ * Called by ThemeService to update this provider's internal state.
110
+ *
111
+ * @public
112
+ * @param layout The layout settings to apply.
113
+ */
114
+ applyLayout(layout: ITheme['layout']): void;
115
+ /**
116
+ * Applies the elevation (shadow) settings from the theme.
117
+ * Called by ThemeService to update this provider's internal state.
118
+ *
119
+ * @public
120
+ * @param elevation The elevation settings to apply.
121
+ */
122
+ applyElevation(elevation: ITheme['elevation']): void;
123
+ /**
124
+ * Called when the theme property changes.
125
+ * Delegates to ThemeService for CSS variable management.
126
+ *
127
+ * @protected
128
+ */
129
+ protected onThemePropertyChanged(prev?: ITheme, next?: ITheme): void;
63
130
  }
64
131
  export declare namespace Theme2Element {
65
132
  type Props = IThemeElementProps;
@@ -1 +1 @@
1
- {"version":3,"file":"Theme2Element.d.ts","sourceRoot":"","sources":["../../src/Theming/Theme2Element.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAExD,OAAO,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AAM/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAItD;;;;;;;GAOG;AACH,qBAMa,aACT,SAAQ,aACR,YAAW,kBAAkB,EAAE,c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