@@ -2,6 +2,7 @@ import * as React from 'react';
2
2
import Autocomplete from '@mui/joy/Autocomplete' ;
3
3
import Box from '@mui/joy/Box' ;
4
4
import Checkbox from '@mui/joy/Checkbox' ;
5
+ import Divider from '@mui/joy/Divider' ;
5
6
import Link from '@mui/joy/Link' ;
6
7
import FormControl , { formControlClasses } from '@mui/joy/FormControl' ;
7
8
import FormLabel from '@mui/joy/FormLabel' ;
@@ -27,20 +28,26 @@ export default function Playground() {
27
28
< Box >
28
29
< Box
29
30
sx = { {
30
- p : 2 ,
31
- borderRadius : 'xs' ,
32
- bgcolor : 'background.level1' ,
31
+ pt : 2 ,
32
+ pb : 1 ,
33
+ bgcolor : 'background.surface' ,
34
+ position : 'sticky' ,
35
+ top : 'var(--MuiDocs-header-height)' ,
36
+ zIndex : 2 ,
33
37
} }
34
38
>
35
- < Autocomplete
36
- options = { top100Films }
37
- renderInput = { ( params ) => < Input { ...params } placeholder = "Playground" /> }
38
- { ...flags . reduce ( ( prev , current ) => ( { ...prev , [ current ] : true } ) , { } ) }
39
- sx = { { width : 300 , mx : 'auto' } }
40
- />
41
- </ Box >
42
- < Box sx = { { minWidth : 0 , flexBasis : 300 , flexGrow : 1 , mt : 2 } } >
43
- < Box sx = { { display : 'flex' , alignItems : 'baseline' , pb : 1 } } >
39
+ < FormControl sx = { { width : 300 , mx : 'auto' } } >
40
+ < FormLabel > Playground</ FormLabel >
41
+ < Autocomplete
42
+ options = { top100Films }
43
+ renderInput = { ( params ) => (
44
+ < Input { ...params } placeholder = "Type to search" />
45
+ ) }
46
+ { ...flags . reduce ( ( prev , current ) => ( { ...prev , [ current ] : true } ) , { } ) }
47
+ />
48
+ </ FormControl >
49
+ < Divider sx = { { mt : 3 , mb : 2 } } />
50
+ < Box sx = { { display : 'flex' , alignItems : 'baseline' } } >
44
51
< Typography
45
52
id = "flags-playground"
46
53
level = "body3"
@@ -52,22 +59,25 @@ export default function Playground() {
52
59
>
53
60
Flags { flags . length ? `(${ flags . length } )` : '' }
54
61
</ Typography >
55
- { /* eslint-disable-next-line jsx-a11y/anchor-is-valid */ }
56
- < Link
57
- component = "button"
58
- level = "body2"
59
- onClick = { ( ) => setFlags ( [ ] ) }
60
- sx = { { ml : 'auto' } }
61
- >
62
- Clear all
63
- </ Link >
62
+ { flags . length > 0 && (
63
+ // eslint-disable-next-line jsx-a11y/anchor-is-valid
64
+ < Link
65
+ component = "button"
66
+ level = "body2"
67
+ onClick = { ( ) => setFlags ( [ ] ) }
68
+ sx = { { ml : 'auto' } }
69
+ >
70
+ Clear all
71
+ </ Link >
72
+ ) }
64
73
</ Box >
74
+ </ Box >
75
+ < Box sx = { { minWidth : 0 , flexBasis : 300 , flexGrow : 1 } } >
65
76
< List
66
77
aria-labelledby = "flags-playground"
67
78
sx = { {
68
79
display : 'grid' ,
69
80
gridTemplateColumns : 'repeat(auto-fill, minmax(300px, 1fr))' ,
70
- maxHeight : 360 ,
71
81
overflow : 'auto' ,
72
82
px : 0.5 ,
73
83
'--List-gap' : '8px' ,
0 commit comments