@blocklet/ui-react 2.9.12 → 2.9.14
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/build.config.ts +29 -0
- package/es/@types/index.d.ts +63 -0
- package/es/@types/index.js +0 -0
- package/es/@types/shims.d.ts +12 -0
- package/es/Dashboard/index.d.ts +41 -0
- package/es/Dashboard/index.js +63 -97
- package/es/Footer/brand.d.ts +22 -0
- package/es/Footer/brand.js +20 -37
- package/es/Footer/copyright.d.ts +18 -0
- package/es/Footer/copyright.js +14 -16
- package/es/Footer/index.d.ts +6 -0
- package/es/Footer/index.js +30 -56
- package/es/Footer/internal-footer.d.ts +29 -0
- package/es/Footer/internal-footer.js +67 -94
- package/es/Footer/layout/plain.d.ts +15 -0
- package/es/Footer/layout/plain.js +19 -37
- package/es/Footer/layout/row.d.ts +18 -0
- package/es/Footer/layout/row.js +9 -19
- package/es/Footer/layout/standard.d.ts +15 -0
- package/es/Footer/layout/standard.js +29 -57
- package/es/Footer/links.d.ts +22 -0
- package/es/Footer/links.js +72 -104
- package/es/Footer/social-media.d.ts +14 -0
- package/es/Footer/social-media.js +35 -35
- package/es/Header/index.d.ts +9 -0
- package/es/Header/index.js +55 -100
- package/es/Icon/index.d.ts +23 -0
- package/es/Icon/index.js +23 -58
- package/es/UserCenter/assets/banner.png +0 -0
- package/es/UserCenter/components/notification.d.ts +5 -0
- package/es/UserCenter/components/notification.js +276 -0
- package/es/UserCenter/components/passport.d.ts +6 -0
- package/es/UserCenter/components/passport.js +69 -0
- package/es/UserCenter/components/privacy.d.ts +11 -0
- package/es/UserCenter/components/privacy.js +99 -0
- package/es/UserCenter/components/settings.d.ts +10 -0
- package/es/UserCenter/components/settings.js +68 -0
- package/es/UserCenter/components/user-basic-info.d.ts +8 -0
- package/es/UserCenter/components/user-basic-info.js +66 -0
- package/es/UserCenter/components/user-center.d.ts +9 -0
- package/es/UserCenter/components/user-center.js +397 -0
- package/es/UserCenter/components/user-info-item.d.ts +10 -0
- package/es/UserCenter/components/user-info-item.js +54 -0
- package/es/UserCenter/components/user-info.d.ts +6 -0
- package/es/UserCenter/components/user-info.js +68 -0
- package/es/UserCenter/components/webhook-item.d.ts +3 -0
- package/es/UserCenter/components/webhook-item.js +243 -0
- package/es/UserCenter/index.d.ts +1 -0
- package/es/UserCenter/index.js +1 -0
- package/es/UserCenter/libs/client.d.ts +2 -0
- package/es/UserCenter/libs/client.js +2 -0
- package/es/UserCenter/libs/locales.d.ts +72 -0
- package/es/UserCenter/libs/locales.js +72 -0
- package/es/UserCenter/libs/utils.d.ts +4 -0
- package/es/UserCenter/libs/utils.js +14 -0
- package/es/blocklets.d.ts +16 -0
- package/es/blocklets.js +56 -45
- package/es/common/header-addons.d.ts +22 -0
- package/es/common/header-addons.js +41 -59
- package/es/common/link-blocker.d.ts +7 -0
- package/es/common/link-blocker.js +10 -17
- package/es/common/overridable-theme-provider.d.ts +18 -0
- package/es/common/overridable-theme-provider.js +6 -16
- package/es/common/wallet-hidden-topbar.d.ts +1 -0
- package/es/common/wallet-hidden-topbar.js +12 -10
- package/es/index.d.ts +5 -0
- package/es/index.js +5 -0
- package/es/types.d.ts +2 -0
- package/es/types.js +17 -11
- package/es/utils.d.ts +8 -0
- package/es/utils.js +21 -26
- package/lib/@types/index.d.ts +63 -0
- package/lib/@types/index.js +1 -0
- package/lib/@types/shims.d.ts +12 -0
- package/lib/Dashboard/index.d.ts +41 -0
- package/lib/Dashboard/index.js +44 -71
- package/lib/Footer/brand.d.ts +22 -0
- package/lib/Footer/brand.js +65 -30
- package/lib/Footer/copyright.d.ts +18 -0
- package/lib/Footer/copyright.js +18 -23
- package/lib/Footer/index.d.ts +6 -0
- package/lib/Footer/index.js +33 -42
- package/lib/Footer/internal-footer.d.ts +29 -0
- package/lib/Footer/internal-footer.js +43 -59
- package/lib/Footer/layout/plain.d.ts +15 -0
- package/lib/Footer/layout/plain.js +25 -30
- package/lib/Footer/layout/row.d.ts +18 -0
- package/lib/Footer/layout/row.js +34 -23
- package/lib/Footer/layout/standard.d.ts +15 -0
- package/lib/Footer/layout/standard.js +35 -41
- package/lib/Footer/links.d.ts +22 -0
- package/lib/Footer/links.js +163 -60
- package/lib/Footer/social-media.d.ts +14 -0
- package/lib/Footer/social-media.js +31 -25
- package/lib/Header/index.d.ts +9 -0
- package/lib/Header/index.js +83 -76
- package/lib/Icon/index.d.ts +23 -0
- package/lib/Icon/index.js +37 -51
- package/lib/UserCenter/assets/banner.png +0 -0
- package/lib/UserCenter/components/notification.d.ts +5 -0
- package/lib/UserCenter/components/notification.js +261 -0
- package/lib/UserCenter/components/passport.d.ts +6 -0
- package/lib/UserCenter/components/passport.js +86 -0
- package/lib/UserCenter/components/privacy.d.ts +11 -0
- package/lib/UserCenter/components/privacy.js +101 -0
- package/lib/UserCenter/components/settings.d.ts +10 -0
- package/lib/UserCenter/components/settings.js +81 -0
- package/lib/UserCenter/components/user-basic-info.d.ts +8 -0
- package/lib/UserCenter/components/user-basic-info.js +67 -0
- package/lib/UserCenter/components/user-center.d.ts +9 -0
- package/lib/UserCenter/components/user-center.js +376 -0
- package/lib/UserCenter/components/user-info-item.d.ts +10 -0
- package/lib/UserCenter/components/user-info-item.js +46 -0
- package/lib/UserCenter/components/user-info.d.ts +6 -0
- package/lib/UserCenter/components/user-info.js +94 -0
- package/lib/UserCenter/components/webhook-item.d.ts +3 -0
- package/lib/UserCenter/components/webhook-item.js +236 -0
- package/lib/UserCenter/index.d.ts +1 -0
- package/lib/UserCenter/index.js +13 -0
- package/lib/UserCenter/libs/client.d.ts +2 -0
- package/lib/UserCenter/libs/client.js +8 -0
- package/lib/UserCenter/libs/locales.d.ts +72 -0
- package/lib/UserCenter/libs/locales.js +78 -0
- package/lib/UserCenter/libs/utils.d.ts +4 -0
- package/lib/UserCenter/libs/utils.js +25 -0
- package/lib/blocklets.d.ts +16 -0
- package/lib/blocklets.js +28 -36
- package/lib/common/header-addons.d.ts +22 -0
- package/lib/common/header-addons.js +24 -36
- package/lib/common/link-blocker.d.ts +7 -0
- package/lib/common/link-blocker.js +10 -18
- package/lib/common/overridable-theme-provider.d.ts +18 -0
- package/lib/common/overridable-theme-provider.js +9 -14
- package/lib/common/wallet-hidden-topbar.d.ts +1 -0
- package/lib/common/wallet-hidden-topbar.js +1 -3
- package/lib/index.d.ts +5 -0
- package/lib/index.js +52 -0
- package/lib/types.d.ts +2 -0
- package/lib/types.js +3 -5
- package/lib/utils.d.ts +8 -0
- package/lib/utils.js +16 -23
- package/package.json +17 -11
- package/src/@types/index.ts +70 -0
- package/src/@types/shims.d.ts +12 -0
- package/src/UserCenter/assets/banner.png +0 -0
- package/src/UserCenter/components/notification.tsx +275 -0
- package/src/UserCenter/components/passport.tsx +83 -0
- package/src/UserCenter/components/privacy.tsx +107 -0
- package/src/UserCenter/components/settings.tsx +78 -0
- package/src/UserCenter/components/user-basic-info.tsx +70 -0
- package/src/UserCenter/components/user-center.tsx +410 -0
- package/src/UserCenter/components/user-info-item.tsx +50 -0
- package/src/UserCenter/components/user-info.tsx +85 -0
- package/src/UserCenter/components/webhook-item.tsx +243 -0
- package/src/UserCenter/index.tsx +1 -0
- package/src/UserCenter/libs/client.ts +3 -0
- package/src/UserCenter/libs/locales.ts +72 -0
- package/src/UserCenter/libs/utils.ts +21 -0
- package/src/blocklets.js +2 -0
- package/src/index.ts +9 -0
- /package/src/common/{link-blocker.js → link-blocker.jsx} +0 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export default InternalFooter;
|
|
2
|
+
/**
|
|
3
|
+
* 通用的内部 footer 组件, 定义并渲染常见的几种 footer 元素: brand/navigation/social medial 等
|
|
4
|
+
*/
|
|
5
|
+
declare function InternalFooter(props: any): import("react").JSX.Element;
|
|
6
|
+
declare namespace InternalFooter {
|
|
7
|
+
namespace propTypes {
|
|
8
|
+
let brand: any;
|
|
9
|
+
let navigation: any;
|
|
10
|
+
let socialMedia: any;
|
|
11
|
+
let copyright: any;
|
|
12
|
+
let links: any;
|
|
13
|
+
let layout: any;
|
|
14
|
+
}
|
|
15
|
+
namespace defaultProps {
|
|
16
|
+
let brand_1: null;
|
|
17
|
+
export { brand_1 as brand };
|
|
18
|
+
let navigation_1: null;
|
|
19
|
+
export { navigation_1 as navigation };
|
|
20
|
+
let copyright_1: null;
|
|
21
|
+
export { copyright_1 as copyright };
|
|
22
|
+
let socialMedia_1: null;
|
|
23
|
+
export { socialMedia_1 as socialMedia };
|
|
24
|
+
let links_1: null;
|
|
25
|
+
export { links_1 as links };
|
|
26
|
+
let layout_1: string;
|
|
27
|
+
export { layout_1 as layout };
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -1,73 +1,47 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
},
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}), {});
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* 通用的内部 footer 组件, 定义并渲染常见的几种 footer 元素: brand/navigation/social medial 等
|
|
29
|
-
*/
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import Box from "@mui/material/Box";
|
|
4
|
+
import Brand from "./brand.js";
|
|
5
|
+
import Links from "./links.js";
|
|
6
|
+
import SocialMedia from "./social-media.js";
|
|
7
|
+
import Copyright from "./copyright.js";
|
|
8
|
+
import StandardLayout from "./layout/standard.js";
|
|
9
|
+
import PlainLayout from "./layout/plain.js";
|
|
10
|
+
const layouts = [
|
|
11
|
+
{
|
|
12
|
+
name: "plain",
|
|
13
|
+
// navigation 数据为空时, 使用简单布局
|
|
14
|
+
support: (_, data) => !data.navigation?.length && !data.socialMedia?.length,
|
|
15
|
+
component: PlainLayout
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: "standard",
|
|
19
|
+
// 默认标准布局
|
|
20
|
+
support: () => true,
|
|
21
|
+
component: StandardLayout
|
|
22
|
+
}
|
|
23
|
+
];
|
|
24
|
+
const layoutsKeyByName = layouts.reduce((acc, cur) => ({ ...acc, [cur.name]: cur }), {});
|
|
30
25
|
function InternalFooter(props) {
|
|
31
|
-
const {
|
|
32
|
-
brand,
|
|
33
|
-
navigation,
|
|
34
|
-
socialMedia,
|
|
35
|
-
copyright,
|
|
36
|
-
links,
|
|
37
|
-
layout,
|
|
38
|
-
...rest
|
|
39
|
-
} = props;
|
|
26
|
+
const { brand, navigation, socialMedia, copyright, links, layout, ...rest } = props;
|
|
40
27
|
const renderBrand = () => {
|
|
41
|
-
return brand ?
|
|
42
|
-
...brand
|
|
43
|
-
}) : null;
|
|
28
|
+
return brand ? /* @__PURE__ */ jsx(Brand, { ...brand }) : null;
|
|
44
29
|
};
|
|
45
30
|
const renderNavigation = () => {
|
|
46
|
-
return navigation?.length ?
|
|
47
|
-
links: navigation
|
|
48
|
-
}) : null;
|
|
31
|
+
return navigation?.length ? /* @__PURE__ */ jsx(Links, { links: navigation }) : null;
|
|
49
32
|
};
|
|
50
33
|
const renderSocialMedia = () => {
|
|
51
|
-
return socialMedia?.length ?
|
|
52
|
-
items: socialMedia
|
|
53
|
-
}) : null;
|
|
34
|
+
return socialMedia?.length ? /* @__PURE__ */ jsx(SocialMedia, { items: socialMedia }) : null;
|
|
54
35
|
};
|
|
55
36
|
const renderCopyright = () => {
|
|
56
|
-
// 如果 copyright.owner 不存在, 则使用 brand.name, 如果 brand.name 也不存在, copyright 元素为空
|
|
57
37
|
const copyrightOwner = copyright?.owner || brand?.name;
|
|
58
38
|
if (!copyrightOwner) {
|
|
59
39
|
return null;
|
|
60
40
|
}
|
|
61
|
-
return
|
|
62
|
-
owner: copyrightOwner,
|
|
63
|
-
year: copyright?.year || undefined
|
|
64
|
-
});
|
|
41
|
+
return /* @__PURE__ */ jsx(Copyright, { owner: copyrightOwner, year: copyright?.year || void 0 });
|
|
65
42
|
};
|
|
66
43
|
const renderLinks = () => {
|
|
67
|
-
return links?.length ?
|
|
68
|
-
flowLayout: true,
|
|
69
|
-
links: links
|
|
70
|
-
}) : null;
|
|
44
|
+
return links?.length ? /* @__PURE__ */ jsx(Links, { flowLayout: true, links }) : null;
|
|
71
45
|
};
|
|
72
46
|
const elements = {
|
|
73
47
|
brand: renderBrand(),
|
|
@@ -77,35 +51,28 @@ function InternalFooter(props) {
|
|
|
77
51
|
links: renderLinks()
|
|
78
52
|
};
|
|
79
53
|
let LayoutComponent = null;
|
|
80
|
-
if (layout ===
|
|
81
|
-
LayoutComponent = layouts.find(item => item.support(elements, props)).component;
|
|
54
|
+
if (layout === "auto") {
|
|
55
|
+
LayoutComponent = layouts.find((item) => item.support(elements, props)).component;
|
|
82
56
|
} else {
|
|
83
57
|
LayoutComponent = layoutsKeyByName[layout]?.component;
|
|
84
58
|
}
|
|
85
59
|
if (!LayoutComponent) {
|
|
86
60
|
throw new Error(`layout ${layout} is not supported.`);
|
|
87
61
|
}
|
|
88
|
-
return
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
background: '#000',
|
|
103
|
-
color: '#fff'
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
children: window?.blocklet?.version
|
|
107
|
-
})]
|
|
108
|
-
});
|
|
62
|
+
return /* @__PURE__ */ jsxs(Box, { position: "relative", ...rest, children: [
|
|
63
|
+
/* @__PURE__ */ jsx(LayoutComponent, { elements, data: props }),
|
|
64
|
+
/* @__PURE__ */ jsx(
|
|
65
|
+
Box,
|
|
66
|
+
{
|
|
67
|
+
position: "absolute",
|
|
68
|
+
right: 16,
|
|
69
|
+
bottom: 0,
|
|
70
|
+
fontSize: 12,
|
|
71
|
+
sx: { color: "transparent", "::selection": { background: "#000", color: "#fff" } },
|
|
72
|
+
children: window?.blocklet?.version
|
|
73
|
+
}
|
|
74
|
+
)
|
|
75
|
+
] });
|
|
109
76
|
}
|
|
110
77
|
InternalFooter.propTypes = {
|
|
111
78
|
brand: PropTypes.shape({
|
|
@@ -113,25 +80,31 @@ InternalFooter.propTypes = {
|
|
|
113
80
|
description: PropTypes.string,
|
|
114
81
|
logo: PropTypes.node
|
|
115
82
|
}),
|
|
116
|
-
navigation: PropTypes.arrayOf(
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
83
|
+
navigation: PropTypes.arrayOf(
|
|
84
|
+
PropTypes.shape({
|
|
85
|
+
label: PropTypes.node,
|
|
86
|
+
link: PropTypes.string
|
|
87
|
+
})
|
|
88
|
+
),
|
|
89
|
+
socialMedia: PropTypes.arrayOf(
|
|
90
|
+
PropTypes.shape({
|
|
91
|
+
icon: PropTypes.node,
|
|
92
|
+
link: PropTypes.string
|
|
93
|
+
})
|
|
94
|
+
),
|
|
124
95
|
copyright: PropTypes.shape({
|
|
125
96
|
owner: PropTypes.string,
|
|
126
97
|
year: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
127
98
|
}),
|
|
128
99
|
// privacy/legal 等链接, 常放于 footer 右下侧或最底部
|
|
129
|
-
links: PropTypes.arrayOf(
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
100
|
+
links: PropTypes.arrayOf(
|
|
101
|
+
PropTypes.shape({
|
|
102
|
+
label: PropTypes.node,
|
|
103
|
+
link: PropTypes.string
|
|
104
|
+
})
|
|
105
|
+
),
|
|
133
106
|
// 可显式指定 footer layout, 默认根据内容自动决定 layout
|
|
134
|
-
layout: PropTypes.oneOf([
|
|
107
|
+
layout: PropTypes.oneOf(["auto", "standard", "plain"])
|
|
135
108
|
};
|
|
136
109
|
InternalFooter.defaultProps = {
|
|
137
110
|
brand: null,
|
|
@@ -139,6 +112,6 @@ InternalFooter.defaultProps = {
|
|
|
139
112
|
copyright: null,
|
|
140
113
|
socialMedia: null,
|
|
141
114
|
links: null,
|
|
142
|
-
layout:
|
|
115
|
+
layout: "auto"
|
|
143
116
|
};
|
|
144
|
-
export default InternalFooter;
|
|
117
|
+
export default InternalFooter;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export default PlainLayout;
|
|
2
|
+
/**
|
|
3
|
+
* footer plain layout
|
|
4
|
+
*/
|
|
5
|
+
declare function PlainLayout({ elements, data, ...rest }: {
|
|
6
|
+
[x: string]: any;
|
|
7
|
+
elements: any;
|
|
8
|
+
data: any;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
10
|
+
declare namespace PlainLayout {
|
|
11
|
+
namespace propTypes {
|
|
12
|
+
let elements: any;
|
|
13
|
+
let data: any;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -1,38 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
})
|
|
18
|
-
return /*#__PURE__*/_jsx(Root, {
|
|
19
|
-
...rest,
|
|
20
|
-
children: /*#__PURE__*/_jsxs(Container, {
|
|
21
|
-
className: "plain-layout-container",
|
|
22
|
-
children: [!!data.links && /*#__PURE__*/_jsxs(Row, {
|
|
23
|
-
sx: {
|
|
24
|
-
width: 1
|
|
25
|
-
},
|
|
26
|
-
autoCenter: true,
|
|
27
|
-
children: [elements.copyright, elements.links]
|
|
28
|
-
}), !data.links && /*#__PURE__*/_jsxs(_Fragment, {
|
|
29
|
-
children: [/*#__PURE__*/cloneElement(elements.brand, {
|
|
30
|
-
name: null,
|
|
31
|
-
description: null
|
|
32
|
-
}), elements.copyright]
|
|
33
|
-
})]
|
|
34
|
-
})
|
|
35
|
-
});
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cloneElement } from "react";
|
|
3
|
+
import PropTypes from "prop-types";
|
|
4
|
+
import Container from "@mui/material/Container";
|
|
5
|
+
import { styled } from "@arcblock/ux/lib/Theme";
|
|
6
|
+
import Row from "./row.js";
|
|
7
|
+
function PlainLayout({ elements, data, ...rest }) {
|
|
8
|
+
return /* @__PURE__ */ jsx(Root, { ...rest, children: /* @__PURE__ */ jsxs(Container, { className: "plain-layout-container", children: [
|
|
9
|
+
!!data.links && /* @__PURE__ */ jsxs(Row, { sx: { width: 1 }, autoCenter: true, children: [
|
|
10
|
+
elements.copyright,
|
|
11
|
+
elements.links
|
|
12
|
+
] }),
|
|
13
|
+
!data.links && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
14
|
+
cloneElement(elements.brand, { name: null, description: null }),
|
|
15
|
+
elements.copyright
|
|
16
|
+
] })
|
|
17
|
+
] }) });
|
|
36
18
|
}
|
|
37
19
|
PlainLayout.propTypes = {
|
|
38
20
|
elements: PropTypes.shape({
|
|
@@ -44,7 +26,7 @@ PlainLayout.propTypes = {
|
|
|
44
26
|
}).isRequired,
|
|
45
27
|
data: PropTypes.object.isRequired
|
|
46
28
|
};
|
|
47
|
-
const Root = styled(
|
|
29
|
+
const Root = styled("div")`
|
|
48
30
|
padding: 24px 0;
|
|
49
31
|
.plain-layout-container {
|
|
50
32
|
display: flex;
|
|
@@ -54,4 +36,4 @@ const Root = styled('div')`
|
|
|
54
36
|
gap: 8px;
|
|
55
37
|
}
|
|
56
38
|
`;
|
|
57
|
-
export default PlainLayout;
|
|
39
|
+
export default PlainLayout;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
declare function Row({ children, autoCenter, ...rest }: {
|
|
2
|
+
[x: string]: any;
|
|
3
|
+
children: any;
|
|
4
|
+
autoCenter: any;
|
|
5
|
+
}): import("react").JSX.Element | null;
|
|
6
|
+
declare namespace Row {
|
|
7
|
+
namespace propTypes {
|
|
8
|
+
let children: any;
|
|
9
|
+
let autoCenter: any;
|
|
10
|
+
}
|
|
11
|
+
namespace defaultProps {
|
|
12
|
+
let children_1: null;
|
|
13
|
+
export { children_1 as children };
|
|
14
|
+
let autoCenter_1: boolean;
|
|
15
|
+
export { autoCenter_1 as autoCenter };
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export default Row;
|
package/es/Footer/layout/row.js
CHANGED
|
@@ -1,23 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
export default function Row({
|
|
7
|
-
children,
|
|
8
|
-
autoCenter,
|
|
9
|
-
...rest
|
|
10
|
-
}) {
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import Box from "@mui/material/Box";
|
|
4
|
+
import { styled } from "@arcblock/ux/lib/Theme";
|
|
5
|
+
import clsx from "clsx";
|
|
6
|
+
export default function Row({ children, autoCenter, ...rest }) {
|
|
11
7
|
if (!children) {
|
|
12
8
|
return null;
|
|
13
9
|
}
|
|
14
|
-
return
|
|
15
|
-
...rest,
|
|
16
|
-
className: clsx(rest.className, {
|
|
17
|
-
'footer-row-auto-center': autoCenter
|
|
18
|
-
}),
|
|
19
|
-
children: children
|
|
20
|
-
});
|
|
10
|
+
return /* @__PURE__ */ jsx(RowRoot, { ...rest, className: clsx(rest.className, { "footer-row-auto-center": autoCenter }), children });
|
|
21
11
|
}
|
|
22
12
|
Row.propTypes = {
|
|
23
13
|
children: PropTypes.any,
|
|
@@ -37,7 +27,7 @@ const RowRoot = styled(Box)`
|
|
|
37
27
|
margin: 0 auto;
|
|
38
28
|
}
|
|
39
29
|
|
|
40
|
-
${props => props.theme.breakpoints.down(
|
|
30
|
+
${(props) => props.theme.breakpoints.down("md")} {
|
|
41
31
|
align-items: stretch;
|
|
42
32
|
flex-direction: column;
|
|
43
33
|
gap: 16px;
|
|
@@ -48,4 +38,4 @@ const RowRoot = styled(Box)`
|
|
|
48
38
|
margin: 0 auto;
|
|
49
39
|
}
|
|
50
40
|
}
|
|
51
|
-
`;
|
|
41
|
+
`;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export default StandardLayout;
|
|
2
|
+
/**
|
|
3
|
+
* footer standard layout
|
|
4
|
+
*/
|
|
5
|
+
declare function StandardLayout({ elements, data, ...rest }: {
|
|
6
|
+
[x: string]: any;
|
|
7
|
+
elements: any;
|
|
8
|
+
data: any;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
10
|
+
declare namespace StandardLayout {
|
|
11
|
+
namespace propTypes {
|
|
12
|
+
let elements: any;
|
|
13
|
+
let data: any;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -1,62 +1,34 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
function StandardLayout({
|
|
13
|
-
elements,
|
|
14
|
-
data,
|
|
15
|
-
...rest
|
|
16
|
-
}) {
|
|
17
|
-
return /*#__PURE__*/_jsx(Root, {
|
|
18
|
-
...rest,
|
|
19
|
-
children: /*#__PURE__*/_jsxs(Container, {
|
|
20
|
-
children: [/*#__PURE__*/_jsxs(Box, {
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import Box from "@mui/material/Box";
|
|
4
|
+
import Container from "@mui/material/Container";
|
|
5
|
+
import { styled } from "@arcblock/ux/lib/Theme";
|
|
6
|
+
import Row from "./row.js";
|
|
7
|
+
function StandardLayout({ elements, data, ...rest }) {
|
|
8
|
+
return /* @__PURE__ */ jsx(Root, { ...rest, children: /* @__PURE__ */ jsxs(Container, { children: [
|
|
9
|
+
/* @__PURE__ */ jsxs(
|
|
10
|
+
Box,
|
|
11
|
+
{
|
|
21
12
|
sx: {
|
|
22
|
-
display:
|
|
23
|
-
flexDirection: {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
justifyContent: 'space-between',
|
|
28
|
-
alignItems: {
|
|
29
|
-
xs: 'center',
|
|
30
|
-
md: 'space-between'
|
|
31
|
-
},
|
|
13
|
+
display: "flex",
|
|
14
|
+
flexDirection: { xs: "column", md: "row" },
|
|
15
|
+
justifyContent: "space-between",
|
|
16
|
+
alignItems: { xs: "center", md: "space-between" },
|
|
32
17
|
gap: 2,
|
|
33
18
|
pb: 3
|
|
34
19
|
},
|
|
35
|
-
children: [
|
|
36
|
-
children: elements.brand
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
},
|
|
48
|
-
children: elements.navigation
|
|
49
|
-
}), /*#__PURE__*/_jsxs(Row, {
|
|
50
|
-
sx: {
|
|
51
|
-
pt: 3,
|
|
52
|
-
borderTop: 1,
|
|
53
|
-
borderColor: 'grey.200'
|
|
54
|
-
},
|
|
55
|
-
autoCenter: true,
|
|
56
|
-
children: [elements.copyright, elements.links]
|
|
57
|
-
})]
|
|
58
|
-
})
|
|
59
|
-
});
|
|
20
|
+
children: [
|
|
21
|
+
/* @__PURE__ */ jsx(Box, { children: elements.brand }),
|
|
22
|
+
/* @__PURE__ */ jsx(Box, { lineHeight: 1, children: elements.socialMedia })
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
),
|
|
26
|
+
!!data.navigation?.length && /* @__PURE__ */ jsx(Box, { sx: { mb: 6, pt: 3, borderTop: 1, borderColor: "grey.200" }, children: elements.navigation }),
|
|
27
|
+
/* @__PURE__ */ jsxs(Row, { sx: { pt: 3, borderTop: 1, borderColor: "grey.200" }, autoCenter: true, children: [
|
|
28
|
+
elements.copyright,
|
|
29
|
+
elements.links
|
|
30
|
+
] })
|
|
31
|
+
] }) });
|
|
60
32
|
}
|
|
61
33
|
StandardLayout.propTypes = {
|
|
62
34
|
elements: PropTypes.shape({
|
|
@@ -68,7 +40,7 @@ StandardLayout.propTypes = {
|
|
|
68
40
|
}).isRequired,
|
|
69
41
|
data: PropTypes.object.isRequired
|
|
70
42
|
};
|
|
71
|
-
const Root = styled(
|
|
43
|
+
const Root = styled("div")`
|
|
72
44
|
padding: 32px 0 24px 0;
|
|
73
45
|
.footer-brand-name,
|
|
74
46
|
.footer-brand-desc {
|
|
@@ -78,4 +50,4 @@ const Root = styled('div')`
|
|
|
78
50
|
margin-right: 0;
|
|
79
51
|
}
|
|
80
52
|
`;
|
|
81
|
-
export default StandardLayout;
|
|
53
|
+
export default StandardLayout;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* footer 中的 links (支持分组, 最多支持 2 级)
|
|
3
|
+
* TODO: dark/light theme
|
|
4
|
+
*/
|
|
5
|
+
declare function Links({ links, flowLayout, ...rest }: {
|
|
6
|
+
[x: string]: any;
|
|
7
|
+
links: any;
|
|
8
|
+
flowLayout: any;
|
|
9
|
+
}): import("react").JSX.Element | null;
|
|
10
|
+
declare namespace Links {
|
|
11
|
+
namespace propTypes {
|
|
12
|
+
let links: any;
|
|
13
|
+
let flowLayout: any;
|
|
14
|
+
}
|
|
15
|
+
namespace defaultProps {
|
|
16
|
+
let links_1: never[];
|
|
17
|
+
export { links_1 as links };
|
|
18
|
+
let flowLayout_1: boolean;
|
|
19
|
+
export { flowLayout_1 as flowLayout };
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export default Links;
|