11import * as React from 'react' ;
2- import type { PanelMode , SemanticStructure , SharedPanelProps } from '../interface' ;
2+ import type { PanelMode , SharedPanelProps } from '../interface' ;
3+ import type { FilledPanelClassNames , FilledPanelStyles } from '../hooks/useSemantic' ;
34
45export interface PanelContextProps < DateType extends object = any >
56 extends Pick <
@@ -31,6 +32,9 @@ export interface PanelContextProps<DateType extends object = any>
3132
3233 // Shared
3334 now : DateType ;
35+
36+ classNames : FilledPanelClassNames ;
37+ styles : FilledPanelStyles ;
3438}
3539
3640/** Used for each single Panel. e.g. DatePanel */
@@ -49,7 +53,7 @@ export function useInfo<DateType extends object = any>(
4953) : [ sharedProps : PanelContextProps < DateType > , now : DateType ] {
5054 const {
5155 prefixCls,
52- generateConfig,
56+ // generateConfig,
5357 locale,
5458 disabledDate,
5559 minDate,
@@ -69,6 +73,9 @@ export function useInfo<DateType extends object = any>(
6973 superNextIcon,
7074 } = props ;
7175
76+ // ======================= Context ========================
77+ const { classNames, styles, generateConfig } = usePanelContext ( ) ;
78+
7279 // ========================= MISC =========================
7380 const now = generateConfig . getNow ( ) ;
7481
@@ -78,6 +85,8 @@ export function useInfo<DateType extends object = any>(
7885 values,
7986 pickerValue,
8087 prefixCls,
88+ classNames,
89+ styles,
8190 disabledDate,
8291 minDate,
8392 maxDate,
@@ -106,8 +115,6 @@ export interface PickerHackContextProps {
106115 hideNext ?: boolean ;
107116 hideHeader ?: boolean ;
108117 onCellDblClick ?: ( ) => void ;
109- styles ?: Partial < Record < SemanticStructure , React . CSSProperties > > ;
110- classNames ?: Partial < Record < SemanticStructure , string > > ;
111118}
112119
113120/**
0 commit comments