@voicenter-team/voicenter-ui-plus 0.2.6 → 0.2.8
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/library/style.css +1 -1
- package/library/super.mjs +2845 -2841
- package/library/super.mjs.map +1 -1
- package/library/super.umd.js +26 -26
- package/library/super.umd.js.map +1 -1
- package/library/types/theme/index.d.ts +2 -1
- package/library/types/theme/theme.types.d.ts +1 -1
- package/package.json +1 -1
- package/src/theme/index.ts +8 -2
- package/src/theme/theme.types.ts +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { UIThemeConfig } from './theme.types';
|
|
1
|
+
import { themeType, UIThemeConfig } from './theme.types';
|
|
2
2
|
export declare function overrideElementTheme(theme: {
|
|
3
3
|
[key: string]: string;
|
|
4
4
|
}): {
|
|
@@ -22,4 +22,5 @@ export declare function overrideElementTheme(theme: {
|
|
|
22
22
|
export declare function appendGlobalCssVariables(cssData: {
|
|
23
23
|
[key: string]: string;
|
|
24
24
|
}, appendTo: HTMLElement): void;
|
|
25
|
+
export declare function getThemeConfigData(themeConfig?: UIThemeConfig): Promise<themeType>;
|
|
25
26
|
export default function (themeConfig?: UIThemeConfig, appendTo?: HTMLElement): Promise<void>;
|
package/package.json
CHANGED
package/src/theme/index.ts
CHANGED
|
@@ -41,7 +41,7 @@ export function appendGlobalCssVariables (cssData: { [key: string]: string }, ap
|
|
|
41
41
|
})
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
export
|
|
44
|
+
export async function getThemeConfigData (themeConfig?: UIThemeConfig) {
|
|
45
45
|
let currentTheme = _default
|
|
46
46
|
|
|
47
47
|
if (themeConfig) {
|
|
@@ -98,12 +98,18 @@ export default async function (themeConfig?: UIThemeConfig, appendTo: HTMLElemen
|
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
+
return currentTheme
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export default async function (themeConfig?: UIThemeConfig, appendTo: HTMLElement = document.documentElement) {
|
|
105
|
+
const currentTheme = await getThemeConfigData(themeConfig)
|
|
106
|
+
|
|
101
107
|
appendGlobalCssVariables(
|
|
102
108
|
{ ...overrideElementTheme(currentTheme), ...globalVariables },
|
|
103
109
|
appendTo
|
|
104
110
|
)
|
|
105
111
|
|
|
106
112
|
if (themeConfig?.onSetupCallback) {
|
|
107
|
-
themeConfig.onSetupCallback()
|
|
113
|
+
themeConfig.onSetupCallback(currentTheme)
|
|
108
114
|
}
|
|
109
115
|
}
|
package/src/theme/theme.types.ts
CHANGED