Debian Codegraph @

node/@patternfly/react-core/src/components/Tabs/TabsContext.ts

raw
1 import { createContext } from 'react';
2
3 export interface TabsContextProps {
4 variant: 'default' | 'secondary';
5 mountOnEnter: boolean;
6 unmountOnExit: boolean;
7 localActiveKey: string | number;
8 uniqueId: string;
9 setAccentStyles?: (shouldInitializeStyles?: boolean) => void;
10 handleTabClick: (
11 event: React.MouseEvent<HTMLElement, MouseEvent>,
12 eventKey: number | string,
13 tabContentRef: React.RefObject<any>
14 ) => void;
15 handleTabClose?: (
16 event: React.MouseEvent<HTMLElement, MouseEvent>,
17 eventKey: number | string,
18 tabContentRef?: React.RefObject<any>
19 ) => void;
20 }
21
22 export const TabsContext = createContext<TabsContextProps>({
23 variant: 'default',
24 mountOnEnter: false,
25 unmountOnExit: false,
26 localActiveKey: '',
27 uniqueId: '',
28 setAccentStyles: () => null,
29 handleTabClick: () => null,
30 handleTabClose: undefined
31 });
32
33 export const TabsContextProvider = TabsContext.Provider;
34 export const TabsContextConsumer = TabsContext.Consumer;