11import { Resizable } from 're-resizable' ;
22import React from 'react' ;
33import Draggable from 'react-draggable' ;
4- import { Box , BoxProps , IconButton , Tooltip } from '../../base' ;
5- import { CloseIcon , CollapseAllIcon , ExpandAllIcon } from '../../icons' ;
6- import { PanelDragHandleIcon } from '../../icons/PanelDragHandle' ;
7- import { useTheme } from '../../theme' ;
4+ import { Box , BoxProps , Tooltip } from '../../base' ;
5+ import { CloseIcon , CollapseAllIcon , ExpandAllIcon , FullScreenIcon } from '../../icons' ;
6+ import { SistentThemeProviderWithoutBaseLine , useTheme } from '../../theme' ;
87import { ErrorBoundary } from '../ErrorBoundary' ;
98import {
9+ CustomIconButton ,
1010 DragHandle ,
1111 DrawerHeader ,
1212 HeaderActionsContainer ,
1313 HeaderContainer ,
1414 PanelBody ,
1515 PanelContainer ,
16+ PanelTitle ,
1617 ResizableContent
1718} from './style' ;
1819
@@ -30,6 +31,8 @@ export type PanelProps = {
3031 top ?: string | number ;
3132 bottom ?: string | number ;
3233 } ;
34+ minimizePanel ?: ( ) => void ;
35+ title ?: string ;
3336} ;
3437
3538const Panel_ : React . FC < PanelProps > = ( {
@@ -40,7 +43,9 @@ const Panel_: React.FC<PanelProps> = ({
4043 toggleExpandAll,
4144 handleClose,
4245 intitialPosition,
43- sx
46+ sx,
47+ minimizePanel,
48+ title = 'Debug Panel'
4449} ) => {
4550 const theme = useTheme ( ) ;
4651 if ( ! isOpen ) return null ;
@@ -70,22 +75,26 @@ const Panel_: React.FC<PanelProps> = ({
7075 < Box display = "flex" justifyContent = "flex-end" padding = "8px" >
7176 { toggleExpandAll && (
7277 < Tooltip title = { areAllExpanded ? 'Collapse All' : 'Expand All' } >
73- < IconButton onClick = { toggleExpandAll } >
78+ < CustomIconButton onClick = { toggleExpandAll } >
7479 { areAllExpanded ? < CollapseAllIcon /> : < ExpandAllIcon /> }
75- </ IconButton >
80+ </ CustomIconButton >
7681 </ Tooltip >
7782 ) }
7883 </ Box >
79- < DragHandle >
80- < PanelDragHandleIcon />
81- </ DragHandle >
84+ < DragHandle />
8285 < HeaderContainer >
8386 < HeaderActionsContainer
8487 id = { `${ id } -panel-header-actions-container` }
8588 > </ HeaderActionsContainer >
86- < IconButton onClick = { handleClose } >
87- < CloseIcon />
88- </ IconButton >
89+ < PanelTitle > { title } </ PanelTitle >
90+ { minimizePanel && (
91+ < CustomIconButton onClick = { minimizePanel } >
92+ < FullScreenIcon fill = { theme . palette . common . white } />
93+ </ CustomIconButton >
94+ ) }
95+ < CustomIconButton onClick = { handleClose } >
96+ < CloseIcon fill = { theme . palette . common . white } />
97+ </ CustomIconButton >
8998 </ HeaderContainer >
9099 </ DrawerHeader >
91100 </ div >
@@ -99,5 +108,9 @@ const Panel_: React.FC<PanelProps> = ({
99108} ;
100109
101110export const Panel : React . FC < PanelProps > = ( { ...props } ) => {
102- return < Panel_ { ...props } /> ;
111+ return (
112+ < SistentThemeProviderWithoutBaseLine >
113+ < Panel_ { ...props } /> ;
114+ </ SistentThemeProviderWithoutBaseLine >
115+ ) ;
103116} ;
0 commit comments