@storybook/addon-docs 11.0.0-alpha.0 → 11.0.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/preview.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  parameters
3
- } from "./_browser-chunks/chunk-6Z2O5XYJ.js";
3
+ } from "./_browser-chunks/chunk-ZZLJPRGX.js";
4
4
  import "./_browser-chunks/chunk-UAWMPV5J.js";
5
5
  export {
6
6
  parameters
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/addon-docs",
3
- "version": "11.0.0-alpha.0",
3
+ "version": "11.0.0-alpha.2",
4
4
  "description": "Storybook Docs: Document UI components automatically with stories and MDX",
5
5
  "keywords": [
6
6
  "docs",
@@ -88,9 +88,8 @@
88
88
  "dependencies": {
89
89
  "@mdx-js/react": "^3.0.0",
90
90
  "@storybook/icons": "^2.0.2",
91
- "@storybook/react-dom-shim": "11.0.0-alpha.0",
92
- "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
93
- "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
91
+ "react": "^18.0.0 || ^19.0.0",
92
+ "react-dom": "^18.0.0 || ^19.0.0",
94
93
  "ts-dedent": "^2.0.0",
95
94
  "unplugin": "^2.3.5"
96
95
  },
@@ -98,7 +97,7 @@
98
97
  "@mdx-js/mdx": "^3.0.0",
99
98
  "@rollup/pluginutils": "^5.0.2",
100
99
  "@types/color-convert": "^2.0.0",
101
- "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
100
+ "@types/react": "^18.0.0 || ^19.0.0",
102
101
  "color-convert": "^2.0.1",
103
102
  "es-toolkit": "^1.43.0",
104
103
  "github-slugger": "^2.0.0",
@@ -106,6 +105,7 @@
106
105
  "memoizerific": "^1.11.3",
107
106
  "polished": "^4.2.2",
108
107
  "react": "^18.2.0",
108
+ "react-aria": "^3.52.1",
109
109
  "react-colorful": "^5.1.2",
110
110
  "react-dom": "^18.2.0",
111
111
  "rehype-external-links": "^3.0.0",
@@ -116,8 +116,8 @@
116
116
  "vite": "^7.0.4"
117
117
  },
118
118
  "peerDependencies": {
119
- "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
120
- "storybook": "^11.0.0-alpha.0"
119
+ "@types/react": "^18.0.0 || ^19.0.0",
120
+ "storybook": "^11.0.0-alpha.2"
121
121
  },
122
122
  "peerDependenciesMeta": {
123
123
  "@types/react": {
@@ -1,52 +0,0 @@
1
- // src/DocsRenderer.tsx
2
- import React, { Component } from "react";
3
- import { renderElement, unmountElement } from "@storybook/react-dom-shim";
4
- import { AnchorMdx, CodeOrSourceMdx, Docs, HeadersMdx } from "@storybook/addon-docs/blocks";
5
- var defaultComponents = {
6
- code: CodeOrSourceMdx,
7
- a: AnchorMdx,
8
- ...HeadersMdx
9
- }, ErrorBoundary = class extends Component {
10
- constructor() {
11
- super(...arguments);
12
- this.state = { hasError: !1 };
13
- }
14
- static getDerivedStateFromError() {
15
- return { hasError: !0 };
16
- }
17
- componentDidCatch(err) {
18
- let { showException } = this.props;
19
- showException(err);
20
- }
21
- render() {
22
- let { hasError } = this.state, { children } = this.props;
23
- return hasError ? null : React.createElement(React.Fragment, null, children);
24
- }
25
- }, DocsRenderer = class {
26
- constructor() {
27
- this.render = async (context, docsParameter, element) => {
28
- let components = {
29
- ...defaultComponents,
30
- ...docsParameter?.components
31
- }, TDocs = Docs;
32
- return new Promise((resolve, reject) => {
33
- import("@mdx-js/react").then(
34
- ({ MDXProvider }) => (
35
- // We use a `key={}` here to reset the `hasError` state each time we render ErrorBoundary
36
- renderElement(
37
- React.createElement(ErrorBoundary, { showException: reject, key: Math.random() }, React.createElement(MDXProvider, { components }, React.createElement(TDocs, { context, docsParameter }))),
38
- element
39
- )
40
- )
41
- ).then(() => resolve());
42
- });
43
- }, this.unmount = (element) => {
44
- unmountElement(element);
45
- };
46
- }
47
- };
48
-
49
- export {
50
- defaultComponents,
51
- DocsRenderer
52
- };