Bin
2025-12-16 971a2a12c03b74dd2d7d668b9dbc599f5131bcaf
1
2
3
4
5
6
7
8
9
10
11
12
import { addons, types } from "storybook/manager-api";
import { ADDON_ID, TOOL_ID } from "./constants";
import { ThemeTool } from "./theme-toggle";
 
addons.register(ADDON_ID, () => {
  addons.add(TOOL_ID, {
    type: types.TOOL,
    title: "Toggle Theme",
    match: ({ tabId, viewMode }: any) => !tabId && (viewMode === "story" || viewMode === "docs"),
    render: ThemeTool,
  } as any);
});