@storybook/react-native-ui 8.4.1 → 8.4.2-alpha.1
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/index.js +10 -7
- package/package.json +3 -3
- package/src/SearchResults.stories.tsx +102 -0
- package/src/SearchResults.tsx +14 -11
package/dist/index.js
CHANGED
|
@@ -4295,13 +4295,16 @@ var Result = import_react11.default.memo(function Result2({
|
|
|
4295
4295
|
] }),
|
|
4296
4296
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(ResultRowContent, { testID: "search-result-item--label", children: [
|
|
4297
4297
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Title, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Highlight, { match: nameMatch, children: item.name }, "search-result-item--label-highlight") }),
|
|
4298
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Path10, { children: item.path.map((group, index) =>
|
|
4299
|
-
|
|
4300
|
-
{
|
|
4301
|
-
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
4298
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Path10, { children: item.path.map((group, index) => {
|
|
4299
|
+
const pathSeparator = index === item.path.length - 1 ? "" : "/";
|
|
4300
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native4.View, { style: { flexShrink: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(PathText, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
4301
|
+
Highlight,
|
|
4302
|
+
{
|
|
4303
|
+
match: pathMatches.find((match) => match.refIndex === index),
|
|
4304
|
+
children: `${group}${pathSeparator}`
|
|
4305
|
+
}
|
|
4306
|
+
) }) }, index);
|
|
4307
|
+
}) })
|
|
4305
4308
|
] }),
|
|
4306
4309
|
item.status ? i : null
|
|
4307
4310
|
] });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/react-native-ui",
|
|
3
|
-
"version": "8.4.1",
|
|
3
|
+
"version": "8.4.2-alpha.1",
|
|
4
4
|
"description": "ui components for react native storybook",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"@storybook/core": "^8.4.2",
|
|
62
62
|
"@storybook/react": "^8.4.2",
|
|
63
|
-
"@storybook/react-native-theming": "^8.4.1",
|
|
63
|
+
"@storybook/react-native-theming": "^8.4.2-alpha.1",
|
|
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": "2666f953f51ae16341c78e7dd77d44d02e1edf60"
|
|
85
85
|
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import type { StoryObj, Meta } from '@storybook/react';
|
|
2
|
+
import { SearchResults } from './SearchResults';
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
component: SearchResults,
|
|
6
|
+
title: 'UI/SearchResults',
|
|
7
|
+
} satisfies Meta<typeof SearchResults>;
|
|
8
|
+
|
|
9
|
+
export default meta;
|
|
10
|
+
|
|
11
|
+
type Story = StoryObj<typeof meta>;
|
|
12
|
+
|
|
13
|
+
export const Default: Story = {
|
|
14
|
+
args: {
|
|
15
|
+
query: 'bubble',
|
|
16
|
+
closeMenu: () => {},
|
|
17
|
+
highlightedIndex: null,
|
|
18
|
+
results: [
|
|
19
|
+
{
|
|
20
|
+
item: {
|
|
21
|
+
type: 'story',
|
|
22
|
+
id: 'nestingexample-message-bubble--first',
|
|
23
|
+
name: 'First',
|
|
24
|
+
title: 'NestingExample/Message/bubble',
|
|
25
|
+
importPath: './components/NestingExample/ChatMessageBubble.stories.tsx',
|
|
26
|
+
tags: ['story'],
|
|
27
|
+
depth: 3,
|
|
28
|
+
parent: 'nestingexample-message-bubble',
|
|
29
|
+
prepared: false,
|
|
30
|
+
refId: 'storybook_internal',
|
|
31
|
+
path: ['NestingExample', 'Message', 'bubble'],
|
|
32
|
+
status: null,
|
|
33
|
+
},
|
|
34
|
+
refIndex: 46,
|
|
35
|
+
matches: [
|
|
36
|
+
{
|
|
37
|
+
indices: [[0, 5]],
|
|
38
|
+
value: 'bubble',
|
|
39
|
+
key: 'path',
|
|
40
|
+
refIndex: 2,
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
score: 0.000020134092876783674,
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
getItemProps: () => ({
|
|
47
|
+
icon: 'story',
|
|
48
|
+
result: {
|
|
49
|
+
item: {
|
|
50
|
+
type: 'story',
|
|
51
|
+
id: 'nestingexample-message-bubble--first',
|
|
52
|
+
name: 'First',
|
|
53
|
+
title: 'NestingExample/Message/bubble',
|
|
54
|
+
importPath: './components/NestingExample/ChatMessageBubble.stories.tsx',
|
|
55
|
+
tags: ['story'],
|
|
56
|
+
depth: 3,
|
|
57
|
+
parent: 'nestingexample-message-bubble',
|
|
58
|
+
prepared: false,
|
|
59
|
+
refId: 'storybook_internal',
|
|
60
|
+
path: ['NestingExample', 'Message', 'bubble'],
|
|
61
|
+
status: null,
|
|
62
|
+
},
|
|
63
|
+
refIndex: 46,
|
|
64
|
+
matches: [
|
|
65
|
+
{
|
|
66
|
+
indices: [[0, 5]],
|
|
67
|
+
value: 'bubble',
|
|
68
|
+
key: 'path',
|
|
69
|
+
refIndex: 2,
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
score: 0.000020134092876783674,
|
|
73
|
+
},
|
|
74
|
+
score: 0.000020134092876783674,
|
|
75
|
+
refIndex: 46,
|
|
76
|
+
item: {
|
|
77
|
+
type: 'story',
|
|
78
|
+
id: 'nestingexample-message-bubble--first',
|
|
79
|
+
name: 'First',
|
|
80
|
+
title: 'NestingExample/Message/bubble',
|
|
81
|
+
importPath: './components/NestingExample/ChatMessageBubble.stories.tsx',
|
|
82
|
+
tags: ['story'],
|
|
83
|
+
depth: 3,
|
|
84
|
+
parent: 'nestingexample-message-bubble',
|
|
85
|
+
prepared: false,
|
|
86
|
+
refId: 'storybook_internal',
|
|
87
|
+
path: ['NestingExample', 'Message', 'bubble'],
|
|
88
|
+
status: null,
|
|
89
|
+
},
|
|
90
|
+
matches: [
|
|
91
|
+
{
|
|
92
|
+
indices: [[0, 5]],
|
|
93
|
+
value: 'bubble',
|
|
94
|
+
key: 'path',
|
|
95
|
+
refIndex: 2,
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
isHighlighted: false,
|
|
99
|
+
onPress: () => {},
|
|
100
|
+
}),
|
|
101
|
+
},
|
|
102
|
+
};
|
package/src/SearchResults.tsx
CHANGED
|
@@ -159,17 +159,20 @@ const Result: FC<SearchResultProps> = React.memo(function Result({
|
|
|
159
159
|
</Highlight>
|
|
160
160
|
</Title>
|
|
161
161
|
<Path>
|
|
162
|
-
{item.path.map((group, index) =>
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
162
|
+
{item.path.map((group, index) => {
|
|
163
|
+
const pathSeparator = index === item.path.length - 1 ? '' : '/';
|
|
164
|
+
return (
|
|
165
|
+
<View key={index} style={{ flexShrink: 1 }}>
|
|
166
|
+
<PathText>
|
|
167
|
+
<Highlight
|
|
168
|
+
match={pathMatches.find((match: FuseResultMatch) => match.refIndex === index)}
|
|
169
|
+
>
|
|
170
|
+
{`${group}${pathSeparator}`}
|
|
171
|
+
</Highlight>
|
|
172
|
+
</PathText>
|
|
173
|
+
</View>
|
|
174
|
+
);
|
|
175
|
+
})}
|
|
173
176
|
</Path>
|
|
174
177
|
</ResultRowContent>
|
|
175
178
|
{item.status ? i : null}
|