Skip to content

Commit

Permalink
chore: update Storybook version
Browse files Browse the repository at this point in the history
  • Loading branch information
domihustinova committed Jul 4, 2024
1 parent df0c31b commit 458ad29
Show file tree
Hide file tree
Showing 5 changed files with 2,708 additions and 1,018 deletions.
20 changes: 15 additions & 5 deletions packages/orbit-components/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
/* eslint-disable no-param-reassign */
import path from "path";
import path, { dirname, join } from "path";
import type { StorybookConfig } from "@storybook/react-webpack5";

function getAbsolutePath(value: string): any {
return dirname(require.resolve(join(value, "package.json")));
}

const config: StorybookConfig = {
staticDirs: [path.resolve(__dirname, "../static")],
stories: ["../src/**/*.stories.*"],
framework: "@storybook/react-webpack5",
framework: getAbsolutePath("@storybook/react-webpack5"),

addons: [
"@storybook/addon-knobs",
"@storybook/addon-a11y",
"storybook-addon-pseudo-states",
getAbsolutePath("@storybook/addon-knobs"),
getAbsolutePath("@storybook/addon-a11y"),
getAbsolutePath("storybook-addon-pseudo-states"),
{
name: "@storybook/addon-essentials",
options: {
Expand All @@ -23,6 +28,7 @@ const config: StorybookConfig = {
},
},
],

webpackFinal(cfg) {
if (cfg) {
// resolve to .js rather than .mjs to avoid webpack failing because of ambiguous imports
Expand All @@ -39,6 +45,10 @@ const config: StorybookConfig = {
}
return undefined;
},

// typescript: {
// reactDocgen: "react-docgen-typescript",
// },
};

export default config;
2 changes: 1 addition & 1 deletion packages/orbit-components/.storybook/manager.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { addons } from "@storybook/addons";
import { addons } from "@storybook/manager-api";

import orbitTheme from "./orbitTheme";

Expand Down
18 changes: 9 additions & 9 deletions packages/orbit-components/.storybook/orbitDecorator.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from "react";
import jsxToString from "react-element-to-jsx-string";
import { Source } from "@storybook/blocks";
// import jsxToString from "react-element-to-jsx-string";
// import { Source } from "@storybook/blocks";

import defaultTheme from "../src/defaultTheme";
import OrbitProvider from "../src/OrbitProvider";
Expand All @@ -18,12 +18,12 @@ const OrbitDecorator = (storyFn, context) => {

const children = storyFn(context);
const { globals } = context;
const options = {
filterProps: val => val != null && val !== "",
functionValue: () => {
return "function()";
},
};
// const options = {
// filterProps: val => val != null && val !== "",
// functionValue: () => {
// return "function()";
// },
// };

const inverted = globals.backgrounds ? globals.backgrounds.value === "#333333" : undefined;

Expand All @@ -38,7 +38,7 @@ const OrbitDecorator = (storyFn, context) => {
</Text>
{children}
<div style={{ marginTop: 20 }} dir="ltr">
<Source code={jsxToString(children, options)} language="jsx" format={false} />
{/*<Source code={jsxToString(children, options)} language="jsx" format={false} />*/}
</div>
</div>
</OrbitProvider>
Expand Down
24 changes: 12 additions & 12 deletions packages/orbit-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,16 @@
"@nanostores/router": "^0.3.1",
"@playwright/experimental-ct-react": "^1.44.1",
"@size-limit/webpack-why": "^8.0.0",
"@storybook/addon-a11y": "^7.4.6",
"@storybook/addon-essentials": "^7.0.23",
"@storybook/addon-knobs": "^7.0.2",
"@storybook/addon-styling": "^1.3.1",
"@storybook/addons": "^7.0.23",
"@storybook/blocks": "^7.0.23",
"@storybook/react": "^7.0.23",
"@storybook/react-webpack5": "^7.0.23",
"@storybook/addon-a11y": "^8.1.11",
"@storybook/addon-essentials": "^8.1.11",
"@storybook/addon-knobs": "8.0.1",
"@storybook/addon-styling": "^1.3.7",
"@storybook/blocks": "^8.1.11",
"@storybook/manager-api": "^8.1.11",
"@storybook/react": "^8.1.11",
"@storybook/react-webpack5": "^8.1.11",
"@storybook/storybook-deployer": "^2.8.16",
"@storybook/theming": "^7.0.23",
"@storybook/theming": "^8.1.11",
"@svgr/core": "^6.3.1",
"@svgr/plugin-jsx": "^6.3.1",
"@svgr/plugin-prettier": "^6.3.1",
Expand All @@ -113,7 +113,7 @@
"babel-loader": "^9.1.2",
"babel-plugin-require-context-hook": "^1.0.0",
"cypress": "^13.2.0",
"eslint-plugin-storybook": "^0.6.12",
"eslint-plugin-storybook": "^0.8.0",
"fs-extra": "^9.0.1",
"jscodeshift": "^0.13.1",
"jsdom": "^20.0.3",
Expand All @@ -127,8 +127,8 @@
"react-window": "^1.8.10",
"sharp": "^0.32.6",
"start-server-and-test": "^1.13.1",
"storybook": "^7.0.23",
"storybook-addon-pseudo-states": "^2.1.2",
"storybook": "^8.1.11",
"storybook-addon-pseudo-states": "^3.1.1",
"surge": "^0.23.0",
"svg2ttf": "^6.0.0",
"svgicons2svgfont": "^12.0.0",
Expand Down
Loading

0 comments on commit 458ad29

Please sign in to comment.