@orderly.network/ui-scaffold 2.0.0 → 2.0.1-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 +50 -54
- package/dist/index.d.ts +50 -54
- package/dist/index.js +18 -18
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -6
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +9 -9
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import React__default, { HTMLAttributeAnchorTarget, FC, PropsWithChildren } from 'react';
|
|
4
|
-
import { LogoProps
|
|
4
|
+
import { LogoProps } from '@orderly.network/ui';
|
|
5
5
|
import { AccountStatusEnum, NetworkId } from '@orderly.network/types';
|
|
6
6
|
import { WsNetworkStatus } from '@orderly.network/hooks';
|
|
7
7
|
|
|
@@ -58,27 +58,6 @@ declare enum CampaignPositionEnum {
|
|
|
58
58
|
menuTailing = "menuTailing",
|
|
59
59
|
navTailing = "navTailing"
|
|
60
60
|
}
|
|
61
|
-
type MainNavWidgetProps = {
|
|
62
|
-
logo: {
|
|
63
|
-
src: string;
|
|
64
|
-
alt: string;
|
|
65
|
-
};
|
|
66
|
-
mainMenus: MainNavItem[];
|
|
67
|
-
products: MainNavItem[];
|
|
68
|
-
campaigns?: MainNavItem;
|
|
69
|
-
campaignPosition?: CampaignPositionEnum;
|
|
70
|
-
initialProduct: string;
|
|
71
|
-
/**
|
|
72
|
-
* initial menu path, if it has submenus, use array
|
|
73
|
-
* @type string | string[]
|
|
74
|
-
*/
|
|
75
|
-
initialMenu: string | string[];
|
|
76
|
-
onItemClick?: (options: {
|
|
77
|
-
href: string;
|
|
78
|
-
name: string;
|
|
79
|
-
scope?: string;
|
|
80
|
-
}) => void;
|
|
81
|
-
};
|
|
82
61
|
|
|
83
62
|
type CampaignProps = {
|
|
84
63
|
item: MainNavItem;
|
|
@@ -107,7 +86,28 @@ type MainNavProps = {
|
|
|
107
86
|
};
|
|
108
87
|
};
|
|
109
88
|
|
|
110
|
-
|
|
89
|
+
type MainNavWidgetProps = PropsWithChildren<{
|
|
90
|
+
logo?: {
|
|
91
|
+
src: string;
|
|
92
|
+
alt: string;
|
|
93
|
+
};
|
|
94
|
+
mainMenus?: MainNavItem[];
|
|
95
|
+
products?: MainNavItem[];
|
|
96
|
+
campaigns?: MainNavItem;
|
|
97
|
+
campaignPosition?: CampaignPositionEnum;
|
|
98
|
+
initialProduct?: string;
|
|
99
|
+
/**
|
|
100
|
+
* initial menu path, if it has submenus, use array
|
|
101
|
+
* @type string | string[]
|
|
102
|
+
*/
|
|
103
|
+
initialMenu?: string | string[];
|
|
104
|
+
onItemClick?: (options: {
|
|
105
|
+
href: string;
|
|
106
|
+
name: string;
|
|
107
|
+
scope?: string;
|
|
108
|
+
}) => void;
|
|
109
|
+
}> & Pick<MainNavProps, "classNames">;
|
|
110
|
+
declare const MainNavWidget: (props: MainNavWidgetProps) => react_jsx_runtime.JSX.Element;
|
|
111
111
|
|
|
112
112
|
declare const AccountSummaryWidget: () => react_jsx_runtime.JSX.Element;
|
|
113
113
|
|
|
@@ -124,8 +124,8 @@ declare const ChainMenu: (props: {
|
|
|
124
124
|
mainnet: ChainItem[];
|
|
125
125
|
testnet: ChainItem[];
|
|
126
126
|
};
|
|
127
|
-
onChange?: (
|
|
128
|
-
currentChainId?: number
|
|
127
|
+
onChange?: (chain: ChainItem) => Promise<any>;
|
|
128
|
+
currentChainId?: number;
|
|
129
129
|
wrongNetwork: boolean;
|
|
130
130
|
isConnected: boolean;
|
|
131
131
|
accountStatus: AccountStatusEnum;
|
|
@@ -141,7 +141,7 @@ type SideMenuItem = {
|
|
|
141
141
|
};
|
|
142
142
|
type SideBarProps = {
|
|
143
143
|
title?: React__default.ReactNode;
|
|
144
|
-
items
|
|
144
|
+
items?: SideMenuItem[];
|
|
145
145
|
open?: boolean;
|
|
146
146
|
onOpenChange?: (open: boolean) => void;
|
|
147
147
|
onItemSelect?: (item: SideMenuItem) => void;
|
|
@@ -158,27 +158,14 @@ declare const SideBar: {
|
|
|
158
158
|
|
|
159
159
|
declare const SideNavbarWidget: (props?: Partial<SideBarProps>) => react_jsx_runtime.JSX.Element;
|
|
160
160
|
|
|
161
|
-
type
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
declare const FooterUI: FC<FooterReturns>;
|
|
167
|
-
|
|
168
|
-
declare const FooterWidget: () => react_jsx_runtime.JSX.Element;
|
|
169
|
-
|
|
170
|
-
type FooterConfig = {
|
|
171
|
-
telegramUrl?: string;
|
|
172
|
-
twitterUrl?: string;
|
|
173
|
-
discordmUrl?: string;
|
|
161
|
+
type RouteOption = {
|
|
162
|
+
href: string;
|
|
163
|
+
name: string;
|
|
164
|
+
scope?: string;
|
|
165
|
+
target?: string;
|
|
174
166
|
};
|
|
175
|
-
|
|
176
167
|
type routerAdapter = {
|
|
177
|
-
onRouteChange: (
|
|
178
|
-
href: string;
|
|
179
|
-
name: string;
|
|
180
|
-
scope?: string;
|
|
181
|
-
}) => void;
|
|
168
|
+
onRouteChange: (option: RouteOption) => void;
|
|
182
169
|
currentPath?: string;
|
|
183
170
|
};
|
|
184
171
|
type ExpandableState = {
|
|
@@ -186,30 +173,39 @@ type ExpandableState = {
|
|
|
186
173
|
expanded?: boolean;
|
|
187
174
|
setExpand: (expand: boolean) => void;
|
|
188
175
|
checkChainSupport: (chainId: number | string) => boolean;
|
|
189
|
-
footerConfig?: FooterConfig;
|
|
190
176
|
};
|
|
191
177
|
declare const ExpandableContext: React.Context<ExpandableState>;
|
|
192
178
|
declare const useScaffoldContext: () => ExpandableState;
|
|
193
179
|
|
|
180
|
+
type FooterReturns = {
|
|
181
|
+
wsStatus: WsNetworkStatus;
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
type FooterProps = {
|
|
185
|
+
telegramUrl?: string;
|
|
186
|
+
twitterUrl?: string;
|
|
187
|
+
discordmUrl?: string;
|
|
188
|
+
};
|
|
189
|
+
declare const FooterWidget: (props: FooterProps) => react_jsx_runtime.JSX.Element;
|
|
190
|
+
|
|
191
|
+
declare const Footer: FC<FooterReturns & FooterProps>;
|
|
192
|
+
|
|
194
193
|
type LayoutProps = {
|
|
195
194
|
/**
|
|
196
195
|
* Custom left sidebar component,
|
|
197
196
|
* if provided, the layout will use this component over the default sidebar component
|
|
198
197
|
*/
|
|
199
|
-
leftSidebar?: React__default.ReactNode;
|
|
200
198
|
gap?: number;
|
|
201
|
-
|
|
202
|
-
bodyPadding?: SizeType;
|
|
199
|
+
leftSidebar?: React__default.ReactNode;
|
|
203
200
|
leftSideProps?: SideBarProps;
|
|
204
201
|
rightSidebar?: React__default.ReactNode;
|
|
205
202
|
topBar?: React__default.ReactNode;
|
|
206
|
-
mainNavProps?:
|
|
203
|
+
mainNavProps?: MainNavWidgetProps;
|
|
207
204
|
footer?: React__default.ReactNode;
|
|
205
|
+
footerProps?: FooterProps;
|
|
208
206
|
routerAdapter?: routerAdapter;
|
|
209
|
-
footerHeight?: number;
|
|
210
|
-
footerIsSticky?: boolean;
|
|
211
|
-
footerConfig?: FooterConfig;
|
|
212
207
|
classNames?: {
|
|
208
|
+
root?: string;
|
|
213
209
|
content?: string;
|
|
214
210
|
body?: string;
|
|
215
211
|
leftSidebar?: string;
|
|
@@ -231,4 +227,4 @@ declare const MaintenanceTipsUI: (props: MaintenanceTipInterface) => react_jsx_r
|
|
|
231
227
|
|
|
232
228
|
declare const MaintenanceTipsWidget: () => react_jsx_runtime.JSX.Element;
|
|
233
229
|
|
|
234
|
-
export { AccountMenuWidget, AccountSummaryWidget, CampaignPositionEnum, ChainMenu, ChainMenuWidget, ExpandableContext, type
|
|
230
|
+
export { AccountMenuWidget, AccountSummaryWidget, CampaignPositionEnum, ChainMenu, ChainMenuWidget, ExpandableContext, Footer, type FooterProps, FooterWidget, type LayoutProps, MainNavWidget, type MainNavWidgetProps, MaintenanceTipsUI, MaintenanceTipsWidget, ProductsMenu, type RouteOption, Scaffold, SideBar, type SideBarProps, type SideMenuItem, SideNavbarWidget, useScaffoldContext };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import React__default, { HTMLAttributeAnchorTarget, FC, PropsWithChildren } from 'react';
|
|
4
|
-
import { LogoProps
|
|
4
|
+
import { LogoProps } from '@orderly.network/ui';
|
|
5
5
|
import { AccountStatusEnum, NetworkId } from '@orderly.network/types';
|
|
6
6
|
import { WsNetworkStatus } from '@orderly.network/hooks';
|
|
7
7
|
|
|
@@ -58,27 +58,6 @@ declare enum CampaignPositionEnum {
|
|
|
58
58
|
menuTailing = "menuTailing",
|
|
59
59
|
navTailing = "navTailing"
|
|
60
60
|
}
|
|
61
|
-
type MainNavWidgetProps = {
|
|
62
|
-
logo: {
|
|
63
|
-
src: string;
|
|
64
|
-
alt: string;
|
|
65
|
-
};
|
|
66
|
-
mainMenus: MainNavItem[];
|
|
67
|
-
products: MainNavItem[];
|
|
68
|
-
campaigns?: MainNavItem;
|
|
69
|
-
campaignPosition?: CampaignPositionEnum;
|
|
70
|
-
initialProduct: string;
|
|
71
|
-
/**
|
|
72
|
-
* initial menu path, if it has submenus, use array
|
|
73
|
-
* @type string | string[]
|
|
74
|
-
*/
|
|
75
|
-
initialMenu: string | string[];
|
|
76
|
-
onItemClick?: (options: {
|
|
77
|
-
href: string;
|
|
78
|
-
name: string;
|
|
79
|
-
scope?: string;
|
|
80
|
-
}) => void;
|
|
81
|
-
};
|
|
82
61
|
|
|
83
62
|
type CampaignProps = {
|
|
84
63
|
item: MainNavItem;
|
|
@@ -107,7 +86,28 @@ type MainNavProps = {
|
|
|
107
86
|
};
|
|
108
87
|
};
|
|
109
88
|
|
|
110
|
-
|
|
89
|
+
type MainNavWidgetProps = PropsWithChildren<{
|
|
90
|
+
logo?: {
|
|
91
|
+
src: string;
|
|
92
|
+
alt: string;
|
|
93
|
+
};
|
|
94
|
+
mainMenus?: MainNavItem[];
|
|
95
|
+
products?: MainNavItem[];
|
|
96
|
+
campaigns?: MainNavItem;
|
|
97
|
+
campaignPosition?: CampaignPositionEnum;
|
|
98
|
+
initialProduct?: string;
|
|
99
|
+
/**
|
|
100
|
+
* initial menu path, if it has submenus, use array
|
|
101
|
+
* @type string | string[]
|
|
102
|
+
*/
|
|
103
|
+
initialMenu?: string | string[];
|
|
104
|
+
onItemClick?: (options: {
|
|
105
|
+
href: string;
|
|
106
|
+
name: string;
|
|
107
|
+
scope?: string;
|
|
108
|
+
}) => void;
|
|
109
|
+
}> & Pick<MainNavProps, "classNames">;
|
|
110
|
+
declare const MainNavWidget: (props: MainNavWidgetProps) => react_jsx_runtime.JSX.Element;
|
|
111
111
|
|
|
112
112
|
declare const AccountSummaryWidget: () => react_jsx_runtime.JSX.Element;
|
|
113
113
|
|
|
@@ -124,8 +124,8 @@ declare const ChainMenu: (props: {
|
|
|
124
124
|
mainnet: ChainItem[];
|
|
125
125
|
testnet: ChainItem[];
|
|
126
126
|
};
|
|
127
|
-
onChange?: (
|
|
128
|
-
currentChainId?: number
|
|
127
|
+
onChange?: (chain: ChainItem) => Promise<any>;
|
|
128
|
+
currentChainId?: number;
|
|
129
129
|
wrongNetwork: boolean;
|
|
130
130
|
isConnected: boolean;
|
|
131
131
|
accountStatus: AccountStatusEnum;
|
|
@@ -141,7 +141,7 @@ type SideMenuItem = {
|
|
|
141
141
|
};
|
|
142
142
|
type SideBarProps = {
|
|
143
143
|
title?: React__default.ReactNode;
|
|
144
|
-
items
|
|
144
|
+
items?: SideMenuItem[];
|
|
145
145
|
open?: boolean;
|
|
146
146
|
onOpenChange?: (open: boolean) => void;
|
|
147
147
|
onItemSelect?: (item: SideMenuItem) => void;
|
|
@@ -158,27 +158,14 @@ declare const SideBar: {
|
|
|
158
158
|
|
|
159
159
|
declare const SideNavbarWidget: (props?: Partial<SideBarProps>) => react_jsx_runtime.JSX.Element;
|
|
160
160
|
|
|
161
|
-
type
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
declare const FooterUI: FC<FooterReturns>;
|
|
167
|
-
|
|
168
|
-
declare const FooterWidget: () => react_jsx_runtime.JSX.Element;
|
|
169
|
-
|
|
170
|
-
type FooterConfig = {
|
|
171
|
-
telegramUrl?: string;
|
|
172
|
-
twitterUrl?: string;
|
|
173
|
-
discordmUrl?: string;
|
|
161
|
+
type RouteOption = {
|
|
162
|
+
href: string;
|
|
163
|
+
name: string;
|
|
164
|
+
scope?: string;
|
|
165
|
+
target?: string;
|
|
174
166
|
};
|
|
175
|
-
|
|
176
167
|
type routerAdapter = {
|
|
177
|
-
onRouteChange: (
|
|
178
|
-
href: string;
|
|
179
|
-
name: string;
|
|
180
|
-
scope?: string;
|
|
181
|
-
}) => void;
|
|
168
|
+
onRouteChange: (option: RouteOption) => void;
|
|
182
169
|
currentPath?: string;
|
|
183
170
|
};
|
|
184
171
|
type ExpandableState = {
|
|
@@ -186,30 +173,39 @@ type ExpandableState = {
|
|
|
186
173
|
expanded?: boolean;
|
|
187
174
|
setExpand: (expand: boolean) => void;
|
|
188
175
|
checkChainSupport: (chainId: number | string) => boolean;
|
|
189
|
-
footerConfig?: FooterConfig;
|
|
190
176
|
};
|
|
191
177
|
declare const ExpandableContext: React.Context<ExpandableState>;
|
|
192
178
|
declare const useScaffoldContext: () => ExpandableState;
|
|
193
179
|
|
|
180
|
+
type FooterReturns = {
|
|
181
|
+
wsStatus: WsNetworkStatus;
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
type FooterProps = {
|
|
185
|
+
telegramUrl?: string;
|
|
186
|
+
twitterUrl?: string;
|
|
187
|
+
discordmUrl?: string;
|
|
188
|
+
};
|
|
189
|
+
declare const FooterWidget: (props: FooterProps) => react_jsx_runtime.JSX.Element;
|
|
190
|
+
|
|
191
|
+
declare const Footer: FC<FooterReturns & FooterProps>;
|
|
192
|
+
|
|
194
193
|
type LayoutProps = {
|
|
195
194
|
/**
|
|
196
195
|
* Custom left sidebar component,
|
|
197
196
|
* if provided, the layout will use this component over the default sidebar component
|
|
198
197
|
*/
|
|
199
|
-
leftSidebar?: React__default.ReactNode;
|
|
200
198
|
gap?: number;
|
|
201
|
-
|
|
202
|
-
bodyPadding?: SizeType;
|
|
199
|
+
leftSidebar?: React__default.ReactNode;
|
|
203
200
|
leftSideProps?: SideBarProps;
|
|
204
201
|
rightSidebar?: React__default.ReactNode;
|
|
205
202
|
topBar?: React__default.ReactNode;
|
|
206
|
-
mainNavProps?:
|
|
203
|
+
mainNavProps?: MainNavWidgetProps;
|
|
207
204
|
footer?: React__default.ReactNode;
|
|
205
|
+
footerProps?: FooterProps;
|
|
208
206
|
routerAdapter?: routerAdapter;
|
|
209
|
-
footerHeight?: number;
|
|
210
|
-
footerIsSticky?: boolean;
|
|
211
|
-
footerConfig?: FooterConfig;
|
|
212
207
|
classNames?: {
|
|
208
|
+
root?: string;
|
|
213
209
|
content?: string;
|
|
214
210
|
body?: string;
|
|
215
211
|
leftSidebar?: string;
|
|
@@ -231,4 +227,4 @@ declare const MaintenanceTipsUI: (props: MaintenanceTipInterface) => react_jsx_r
|
|
|
231
227
|
|
|
232
228
|
declare const MaintenanceTipsWidget: () => react_jsx_runtime.JSX.Element;
|
|
233
229
|
|
|
234
|
-
export { AccountMenuWidget, AccountSummaryWidget, CampaignPositionEnum, ChainMenu, ChainMenuWidget, ExpandableContext, type
|
|
230
|
+
export { AccountMenuWidget, AccountSummaryWidget, CampaignPositionEnum, ChainMenu, ChainMenuWidget, ExpandableContext, Footer, type FooterProps, FooterWidget, type LayoutProps, MainNavWidget, type MainNavWidgetProps, MaintenanceTipsUI, MaintenanceTipsWidget, ProductsMenu, type RouteOption, Scaffold, SideBar, type SideBarProps, type SideMenuItem, SideNavbarWidget, useScaffoldContext };
|