@storybook/addon-themes 11.0.0-alpha.4 → 11.0.0-alpha.5
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/index.d.ts +3 -5
- package/dist/index.js +2 -13
- package/dist/postinstall.js +6 -6
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { DecoratorFunction, Renderer, StoryContext } from "storybook/internal/ty
|
|
|
3
3
|
//#region \0rolldown/runtime.js
|
|
4
4
|
//#endregion
|
|
5
5
|
//#region code/addons/themes/.dts-emit/code/addons/themes/src/types.d.ts
|
|
6
|
-
interface ThemesParameters
|
|
6
|
+
interface ThemesParameters {
|
|
7
7
|
/**
|
|
8
8
|
* Themes configuration
|
|
9
9
|
*
|
|
@@ -19,7 +19,7 @@ interface ThemesGlobals {
|
|
|
19
19
|
theme?: string;
|
|
20
20
|
}
|
|
21
21
|
interface ThemesTypes {
|
|
22
|
-
parameters: ThemesParameters
|
|
22
|
+
parameters: ThemesParameters;
|
|
23
23
|
globals: ThemesGlobals;
|
|
24
24
|
}
|
|
25
25
|
//#endregion
|
|
@@ -65,9 +65,8 @@ declare const withThemeFromJSXProvider: <TRenderer extends Renderer = any>({
|
|
|
65
65
|
themes
|
|
66
66
|
}: ProviderStrategyConfiguration) => DecoratorFunction<TRenderer>;
|
|
67
67
|
declare namespace helpers_d_exports {
|
|
68
|
-
export { initializeThemeState, pluckThemeFromContext
|
|
68
|
+
export { initializeThemeState, pluckThemeFromContext };
|
|
69
69
|
}
|
|
70
|
-
type ThemesParameters = ThemesParameters$1['themes'];
|
|
71
70
|
/**
|
|
72
71
|
* @param StoryContext
|
|
73
72
|
* @returns The global theme name set for your stories
|
|
@@ -75,7 +74,6 @@ type ThemesParameters = ThemesParameters$1['themes'];
|
|
|
75
74
|
declare function pluckThemeFromContext({
|
|
76
75
|
globals
|
|
77
76
|
}: StoryContext): string;
|
|
78
|
-
declare function useThemeParameters(context?: StoryContext): ThemesParameters;
|
|
79
77
|
declare function initializeThemeState(themeNames: string[], defaultTheme: string): void;
|
|
80
78
|
//#endregion
|
|
81
79
|
//#region code/addons/themes/.dts-emit/code/addons/themes/src/index.d.ts
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,6 @@ import {
|
|
|
2
2
|
preview_exports
|
|
3
3
|
} from "./_browser-chunks/chunk-R3GPJ3N7.js";
|
|
4
4
|
import {
|
|
5
|
-
DEFAULT_THEME_PARAMETERS,
|
|
6
5
|
GLOBAL_KEY,
|
|
7
6
|
PARAM_KEY,
|
|
8
7
|
THEMING_EVENTS,
|
|
@@ -19,22 +18,12 @@ import { useEffect } from "storybook/preview-api";
|
|
|
19
18
|
var helpers_exports = {};
|
|
20
19
|
__export(helpers_exports, {
|
|
21
20
|
initializeThemeState: () => initializeThemeState,
|
|
22
|
-
pluckThemeFromContext: () => pluckThemeFromContext
|
|
23
|
-
useThemeParameters: () => useThemeParameters
|
|
21
|
+
pluckThemeFromContext: () => pluckThemeFromContext
|
|
24
22
|
});
|
|
25
|
-
import {
|
|
26
|
-
import { addons, useParameter } from "storybook/preview-api";
|
|
27
|
-
import { dedent } from "ts-dedent";
|
|
23
|
+
import { addons } from "storybook/preview-api";
|
|
28
24
|
function pluckThemeFromContext({ globals }) {
|
|
29
25
|
return globals[GLOBAL_KEY] || "";
|
|
30
26
|
}
|
|
31
|
-
function useThemeParameters(context) {
|
|
32
|
-
return deprecate(
|
|
33
|
-
dedent`The useThemeParameters function is deprecated. Please access parameters via the context directly instead e.g.
|
|
34
|
-
- const { themeOverride } = context.parameters.themes ?? {};
|
|
35
|
-
`
|
|
36
|
-
), context ? context.parameters[PARAM_KEY] ?? DEFAULT_THEME_PARAMETERS : useParameter(PARAM_KEY, DEFAULT_THEME_PARAMETERS);
|
|
37
|
-
}
|
|
38
27
|
function initializeThemeState(themeNames, defaultTheme) {
|
|
39
28
|
addons.getChannel().emit(THEMING_EVENTS.REGISTER_THEMES, {
|
|
40
29
|
defaultTheme,
|
package/dist/postinstall.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_oq7c1sn15n from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_oq7c1sn15n from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_oq7c1sn15n from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_oq7c1sn15n.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_oq7c1sn15n.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_oq7c1sn15n.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/addon-themes",
|
|
3
|
-
"version": "11.0.0-alpha.
|
|
3
|
+
"version": "11.0.0-alpha.5",
|
|
4
4
|
"description": "Storybook Themes addon: Switch between themes from the toolbar",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"css",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"typescript": "^6.0.3"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
|
-
"storybook": "^11.0.0-alpha.
|
|
68
|
+
"storybook": "^11.0.0-alpha.5"
|
|
69
69
|
},
|
|
70
70
|
"publishConfig": {
|
|
71
71
|
"access": "public"
|