@storybook/addon-themes 10.5.2 → 10.6.0-alpha.1

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 CHANGED
@@ -1,69 +1,84 @@
1
- import * as storybook_internal_csf from 'storybook/internal/csf';
2
- import { Renderer, DecoratorFunction, StoryContext } from 'storybook/internal/types';
1
+ import { DecoratorFunction, Renderer, StoryContext } from "storybook/internal/types";
3
2
 
3
+ //#region \0rolldown/runtime.js
4
+ //#endregion
5
+ //#region code/addons/themes/.dts-emit/code/addons/themes/src/types.d.ts
4
6
  interface ThemesParameters$1 {
5
- /**
6
- * Themes configuration
7
- *
8
- * @see https://github.com/storybookjs/storybook/blob/next/code/addons/themes/README.md
9
- */
10
- themes?: {
11
- /** Remove the addon panel and disable the addon's behavior */
12
- disable?: boolean;
13
- /** Which theme to override for the story */
14
- themeOverride?: string;
15
- };
7
+ /**
8
+ * Themes configuration
9
+ *
10
+ * @see https://github.com/storybookjs/storybook/blob/next/code/addons/themes/README.md
11
+ */
12
+ themes?: {
13
+ /** Remove the addon panel and disable the addon's behavior */disable?: boolean; /** Which theme to override for the story */
14
+ themeOverride?: string;
15
+ };
16
16
  }
17
17
  interface ThemesGlobals {
18
- /** Which theme to override for the story */
19
- theme?: string;
18
+ /** Which theme to override for the story */
19
+ theme?: string;
20
20
  }
21
21
  interface ThemesTypes {
22
- parameters: ThemesParameters$1;
23
- globals: ThemesGlobals;
22
+ parameters: ThemesParameters$1;
23
+ globals: ThemesGlobals;
24
24
  }
25
-
25
+ //#endregion
26
+ //#region code/addons/themes/.dts-emit/code/addons/themes/src/decorators/class-name.decorator.d.ts
26
27
  interface ClassNameStrategyConfiguration {
27
- themes: Record<string, string>;
28
- defaultTheme: string;
29
- parentSelector?: string;
28
+ themes: Record<string, string>;
29
+ defaultTheme: string;
30
+ parentSelector?: string;
30
31
  }
31
- declare const withThemeByClassName: <TRenderer extends Renderer = Renderer>({ themes, defaultTheme, parentSelector, }: ClassNameStrategyConfiguration) => DecoratorFunction<TRenderer>;
32
-
32
+ declare const withThemeByClassName: <TRenderer extends Renderer = Renderer>({
33
+ themes,
34
+ defaultTheme,
35
+ parentSelector
36
+ }: ClassNameStrategyConfiguration) => DecoratorFunction<TRenderer>;
37
+ //#endregion
38
+ //#region code/addons/themes/.dts-emit/code/addons/themes/src/decorators/data-attribute.decorator.d.ts
33
39
  interface DataAttributeStrategyConfiguration {
34
- themes: Record<string, string>;
35
- defaultTheme: string;
36
- parentSelector?: string;
37
- attributeName?: string;
40
+ themes: Record<string, string>;
41
+ defaultTheme: string;
42
+ parentSelector?: string;
43
+ attributeName?: string;
38
44
  }
39
- declare const withThemeByDataAttribute: <TRenderer extends Renderer = any>({ themes, defaultTheme, parentSelector, attributeName, }: DataAttributeStrategyConfiguration) => DecoratorFunction<TRenderer>;
40
-
45
+ declare const withThemeByDataAttribute: <TRenderer extends Renderer = any>({
46
+ themes,
47
+ defaultTheme,
48
+ parentSelector,
49
+ attributeName
50
+ }: DataAttributeStrategyConfiguration) => DecoratorFunction<TRenderer>;
51
+ //#endregion
52
+ //#region code/addons/themes/.dts-emit/code/addons/themes/src/decorators/provider.decorator.d.ts
41
53
  type Theme = Record<string, any>;
42
54
  type ThemeMap = Record<string, Theme>;
43
55
  interface ProviderStrategyConfiguration {
44
- Provider?: any;
45
- GlobalStyles?: any;
46
- defaultTheme?: string;
47
- themes?: ThemeMap;
56
+ Provider?: any;
57
+ GlobalStyles?: any;
58
+ defaultTheme?: string;
59
+ themes?: ThemeMap;
60
+ }
61
+ declare const withThemeFromJSXProvider: <TRenderer extends Renderer = any>({
62
+ Provider,
63
+ GlobalStyles,
64
+ defaultTheme,
65
+ themes
66
+ }: ProviderStrategyConfiguration) => DecoratorFunction<TRenderer>;
67
+ declare namespace helpers_d_exports {
68
+ export { initializeThemeState, pluckThemeFromContext, useThemeParameters };
48
69
  }
49
- declare const withThemeFromJSXProvider: <TRenderer extends Renderer = any>({ Provider, GlobalStyles, defaultTheme, themes, }: ProviderStrategyConfiguration) => DecoratorFunction<TRenderer>;
50
-
51
70
  type ThemesParameters = ThemesParameters$1['themes'];
52
71
  /**
53
72
  * @param StoryContext
54
73
  * @returns The global theme name set for your stories
55
74
  */
56
- declare function pluckThemeFromContext({ globals }: StoryContext): string;
75
+ declare function pluckThemeFromContext({
76
+ globals
77
+ }: StoryContext): string;
57
78
  declare function useThemeParameters(context?: StoryContext): ThemesParameters;
58
79
  declare function initializeThemeState(themeNames: string[], defaultTheme: string): void;
59
-
60
- declare const helpers_initializeThemeState: typeof initializeThemeState;
61
- declare const helpers_pluckThemeFromContext: typeof pluckThemeFromContext;
62
- declare const helpers_useThemeParameters: typeof useThemeParameters;
63
- declare namespace helpers {
64
- export { helpers_initializeThemeState as initializeThemeState, helpers_pluckThemeFromContext as pluckThemeFromContext, helpers_useThemeParameters as useThemeParameters };
65
- }
66
-
67
- declare const _default: () => storybook_internal_csf.PreviewAddon<ThemesTypes>;
68
-
69
- export { type ClassNameStrategyConfiguration, type DataAttributeStrategyConfiguration, helpers as DecoratorHelpers, type ProviderStrategyConfiguration, type ThemesGlobals, type ThemesTypes, _default as default, withThemeByClassName, withThemeByDataAttribute, withThemeFromJSXProvider };
80
+ //#endregion
81
+ //#region code/addons/themes/.dts-emit/code/addons/themes/src/index.d.ts
82
+ declare function _default(): import("storybook/internal/csf").PreviewAddon<ThemesTypes>;
83
+ //#endregion
84
+ export { ClassNameStrategyConfiguration, DataAttributeStrategyConfiguration, helpers_d_exports as DecoratorHelpers, ProviderStrategyConfiguration, type ThemesGlobals, type ThemesTypes, _default as default, withThemeByClassName, withThemeByDataAttribute, withThemeFromJSXProvider };
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_5hle6sfzkok from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_5hle6sfzkok from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_5hle6sfzkok from "node:module";
1
+ import CJS_COMPAT_NODE_URL_ytvnhg3xqw8 from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_ytvnhg3xqw8 from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_ytvnhg3xqw8 from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_5hle6sfzkok.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_5hle6sfzkok.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_5hle6sfzkok.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_ytvnhg3xqw8.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_ytvnhg3xqw8.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_ytvnhg3xqw8.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
package/dist/preview.d.ts CHANGED
@@ -1,5 +1,6 @@
1
- import { ProjectAnnotations, Renderer } from 'storybook/internal/types';
1
+ import { ProjectAnnotations, Renderer } from "storybook/internal/types";
2
2
 
3
+ //#region code/addons/themes/.dts-emit/code/addons/themes/src/preview.d.ts
3
4
  declare const initialGlobals: ProjectAnnotations<Renderer>['initialGlobals'];
4
-
5
- export { initialGlobals };
5
+ //#endregion
6
+ export { initialGlobals };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/addon-themes",
3
- "version": "10.5.2",
3
+ "version": "10.6.0-alpha.1",
4
4
  "description": "Storybook Themes addon: Switch between themes from the toolbar",
5
5
  "keywords": [
6
6
  "css",
@@ -62,10 +62,10 @@
62
62
  "@storybook/icons": "^2.0.2",
63
63
  "react": "^18.2.0",
64
64
  "react-dom": "^18.2.0",
65
- "typescript": "^5.9.3"
65
+ "typescript": "^6.0.3"
66
66
  },
67
67
  "peerDependencies": {
68
- "storybook": "^10.5.2"
68
+ "storybook": "^10.6.0-alpha.1"
69
69
  },
70
70
  "publishConfig": {
71
71
  "access": "public"