@storybook/react-native-web-vite 11.0.0-beta.0 → 11.0.0-beta.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/_node-chunks/{chunk-UZBQTLWM.js → chunk-6C5VYYR3.js} +6 -6
- package/dist/_node-chunks/{chunk-Q72FCXQH.js → chunk-HECO3QIR.js} +7 -7
- package/dist/node/index.js +7 -7
- package/dist/preset.js +8 -8
- package/dist/vite-plugin.js +8 -8
- package/package.json +19 -5
- package/template/cli/js/Button.stories.jsx +11 -12
- package/template/cli/js/Header.stories.jsx +7 -8
- package/template/cli/js/Page.stories.jsx +6 -7
- package/template/cli/ts/Button.stories.tsx +11 -15
- package/template/cli/ts/Header.stories.tsx +7 -11
- package/template/cli/ts/Page.stories.tsx +6 -10
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_spe77k400r from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_spe77k400r from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_spe77k400r from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_spe77k400r.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_spe77k400r.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_spe77k400r.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_spe77k400r from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_spe77k400r from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_spe77k400r from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_spe77k400r.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_spe77k400r.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_spe77k400r.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
__commonJS,
|
|
14
14
|
__require,
|
|
15
15
|
__toESM
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-6C5VYYR3.js";
|
|
17
17
|
|
|
18
18
|
// ../../../node_modules/ms/index.js
|
|
19
19
|
var require_ms = __commonJS({
|
package/dist/node/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_spe77k400r from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_spe77k400r from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_spe77k400r from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_spe77k400r.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_spe77k400r.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_spe77k400r.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
|
-
import "../_node-chunks/chunk-
|
|
12
|
+
import "../_node-chunks/chunk-6C5VYYR3.js";
|
|
13
13
|
|
|
14
14
|
// src/node/index.ts
|
|
15
15
|
function defineMain(config) {
|
package/dist/preset.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_spe77k400r from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_spe77k400r from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_spe77k400r from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_spe77k400r.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_spe77k400r.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_spe77k400r.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
12
|
import {
|
|
13
13
|
src_default
|
|
14
|
-
} from "./_node-chunks/chunk-
|
|
15
|
-
import "./_node-chunks/chunk-
|
|
14
|
+
} from "./_node-chunks/chunk-HECO3QIR.js";
|
|
15
|
+
import "./_node-chunks/chunk-6C5VYYR3.js";
|
|
16
16
|
|
|
17
17
|
// src/preset.ts
|
|
18
18
|
import { viteFinal as reactViteFinal } from "@storybook/react-vite/preset";
|
package/dist/vite-plugin.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_spe77k400r from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_spe77k400r from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_spe77k400r from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_spe77k400r.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_spe77k400r.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_spe77k400r.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
12
|
import {
|
|
13
13
|
src_default
|
|
14
|
-
} from "./_node-chunks/chunk-
|
|
15
|
-
import "./_node-chunks/chunk-
|
|
14
|
+
} from "./_node-chunks/chunk-HECO3QIR.js";
|
|
15
|
+
import "./_node-chunks/chunk-6C5VYYR3.js";
|
|
16
16
|
|
|
17
17
|
// src/vite-plugin.ts
|
|
18
18
|
import { rnw } from "vite-plugin-rnw";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/react-native-web-vite",
|
|
3
|
-
"version": "11.0.0-beta.
|
|
3
|
+
"version": "11.0.0-beta.2",
|
|
4
4
|
"description": "Storybook for React Native Web and Vite: Develop, document, and test UI components in isolation",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -51,9 +51,9 @@
|
|
|
51
51
|
"!src/**/*"
|
|
52
52
|
],
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@storybook/builder-vite": "11.0.0-beta.
|
|
55
|
-
"@storybook/react": "11.0.0-beta.
|
|
56
|
-
"@storybook/react-vite": "11.0.0-beta.
|
|
54
|
+
"@storybook/builder-vite": "11.0.0-beta.2",
|
|
55
|
+
"@storybook/react": "11.0.0-beta.2",
|
|
56
|
+
"@storybook/react-vite": "11.0.0-beta.2",
|
|
57
57
|
"vite-plugin-rnw": "~0.0.12"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
@@ -62,14 +62,28 @@
|
|
|
62
62
|
"vite-tsconfig-paths": "^6.1.1"
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
65
|
+
"@joshwooding/vite-plugin-react-docgen-typescript": "^0.7.0",
|
|
65
66
|
"react": "^18.0.0 || ^19.0.0",
|
|
67
|
+
"react-docgen": "^8.0.2",
|
|
68
|
+
"react-docgen-typescript": "^2.2.2",
|
|
66
69
|
"react-dom": "^18.0.0 || ^19.0.0",
|
|
67
70
|
"react-native": ">=0.74.5",
|
|
68
71
|
"react-native-web": "^0.19.12 || ^0.20.0 || ^0.21.0",
|
|
69
|
-
"storybook": "^11.0.0-beta.
|
|
72
|
+
"storybook": "^11.0.0-beta.2",
|
|
70
73
|
"typescript": "^5.9.0 || ^6.0.0 || ^7.0.0",
|
|
71
74
|
"vite": "^6.3.0 || ^7.0.0 || ^8.0.0"
|
|
72
75
|
},
|
|
76
|
+
"peerDependenciesMeta": {
|
|
77
|
+
"@joshwooding/vite-plugin-react-docgen-typescript": {
|
|
78
|
+
"optional": true
|
|
79
|
+
},
|
|
80
|
+
"react-docgen": {
|
|
81
|
+
"optional": true
|
|
82
|
+
},
|
|
83
|
+
"react-docgen-typescript": {
|
|
84
|
+
"optional": true
|
|
85
|
+
}
|
|
86
|
+
},
|
|
73
87
|
"publishConfig": {
|
|
74
88
|
"access": "public"
|
|
75
89
|
},
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import preview from '../../.storybook/preview';
|
|
1
2
|
import { View } from 'react-native';
|
|
2
3
|
import { fn } from 'storybook/test';
|
|
3
4
|
|
|
4
5
|
import { Button } from './Button';
|
|
5
6
|
|
|
6
|
-
const meta = {
|
|
7
|
+
const meta = preview.meta({
|
|
7
8
|
title: 'Example/Button',
|
|
8
9
|
component: Button,
|
|
9
10
|
decorators: [
|
|
@@ -17,33 +18,31 @@ const meta = {
|
|
|
17
18
|
tags: ['autodocs'],
|
|
18
19
|
// Use `fn` to spy on the onPress arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#story-args
|
|
19
20
|
args: { onPress: fn() },
|
|
20
|
-
};
|
|
21
|
+
});
|
|
21
22
|
|
|
22
|
-
export
|
|
23
|
-
|
|
24
|
-
export const Primary = {
|
|
23
|
+
export const Primary = meta.story({
|
|
25
24
|
args: {
|
|
26
25
|
primary: true,
|
|
27
26
|
label: 'Button',
|
|
28
27
|
},
|
|
29
|
-
};
|
|
28
|
+
});
|
|
30
29
|
|
|
31
|
-
export const Secondary = {
|
|
30
|
+
export const Secondary = meta.story({
|
|
32
31
|
args: {
|
|
33
32
|
label: 'Button',
|
|
34
33
|
},
|
|
35
|
-
};
|
|
34
|
+
});
|
|
36
35
|
|
|
37
|
-
export const Large = {
|
|
36
|
+
export const Large = meta.story({
|
|
38
37
|
args: {
|
|
39
38
|
size: 'large',
|
|
40
39
|
label: 'Button',
|
|
41
40
|
},
|
|
42
|
-
};
|
|
41
|
+
});
|
|
43
42
|
|
|
44
|
-
export const Small = {
|
|
43
|
+
export const Small = meta.story({
|
|
45
44
|
args: {
|
|
46
45
|
size: 'small',
|
|
47
46
|
label: 'Button',
|
|
48
47
|
},
|
|
49
|
-
};
|
|
48
|
+
});
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
+
import preview from '../../.storybook/preview';
|
|
1
2
|
import { Header } from './Header';
|
|
2
3
|
|
|
3
|
-
const meta = {
|
|
4
|
+
const meta = preview.meta({
|
|
4
5
|
title: 'Example/Header',
|
|
5
6
|
component: Header,
|
|
6
7
|
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
7
8
|
tags: ['autodocs'],
|
|
8
|
-
};
|
|
9
|
+
});
|
|
9
10
|
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
export const LoggedIn = {
|
|
11
|
+
export const LoggedIn = meta.story({
|
|
13
12
|
args: {
|
|
14
13
|
user: {
|
|
15
14
|
name: 'Jane Doe',
|
|
@@ -18,12 +17,12 @@ export const LoggedIn = {
|
|
|
18
17
|
onLogout: () => {},
|
|
19
18
|
onCreateAccount: () => {},
|
|
20
19
|
},
|
|
21
|
-
};
|
|
20
|
+
});
|
|
22
21
|
|
|
23
|
-
export const LoggedOut = {
|
|
22
|
+
export const LoggedOut = meta.story({
|
|
24
23
|
args: {
|
|
25
24
|
onLogin: () => {},
|
|
26
25
|
onLogout: () => {},
|
|
27
26
|
onCreateAccount: () => {},
|
|
28
27
|
},
|
|
29
|
-
};
|
|
28
|
+
});
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
+
import preview from '../../.storybook/preview';
|
|
1
2
|
import { expect, userEvent, within } from 'storybook/test';
|
|
2
3
|
|
|
3
4
|
import { Page } from './Page';
|
|
4
5
|
|
|
5
|
-
const meta = {
|
|
6
|
+
const meta = preview.meta({
|
|
6
7
|
title: 'Example/Page',
|
|
7
8
|
component: Page,
|
|
8
|
-
};
|
|
9
|
+
});
|
|
9
10
|
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
export const LoggedIn = {
|
|
11
|
+
export const LoggedIn = meta.story({
|
|
13
12
|
play: async ({ canvasElement }) => {
|
|
14
13
|
const canvas = within(canvasElement);
|
|
15
14
|
const loginButton = canvas.getByRole('button', { name: /Log in/i });
|
|
@@ -19,6 +18,6 @@ export const LoggedIn = {
|
|
|
19
18
|
const logoutButton = canvas.getByRole('button', { name: /Log out/i });
|
|
20
19
|
await expect(logoutButton).toBeInTheDocument();
|
|
21
20
|
},
|
|
22
|
-
};
|
|
21
|
+
});
|
|
23
22
|
|
|
24
|
-
export const LoggedOut =
|
|
23
|
+
export const LoggedOut = meta.story();
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import preview from '../../.storybook/preview';
|
|
2
2
|
|
|
3
3
|
import { View } from 'react-native';
|
|
4
4
|
import { fn } from 'storybook/test';
|
|
5
5
|
|
|
6
6
|
import { Button } from './Button';
|
|
7
7
|
|
|
8
|
-
const meta = {
|
|
8
|
+
const meta = preview.meta({
|
|
9
9
|
title: 'Example/Button',
|
|
10
10
|
component: Button,
|
|
11
11
|
decorators: [
|
|
@@ -19,35 +19,31 @@ const meta = {
|
|
|
19
19
|
tags: ['autodocs'],
|
|
20
20
|
// Use `fn` to spy on the onPress arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#story-args
|
|
21
21
|
args: { onPress: fn() },
|
|
22
|
-
}
|
|
22
|
+
});
|
|
23
23
|
|
|
24
|
-
export
|
|
25
|
-
|
|
26
|
-
type Story = StoryObj<typeof meta>;
|
|
27
|
-
|
|
28
|
-
export const Primary: Story = {
|
|
24
|
+
export const Primary = meta.story({
|
|
29
25
|
args: {
|
|
30
26
|
primary: true,
|
|
31
27
|
label: 'Button',
|
|
32
28
|
},
|
|
33
|
-
};
|
|
29
|
+
});
|
|
34
30
|
|
|
35
|
-
export const Secondary
|
|
31
|
+
export const Secondary = meta.story({
|
|
36
32
|
args: {
|
|
37
33
|
label: 'Button',
|
|
38
34
|
},
|
|
39
|
-
};
|
|
35
|
+
});
|
|
40
36
|
|
|
41
|
-
export const Large
|
|
37
|
+
export const Large = meta.story({
|
|
42
38
|
args: {
|
|
43
39
|
size: 'large',
|
|
44
40
|
label: 'Button',
|
|
45
41
|
},
|
|
46
|
-
};
|
|
42
|
+
});
|
|
47
43
|
|
|
48
|
-
export const Small
|
|
44
|
+
export const Small = meta.story({
|
|
49
45
|
args: {
|
|
50
46
|
size: 'small',
|
|
51
47
|
label: 'Button',
|
|
52
48
|
},
|
|
53
|
-
};
|
|
49
|
+
});
|
|
@@ -1,19 +1,15 @@
|
|
|
1
|
-
import
|
|
1
|
+
import preview from '../../.storybook/preview';
|
|
2
2
|
|
|
3
3
|
import { Header } from './Header';
|
|
4
4
|
|
|
5
|
-
const meta = {
|
|
5
|
+
const meta = preview.meta({
|
|
6
6
|
title: 'Example/Header',
|
|
7
7
|
component: Header,
|
|
8
8
|
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
9
9
|
tags: ['autodocs'],
|
|
10
|
-
}
|
|
10
|
+
});
|
|
11
11
|
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
type Story = StoryObj<typeof meta>;
|
|
15
|
-
|
|
16
|
-
export const LoggedIn: Story = {
|
|
12
|
+
export const LoggedIn = meta.story({
|
|
17
13
|
args: {
|
|
18
14
|
user: {
|
|
19
15
|
name: 'Jane Doe',
|
|
@@ -22,12 +18,12 @@ export const LoggedIn: Story = {
|
|
|
22
18
|
onLogout: () => {},
|
|
23
19
|
onCreateAccount: () => {},
|
|
24
20
|
},
|
|
25
|
-
};
|
|
21
|
+
});
|
|
26
22
|
|
|
27
|
-
export const LoggedOut
|
|
23
|
+
export const LoggedOut = meta.story({
|
|
28
24
|
args: {
|
|
29
25
|
onLogin: () => {},
|
|
30
26
|
onLogout: () => {},
|
|
31
27
|
onCreateAccount: () => {},
|
|
32
28
|
},
|
|
33
|
-
};
|
|
29
|
+
});
|
|
@@ -1,19 +1,15 @@
|
|
|
1
|
-
import
|
|
1
|
+
import preview from '../../.storybook/preview';
|
|
2
2
|
|
|
3
3
|
import { expect, userEvent, within } from 'storybook/test';
|
|
4
4
|
|
|
5
5
|
import { Page } from './Page';
|
|
6
6
|
|
|
7
|
-
const meta = {
|
|
7
|
+
const meta = preview.meta({
|
|
8
8
|
title: 'Example/Page',
|
|
9
9
|
component: Page,
|
|
10
|
-
}
|
|
10
|
+
});
|
|
11
11
|
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
type Story = StoryObj<typeof meta>;
|
|
15
|
-
|
|
16
|
-
export const LoggedIn: Story = {
|
|
12
|
+
export const LoggedIn = meta.story({
|
|
17
13
|
play: async ({ canvasElement }) => {
|
|
18
14
|
const canvas = within(canvasElement);
|
|
19
15
|
const loginButton = canvas.getByRole('button', { name: /Log in/i });
|
|
@@ -23,6 +19,6 @@ export const LoggedIn: Story = {
|
|
|
23
19
|
const logoutButton = canvas.getByRole('button', { name: /Log out/i });
|
|
24
20
|
await expect(logoutButton).toBeInTheDocument();
|
|
25
21
|
},
|
|
26
|
-
};
|
|
22
|
+
});
|
|
27
23
|
|
|
28
|
-
export const LoggedOut
|
|
24
|
+
export const LoggedOut = meta.story();
|