@fastr-pro/global-header 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,235 @@
1
+ import * as React from 'react';
2
+
3
+ export interface UserSubscription {
4
+ name?: string;
5
+ app_name?: string;
6
+ code?: string;
7
+ app_code?: string;
8
+ status?: string;
9
+ subscription_status?: string;
10
+ [key: string]: any;
11
+ }
12
+
13
+ export interface UserApp {
14
+ id?: string | number;
15
+ name?: string;
16
+ app_name?: string;
17
+ code?: string;
18
+ role?: string;
19
+ subscription_status?: string;
20
+ is_subscribed?: boolean;
21
+ app_url?: string;
22
+ [key: string]: any;
23
+ }
24
+
25
+ export interface User {
26
+ id?: string | number;
27
+ name?: string;
28
+ full_name?: string;
29
+ fullName?: string;
30
+ email?: string;
31
+ role?: string;
32
+ is_superadmin?: boolean;
33
+ subscriptions?: UserSubscription[] | Record<string, any>;
34
+ apps?: UserApp[];
35
+ all_apps?: UserApp[];
36
+ [key: string]: any;
37
+ }
38
+
39
+ export interface AppUrls {
40
+ landing?: string;
41
+ sso?: string;
42
+ purchase?: string;
43
+ profile?: string;
44
+ xray?: string;
45
+ scanner?: string;
46
+ charting?: string;
47
+ macro?: string;
48
+ derivatives?: string;
49
+ [key: string]: string | undefined;
50
+ }
51
+
52
+ export interface AppItemConfig {
53
+ id: string;
54
+ title?: string;
55
+ name?: string;
56
+ label?: string;
57
+ desc?: string;
58
+ description?: string;
59
+ route?: string;
60
+ href?: string;
61
+ hash?: string;
62
+ queryParams?: Record<string, string | number | boolean | undefined>;
63
+ params?: Record<string, string | number | boolean | undefined>;
64
+ indicator?: string;
65
+ icon?: React.ComponentType<any> | React.ReactNode;
66
+ badge?: string;
67
+ badgeColor?: string;
68
+ onClick?: (item: AppItemConfig, page: AppPageConfig, app: AppConfig) => void;
69
+ [key: string]: any;
70
+ }
71
+
72
+ export interface AppPageConfig {
73
+ id: string;
74
+ label?: string;
75
+ title?: string;
76
+ name?: string;
77
+ value?: string;
78
+ route?: string;
79
+ href?: string;
80
+ hash?: string;
81
+ queryParams?: Record<string, string | number | boolean | undefined>;
82
+ params?: Record<string, string | number | boolean | undefined>;
83
+ icon?: React.ComponentType<any> | React.ReactNode;
84
+ description?: string;
85
+ sections?: AppItemConfig[];
86
+ items?: AppItemConfig[];
87
+ dbName?: string;
88
+ dbId?: string;
89
+ onClick?: (page: AppPageConfig, app: AppConfig) => void;
90
+ [key: string]: any;
91
+ }
92
+
93
+ export interface QuickActionConfig {
94
+ id: string;
95
+ title?: string;
96
+ label?: string;
97
+ icon?: React.ComponentType<any> | React.ReactNode;
98
+ route?: string;
99
+ href?: string;
100
+ hash?: string;
101
+ queryParams?: Record<string, string | number | boolean | undefined>;
102
+ params?: Record<string, string | number | boolean | undefined>;
103
+ badgeColor?: string;
104
+ onClick?: (action: QuickActionConfig, app: AppConfig) => void;
105
+ [key: string]: any;
106
+ }
107
+
108
+ export interface AppConfig {
109
+ id: string;
110
+ name?: string;
111
+ label?: string;
112
+ url?: string;
113
+ href?: string;
114
+ route?: string;
115
+ hash?: string;
116
+ queryParams?: Record<string, string | number | boolean | undefined>;
117
+ params?: Record<string, string | number | boolean | undefined>;
118
+ icon?: React.ComponentType<any> | React.ReactNode;
119
+ bannerImage?: string;
120
+ badge?: string;
121
+ badgeColor?: string;
122
+ footerNote?: string;
123
+ menuHeader?: string;
124
+ categoriesHeader?: string;
125
+ description?: string;
126
+ hasMegaMenu?: boolean;
127
+ quickActions?: QuickActionConfig[];
128
+ pages?: AppPageConfig[];
129
+ categories?: AppPageConfig[];
130
+ onClick?: (app: AppConfig) => void;
131
+ [key: string]: any;
132
+ }
133
+
134
+ export interface HeaderConfig {
135
+ authApiUrl?: string;
136
+ authRedirectUrl?: string;
137
+ profileGetter?: (() => Promise<User | any> | User | any) | null;
138
+ uiTheme?: 'light' | 'dark' | 'system' | string;
139
+ currentApp?: string;
140
+ themeParamName?: string;
141
+ appendThemeParam?: boolean;
142
+ user?: User | null;
143
+ logout?: (() => void | Promise<void>) | null;
144
+ urls?: AppUrls;
145
+ apps?: Record<string, AppConfig> | AppConfig[];
146
+ [key: string]: any;
147
+ }
148
+
149
+ export interface GlobalHeaderProps {
150
+ config?: HeaderConfig;
151
+ authApiUrl?: string;
152
+ authRedirectUrl?: string;
153
+ profileGetter?: () => Promise<User | any> | User | any;
154
+ uiTheme?: 'light' | 'dark' | 'system' | string;
155
+ apps?: Record<string, AppConfig> | AppConfig[];
156
+ user?: User | null;
157
+ logout?: () => void;
158
+ theme?: 'light' | 'dark' | 'system';
159
+ setTheme?: (theme: 'light' | 'dark' | 'system') => void;
160
+ currentApp?: 'derivatives' | 'xray' | 'scanner' | 'charting' | 'macro' | string;
161
+ navigate?: (path: string) => void;
162
+ onNavigate?: (path: string, app?: AppConfig, item?: AppItemConfig) => void;
163
+ urls?: AppUrls;
164
+ logo?: React.ReactNode;
165
+ onLogoClick?: () => void;
166
+ categoryData?: any[];
167
+ chartingCallbacks?: {
168
+ onSelectCandleType?: (id: string) => void;
169
+ onSelectIndicator?: (id: string) => void;
170
+ onSelectPattern?: (id: string) => void;
171
+ onSelectCondition?: (id: string) => void;
172
+ onSelectInterval?: (id: string) => void;
173
+ };
174
+ products?: any[];
175
+ extraRightContent?: React.ReactNode;
176
+ className?: string;
177
+ }
178
+
179
+ export declare const GlobalHeader: React.FC<GlobalHeaderProps>;
180
+ export default GlobalHeader;
181
+
182
+ export interface GlobalMegaMenuProps {
183
+ app?: AppConfig;
184
+ type?: string;
185
+ config?: HeaderConfig;
186
+ currentApp?: string;
187
+ isDarkMode?: boolean;
188
+ isSubscribed?: boolean;
189
+ purchaseUrl?: string;
190
+ categoryData?: any[];
191
+ theme?: string;
192
+ onClose?: () => void;
193
+ onNavigate?: (path: string, app?: AppConfig, item?: any) => void;
194
+ urls?: AppUrls;
195
+ onSelectCandleType?: (id: string) => void;
196
+ onSelectIndicator?: (id: string) => void;
197
+ onSelectPattern?: (id: string) => void;
198
+ onSelectCondition?: (id: string) => void;
199
+ onSelectInterval?: (id: string) => void;
200
+ }
201
+
202
+ export declare const GlobalMegaMenu: React.FC<GlobalMegaMenuProps>;
203
+
204
+ export interface FasterProLogoProps extends React.SVGProps<SVGSVGElement> {
205
+ className?: string;
206
+ isDarkMode?: boolean;
207
+ theme?: 'light' | 'dark' | 'system';
208
+ }
209
+
210
+ export declare const FasterProLogo: React.FC<FasterProLogoProps>;
211
+
212
+ export declare const defaultHeaderConfig: HeaderConfig;
213
+ export declare function createHeaderConfig(userConfig?: Partial<HeaderConfig>): HeaderConfig;
214
+ export declare function renderIcon(IconOrNode: any, props?: any): React.ReactNode;
215
+ export declare function buildItemUrl(options: {
216
+ baseUrl?: string;
217
+ route?: string;
218
+ href?: string;
219
+ queryParams?: Record<string, string | number | boolean | undefined>;
220
+ params?: Record<string, string | number | boolean | undefined>;
221
+ hash?: string;
222
+ currentTheme?: string;
223
+ appendTheme?: boolean;
224
+ themeParamName?: string;
225
+ isCurrentApp?: boolean;
226
+ }): string;
227
+ export declare function withThemeParam(url: string, currentTheme: string, themeParamName?: string): string;
228
+
229
+ export declare const stockXRayCategories: any[];
230
+ export declare const chartingCategories: any[];
231
+ export declare const scannerCategories: any[];
232
+ export declare const macroPulseCategories: any[];
233
+ export declare const derivativesCategories: any[];
234
+
235
+ export declare function cn(...inputs: any[]): string;