@kodiak-finance/orderly-ui-scaffold 2.8.18 → 2.8.19-rc.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.
package/dist/index.d.ts CHANGED
@@ -2,10 +2,11 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as react from 'react';
3
3
  import react__default, { ReactNode, HTMLAttributeAnchorTarget, FC, PropsWithChildren } from 'react';
4
4
  import * as _kodiak_finance_orderly_types from '@kodiak-finance/orderly-types';
5
- import { NetworkId, API } from '@kodiak-finance/orderly-types';
5
+ import { RouterAdapter, NetworkId, API } from '@kodiak-finance/orderly-types';
6
6
  import { WsNetworkStatus } from '@kodiak-finance/orderly-hooks';
7
7
  import * as _kodiak_finance_orderly_i18n from '@kodiak-finance/orderly-i18n';
8
8
  import { LocaleContextState } from '@kodiak-finance/orderly-i18n';
9
+ import { useAnnouncement } from '@kodiak-finance/orderly-ui-notification';
9
10
 
10
11
  declare const AccountMenuWidget: () => react_jsx_runtime.JSX.Element;
11
12
 
@@ -36,12 +37,18 @@ type LeftNavItem = {
36
37
  * @default false
37
38
  **/
38
39
  onlyInMainAccount?: boolean;
40
+ /**
41
+ * Optional secondary style; secondary items render smaller and gray.
42
+ * Secondary items are grouped below primary items with a divider in between.
43
+ */
44
+ isSecondary?: boolean;
39
45
  };
40
46
 
41
47
  type MainNavItem = {
42
48
  id?: string;
43
49
  testid?: string;
44
50
  name: string;
51
+ label?: string;
45
52
  href: string;
46
53
  target?: HTMLAttributeAnchorTarget;
47
54
  icon?: string | react__default.ReactElement;
@@ -72,6 +79,12 @@ type MainNavItem = {
72
79
  href: string;
73
80
  isActive?: boolean;
74
81
  }) => react__default.ReactNode;
82
+ /**
83
+ * Custom submenu renderer - provides full control over submenu content
84
+ * Renders as a free-form component without any predefined structure
85
+ * @returns React node to render as submenu content
86
+ */
87
+ customSubMenuRender?: () => react__default.ReactNode;
75
88
  /**
76
89
  * if true, this item will only be shown in the main account
77
90
  * @default false
@@ -95,144 +108,15 @@ type MainNavClassNames = {
95
108
  subMenu?: string;
96
109
  };
97
110
 
98
- declare const LeftNavWidget: FC<LeftNavProps>;
99
-
100
- type BottomNavItem = {
101
- name: string;
102
- href: string;
103
- activeIcon: ReactNode;
104
- inactiveIcon: ReactNode;
105
- };
106
- type BottomNavProps$1 = {
107
- mainMenus?: BottomNavItem[];
108
- current?: string;
109
- onRouteChange?: RouterAdapter["onRouteChange"];
110
- };
111
- declare const BottomNavWidget: react__default.FC<BottomNavProps$1>;
112
-
113
- type FooterReturns = {
114
- wsStatus: WsNetworkStatus;
115
- };
116
-
117
- type FooterProps = {
118
- telegramUrl?: string;
119
- twitterUrl?: string;
120
- discordUrl?: string;
121
- trailing?: ReactNode;
122
- };
123
- declare const FooterWidget: react__default.FC<FooterProps>;
124
-
125
- declare const Footer: FC<FooterReturns & FooterProps>;
126
-
127
- type SideMenuItem = {
128
- name: string;
129
- icon?: react__default.ReactNode;
130
- href?: string;
131
- disabled?: boolean;
132
- onClick?: () => void;
133
- hide?: boolean;
134
- };
135
- type SideBarProps = {
136
- title?: react__default.ReactNode;
137
- items?: SideMenuItem[];
138
- open?: boolean;
139
- onOpenChange?: (open: boolean) => void;
140
- onItemSelect?: (item: SideMenuItem) => void;
141
- current?: string;
142
- className?: string;
143
- maxWidth?: number;
144
- minWidth?: number;
145
- style?: react__default.CSSProperties;
146
- };
147
- declare const SideBar: react__default.FC<SideBarProps>;
148
-
149
- declare const SideNavbarWidget: react__default.FC<Partial<SideBarProps>>;
150
-
151
- type RouteOption = {
152
- href: string;
153
- name: string;
154
- scope?: string;
155
- target?: string;
156
- };
157
- type RouterAdapter = {
158
- onRouteChange: (option: RouteOption) => void;
159
- currentPath?: string;
160
- };
161
- type ScaffoldState = {
162
- routerAdapter?: RouterAdapter;
163
- expanded?: boolean;
164
- setExpand: (expand: boolean) => void;
165
- checkChainSupport: (chainId: number | string) => boolean;
166
- topNavbarHeight: number;
167
- footerHeight: number;
168
- announcementHeight: number;
169
- };
170
- declare const ScaffoldContext: react.Context<ScaffoldState>;
171
- declare const useScaffoldContext: () => ScaffoldState;
172
-
173
- type ScaffoldProps = {
174
- /**
175
- * custom left sidebar component, only works on desktop
176
- * if provided, the layout will use this component over the default sidebar component
177
- */
178
- leftSidebar?: ReactNode;
179
- /**
180
- * custom left sidebar props, only works on desktop
181
- */
182
- leftSideProps?: SideBarProps;
183
- /**
184
- * custom left nav props, only works on mobile
185
- */
186
- leftNavProps?: LeftNavProps;
187
- /**
188
- * custom top bar component
189
- */
190
- topBar?: ReactNode;
191
- /**
192
- * custom top nav props
193
- */
194
- mainNavProps?: MainNavWidgetProps;
195
- /**
196
- * custom bottom nav component, only works on mobile
197
- */
198
- bottomNav?: ReactNode;
199
- /**
200
- * custom bottom nav component, only works on mobile
201
- */
202
- bottomNavProps?: BottomNavProps$1;
203
- /**
204
- * custom footer component, only works on desktop
205
- */
206
- footer?: ReactNode;
207
- /**
208
- * custom footer props, only works on desktop
209
- */
210
- footerProps?: FooterProps;
211
- routerAdapter?: RouterAdapter;
212
- classNames?: {
213
- root?: string;
214
- container?: string;
215
- content?: string;
216
- body?: string;
217
- leftSidebar?: string;
218
- topNavbar?: string;
219
- footer?: string;
220
- bottomNav?: string;
221
- };
222
- };
223
- declare const Scaffold: react__default.FC<PropsWithChildren<ScaffoldProps>>;
224
-
225
- type BottomNavProps = {
226
- mainMenus?: BottomNavItem[];
227
- current?: string | string[];
228
- onRouteChange?: RouterAdapter["onRouteChange"];
111
+ declare const useLeftNavScript: () => {
112
+ open: boolean;
113
+ onOpenChange: react.Dispatch<react.SetStateAction<boolean>>;
114
+ showSheet: () => void;
115
+ hideSheet: () => void;
229
116
  };
230
- declare const BottomNav: react__default.FC<BottomNavProps>;
231
-
232
- declare const useLeftNavState: () => {};
233
- type LeftNavState = ReturnType<typeof useLeftNavState>;
117
+ type LeftNavScriptReturn = ReturnType<typeof useLeftNavScript>;
234
118
 
235
- type LeftNavUIProps = LeftNavProps & LeftNavState & {
119
+ type LeftNavUIProps = LeftNavProps & Partial<LeftNavScriptReturn> & {
236
120
  className?: string;
237
121
  logo?: {
238
122
  src: string;
@@ -243,6 +127,8 @@ type LeftNavUIProps = LeftNavProps & LeftNavState & {
243
127
  };
244
128
  declare const LeftNavUI: FC<LeftNavUIProps>;
245
129
 
130
+ declare const LeftNavWidget: FC<LeftNavUIProps>;
131
+
246
132
  declare enum CampaignPositionEnum {
247
133
  menuLeading = "menuLeading",
248
134
  menuTailing = "menuTailing",
@@ -297,6 +183,7 @@ type MainNavWidgetProps = {
297
183
  chainMenu?: ReactNode;
298
184
  /** Wallet connection component (desktop & mobile) */
299
185
  walletConnect?: ReactNode;
186
+ notify?: ReactNode;
300
187
  /** Main navigation menu (desktop & mobile) */
301
188
  mainNav?: ReactNode;
302
189
  /** Account summary component (desktop only) */
@@ -319,6 +206,26 @@ type MainNavMobileProps = {
319
206
  } & MainNavWidgetProps;
320
207
  declare const MainNavMobile: FC<MainNavMobileProps>;
321
208
 
209
+ type BottomNavItem = {
210
+ name: string;
211
+ href: string;
212
+ activeIcon: ReactNode;
213
+ inactiveIcon: ReactNode;
214
+ };
215
+ type BottomNavProps$1 = {
216
+ mainMenus?: BottomNavItem[];
217
+ current?: string;
218
+ onRouteChange?: RouterAdapter["onRouteChange"];
219
+ };
220
+ declare const BottomNavWidget: react__default.FC<BottomNavProps$1>;
221
+
222
+ type BottomNavProps = {
223
+ mainMenus?: BottomNavItem[];
224
+ current?: string | string[];
225
+ onRouteChange?: RouterAdapter["onRouteChange"];
226
+ };
227
+ declare const BottomNav: react__default.FC<BottomNavProps>;
228
+
322
229
  declare const AccountSummaryWidget: react__default.FC;
323
230
 
324
231
  declare const ChainMenuWidget: () => react_jsx_runtime.JSX.Element;
@@ -342,6 +249,30 @@ declare const useChainMenuScript: () => {
342
249
 
343
250
  declare const ChainMenu: (props: UseChainMenuScriptReturn) => react_jsx_runtime.JSX.Element;
344
251
 
252
+ type SideMenuItem = {
253
+ name: string;
254
+ icon?: react__default.ReactNode;
255
+ href?: string;
256
+ disabled?: boolean;
257
+ onClick?: () => void;
258
+ hide?: boolean;
259
+ };
260
+ type SideBarProps = {
261
+ title?: react__default.ReactNode;
262
+ items?: SideMenuItem[];
263
+ open?: boolean;
264
+ onOpenChange?: (open: boolean) => void;
265
+ onItemSelect?: (item: SideMenuItem) => void;
266
+ current?: string;
267
+ className?: string;
268
+ maxWidth?: number;
269
+ minWidth?: number;
270
+ style?: react__default.CSSProperties;
271
+ };
272
+ declare const SideBar: react__default.FC<SideBarProps>;
273
+
274
+ declare const SideNavbarWidget: react__default.FC<Partial<SideBarProps>>;
275
+
345
276
  type SubAccountWidgetProps = {
346
277
  customTrigger?: ReactNode;
347
278
  };
@@ -376,6 +307,20 @@ declare function SubAccountUI(props: SubAccountScriptReturn & {
376
307
  customTrigger?: ReactNode;
377
308
  }): react_jsx_runtime.JSX.Element;
378
309
 
310
+ type FooterReturns = {
311
+ wsStatus: WsNetworkStatus;
312
+ };
313
+
314
+ type FooterProps = {
315
+ telegramUrl?: string;
316
+ twitterUrl?: string;
317
+ discordUrl?: string;
318
+ trailing?: ReactNode;
319
+ };
320
+ declare const FooterWidget: react__default.FC<FooterProps>;
321
+
322
+ declare const Footer: FC<FooterReturns & FooterProps>;
323
+
379
324
  interface MaintenanceTipInterface {
380
325
  tipsContent: string;
381
326
  showTips: boolean;
@@ -388,27 +333,6 @@ declare const MaintenanceTipsUI: (props: MaintenanceTipInterface) => react_jsx_r
388
333
 
389
334
  declare const MaintenanceTipsWidget: () => react_jsx_runtime.JSX.Element;
390
335
 
391
- type AnnouncementScriptOptions = {
392
- hideTips?: boolean;
393
- };
394
- type AnnouncementScriptReturn = ReturnType<typeof useAnnouncementScript>;
395
- declare const useAnnouncementScript: (options?: AnnouncementScriptOptions) => {
396
- maintenanceDialogInfo: string | undefined;
397
- tips: API.AnnouncementRow[];
398
- closeTips: () => void;
399
- showAnnouncement: boolean;
400
- };
401
-
402
- type AnnouncementProps = AnnouncementScriptReturn & {
403
- style?: react__default.CSSProperties;
404
- className?: string;
405
- hideTips?: boolean;
406
- };
407
- declare const AnnouncementUI: react__default.FC<Readonly<AnnouncementProps>>;
408
-
409
- type AnnouncementWidgetProps = Pick<AnnouncementProps, "style" | "className" | "hideTips">;
410
- declare const AnnouncementWidget: react__default.FC<AnnouncementWidgetProps>;
411
-
412
336
  type UseRestrictedInfoScriptReturn = ReturnType<typeof useRestrictedInfoScript> & {
413
337
  brokerName?: string;
414
338
  };
@@ -440,6 +364,71 @@ declare const RestrictedInfo: FC<RestrictedInfoProps>;
440
364
  type RestrictedInfoWidgetProps = Pick<RestrictedInfoProps, "className">;
441
365
  declare const RestrictedInfoWidget: FC<RestrictedInfoWidgetProps>;
442
366
 
367
+ type ScaffoldProps = {
368
+ /**
369
+ * custom left sidebar component, only works on desktop
370
+ * if provided, the layout will use this component over the default sidebar component
371
+ */
372
+ leftSidebar?: ReactNode;
373
+ /**
374
+ * custom left sidebar props, only works on desktop
375
+ */
376
+ leftSideProps?: SideBarProps;
377
+ /**
378
+ * custom left nav props, only works on mobile
379
+ */
380
+ leftNavProps?: LeftNavProps;
381
+ /**
382
+ * custom top bar component
383
+ */
384
+ topBar?: ReactNode;
385
+ /**
386
+ * custom top nav props
387
+ */
388
+ mainNavProps?: MainNavWidgetProps;
389
+ /**
390
+ * custom bottom nav component, only works on mobile
391
+ */
392
+ bottomNav?: ReactNode;
393
+ /**
394
+ * custom bottom nav component, only works on mobile
395
+ */
396
+ bottomNavProps?: BottomNavProps$1;
397
+ /**
398
+ * custom footer component, only works on desktop
399
+ */
400
+ footer?: ReactNode;
401
+ /**
402
+ * custom footer props, only works on desktop
403
+ */
404
+ footerProps?: FooterProps;
405
+ routerAdapter?: RouterAdapter;
406
+ classNames?: {
407
+ root?: string;
408
+ container?: string;
409
+ content?: string;
410
+ body?: string;
411
+ leftSidebar?: string;
412
+ topNavbar?: string;
413
+ footer?: string;
414
+ bottomNav?: string;
415
+ };
416
+ };
417
+ declare const Scaffold: react__default.FC<PropsWithChildren<ScaffoldProps>>;
418
+
419
+ type ScaffoldState = {
420
+ routerAdapter?: RouterAdapter;
421
+ expanded?: boolean;
422
+ setExpand: (expand: boolean) => void;
423
+ checkChainSupport: (chainId: number | string) => boolean;
424
+ topNavbarHeight: number;
425
+ footerHeight: number;
426
+ announcementHeight: number;
427
+ announcementState: ReturnType<typeof useAnnouncement>;
428
+ };
429
+ declare const ScaffoldContext: react.Context<ScaffoldState>;
430
+ declare const useScaffoldContext: () => ScaffoldState;
431
+
443
432
  type MainLogoProps = {
444
433
  src?: string;
445
434
  alt?: string;
@@ -486,4 +475,4 @@ declare const useScanQRCodeScript: () => {
486
475
  type ScanQRCodeProps = UseScanQRCodeScriptReturn;
487
476
  declare const ScanQRCode: FC<ScanQRCodeProps>;
488
477
 
489
- export { AccountMenuWidget, AccountSummaryWidget, AnnouncementUI, AnnouncementWidget, type AnnouncementWidgetProps, BottomNav, type BottomNavProps$1 as BottomNavProps, BottomNavWidget, CampaignPositionEnum, ChainMenu, ChainMenuWidget, Footer, type FooterProps, FooterWidget, LanguageSwitcher, type LanguageSwitcherProps, type LanguageSwitcherScriptReturn, LanguageSwitcherWidget, type LanguageSwitcherWidgetProps, type LeftNavItem, type LeftNavProps, LeftNavUI, LeftNavWidget, MainLogo, MainNavMobile, MainNavWidget, type MainNavWidgetProps, MaintenanceTipsUI, MaintenanceTipsWidget, RestrictedInfo, RestrictedInfoWidget, type RouteOption, type RouterAdapter, Scaffold, ScaffoldContext, type ScaffoldProps, ScanQRCode, ScanQRCodeWidget, SideBar, type SideBarProps, type SideMenuItem, SideNavbarWidget, SubAccountScript, SubAccountUI, SubAccountWidget, useAnnouncementScript, useLanguageSwitcherScript, useRestrictedInfoScript, useScaffoldContext, useScanQRCodeScript };
478
+ export { AccountMenuWidget, AccountSummaryWidget, BottomNav, type BottomNavProps$1 as BottomNavProps, BottomNavWidget, CampaignPositionEnum, ChainMenu, ChainMenuWidget, Footer, type FooterProps, FooterWidget, LanguageSwitcher, type LanguageSwitcherProps, type LanguageSwitcherScriptReturn, LanguageSwitcherWidget, type LanguageSwitcherWidgetProps, type LeftNavItem, type LeftNavProps, LeftNavUI, type LeftNavUIProps, LeftNavWidget, MainLogo, type MainNavItem, MainNavMobile, MainNavWidget, type MainNavWidgetProps, MaintenanceTipsUI, MaintenanceTipsWidget, RestrictedInfo, RestrictedInfoWidget, Scaffold, ScaffoldContext, type ScaffoldProps, ScanQRCode, ScanQRCodeWidget, SideBar, type SideBarProps, type SideMenuItem, SideNavbarWidget, SubAccountScript, SubAccountUI, SubAccountWidget, useLanguageSwitcherScript, useRestrictedInfoScript, useScaffoldContext, useScanQRCodeScript };