preview.tsx 940 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import { sans } from "@pythnetwork/fonts";
  2. import { withThemeByClassName } from "@storybook/addon-themes";
  3. import type { Preview, Decorator } from "@storybook/react";
  4. import clsx from "clsx";
  5. import "../src/Html/base.scss";
  6. import styles from "./storybook.module.scss";
  7. const preview = {
  8. parameters: {
  9. backgrounds: {
  10. grid: {
  11. cellSize: 4,
  12. cellAmount: 4,
  13. },
  14. options: [
  15. { name: "Primary", value: "var(--primary-background)" },
  16. { name: "Secondary", value: "var(--secondary-background)" },
  17. ],
  18. },
  19. actions: { argTypesRegex: "^on[A-Z].*" },
  20. },
  21. initialGlobals: {
  22. backgrounds: { value: "Primary" },
  23. },
  24. } satisfies Preview;
  25. export default preview;
  26. export const decorators: Decorator[] = [
  27. withThemeByClassName({
  28. themes: {
  29. Light: clsx(sans.className, styles.light),
  30. Dark: clsx(sans.className, styles.dark),
  31. },
  32. defaultTheme: "Light",
  33. }),
  34. ];