-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: upgrade storybook8 * chore: upgrade storybook and vite * chore: remove @mdx-js/react optimizeDep * chore: add @mdx-js/react optimizeDep * fix: format
- Loading branch information
Showing
11 changed files
with
1,046 additions
and
3,285 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 14 additions & 14 deletions
28
packages/storybook/.storybook/addons/react-strict-mode/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
import type { PropsWithChildren } from "react" | ||
import type {PropsWithChildren} from "react"; | ||
|
||
import { addons, makeDecorator } from "@storybook/preview-api" | ||
import { getQueryParams } from "@storybook/preview-api" | ||
import React, { StrictMode, useEffect, useState } from "react" | ||
import {addons, makeDecorator} from "@storybook/preview-api"; | ||
import React, {StrictMode, useEffect, useState} from "react"; | ||
|
||
function StrictModeDecorator({ children }: PropsWithChildren<any>) { | ||
const [isStrict, setStrict] = useState(() => getQueryParams()?.strict === "true") | ||
function StrictModeDecorator({children}: PropsWithChildren<any>) { | ||
const strictQuery = new URLSearchParams(window.location.search).get("strict"); | ||
const [isStrict, setStrict] = useState(strictQuery === "true"); | ||
|
||
useEffect(() => { | ||
const channel = addons.getChannel() | ||
const channel = addons.getChannel(); | ||
|
||
channel.on("strict/updated", setStrict) | ||
channel.on("strict/updated", setStrict); | ||
|
||
return () => { | ||
channel.removeListener("strict/updated", setStrict) | ||
} | ||
}, []) | ||
channel.removeListener("strict/updated", setStrict); | ||
}; | ||
}, []); | ||
|
||
return isStrict ? <StrictMode>{children}</StrictMode> : children | ||
return isStrict ? <StrictMode>{children}</StrictMode> : children; | ||
} | ||
|
||
export const withStrictModeSwitcher = makeDecorator({ | ||
name: "withStrictModeSwitcher", | ||
parameterName: "strictModeSwitcher", | ||
wrapper: (getStory, context) => { | ||
return <StrictModeDecorator>{getStory(context)}</StrictModeDecorator> | ||
return <StrictModeDecorator>{getStory(context)}</StrictModeDecorator>; | ||
}, | ||
}) | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
"keywords": [ | ||
"storybook" | ||
], | ||
"type": "module", | ||
"author": "Junior Garcia <[email protected]>", | ||
"homepage": "https://nextui.org", | ||
"license": "MIT", | ||
|
@@ -37,23 +38,24 @@ | |
"react-dom": "^18.0.0" | ||
}, | ||
"devDependencies": { | ||
"@storybook/addon-a11y": "^7.4.6", | ||
"@storybook/addon-actions": "^7.4.6", | ||
"@storybook/addon-docs": "^7.4.6", | ||
"@storybook/addon-essentials": "^7.4.6", | ||
"@storybook/addon-links": "^7.4.6", | ||
"@storybook/addon-mdx-gfm": "^7.4.6", | ||
"@storybook/cli": "^7.4.6", | ||
"@storybook/manager-api": "^7.6.17", | ||
"@storybook/preview-api": "^7.6.17", | ||
"@storybook/react": "^7.4.6", | ||
"@storybook/react-vite": "^7.4.6", | ||
"@storybook/theming": "^7.4.6", | ||
"@storybook/addon-a11y": "^8.4.5", | ||
"@storybook/addon-actions": "^8.4.5", | ||
"@storybook/addon-docs": "^8.4.5", | ||
"@storybook/addon-essentials": "^8.4.5", | ||
"@storybook/addon-links": "^8.4.5", | ||
"@storybook/cli": "^8.4.5", | ||
"@storybook/manager-api": "^8.4.5", | ||
"@storybook/preview-api": "^8.4.5", | ||
"@storybook/react": "^8.4.5", | ||
"@storybook/react-vite": "^8.4.5", | ||
"@storybook/theming": "^8.4.5", | ||
"@vitejs/plugin-react": "^4.3.3", | ||
"autoprefixer": "^10.4.13", | ||
"storybook": "^7.4.6", | ||
"storybook-dark-mode": "^3.0.1", | ||
"remark-gfm": "^4.0.0", | ||
"storybook": "^8.4.5", | ||
"storybook-dark-mode": "^4.0.2", | ||
"tailwindcss": "^3.3.5", | ||
"vite": "^4.4.7" | ||
"vite": "^5.4.11" | ||
}, | ||
"tsup": { | ||
"clean": true, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module.exports = { | ||
export default { | ||
plugins: { | ||
tailwindcss: {}, | ||
autoprefixer: {}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import {defineConfig} from "vite"; | ||
import react from "@vitejs/plugin-react"; | ||
|
||
export default defineConfig({ | ||
plugins: [react()], | ||
optimizeDeps: { | ||
include: ["@storybook/theming", "@mdx-js/react"], | ||
}, | ||
}); |
Oops, something went wrong.