@storybook/preact 7.4.0-alpha.0 → 7.4.0-alpha.1

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/preact",
3
- "version": "7.4.0-alpha.0",
3
+ "version": "7.4.0-alpha.1",
4
4
  "description": "Storybook Preact renderer",
5
5
  "keywords": [
6
6
  "storybook"
@@ -38,20 +38,21 @@
38
38
  "types": "dist/index.d.ts",
39
39
  "files": [
40
40
  "dist/**/*",
41
- "template/**/*",
41
+ "template/cli/**/*",
42
42
  "README.md",
43
43
  "*.js",
44
- "*.d.ts"
44
+ "*.d.ts",
45
+ "!src/**/*"
45
46
  ],
46
47
  "scripts": {
47
48
  "check": "../../../scripts/prepare/check.ts",
48
49
  "prep": "../../../scripts/prepare/bundle.ts"
49
50
  },
50
51
  "dependencies": {
51
- "@storybook/core-client": "7.4.0-alpha.0",
52
+ "@storybook/core-client": "7.4.0-alpha.1",
52
53
  "@storybook/global": "^5.0.0",
53
- "@storybook/preview-api": "7.4.0-alpha.0",
54
- "@storybook/types": "7.4.0-alpha.0",
54
+ "@storybook/preview-api": "7.4.0-alpha.1",
55
+ "@storybook/types": "7.4.0-alpha.1",
55
56
  "ts-dedent": "^2.0.0"
56
57
  },
57
58
  "devDependencies": {
package/src/typings.d.ts DELETED
@@ -1 +0,0 @@
1
- declare var STORYBOOK_ENV: 'preact';
@@ -1,14 +0,0 @@
1
- /* eslint-disable react/react-in-jsx-scope */
2
- // eslint-disable-next-line import/no-extraneous-dependencies
3
- import PropTypes from 'prop-types';
4
-
5
- export const Button = ({ onClick, label }) => (
6
- <button type="button" onClick={onClick}>
7
- {label}
8
- </button>
9
- );
10
-
11
- Button.propTypes = {
12
- onClick: PropTypes.func.isRequired,
13
- label: PropTypes.node.isRequired,
14
- };
@@ -1,38 +0,0 @@
1
- /* eslint-disable react/react-in-jsx-scope */
2
- // eslint-disable-next-line import/no-extraneous-dependencies
3
- import PropTypes from 'prop-types';
4
- import { useState } from 'preact/hooks';
5
-
6
- export const Form = ({ onSuccess }) => {
7
- const [value, setValue] = useState('');
8
- const [complete, setComplete] = useState(false);
9
-
10
- function onSubmit(event) {
11
- event.preventDefault();
12
- onSuccess(value);
13
-
14
- setTimeout(() => setComplete(true), 500);
15
- setTimeout(() => setComplete(false), 1500);
16
- }
17
-
18
- return (
19
- <form id="interaction-test-form" onSubmit={onSubmit}>
20
- <label>
21
- Enter Value
22
- <input
23
- type="text"
24
- data-testid="value"
25
- value={value}
26
- required
27
- onInput={(event) => setValue(event.target.value)}
28
- />
29
- </label>
30
- <button type="submit">Submit</button>
31
- {complete && <p>Completed!!</p>}
32
- </form>
33
- );
34
- };
35
-
36
- Form.propTypes = {
37
- onSuccess: PropTypes.func.isRequired,
38
- };
@@ -1,10 +0,0 @@
1
- /* eslint-disable react/react-in-jsx-scope */
2
- // eslint-disable-next-line import/no-extraneous-dependencies
3
- import PropTypes from 'prop-types';
4
-
5
- // eslint-disable-next-line react/no-danger
6
- export const Html = ({ content }) => <div dangerouslySetInnerHTML={{ __html: content }} />;
7
-
8
- Html.propTypes = {
9
- content: PropTypes.string.isRequired,
10
- };
@@ -1,21 +0,0 @@
1
- /* eslint-disable react/react-in-jsx-scope */
2
- // eslint-disable-next-line import/no-extraneous-dependencies
3
- import PropTypes from 'prop-types';
4
-
5
- export const Pre = ({ style, object, text }) => (
6
- <pre style={style} data-testid="pre">
7
- {object ? JSON.stringify(object, null, 2) : text}
8
- </pre>
9
- );
10
-
11
- Pre.propTypes = {
12
- style: PropTypes.shape({}),
13
- object: PropTypes.shape({}),
14
- text: PropTypes.string,
15
- };
16
-
17
- Pre.defaultProps = {
18
- style: {},
19
- object: null,
20
- text: '',
21
- };