@storybook/react-native 9.0.0 → 9.0.5

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.
Files changed (3) hide show
  1. package/dist/index.js +13 -12
  2. package/package.json +5 -5
  3. package/readme.md +13 -11
package/dist/index.js CHANGED
@@ -1111,6 +1111,19 @@ var View3 = class {
1111
1111
  );
1112
1112
  }
1113
1113
  if (onDeviceUI) {
1114
+ if (CustomUIComponent) {
1115
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1116
+ CustomUIComponent,
1117
+ {
1118
+ story,
1119
+ storyHash,
1120
+ setStory: (newStoryId) => self._channel.emit(import_core_events.SET_CURRENT_STORY, { storyId: newStoryId }),
1121
+ storage,
1122
+ theme: appliedTheme,
1123
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(StoryView_default, {})
1124
+ }
1125
+ );
1126
+ }
1114
1127
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1115
1128
  FullUI,
1116
1129
  {
@@ -1122,18 +1135,6 @@ var View3 = class {
1122
1135
  children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(StoryView_default, {})
1123
1136
  }
1124
1137
  );
1125
- } else if (CustomUIComponent) {
1126
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1127
- CustomUIComponent,
1128
- {
1129
- story,
1130
- storyHash,
1131
- setStory: (newStoryId) => self._channel.emit(import_core_events.SET_CURRENT_STORY, { storyId: newStoryId }),
1132
- storage,
1133
- theme: appliedTheme,
1134
- children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(StoryView_default, {})
1135
- }
1136
- );
1137
1138
  } else {
1138
1139
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(StoryView_default, {});
1139
1140
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/react-native",
3
- "version": "9.0.0",
3
+ "version": "9.0.5",
4
4
  "description": "A better way to develop React Native Components for your app",
5
5
  "keywords": [
6
6
  "react",
@@ -49,9 +49,9 @@
49
49
  "@storybook/csf": "^0.1.13",
50
50
  "@storybook/global": "^5.0.0",
51
51
  "@storybook/react": "^9",
52
- "@storybook/react-native-theming": "^9.0.0",
53
- "@storybook/react-native-ui": "^9.0.0",
54
- "@storybook/react-native-ui-common": "^9.0.0",
52
+ "@storybook/react-native-theming": "^9.0.5",
53
+ "@storybook/react-native-ui": "^9.0.5",
54
+ "@storybook/react-native-ui-common": "^9.0.5",
55
55
  "commander": "^8.2.0",
56
56
  "dedent": "^1.5.1",
57
57
  "deepmerge": "^4.3.0",
@@ -105,5 +105,5 @@
105
105
  "publishConfig": {
106
106
  "access": "public"
107
107
  },
108
- "gitHead": "042b39289131a9a80a74859439679947a4b81ac1"
108
+ "gitHead": "aec45d5fc129ca52f2a05c26cf25f25ced73d9e5"
109
109
  }
package/readme.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Storybook for React Native
2
2
 
3
- > This readme is for v9 beta, for v8 docs see the [v8.6 docs](https://github.com/storybookjs/react-native/tree/v8.6.0-stable).
3
+ > This readme is for v9, for v8 docs see the [v8.6 docs](https://github.com/storybookjs/react-native/tree/v8.6.0-stable).
4
4
 
5
5
  With Storybook for React Native you can design and develop individual React Native components without running your app.
6
6
 
@@ -54,7 +54,7 @@ npx storybook@latest init
54
54
  The only thing left to do is return Storybook's UI in your app entry point (such as `App.tsx`) like this:
55
55
 
56
56
  ```tsx
57
- export { default } from './.storybook';
57
+ export { default } from './.rnstorybook';
58
58
  ```
59
59
 
60
60
  Then wrap your metro config with the withStorybook function as seen [below](#additional-steps-update-your-metro-config)
@@ -91,7 +91,8 @@ module.exports = withStorybook(config, {
91
91
  // you can also use a env variable to set this
92
92
  enabled: true,
93
93
  // Path to your storybook config
94
- configPath: path.resolve(__dirname, './.storybook'),
94
+ configPath: path.resolve(__dirname, './.rnstorybook'),
95
+ // note that this is the default so you can the config path blank if you use .rnstorybook
95
96
 
96
97
  // Optional websockets configuration
97
98
  // Starts a websocket server on the specified port and host on metro start
@@ -126,7 +127,8 @@ module.exports = withStorybook(finalConfig, {
126
127
  // you can also use a env variable to set this
127
128
  enabled: true,
128
129
  // Path to your storybook config
129
- configPath: path.resolve(__dirname, './.storybook'),
130
+ configPath: path.resolve(__dirname, './.rnstorybook'),
131
+ // note that this is the default so you can the config path blank if you use .rnstorybook
130
132
 
131
133
  // Optional websockets configuration
132
134
  // Starts a websocket server on the specified port and host on metro start
@@ -170,10 +172,10 @@ export const Basic: Story = {
170
172
  };
171
173
  ```
172
174
 
173
- You should configure the path to your story files in the `main.ts` config file from the `.storybook` folder.
175
+ You should configure the path to your story files in the `main.ts` config file from the `.rnstorybook` folder.
174
176
 
175
177
  ```ts
176
- // .storybook/main.ts
178
+ // .rnstorybook/main.ts
177
179
  import { StorybookConfig } from '@storybook/react-native';
178
180
 
179
181
  const main: StorybookConfig = {
@@ -216,10 +218,10 @@ const meta = {
216
218
  export default meta;
217
219
  ```
218
220
 
219
- For global decorators and parameters, you can add them to `preview.tsx` inside your `.storybook` folder.
221
+ For global decorators and parameters, you can add them to `preview.tsx` inside your `.rnstorybook` folder.
220
222
 
221
223
  ```tsx
222
- // .storybook/preview.tsx
224
+ // .rnstorybook/preview.tsx
223
225
  import type { Preview } from '@storybook/react';
224
226
  import { withBackgrounds } from '@storybook/addon-ondevice-backgrounds';
225
227
 
@@ -262,7 +264,7 @@ Currently the addons available are:
262
264
  Install each one you want to use and add them to the `main.ts` addons list as follows:
263
265
 
264
266
  ```ts
265
- // .storybook/main.ts
267
+ // .rnstorybook/main.ts
266
268
  import { StorybookConfig } from '@storybook/react-native';
267
269
 
268
270
  const main: StorybookConfig = {
@@ -346,11 +348,11 @@ This is useful if you want to remove storybook from your production build.
346
348
 
347
349
  Type: `boolean`, default: `false`
348
350
 
349
- Generates the `.storybook/storybook.requires` file in JavaScript instead of TypeScript.
351
+ Generates the `.rnstorybook/storybook.requires` file in JavaScript instead of TypeScript.
350
352
 
351
353
  #### configPath
352
354
 
353
- Type: `string`, default: `path.resolve(process.cwd(), './.storybook')`
355
+ Type: `string`, default: `path.resolve(process.cwd(), './.rnstorybook')`
354
356
 
355
357
  The location of your Storybook configuration directory, which includes `main.ts` and other project-related files.
356
358