@@ -6,7 +6,12 @@ import type {
6
6
FileComponentSearchResponsePayload ,
7
7
} from 'storybook/internal/core-events' ;
8
8
9
- import { ChevronDownIcon , ChevronRightIcon , ComponentIcon } from '@storybook/icons' ;
9
+ import {
10
+ BookmarkHollowIcon ,
11
+ ChevronSmallDownIcon ,
12
+ ChevronSmallRightIcon ,
13
+ ComponentIcon ,
14
+ } from '@storybook/icons' ;
10
15
11
16
import type { VirtualItem } from '@tanstack/react-virtual' ;
12
17
import { useVirtualizer } from '@tanstack/react-virtual' ;
@@ -24,6 +29,7 @@ import {
24
29
FileListItemExport ,
25
30
FileListItemExportName ,
26
31
FileListItemExportNameContent ,
32
+ FileListItemExportNameContentWithExport ,
27
33
FileListItemLabel ,
28
34
FileListItemPath ,
29
35
FileListLi ,
@@ -40,16 +46,14 @@ export interface NewStoryPayload extends CreateNewStoryRequestPayload {
40
46
selectedItemId : string | number ;
41
47
}
42
48
43
- const ChevronRightIconStyled = styled ( ChevronRightIcon ) ( ( { theme } ) => ( {
44
- display : 'none' ,
45
- alignSelf : 'center' ,
49
+ const TreeExpandIconStyled = styled ( ChevronSmallRightIcon ) ( ( { theme } ) => ( {
46
50
color : theme . color . mediumdark ,
51
+ marginTop : 2 ,
47
52
} ) ) ;
48
53
49
- const ChevronDownIconStyled = styled ( ChevronDownIcon ) ( ( { theme } ) => ( {
50
- display : 'none' ,
51
- alignSelf : 'center' ,
54
+ const TreeCollapseIconStyled = styled ( ChevronSmallDownIcon ) ( ( { theme } ) => ( {
52
55
color : theme . color . mediumdark ,
56
+ marginTop : 2 ,
53
57
} ) ) ;
54
58
55
59
interface FileSearchListProps {
@@ -189,6 +193,11 @@ export const FileSearchList = memo(function FileSearchList({
189
193
searchResult . exportedComponents ?. length === 0
190
194
}
191
195
>
196
+ { itemSelected ? (
197
+ < TreeCollapseIconStyled size = { 14 } />
198
+ ) : (
199
+ < TreeExpandIconStyled size = { 14 } />
200
+ ) }
192
201
< FileListIconWrapper error = { itemError } >
193
202
< ComponentIcon />
194
203
</ FileListIconWrapper >
@@ -198,7 +207,6 @@ export const FileSearchList = memo(function FileSearchList({
198
207
</ FileListItemLabel >
199
208
< FileListItemPath > { searchResult . filepath } </ FileListItemPath >
200
209
</ FileListItemContent >
201
- { itemSelected ? < ChevronDownIconStyled /> : < ChevronRightIconStyled /> }
202
210
</ FileListItemContentWrapper >
203
211
{ /* @ts -expect-error (non strict) */ }
204
212
{ searchResult ?. exportedComponents ?. length > 1 && itemSelected && (
@@ -249,19 +257,20 @@ export const FileSearchList = memo(function FileSearchList({
249
257
} }
250
258
>
251
259
< FileListItemExportName >
252
- < ComponentIcon />
260
+ < BookmarkHollowIcon />
253
261
{ component . default ? (
254
262
< >
255
- < FileListItemExportNameContent >
263
+ < FileListItemExportNameContentWithExport >
256
264
{ searchResult . filepath . split ( '/' ) . at ( - 1 ) ?. split ( '.' ) ?. at ( 0 ) }
257
- </ FileListItemExportNameContent >
265
+ </ FileListItemExportNameContentWithExport >
258
266
< DefaultExport > Default export</ DefaultExport >
259
267
</ >
260
268
) : (
261
- component . name
269
+ < FileListItemExportNameContent >
270
+ { component . name }
271
+ </ FileListItemExportNameContent >
262
272
) }
263
273
</ FileListItemExportName >
264
- < ChevronRightIconStyled />
265
274
</ FileListItemExport >
266
275
) ;
267
276
} ) }
@@ -340,15 +349,15 @@ export const FileSearchList = memo(function FileSearchList({
340
349
< WithTooltip
341
350
{ ...itemProps }
342
351
style = { { width : '100%' } }
352
+ trigger = "hover"
343
353
hasChrome = { false }
344
- closeOnOutsideClick = { true }
354
+ delayHide = { 100 }
355
+ delayShow = { 200 }
356
+ placement = "top-start"
345
357
tooltip = {
346
358
< TooltipNote
347
- // @ts -expect-error (non strict)
348
359
note = {
349
- noExports
350
- ? "We can't evaluate exports for this file. You can't create a story for it automatically"
351
- : null
360
+ "We can't evaluate exports for this file. Automatic story creation is disabled."
352
361
}
353
362
/>
354
363
}
0 commit comments