@@ -3,7 +3,7 @@ import React from 'react';
33import Draggable from 'react-draggable' ;
44import { Box , BoxProps , Tooltip } from '../../base' ;
55import { CloseIcon , CollapseAllIcon , ExpandAllIcon , FullScreenIcon } from '../../icons' ;
6- import { SistentThemeProviderWithoutBaseLine , useTheme } from '../../theme' ;
6+ import { useTheme } from '../../theme' ;
77import { ErrorBoundary } from '../ErrorBoundary' ;
88import {
99 CustomIconButton ,
@@ -31,6 +31,10 @@ export type PanelProps = {
3131 top ?: string | number ;
3232 bottom ?: string | number ;
3333 } ;
34+ defaultSize ?: {
35+ width ?: string | number ;
36+ height ?: string | number ;
37+ } ;
3438 minimizePanel ?: ( ) => void ;
3539 title ?: string ;
3640} ;
@@ -42,18 +46,22 @@ const Panel_: React.FC<PanelProps> = ({
4246 areAllExpanded,
4347 toggleExpandAll,
4448 handleClose,
49+ defaultSize,
4550 intitialPosition,
4651 sx,
4752 minimizePanel,
48- title = 'Debug Panel '
53+ title = ''
4954} ) => {
5055 const theme = useTheme ( ) ;
5156 if ( ! isOpen ) return null ;
5257 return (
5358 < Draggable handle = ".drag-handle" >
5459 < PanelContainer theme = { theme } intitialPosition = { intitialPosition } sx = { sx } >
5560 < Resizable
56- defaultSize = { { width : '18rem' , height : 'auto' } }
61+ defaultSize = { {
62+ width : defaultSize ?. width || '18rem' ,
63+ height : defaultSize ?. height || 'auto'
64+ } }
5765 onResize = { ( ) => {
5866 window . dispatchEvent ( new Event ( 'panel-resize' ) ) ;
5967 } }
@@ -98,7 +106,9 @@ const Panel_: React.FC<PanelProps> = ({
98106 </ HeaderContainer >
99107 </ DrawerHeader >
100108 </ div >
101- < PanelBody className = "panel-body" > { children } </ PanelBody >
109+ < PanelBody className = "panel-body" theme = { theme } >
110+ { children }
111+ </ PanelBody >
102112 </ ErrorBoundary >
103113 </ ResizableContent >
104114 </ Resizable >
@@ -108,9 +118,5 @@ const Panel_: React.FC<PanelProps> = ({
108118} ;
109119
110120export const Panel : React . FC < PanelProps > = ( { ...props } ) => {
111- return (
112- < SistentThemeProviderWithoutBaseLine >
113- < Panel_ { ...props } /> ;
114- </ SistentThemeProviderWithoutBaseLine >
115- ) ;
121+ return < Panel_ { ...props } /> ;
116122} ;
0 commit comments