@storybook/react-native-ui 8.6.0 → 8.6.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/package.json +5 -5
- package/src/Tree.stories.tsx +37 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/react-native-ui",
|
|
3
|
-
"version": "8.6.
|
|
3
|
+
"version": "8.6.2",
|
|
4
4
|
"description": "ui components for react native storybook",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -58,9 +58,9 @@
|
|
|
58
58
|
"typescript": "^5.3.3"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@storybook/core": "8.6.
|
|
62
|
-
"@storybook/react": "8.6.
|
|
63
|
-
"@storybook/react-native-theming": "^8.6.
|
|
61
|
+
"@storybook/core": "^8.6.6",
|
|
62
|
+
"@storybook/react": "^8.6.6",
|
|
63
|
+
"@storybook/react-native-theming": "^8.6.2",
|
|
64
64
|
"fuse.js": "^7.0.0",
|
|
65
65
|
"memoizerific": "^1.11.3",
|
|
66
66
|
"polished": "^4.3.1",
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"publishConfig": {
|
|
82
82
|
"access": "public"
|
|
83
83
|
},
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "eec6bdfc1fa3aa6536080009cb769cfa7785da1a"
|
|
85
85
|
}
|
package/src/Tree.stories.tsx
CHANGED
|
@@ -2,6 +2,7 @@ import { useState } from 'react';
|
|
|
2
2
|
import type { ComponentEntry, IndexHash } from '@storybook/core/manager-api';
|
|
3
3
|
import type { StoryObj, Meta } from '@storybook/react';
|
|
4
4
|
import { Tree } from './Tree';
|
|
5
|
+
import type { Dataset } from './types';
|
|
5
6
|
import { index } from './mockdata.large';
|
|
6
7
|
import { DEFAULT_REF_ID } from './constants';
|
|
7
8
|
import { ScrollView, Text } from 'react-native';
|
|
@@ -138,3 +139,39 @@ export const SingleStoryComponents: Story = {
|
|
|
138
139
|
);
|
|
139
140
|
},
|
|
140
141
|
};
|
|
142
|
+
|
|
143
|
+
const dataWithStoryName: Dataset = {
|
|
144
|
+
images: {
|
|
145
|
+
name: 'Testing storyNames support',
|
|
146
|
+
id: 'images',
|
|
147
|
+
depth: 0,
|
|
148
|
+
children: [],
|
|
149
|
+
type: 'component',
|
|
150
|
+
tags: [],
|
|
151
|
+
},
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
export const WithStoryNames: Story = {
|
|
155
|
+
storyName: 'Story with a storyName',
|
|
156
|
+
args: {
|
|
157
|
+
docsMode: false,
|
|
158
|
+
isBrowsing: true,
|
|
159
|
+
isMain: true,
|
|
160
|
+
refId: DEFAULT_REF_ID,
|
|
161
|
+
data: undefined,
|
|
162
|
+
onSelectStoryId: () => {},
|
|
163
|
+
selectedStoryId: 'some-component',
|
|
164
|
+
status: undefined,
|
|
165
|
+
},
|
|
166
|
+
render: function Render(args) {
|
|
167
|
+
const [selectedId, setSelectedId] = useState(storyId);
|
|
168
|
+
return (
|
|
169
|
+
<Tree
|
|
170
|
+
{...args}
|
|
171
|
+
data={dataWithStoryName}
|
|
172
|
+
selectedStoryId={selectedId}
|
|
173
|
+
onSelectStoryId={setSelectedId}
|
|
174
|
+
/>
|
|
175
|
+
);
|
|
176
|
+
},
|
|
177
|
+
};
|