import { getDefaultTheme } from "@elliemae/pui-theme";
import { createAppStore } from "../../data/store.js";
import { withAppDecorator } from "../../view/storybook/decorator.js";
import { loadAppConfig } from "../app-config/index.js";
import { createTheme } from "./theme.js";
import { browserHistory } from "../history.js";
import "./preview.css";
const theme = getDefaultTheme();
const store = createAppStore({}, browserHistory);
const appDecorator = withAppDecorator.bind(null, theme, store);
const getParameters = (storyBookTheme) => ({
  layout: "fullscreen",
  actions: { argTypesRegex: "^on.*" },
  controls: { hideNoControlsWarning: true },
  docs: {
    // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
    theme: createTheme(storyBookTheme)
  },
  options: {
    storySort: {
      method: "alphabetical",
      order: [
        "Getting Started",
        [
          "Introduction",
          "Installation",
          "Packages",
          "Supported Browsers",
          "Releases",
          "Theme"
        ],
        "Components"
      ],
      locales: ["en-US"]
    }
  },
  dependencies: {
    withStoriesOnly: true,
    hideEmpty: true
  }
});
const decorators = [appDecorator];
const loaders = [
  async () => {
    await loadAppConfig("./");
  }
];
export {
  decorators,
  getParameters,
  loaders
};
