@kodiak-finance/orderly-ui-scaffold 2.9.1 → 2.9.2-alpha.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.mts CHANGED
@@ -1,52 +1,41 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as react from 'react';
3
- import react__default, { ReactNode, HTMLAttributeAnchorTarget, FC, PropsWithChildren } from 'react';
4
1
  import * as _kodiak_finance_orderly_types from '@kodiak-finance/orderly-types';
5
- import { RouterAdapter, NetworkId, API } from '@kodiak-finance/orderly-types';
2
+ import { AccountStatusEnum, RouterAdapter, NetworkId, API } from '@kodiak-finance/orderly-types';
3
+ import * as react from 'react';
4
+ import react__default, { HTMLAttributeAnchorTarget, ReactNode, FC, PropsWithChildren } from 'react';
5
+ import * as react_jsx_runtime from 'react/jsx-runtime';
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 { LanguageContextState } from '@kodiak-finance/orderly-i18n';
9
9
  import { useAnnouncement } from '@kodiak-finance/orderly-ui-notification';
10
10
 
11
- declare const AccountMenuWidget: () => react_jsx_runtime.JSX.Element;
12
-
13
- type LeftNavProps = {
14
- /** custom leading */
15
- leading?: ReactNode;
16
- menus?: LeftNavItem[];
17
- twitterUrl?: string;
18
- telegramUrl?: string;
19
- discordUrl?: string;
20
- duneUrl?: string;
21
- /**
22
- * @deprecated Deprecated. This prop will no longer affect the rendered UI
23
- * in the leftNav drawer footer. Use `customFooter` instead.
24
- */
25
- feedbackUrl?: string;
26
- customFooter?: ReactNode;
27
- customLeftNav?: ReactNode;
11
+ type AccountMenuProps = {
12
+ accountState: AccountState;
13
+ address?: string;
14
+ onDisconnect: () => void;
15
+ connect: () => Promise<void>;
16
+ onCrateAccount: () => Promise<void>;
17
+ onCreateOrderlyKey: () => Promise<void>;
18
+ onOpenExplorer: () => void;
19
+ onSwitchNetwork: () => void;
20
+ wrongNetwork: boolean;
21
+ disabledConnect?: boolean;
22
+ isMobile: boolean;
28
23
  };
29
- type LeftNavItem = {
30
- name: string;
31
- href: string;
32
- target?: string;
33
- icon?: ReactNode;
34
- trailing?: ReactNode;
35
- customRender?: (option: {
36
- name: string;
37
- href: string;
38
- isActive?: boolean;
39
- }) => React.ReactNode;
24
+ type AccountState = {
25
+ status: AccountStatusEnum;
40
26
  /**
41
- * if true, this item will only be shown in the main account
42
- * @default false
43
- **/
44
- onlyInMainAccount?: boolean;
45
- /**
46
- * Optional secondary style; secondary items render smaller and gray.
47
- * Secondary items are grouped below primary items with a divider in between.
27
+ * whether the account is validating
48
28
  */
49
- isSecondary?: boolean;
29
+ validating: boolean;
30
+ chainNamespace?: string;
31
+ accountId?: string;
32
+ userId?: string;
33
+ address?: string;
34
+ isNew?: boolean;
35
+ connectWallet?: {
36
+ name: string;
37
+ chainId: number;
38
+ };
50
39
  };
51
40
 
52
41
  type MainNavItem = {
@@ -114,6 +103,66 @@ type MainNavClassNames = {
114
103
  navItem?: string;
115
104
  subMenu?: string;
116
105
  };
106
+ type MainNavItemsProps = {
107
+ items?: MainNavItem[];
108
+ current?: string[];
109
+ classNames?: MainNavClassNames;
110
+ onItemClick?: (item: MainNavItem[]) => void;
111
+ };
112
+
113
+ /**
114
+ * Module augmentation: maps interceptor target paths to their component props types.
115
+ * Import from @kodiak-finance/orderly-ui-scaffold to enable typed props in
116
+ * createInterceptor('Account.AccountMenu', ...) and createInterceptor('Layout.MainMenus', ...).
117
+ */
118
+
119
+ declare module "@kodiak-finance/orderly-plugin-core" {
120
+ interface InterceptorTargetPropsMap {
121
+ "Account.AccountMenu": AccountMenuProps;
122
+ "Layout.MainMenus": MainNavItemsProps;
123
+ }
124
+ }
125
+
126
+ declare const AccountMenuWidget: () => react_jsx_runtime.JSX.Element;
127
+
128
+ type LeftNavProps = {
129
+ /** custom leading */
130
+ leading?: ReactNode;
131
+ menus?: LeftNavItem[];
132
+ twitterUrl?: string;
133
+ telegramUrl?: string;
134
+ discordUrl?: string;
135
+ duneUrl?: string;
136
+ /**
137
+ * @deprecated Deprecated. This prop will no longer affect the rendered UI
138
+ * in the leftNav drawer footer. Use `customFooter` instead.
139
+ */
140
+ feedbackUrl?: string;
141
+ customFooter?: ReactNode;
142
+ customLeftNav?: ReactNode;
143
+ };
144
+ type LeftNavItem = {
145
+ name: string;
146
+ href: string;
147
+ target?: string;
148
+ icon?: ReactNode;
149
+ trailing?: ReactNode;
150
+ customRender?: (option: {
151
+ name: string;
152
+ href: string;
153
+ isActive?: boolean;
154
+ }) => React.ReactNode;
155
+ /**
156
+ * if true, this item will only be shown in the main account
157
+ * @default false
158
+ **/
159
+ onlyInMainAccount?: boolean;
160
+ /**
161
+ * Optional secondary style; secondary items render smaller and gray.
162
+ * Secondary items are grouped below primary items with a divider in between.
163
+ */
164
+ isSecondary?: boolean;
165
+ };
117
166
 
118
167
  declare const useLeftNavScript: () => {
119
168
  open: boolean;
@@ -482,4 +531,4 @@ declare const useScanQRCodeScript: () => {
482
531
  type ScanQRCodeProps = UseScanQRCodeScriptReturn;
483
532
  declare const ScanQRCode: FC<ScanQRCodeProps>;
484
533
 
485
- 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 };
534
+ export { type AccountMenuProps, 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, type MainNavItemsProps, 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 };
package/dist/index.d.ts CHANGED
@@ -1,52 +1,41 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as react from 'react';
3
- import react__default, { ReactNode, HTMLAttributeAnchorTarget, FC, PropsWithChildren } from 'react';
4
1
  import * as _kodiak_finance_orderly_types from '@kodiak-finance/orderly-types';
5
- import { RouterAdapter, NetworkId, API } from '@kodiak-finance/orderly-types';
2
+ import { AccountStatusEnum, RouterAdapter, NetworkId, API } from '@kodiak-finance/orderly-types';
3
+ import * as react from 'react';
4
+ import react__default, { HTMLAttributeAnchorTarget, ReactNode, FC, PropsWithChildren } from 'react';
5
+ import * as react_jsx_runtime from 'react/jsx-runtime';
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 { LanguageContextState } from '@kodiak-finance/orderly-i18n';
9
9
  import { useAnnouncement } from '@kodiak-finance/orderly-ui-notification';
10
10
 
11
- declare const AccountMenuWidget: () => react_jsx_runtime.JSX.Element;
12
-
13
- type LeftNavProps = {
14
- /** custom leading */
15
- leading?: ReactNode;
16
- menus?: LeftNavItem[];
17
- twitterUrl?: string;
18
- telegramUrl?: string;
19
- discordUrl?: string;
20
- duneUrl?: string;
21
- /**
22
- * @deprecated Deprecated. This prop will no longer affect the rendered UI
23
- * in the leftNav drawer footer. Use `customFooter` instead.
24
- */
25
- feedbackUrl?: string;
26
- customFooter?: ReactNode;
27
- customLeftNav?: ReactNode;
11
+ type AccountMenuProps = {
12
+ accountState: AccountState;
13
+ address?: string;
14
+ onDisconnect: () => void;
15
+ connect: () => Promise<void>;
16
+ onCrateAccount: () => Promise<void>;
17
+ onCreateOrderlyKey: () => Promise<void>;
18
+ onOpenExplorer: () => void;
19
+ onSwitchNetwork: () => void;
20
+ wrongNetwork: boolean;
21
+ disabledConnect?: boolean;
22
+ isMobile: boolean;
28
23
  };
29
- type LeftNavItem = {
30
- name: string;
31
- href: string;
32
- target?: string;
33
- icon?: ReactNode;
34
- trailing?: ReactNode;
35
- customRender?: (option: {
36
- name: string;
37
- href: string;
38
- isActive?: boolean;
39
- }) => React.ReactNode;
24
+ type AccountState = {
25
+ status: AccountStatusEnum;
40
26
  /**
41
- * if true, this item will only be shown in the main account
42
- * @default false
43
- **/
44
- onlyInMainAccount?: boolean;
45
- /**
46
- * Optional secondary style; secondary items render smaller and gray.
47
- * Secondary items are grouped below primary items with a divider in between.
27
+ * whether the account is validating
48
28
  */
49
- isSecondary?: boolean;
29
+ validating: boolean;
30
+ chainNamespace?: string;
31
+ accountId?: string;
32
+ userId?: string;
33
+ address?: string;
34
+ isNew?: boolean;
35
+ connectWallet?: {
36
+ name: string;
37
+ chainId: number;
38
+ };
50
39
  };
51
40
 
52
41
  type MainNavItem = {
@@ -114,6 +103,66 @@ type MainNavClassNames = {
114
103
  navItem?: string;
115
104
  subMenu?: string;
116
105
  };
106
+ type MainNavItemsProps = {
107
+ items?: MainNavItem[];
108
+ current?: string[];
109
+ classNames?: MainNavClassNames;
110
+ onItemClick?: (item: MainNavItem[]) => void;
111
+ };
112
+
113
+ /**
114
+ * Module augmentation: maps interceptor target paths to their component props types.
115
+ * Import from @kodiak-finance/orderly-ui-scaffold to enable typed props in
116
+ * createInterceptor('Account.AccountMenu', ...) and createInterceptor('Layout.MainMenus', ...).
117
+ */
118
+
119
+ declare module "@kodiak-finance/orderly-plugin-core" {
120
+ interface InterceptorTargetPropsMap {
121
+ "Account.AccountMenu": AccountMenuProps;
122
+ "Layout.MainMenus": MainNavItemsProps;
123
+ }
124
+ }
125
+
126
+ declare const AccountMenuWidget: () => react_jsx_runtime.JSX.Element;
127
+
128
+ type LeftNavProps = {
129
+ /** custom leading */
130
+ leading?: ReactNode;
131
+ menus?: LeftNavItem[];
132
+ twitterUrl?: string;
133
+ telegramUrl?: string;
134
+ discordUrl?: string;
135
+ duneUrl?: string;
136
+ /**
137
+ * @deprecated Deprecated. This prop will no longer affect the rendered UI
138
+ * in the leftNav drawer footer. Use `customFooter` instead.
139
+ */
140
+ feedbackUrl?: string;
141
+ customFooter?: ReactNode;
142
+ customLeftNav?: ReactNode;
143
+ };
144
+ type LeftNavItem = {
145
+ name: string;
146
+ href: string;
147
+ target?: string;
148
+ icon?: ReactNode;
149
+ trailing?: ReactNode;
150
+ customRender?: (option: {
151
+ name: string;
152
+ href: string;
153
+ isActive?: boolean;
154
+ }) => React.ReactNode;
155
+ /**
156
+ * if true, this item will only be shown in the main account
157
+ * @default false
158
+ **/
159
+ onlyInMainAccount?: boolean;
160
+ /**
161
+ * Optional secondary style; secondary items render smaller and gray.
162
+ * Secondary items are grouped below primary items with a divider in between.
163
+ */
164
+ isSecondary?: boolean;
165
+ };
117
166
 
118
167
  declare const useLeftNavScript: () => {
119
168
  open: boolean;
@@ -482,4 +531,4 @@ declare const useScanQRCodeScript: () => {
482
531
  type ScanQRCodeProps = UseScanQRCodeScriptReturn;
483
532
  declare const ScanQRCode: FC<ScanQRCodeProps>;
484
533
 
485
- 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 };
534
+ export { type AccountMenuProps, 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, type MainNavItemsProps, 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 };
package/dist/index.js CHANGED
@@ -978,21 +978,14 @@ var useAccountMenu = () => {
978
978
  isMobile
979
979
  };
980
980
  };
981
+ var InjectableAccountMenu = orderlyUi.injectable(AccountMenu, "Account.AccountMenu");
981
982
  var AccountMenuWidget = () => {
982
983
  const state = useAccountMenu();
983
984
  return /* @__PURE__ */ jsxRuntime.jsx(AccountMenu, { ...state });
984
985
  };
985
- orderlyUi.installExtension({
986
- name: "account-menu",
987
- scope: ["*"],
988
- positions: [orderlyUi.ExtensionPositionEnum.AccountMenu],
989
- builder: useAccountMenu,
990
- __isInternal: true
991
- })((props) => {
992
- return /* @__PURE__ */ jsxRuntime.jsx(AccountMenu, { ...props });
993
- });
994
986
  var WalletConnectButtonExtension = () => {
995
- return /* @__PURE__ */ jsxRuntime.jsx(orderlyUi.ExtensionSlot, { position: orderlyUi.ExtensionPositionEnum.AccountMenu });
987
+ const state = useAccountMenu();
988
+ return /* @__PURE__ */ jsxRuntime.jsx(InjectableAccountMenu, { ...state });
996
989
  };
997
990
  var useChainMenuScript = () => {
998
991
  const [open2, setOpen] = React7.useState(false);
@@ -5526,16 +5519,9 @@ var MainNavMenus = (props) => {
5526
5519
  index
5527
5520
  )) });
5528
5521
  };
5529
- orderlyUi.installExtension({
5530
- name: "default-main-nav-menus",
5531
- scope: ["*"],
5532
- positions: [orderlyUi.ExtensionPositionEnum.MainMenus],
5533
- __isInternal: true
5534
- })((props) => {
5535
- return /* @__PURE__ */ jsxRuntime.jsx(MainNavMenus, { ...props });
5536
- });
5522
+ var InjectableMainNavMenus = orderlyUi.injectable(MainNavMenus, "Layout.MainMenus");
5537
5523
  var MainNavMenusExtension = (props) => {
5538
- return /* @__PURE__ */ jsxRuntime.jsx(orderlyUi.ExtensionSlot, { position: orderlyUi.ExtensionPositionEnum.MainMenus, ...props });
5524
+ return /* @__PURE__ */ jsxRuntime.jsx(InjectableMainNavMenus, { ...props });
5539
5525
  };
5540
5526
  var MainNav = (props) => {
5541
5527
  const { className, classNames, campaigns, campaignPosition } = props;