@storybook/react 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-chunks/{chunk-EH6QRX5B.js → chunk-AV7GEKV7.js} +682 -751
- package/dist/docgen/docgen-worker.js +12 -11
- package/dist/index.d.ts +3 -3
- package/dist/preset.js +134 -119
- package/package.json +2 -5
- package/template/cli/js/Button.jsx +11 -23
- package/template/cli/js/Header.jsx +8 -12
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
|
|
5
3
|
import { Button } from './Button';
|
|
6
4
|
import './header.css';
|
|
7
5
|
|
|
8
|
-
|
|
6
|
+
/**
|
|
7
|
+
* @param {object} props
|
|
8
|
+
* @param {{ name: string }} [props.user] The signed-in user, if any
|
|
9
|
+
* @param {() => void} props.onLogin Called when the user clicks Log in
|
|
10
|
+
* @param {() => void} props.onLogout Called when the user clicks Log out
|
|
11
|
+
* @param {() => void} props.onCreateAccount Called when the user clicks Sign up
|
|
12
|
+
*/
|
|
13
|
+
export const Header = ({ user, onLogin, onLogout, onCreateAccount }) => (
|
|
9
14
|
<header>
|
|
10
15
|
<div className="storybook-header">
|
|
11
16
|
<div>
|
|
@@ -45,12 +50,3 @@ export const Header = ({ user = null, onLogin, onLogout, onCreateAccount }) => (
|
|
|
45
50
|
</div>
|
|
46
51
|
</header>
|
|
47
52
|
);
|
|
48
|
-
|
|
49
|
-
Header.propTypes = {
|
|
50
|
-
user: PropTypes.shape({
|
|
51
|
-
name: PropTypes.string.isRequired,
|
|
52
|
-
}),
|
|
53
|
-
onLogin: PropTypes.func.isRequired,
|
|
54
|
-
onLogout: PropTypes.func.isRequired,
|
|
55
|
-
onCreateAccount: PropTypes.func.isRequired,
|
|
56
|
-
};
|