@storybook/react-webpack5 11.0.0-alpha.7 → 11.0.0-alpha.9
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/node/index.js +6 -6
- package/dist/preset.js +6 -6
- package/package.json +5 -10
- package/template/cli/js/Button.jsx +11 -23
- package/template/cli/js/Header.jsx +8 -12
package/dist/node/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_at8cjmtg54 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_at8cjmtg54 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_at8cjmtg54 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_at8cjmtg54.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_at8cjmtg54.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_at8cjmtg54.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
package/dist/preset.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_at8cjmtg54 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_at8cjmtg54 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_at8cjmtg54 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_at8cjmtg54.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_at8cjmtg54.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_at8cjmtg54.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/react-webpack5",
|
|
3
|
-
"version": "11.0.0-alpha.
|
|
3
|
+
"version": "11.0.0-alpha.9",
|
|
4
4
|
"description": "Storybook for React and Webpack: Develop, document, and test UI components in isolation",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -48,9 +48,9 @@
|
|
|
48
48
|
"!src/**/*"
|
|
49
49
|
],
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@storybook/builder-webpack5": "11.0.0-alpha.
|
|
52
|
-
"@storybook/preset-react-webpack": "11.0.0-alpha.
|
|
53
|
-
"@storybook/react": "11.0.0-alpha.
|
|
51
|
+
"@storybook/builder-webpack5": "11.0.0-alpha.9",
|
|
52
|
+
"@storybook/preset-react-webpack": "11.0.0-alpha.9",
|
|
53
|
+
"@storybook/react": "11.0.0-alpha.9"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@types/node": "^22.19.1"
|
|
@@ -58,14 +58,9 @@
|
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"react": "^18.0.0 || ^19.0.0",
|
|
60
60
|
"react-dom": "^18.0.0 || ^19.0.0",
|
|
61
|
-
"storybook": "^11.0.0-alpha.
|
|
61
|
+
"storybook": "^11.0.0-alpha.9",
|
|
62
62
|
"typescript": "^5.9.0 || ^6.0.0 || ^7.0.0"
|
|
63
63
|
},
|
|
64
|
-
"peerDependenciesMeta": {
|
|
65
|
-
"typescript": {
|
|
66
|
-
"optional": true
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
64
|
"publishConfig": {
|
|
70
65
|
"access": "public"
|
|
71
66
|
},
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
|
-
|
|
3
1
|
import './button.css';
|
|
4
2
|
|
|
5
|
-
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
3
|
+
/**
|
|
4
|
+
* Primary UI component for user interaction
|
|
5
|
+
*
|
|
6
|
+
* @param {object} props
|
|
7
|
+
* @param {boolean} [props.primary=false] Is this the principal call to action on the page?
|
|
8
|
+
* @param {string} [props.backgroundColor] What background color to use
|
|
9
|
+
* @param {'small' | 'medium' | 'large'} [props.size='medium'] How large should the button be?
|
|
10
|
+
* @param {string} props.label Button contents
|
|
11
|
+
* @param {() => void} [props.onClick] Optional click handler
|
|
12
|
+
*/
|
|
13
|
+
export const Button = ({ primary = false, backgroundColor, size = 'medium', label, ...props }) => {
|
|
13
14
|
const mode = primary ? 'storybook-button--primary' : 'storybook-button--secondary';
|
|
14
15
|
return (
|
|
15
16
|
<button
|
|
@@ -22,16 +23,3 @@ export const Button = ({
|
|
|
22
23
|
</button>
|
|
23
24
|
);
|
|
24
25
|
};
|
|
25
|
-
|
|
26
|
-
Button.propTypes = {
|
|
27
|
-
/** Is this the principal call to action on the page? */
|
|
28
|
-
primary: PropTypes.bool,
|
|
29
|
-
/** What background color to use */
|
|
30
|
-
backgroundColor: PropTypes.string,
|
|
31
|
-
/** How large should the button be? */
|
|
32
|
-
size: PropTypes.oneOf(['small', 'medium', 'large']),
|
|
33
|
-
/** Button contents */
|
|
34
|
-
label: PropTypes.string.isRequired,
|
|
35
|
-
/** Optional click handler */
|
|
36
|
-
onClick: PropTypes.func,
|
|
37
|
-
};
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
|
-
|
|
3
1
|
import { Button } from './Button';
|
|
4
2
|
import './header.css';
|
|
5
3
|
|
|
6
|
-
|
|
4
|
+
/**
|
|
5
|
+
* @param {object} props
|
|
6
|
+
* @param {{ name: string }} [props.user] The signed-in user, if any
|
|
7
|
+
* @param {() => void} props.onLogin Called when the user clicks Log in
|
|
8
|
+
* @param {() => void} props.onLogout Called when the user clicks Log out
|
|
9
|
+
* @param {() => void} props.onCreateAccount Called when the user clicks Sign up
|
|
10
|
+
*/
|
|
11
|
+
export const Header = ({ user, onLogin, onLogout, onCreateAccount }) => (
|
|
7
12
|
<header>
|
|
8
13
|
<div className="storybook-header">
|
|
9
14
|
<div>
|
|
@@ -43,12 +48,3 @@ export const Header = ({ user = null, onLogin, onLogout, onCreateAccount }) => (
|
|
|
43
48
|
</div>
|
|
44
49
|
</header>
|
|
45
50
|
);
|
|
46
|
-
|
|
47
|
-
Header.propTypes = {
|
|
48
|
-
user: PropTypes.shape({
|
|
49
|
-
name: PropTypes.string.isRequired,
|
|
50
|
-
}),
|
|
51
|
-
onLogin: PropTypes.func.isRequired,
|
|
52
|
-
onLogout: PropTypes.func.isRequired,
|
|
53
|
-
onCreateAccount: PropTypes.func.isRequired,
|
|
54
|
-
};
|