Skip to content

Commit

Permalink
update storybook
Browse files Browse the repository at this point in the history
  • Loading branch information
fakefeik committed Jan 17, 2024
1 parent c4c86d2 commit cb4ac07
Show file tree
Hide file tree
Showing 10 changed files with 1,006 additions and 1,745 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
module.exports = {
import type { StorybookConfig } from '@storybook/react-vite';

const config: StorybookConfig = {
stories: ["../stories/**/*.stories.tsx"],
addons: ["@storybook/addon-actions"],
framework: "@storybook/react-vite",
};

export default config;
File renamed without changes.
14 changes: 7 additions & 7 deletions db-viewer-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@
"tslib": "^2.3.0"
},
"devDependencies": {
"@skbkontur/icons": "^1.3.0",
"@skbkontur/icons": "^1.7.3",
"@skbkontur/react-selenium-testing": "^0.2.1",
"@skbkontur/react-ui": "^4.1.0",
"@storybook/addon-actions": "^7.0.7",
"@storybook/addons": "^7.0.7",
"@storybook/cli": "^7.4.6",
"@storybook/react": "^7.0.7",
"@storybook/react-vite": "^7.4.6",
"@storybook/addon-actions": "^7.6.8",
"@storybook/addons": "^7.6.8",
"@storybook/cli": "^7.6.8",
"@storybook/react": "^7.6.8",
"@storybook/react-vite": "^7.6.8",
"@types/lodash": "^4.14.171",
"@types/react": "^17.0.15",
"@types/react-dom": "^17.0.15",
Expand All @@ -86,7 +86,7 @@
"react-refresh": "^0.10.0",
"react-router-dom": "^6.11.1",
"rimraf": "^3.0.2",
"storybook-addon-react-router-v6": "^2.0.7",
"storybook-addon-react-router-v6": "^2.0.10",
"typescript": "^4.3.5",
"vite": "^4.4.9",
"vitest": "^0.30.1"
Expand Down
9 changes: 3 additions & 6 deletions db-viewer-ui/stories/Themes/ObjectDetails.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,17 @@ import {
DEFAULT_THEME,
DEFAULT_THEME_8PX_OLD,
FLAT_THEME_8PX_OLD,
DARK_THEME,
ThemeContext,
ThemeFactory,
} from "@skbkontur/react-ui";
import { Theme } from "@skbkontur/react-ui/lib/theming/Theme";
import React from "react";
import { MemoryRouter, Route } from "react-router";
import { Routes } from "react-router-dom";
import { MemoryRouter, Route, Routes } from "react-router-dom";

import { NullCustomRenderer } from "../../src";
import { ObjectDetailsContainer } from "../../src/Containers/ObjectDetailsContainer";
import { DbViewerApiFake } from "../Api/DbViewerApiFake";

import { reactUiDark } from "./reactUiDark";

export default {
title: "Themes/ObjectDetails",
};
Expand Down Expand Up @@ -43,4 +40,4 @@ const DetailsContainer = ({ theme }: { theme: Theme }) => (
export const Default = (): React.ReactElement => <DetailsContainer theme={DEFAULT_THEME} />;
export const Flat = (): React.ReactElement => <DetailsContainer theme={FLAT_THEME_8PX_OLD} />;
export const Old = (): React.ReactElement => <DetailsContainer theme={DEFAULT_THEME_8PX_OLD} />;
export const Dark = (): React.ReactElement => <DetailsContainer theme={ThemeFactory.create(reactUiDark)} />;
export const Dark = (): React.ReactElement => <DetailsContainer theme={DARK_THEME} />;
6 changes: 2 additions & 4 deletions db-viewer-ui/stories/Themes/ObjectError.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import {
DEFAULT_THEME,
DEFAULT_THEME_8PX_OLD,
FLAT_THEME_8PX_OLD,
DARK_THEME,
ThemeContext,
ThemeFactory,
} from "@skbkontur/react-ui";
import { Theme } from "@skbkontur/react-ui/lib/theming/Theme";
import React from "react";
Expand All @@ -13,8 +13,6 @@ import { NullCustomRenderer } from "../../src";
import { ObjectDetailsContainer } from "../../src/Containers/ObjectDetailsContainer";
import { DbViewerApiFake } from "../Api/DbViewerApiFake";

import { reactUiDark } from "./reactUiDark";

export default {
title: "Themes/ObjectError",
};
Expand Down Expand Up @@ -42,4 +40,4 @@ const ErrorContainer = ({ theme }: { theme: Theme }) => (
export const Default = (): React.ReactElement => <ErrorContainer theme={DEFAULT_THEME} />;
export const Flat = (): React.ReactElement => <ErrorContainer theme={FLAT_THEME_8PX_OLD} />;
export const Old = (): React.ReactElement => <ErrorContainer theme={DEFAULT_THEME_8PX_OLD} />;
export const Dark = (): React.ReactElement => <ErrorContainer theme={ThemeFactory.create(reactUiDark)} />;
export const Dark = (): React.ReactElement => <ErrorContainer theme={DARK_THEME} />;
9 changes: 3 additions & 6 deletions db-viewer-ui/stories/Themes/ObjectNotFound.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,17 @@ import {
DEFAULT_THEME,
DEFAULT_THEME_8PX_OLD,
FLAT_THEME_8PX_OLD,
DARK_THEME,
ThemeContext,
ThemeFactory,
} from "@skbkontur/react-ui";
import { Theme } from "@skbkontur/react-ui/lib/theming/Theme";
import React from "react";
import { MemoryRouter, Route } from "react-router";
import { Routes } from "react-router-dom";
import { MemoryRouter, Route, Routes } from "react-router-dom";

import { NullCustomRenderer } from "../../src";
import { ObjectDetailsContainer } from "../../src/Containers/ObjectDetailsContainer";
import { DbViewerApiFake } from "../Api/DbViewerApiFake";

import { reactUiDark } from "./reactUiDark";

export default {
title: "Themes/ObjectNotFound",
};
Expand Down Expand Up @@ -43,4 +40,4 @@ const DetailsContainer = ({ theme }: { theme: Theme }) => (
export const Default = (): React.ReactElement => <DetailsContainer theme={DEFAULT_THEME} />;
export const Flat = (): React.ReactElement => <DetailsContainer theme={FLAT_THEME_8PX_OLD} />;
export const Old = (): React.ReactElement => <DetailsContainer theme={DEFAULT_THEME_8PX_OLD} />;
export const Dark = (): React.ReactElement => <DetailsContainer theme={ThemeFactory.create(reactUiDark)} />;
export const Dark = (): React.ReactElement => <DetailsContainer theme={DARK_THEME} />;
6 changes: 2 additions & 4 deletions db-viewer-ui/stories/Themes/ObjectTable.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import {
DEFAULT_THEME,
DEFAULT_THEME_8PX_OLD,
FLAT_THEME_8PX_OLD,
DARK_THEME,
ThemeContext,
ThemeFactory,
} from "@skbkontur/react-ui";
import { Theme } from "@skbkontur/react-ui/lib/theming/Theme";
import React from "react";
Expand All @@ -13,8 +13,6 @@ import { NullCustomRenderer } from "../../src";
import { ObjectTableContainer } from "../../src/Containers/ObjectTableContainer";
import { DbViewerApiFake } from "../Api/DbViewerApiFake";

import { reactUiDark } from "./reactUiDark";

export default {
title: "Themes/ObjectTable",
};
Expand Down Expand Up @@ -42,4 +40,4 @@ const TableContainer = ({ theme }: { theme: Theme }) => (
export const Default = (): React.ReactElement => <TableContainer theme={DEFAULT_THEME} />;
export const Flat = (): React.ReactElement => <TableContainer theme={FLAT_THEME_8PX_OLD} />;
export const Old = (): React.ReactElement => <TableContainer theme={DEFAULT_THEME_8PX_OLD} />;
export const Dark = (): React.ReactElement => <TableContainer theme={ThemeFactory.create(reactUiDark)} />;
export const Dark = (): React.ReactElement => <TableContainer theme={DARK_THEME} />;
6 changes: 2 additions & 4 deletions db-viewer-ui/stories/Themes/ObjectTableNoEntries.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import {
DEFAULT_THEME,
DEFAULT_THEME_8PX_OLD,
FLAT_THEME_8PX_OLD,
DARK_THEME,
ThemeContext,
ThemeFactory,
} from "@skbkontur/react-ui";
import { Theme } from "@skbkontur/react-ui/lib/theming/Theme";
import React from "react";
Expand All @@ -13,8 +13,6 @@ import { NullCustomRenderer } from "../../src";
import { ObjectTableContainer } from "../../src/Containers/ObjectTableContainer";
import { DbViewerApiFake } from "../Api/DbViewerApiFake";

import { reactUiDark } from "./reactUiDark";

export default {
title: "Themes/ObjectTableZeroEntries",
};
Expand Down Expand Up @@ -42,4 +40,4 @@ const TableContainer = ({ theme }: { theme: Theme }) => (
export const Default = (): React.ReactElement => <TableContainer theme={DEFAULT_THEME} />;
export const Flat = (): React.ReactElement => <TableContainer theme={FLAT_THEME_8PX_OLD} />;
export const Old = (): React.ReactElement => <TableContainer theme={DEFAULT_THEME_8PX_OLD} />;
export const Dark = (): React.ReactElement => <TableContainer theme={ThemeFactory.create(reactUiDark)} />;
export const Dark = (): React.ReactElement => <TableContainer theme={DARK_THEME} />;
8 changes: 2 additions & 6 deletions db-viewer-ui/stories/Themes/ObjectTypes.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,18 @@ import {
DEFAULT_THEME,
DEFAULT_THEME_8PX_OLD,
FLAT_THEME_8PX_OLD,
DARK_THEME,
ThemeContext,
ThemeFactory,
} from "@skbkontur/react-ui";
import { Theme } from "@skbkontur/react-ui/lib/theming/Theme";
import React from "react";
import { MemoryRouter, Route, Routes } from "react-router-dom";
import { withRouter } from "storybook-addon-react-router-v6";

import { ObjectTypesContainer } from "../../src/Containers/ObjectTypesContainer";
import { DbViewerApiFake } from "../Api/DbViewerApiFake";

import { reactUiDark } from "./reactUiDark";

export default {
title: "Themes/ObjectTypes",
decorators: [withRouter],
};

const TypesContainer = ({ theme }: { theme: Theme }) => (
Expand All @@ -42,4 +38,4 @@ const TypesContainer = ({ theme }: { theme: Theme }) => (
export const Default = (): React.ReactElement => <TypesContainer theme={DEFAULT_THEME} />;
export const Flat = (): React.ReactElement => <TypesContainer theme={FLAT_THEME_8PX_OLD} />;
export const Old = (): React.ReactElement => <TypesContainer theme={DEFAULT_THEME_8PX_OLD} />;
export const Dark = (): React.ReactElement => <TypesContainer theme={ThemeFactory.create(reactUiDark)} />;
export const Dark = (): React.ReactElement => <TypesContainer theme={DARK_THEME} />;
Loading

0 comments on commit cb4ac07

Please sign in to comment.