@@ -8,11 +8,11 @@ import {
8
8
} from '@primer/octicons-react'
9
9
import type { Meta , StoryFn } from '@storybook/react-vite'
10
10
import React from 'react'
11
- import Box from '../Box'
12
11
import { Button , IconButton } from '../Button'
13
12
import Octicon from '../Octicon'
14
13
import type { SubTreeState } from './TreeView'
15
14
import { TreeView } from './TreeView'
15
+ import classes from './TreeView.features.stories.module.css'
16
16
17
17
const meta : Meta = {
18
18
title : 'Components/TreeView/Features' ,
@@ -21,9 +21,9 @@ const meta: Meta = {
21
21
Story => {
22
22
return (
23
23
// Prevent TreeView from expanding to the full width of the screen
24
- < Box sx = { { maxWidth : 400 } } >
24
+ < div className = { classes . StorybookDecorator } >
25
25
< Story />
26
- </ Box >
26
+ </ div >
27
27
)
28
28
} ,
29
29
] ,
@@ -275,11 +275,11 @@ export const Controlled: StoryFn = () => {
275
275
const [ tree , setTree ] = React . useState < TreeItem [ ] > ( initialTree )
276
276
277
277
return (
278
- < Box sx = { { display : 'grid' , gap : 3 } } >
279
- < Box sx = { { display : 'flex' , gap : 2 } } >
278
+ < div className = { classes . ControlledContainer } >
279
+ < div className = { classes . ButtonContainer } >
280
280
< Button onClick = { ( ) => setTree ( collapseAll ) } > Collapse all</ Button >
281
281
< Button onClick = { ( ) => setTree ( expandAll ) } > Expand all</ Button >
282
- </ Box >
282
+ </ div >
283
283
< nav aria-label = "Files" >
284
284
< CurrentPathContext . Provider value = { { currentPath, setCurrentPath} } >
285
285
< TreeView aria-label = "Files" >
@@ -294,7 +294,7 @@ export const Controlled: StoryFn = () => {
294
294
</ TreeView >
295
295
</ CurrentPathContext . Provider >
296
296
</ nav >
297
- </ Box >
297
+ </ div >
298
298
)
299
299
}
300
300
@@ -700,7 +700,7 @@ export const NestedTrees: StoryFn = () => {
700
700
701
701
export const NestedScrollContainer : StoryFn = ( ) => {
702
702
return (
703
- < Box sx = { { maxHeight : '50vh' , overflow : 'auto' } } >
703
+ < div className = { classes . ScrollContainer } >
704
704
< TreeView aria-label = "Files" >
705
705
{ Array . from ( { length : 100 } ) . map ( ( _ , i ) => (
706
706
< TreeView . Item key = { i } id = { `directory-${ i } ` } >
@@ -726,7 +726,7 @@ export const NestedScrollContainer: StoryFn = () => {
726
726
</ TreeView . Item >
727
727
) ) }
728
728
</ TreeView >
729
- </ Box >
729
+ </ div >
730
730
)
731
731
}
732
732
0 commit comments