@@ -6,7 +6,12 @@ import type {
66 FileComponentSearchResponsePayload ,
77} from 'storybook/internal/core-events' ;
88
9- import { ChevronDownIcon , ChevronRightIcon , ComponentIcon } from '@storybook/icons' ;
9+ import {
10+ BookmarkHollowIcon ,
11+ ChevronSmallDownIcon ,
12+ ChevronSmallRightIcon ,
13+ ComponentIcon ,
14+ } from '@storybook/icons' ;
1015
1116import type { VirtualItem } from '@tanstack/react-virtual' ;
1217import { useVirtualizer } from '@tanstack/react-virtual' ;
@@ -24,6 +29,7 @@ import {
2429 FileListItemExport ,
2530 FileListItemExportName ,
2631 FileListItemExportNameContent ,
32+ FileListItemExportNameContentWithExport ,
2733 FileListItemLabel ,
2834 FileListItemPath ,
2935 FileListLi ,
@@ -40,16 +46,14 @@ export interface NewStoryPayload extends CreateNewStoryRequestPayload {
4046 selectedItemId : string | number ;
4147}
4248
43- const ChevronRightIconStyled = styled ( ChevronRightIcon ) ( ( { theme } ) => ( {
44- display : 'none' ,
45- alignSelf : 'center' ,
49+ const TreeExpandIconStyled = styled ( ChevronSmallRightIcon ) ( ( { theme } ) => ( {
4650 color : theme . color . mediumdark ,
51+ marginTop : 2 ,
4752} ) ) ;
4853
49- const ChevronDownIconStyled = styled ( ChevronDownIcon ) ( ( { theme } ) => ( {
50- display : 'none' ,
51- alignSelf : 'center' ,
54+ const TreeCollapseIconStyled = styled ( ChevronSmallDownIcon ) ( ( { theme } ) => ( {
5255 color : theme . color . mediumdark ,
56+ marginTop : 2 ,
5357} ) ) ;
5458
5559interface FileSearchListProps {
@@ -189,6 +193,11 @@ export const FileSearchList = memo(function FileSearchList({
189193 searchResult . exportedComponents ?. length === 0
190194 }
191195 >
196+ { itemSelected ? (
197+ < TreeCollapseIconStyled size = { 14 } />
198+ ) : (
199+ < TreeExpandIconStyled size = { 14 } />
200+ ) }
192201 < FileListIconWrapper error = { itemError } >
193202 < ComponentIcon />
194203 </ FileListIconWrapper >
@@ -198,7 +207,6 @@ export const FileSearchList = memo(function FileSearchList({
198207 </ FileListItemLabel >
199208 < FileListItemPath > { searchResult . filepath } </ FileListItemPath >
200209 </ FileListItemContent >
201- { itemSelected ? < ChevronDownIconStyled /> : < ChevronRightIconStyled /> }
202210 </ FileListItemContentWrapper >
203211 { /* @ts -expect-error (non strict) */ }
204212 { searchResult ?. exportedComponents ?. length > 1 && itemSelected && (
@@ -249,19 +257,20 @@ export const FileSearchList = memo(function FileSearchList({
249257 } }
250258 >
251259 < FileListItemExportName >
252- < ComponentIcon />
260+ < BookmarkHollowIcon />
253261 { component . default ? (
254262 < >
255- < FileListItemExportNameContent >
263+ < FileListItemExportNameContentWithExport >
256264 { searchResult . filepath . split ( '/' ) . at ( - 1 ) ?. split ( '.' ) ?. at ( 0 ) }
257- </ FileListItemExportNameContent >
265+ </ FileListItemExportNameContentWithExport >
258266 < DefaultExport > Default export</ DefaultExport >
259267 </ >
260268 ) : (
261- component . name
269+ < FileListItemExportNameContent >
270+ { component . name }
271+ </ FileListItemExportNameContent >
262272 ) }
263273 </ FileListItemExportName >
264- < ChevronRightIconStyled />
265274 </ FileListItemExport >
266275 ) ;
267276 } ) }
@@ -340,15 +349,15 @@ export const FileSearchList = memo(function FileSearchList({
340349 < WithTooltip
341350 { ...itemProps }
342351 style = { { width : '100%' } }
352+ trigger = "hover"
343353 hasChrome = { false }
344- closeOnOutsideClick = { true }
354+ delayHide = { 100 }
355+ delayShow = { 200 }
356+ placement = "top-start"
345357 tooltip = {
346358 < TooltipNote
347- // @ts -expect-error (non strict)
348359 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."
352361 }
353362 />
354363 }
0 commit comments