@arcblock/ux 3.0.6 → 3.0.8
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/lib/ActionButton/index.d.ts +1 -1
- package/lib/ActionButton/index.js +1 -1
- package/lib/Address/compact-text.d.ts +1 -1
- package/lib/Address/compact-text.js +5 -5
- package/lib/Address/did-address.js +1 -1
- package/lib/Address/index.js +5 -5
- package/lib/Address/responsive-did-address.js +14 -14
- package/lib/Alert/index.d.ts +1 -1
- package/lib/Alert/index.js +1 -1
- package/lib/Avatar/index.d.ts +1 -1
- package/lib/Avatar/index.js +1 -1
- package/lib/Badge/index.js +1 -1
- package/lib/BlockletContext/index.d.ts +1 -1
- package/lib/BlockletNFT/index.js +1 -1
- package/lib/BlockletV2/blocklet.d.ts +1 -1
- package/lib/BlockletV2/blocklet.js +1 -1
- package/lib/BlockletV2/components/icon-text.d.ts +1 -1
- package/lib/BlockletV2/components/icon-text.js +13 -13
- package/lib/BlockletV2/components/tooltip-icon.js +22 -20
- package/lib/Button/wrap.js +1 -1
- package/lib/Center/index.js +3 -3
- package/lib/ClickToCopy/copy-button.js +3 -3
- package/lib/CloseButton/index.js +1 -1
- package/lib/ContactForm/index.js +22 -21
- package/lib/DID/index.js +45 -44
- package/lib/DIDConnect/app-info-item.js +1 -1
- package/lib/DIDConnect/auth-apps/index.js +48 -48
- package/lib/DIDConnect/did-connect-container.js +22 -22
- package/lib/DIDConnect/did-connect-footer.js +1 -1
- package/lib/DIDConnect/landing-page.js +27 -27
- package/lib/DIDConnect/request-storage-access-api-dialog.js +39 -40
- package/lib/Datatable/CustomToolbar.d.ts +3 -1
- package/lib/Datatable/CustomToolbar.js +1 -1
- package/lib/Datatable/index.js +2 -2
- package/lib/Dialog/confirm.d.ts +1 -1
- package/lib/Dialog/confirm.js +12 -12
- package/lib/Earth/index.js +1 -1
- package/lib/Footer/index.d.ts +1 -1
- package/lib/Footer/index.js +5 -5
- package/lib/Header/addon-button.d.ts +1 -1
- package/lib/Header/addon-button.js +11 -6
- package/lib/Header/header.js +1 -1
- package/lib/Header/responsive-header.d.ts +1 -1
- package/lib/Header/responsive-header.js +33 -34
- package/lib/Icon/index.js +12 -12
- package/lib/InfoRow/index.d.ts +1 -1
- package/lib/InfoRow/index.js +0 -1
- package/lib/Layout/dashboard/external-link.d.ts +1 -1
- package/lib/Layout/dashboard/external-link.js +1 -1
- package/lib/Layout/dashboard/full-page.js +8 -8
- package/lib/Layout/dashboard/index.js +1 -1
- package/lib/Layout/dashboard/sidebar.js +1 -1
- package/lib/Layout/dashboard-legacy/header.js +10 -10
- package/lib/Layout/dashboard-legacy/index.js +16 -16
- package/lib/Layout/dashboard-legacy/sidebar.d.ts +1 -1
- package/lib/Layout/dashboard-legacy/sidebar.js +19 -12
- package/lib/Layout/index.js +2 -2
- package/lib/LoadingMask/index.d.ts +1 -1
- package/lib/LoadingMask/index.js +4 -4
- package/lib/Locale/context.js +24 -24
- package/lib/Locale/selector.d.ts +1 -1
- package/lib/Locale/selector.js +1 -1
- package/lib/Logo/index.js +3 -3
- package/lib/NFTDisplay/aspect-ratio-container.d.ts +1 -1
- package/lib/NFTDisplay/index.js +5 -2
- package/lib/NFTDisplay/render-svg.js +3 -3
- package/lib/NavMenu/nav-menu.js +29 -26
- package/lib/NavMenu/products.js +1 -1
- package/lib/PageScroller/index.js +43 -43
- package/lib/PhoneInput/country-select.js +23 -23
- package/lib/PhoneInput/index.js +11 -11
- package/lib/PoweredByArcBlock/index.js +10 -6
- package/lib/QRCode/index.js +5 -5
- package/lib/RelativeTime/index.js +16 -16
- package/lib/Result/result.js +5 -5
- package/lib/Screenshot/index.d.ts +1 -1
- package/lib/Screenshot/index.js +1 -1
- package/lib/SessionUser/components/did-space.d.ts +1 -1
- package/lib/SessionUser/components/session-user-item.js +10 -10
- package/lib/SharedBridge/index.js +6 -6
- package/lib/Spinner/index.js +1 -1
- package/lib/SplitButton/index.d.ts +1 -1
- package/lib/SplitButton/index.js +1 -1
- package/lib/Success/index.js +1 -1
- package/lib/Tabs/index.js +15 -8
- package/lib/Tag/index.d.ts +1 -1
- package/lib/Tag/index.js +1 -1
- package/lib/TextCollapse/index.js +1 -1
- package/lib/Theme/theme-provider.js +58 -53
- package/lib/Theme/theme.js +1 -0
- package/lib/Typography/index.js +13 -13
- package/lib/UserCard/Cards/basic-info.d.ts +1 -1
- package/lib/UserCard/Cards/basic-info.js +1 -1
- package/lib/UserCard/Cards/index.d.ts +1 -1
- package/lib/UserCard/Cards/index.js +1 -1
- package/lib/UserCard/Container/card.js +6 -6
- package/lib/UserCard/Container/dialog.js +1 -1
- package/lib/UserCard/Content/basic.js +2 -2
- package/lib/UserCard/Content/minimal.d.ts +1 -1
- package/lib/UserCard/Content/minimal.js +1 -1
- package/lib/UserCard/Content/tooltip-avatar.js +17 -17
- package/lib/VerificationCode/index.js +1 -1
- package/lib/WalletOSIcon/index.d.ts +2 -2
- package/lib/WalletOSIcon/index.js +7 -2
- package/lib/WebWalletSWKeeper/index.d.ts +3 -1
- package/lib/WebWalletSWKeeper/index.js +4 -1
- package/lib/withTheme/index.d.ts +3 -2
- package/lib/withTheme/index.js +16 -16
- package/package.json +7 -7
- package/src/ActionButton/index.jsx +1 -1
- package/src/Address/compact-text.jsx +1 -1
- package/src/Address/did-address.tsx +1 -1
- package/src/Address/index.tsx +1 -1
- package/src/Address/responsive-did-address.tsx +3 -3
- package/src/Alert/index.jsx +1 -1
- package/src/Avatar/index.jsx +1 -1
- package/src/Badge/index.jsx +1 -1
- package/src/BlockletContext/index.tsx +1 -1
- package/src/BlockletNFT/index.jsx +1 -1
- package/src/BlockletV2/blocklet.tsx +1 -1
- package/src/BlockletV2/components/icon-text.tsx +4 -4
- package/src/BlockletV2/components/tooltip-icon.tsx +5 -3
- package/src/Button/wrap.jsx +1 -1
- package/src/Center/index.tsx +1 -1
- package/src/ClickToCopy/copy-button.tsx +1 -1
- package/src/CloseButton/index.tsx +1 -1
- package/src/ContactForm/index.tsx +9 -2
- package/src/DID/index.tsx +5 -4
- package/src/DIDConnect/app-info-item.tsx +1 -1
- package/src/DIDConnect/auth-apps/index.tsx +8 -8
- package/src/DIDConnect/did-connect-container.tsx +2 -2
- package/src/DIDConnect/did-connect-footer.tsx +1 -1
- package/src/DIDConnect/landing-page.tsx +6 -6
- package/src/DIDConnect/request-storage-access-api-dialog.tsx +1 -2
- package/src/Datatable/CustomToolbar.jsx +1 -1
- package/src/Datatable/index.jsx +2 -2
- package/src/Dialog/confirm.jsx +1 -1
- package/src/Earth/index.tsx +1 -1
- package/src/Footer/index.tsx +5 -2
- package/src/Header/addon-button.tsx +7 -2
- package/src/Header/header.tsx +1 -1
- package/src/Header/responsive-header.tsx +1 -2
- package/src/Icon/index.tsx +1 -1
- package/src/InfoRow/index.tsx +1 -2
- package/src/Layout/dashboard/external-link.tsx +1 -1
- package/src/Layout/dashboard/full-page.tsx +1 -1
- package/src/Layout/dashboard/index.tsx +1 -1
- package/src/Layout/dashboard/sidebar.tsx +5 -2
- package/src/Layout/dashboard-legacy/header.tsx +5 -5
- package/src/Layout/dashboard-legacy/index.tsx +3 -3
- package/src/Layout/dashboard-legacy/sidebar.tsx +10 -2
- package/src/Layout/index.tsx +2 -2
- package/src/LoadingMask/index.tsx +5 -5
- package/src/Locale/context.tsx +3 -3
- package/src/Locale/selector.tsx +1 -1
- package/src/Logo/index.tsx +1 -1
- package/src/NFTDisplay/aspect-ratio-container.tsx +1 -1
- package/src/NFTDisplay/index.tsx +2 -1
- package/src/NFTDisplay/render-svg.tsx +1 -1
- package/src/NavMenu/nav-menu.tsx +8 -5
- package/src/NavMenu/products.tsx +3 -1
- package/src/PageScroller/index.tsx +4 -4
- package/src/PhoneInput/country-select.tsx +3 -3
- package/src/PhoneInput/index.tsx +1 -1
- package/src/PoweredByArcBlock/index.tsx +5 -1
- package/src/QRCode/index.tsx +1 -1
- package/src/RelativeTime/index.tsx +3 -3
- package/src/Result/result.tsx +1 -1
- package/src/Screenshot/index.tsx +2 -2
- package/src/SessionUser/components/did-space.tsx +1 -1
- package/src/SessionUser/components/session-user-item.tsx +1 -1
- package/src/SharedBridge/index.tsx +2 -2
- package/src/Spinner/index.tsx +1 -1
- package/src/SplitButton/index.tsx +1 -1
- package/src/Success/index.tsx +1 -1
- package/src/Tabs/index.tsx +10 -3
- package/src/Tag/index.jsx +1 -1
- package/src/TextCollapse/index.tsx +1 -1
- package/src/Theme/theme-provider.tsx +11 -6
- package/src/Theme/theme.ts +5 -0
- package/src/Typography/index.tsx +1 -1
- package/src/UserCard/Cards/basic-info.tsx +1 -1
- package/src/UserCard/Cards/index.tsx +1 -1
- package/src/UserCard/Container/card.tsx +2 -2
- package/src/UserCard/Container/dialog.tsx +1 -1
- package/src/UserCard/Content/basic.tsx +2 -2
- package/src/UserCard/Content/minimal.tsx +1 -1
- package/src/UserCard/Content/tooltip-avatar.tsx +4 -4
- package/src/VerificationCode/index.tsx +1 -1
- package/src/WalletOSIcon/index.tsx +7 -2
- package/src/WebWalletSWKeeper/index.tsx +6 -1
- package/src/withTheme/index.tsx +7 -3
- package/vite.config.mjs +4 -1
- package/lib/ActionButton/ActionButton.stories.d.ts +0 -18
- package/lib/ActivityIndicator/ActivityIndicator.stories.d.ts +0 -8
- package/lib/Address/Address.stories.d.ts +0 -16
- package/lib/Alert/Alert.stories.d.ts +0 -28
- package/lib/AnimationWaiter/AnimationWaiter.stories.d.ts +0 -21
- package/lib/Avatar/Avatar.stories.d.ts +0 -11
- package/lib/Badge/Badge.stories.d.ts +0 -13
- package/lib/Blocklet/Blocklet.stories.d.ts +0 -17
- package/lib/BlockletNFT/BlockletNFT.stories.d.ts +0 -17
- package/lib/BlockletV2/Blocklet.stories.d.ts +0 -18
- package/lib/Button/Button.stories.d.ts +0 -19
- package/lib/Center/Center.stories.d.ts +0 -18
- package/lib/ClickToCopy/ClickToCopy.stories.d.ts +0 -16
- package/lib/CodeBlock/CodeBlock.stories.d.ts +0 -20
- package/lib/Colors/Colors.stories.d.ts +0 -34
- package/lib/Config/Config.stories.d.ts +0 -14
- package/lib/ContactForm/ContactForm.stories.d.ts +0 -23
- package/lib/CookieConsent/CookieConsent.stories.d.ts +0 -18
- package/lib/CountDown/CountDown.stories.d.ts +0 -14
- package/lib/DID/DID.stories.d.ts +0 -15
- package/lib/Datatable/Datatable.stories.d.ts +0 -32
- package/lib/Dialog/Dialog.stories.d.ts +0 -20
- package/lib/DidLogo/Logo.stories.d.ts +0 -8
- package/lib/Earth/Earth.stories.d.ts +0 -18
- package/lib/Empty/Empty.stories.d.ts +0 -17
- package/lib/ErrorBoundary/ErrorBoundary.stories.d.ts +0 -12
- package/lib/Footer/Footer.stories.d.ts +0 -12
- package/lib/Header/Header.stories.d.ts +0 -21
- package/lib/Icon/Icon.stories.d.ts +0 -23
- package/lib/Img/Img.stories.d.ts +0 -13
- package/lib/InfoRow/InfoRow.stories.d.ts +0 -14
- package/lib/Layout/Layout.stories.d.ts +0 -23
- package/lib/Locale/LocaleSelector.stories.d.ts +0 -22
- package/lib/Logo/Logo.stories.d.ts +0 -22
- package/lib/Metric/Metric.stories.d.ts +0 -14
- package/lib/NFTDisplay/NFTDisplay.stories.d.ts +0 -15
- package/lib/NavMenu/NavMenu.stories.d.ts +0 -17
- package/lib/PageScroller/story/PageScroller.stories.d.ts +0 -13
- package/lib/PhoneInput/PhoneInput.stories.d.ts +0 -12
- package/lib/PricingTable/PricingTable.stories.d.ts +0 -8
- package/lib/QRCode/QRCode.stories.d.ts +0 -13
- package/lib/RelativeTime/RelativeTime.stories.d.ts +0 -20
- package/lib/Result/Result.stories.d.ts +0 -21
- package/lib/Screenshot/Screenshot.stories.d.ts +0 -13
- package/lib/SessionManager/SessionManager.stories.d.ts +0 -9
- package/lib/Sparkline/Sparkline.stories.d.ts +0 -12
- package/lib/Spinner/Spinner.stories.d.ts +0 -18
- package/lib/SplitButton/SplitButton.stories.d.ts +0 -15
- package/lib/Switch/Switch.stories.d.ts +0 -13
- package/lib/Tabs/Tabs.stories.d.ts +0 -14
- package/lib/Tag/Tag.stories.d.ts +0 -13
- package/lib/TextCollapse/TextCollapse.stories.d.ts +0 -28
- package/lib/Theme/Theme.stories.d.ts +0 -10
- package/lib/Toast/Toast.stories.d.ts +0 -15
- package/lib/UserCard/UserCard.stories.d.ts +0 -18
- package/lib/Util/WebWalletOpener.stories.d.ts +0 -5
- package/lib/Video/Video.stories.d.ts +0 -6
- package/lib/Wallet/Action.stories.d.ts +0 -8
- package/lib/Wallet/Download.stories.d.ts +0 -9
- package/lib/Wallet/OpenInWallet.stories.d.ts +0 -5
package/lib/NavMenu/nav-menu.js
CHANGED
@@ -2,7 +2,7 @@ import { jsx as o, jsxs as M } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as T, useLayoutEffect as ne, useEffect as j, Children as V, isValidElement as te, cloneElement as re } from "react";
|
3
3
|
import { useTheme as oe, ClickAwayListener as ae } from "@mui/material";
|
4
4
|
import F from "clsx";
|
5
|
-
import { Menu as
|
5
|
+
import { Menu as ie, MoreHoriz as le, ArrowForward as se, ExpandMore as ue } from "@mui/icons-material";
|
6
6
|
import { useCreation as L, useReactive as ce, useMemoizedFn as A, useSize as de, useThrottleFn as me } from "ahooks";
|
7
7
|
import fe from "lodash/noop";
|
8
8
|
import { NavMenuProvider as ve, useNavMenuContext as B } from "./nav-menu-context.js";
|
@@ -21,14 +21,17 @@ function J({
|
|
21
21
|
mode: a = "horizontal",
|
22
22
|
children: C = null,
|
23
23
|
activeId: m = null,
|
24
|
+
// eslint-disable-next-line react/require-default-props
|
24
25
|
textColor: y,
|
26
|
+
// eslint-disable-next-line react/require-default-props
|
25
27
|
activeTextColor: g,
|
28
|
+
// eslint-disable-next-line react/require-default-props
|
26
29
|
bgColor: I,
|
27
|
-
onSelected: s,
|
30
|
+
onSelected: s = void 0,
|
28
31
|
...f
|
29
32
|
}) {
|
30
33
|
var O;
|
31
|
-
const r = oe(), u = L(() => r.palette.text.secondary, [r]), v = L(() => r.palette.text.primary, [r]),
|
34
|
+
const r = oe(), u = L(() => r.palette.text.secondary, [r]), v = L(() => r.palette.text.primary, [r]), i = L(() => r.palette.background.default, [r]), c = D(C);
|
32
35
|
if (!(n != null && n.length) && !(c != null && c.length))
|
33
36
|
throw new Error("One of 'items' or 'children' is required by NavMenu component.");
|
34
37
|
const t = ce({
|
@@ -40,13 +43,13 @@ function J({
|
|
40
43
|
}), _ = A((e) => {
|
41
44
|
t.openedIds.push(e);
|
42
45
|
}), W = A((e) => {
|
43
|
-
t.openedIds = t.openedIds.filter((
|
46
|
+
t.openedIds = t.openedIds.filter((l) => l !== e);
|
44
47
|
}), z = L(() => ({
|
45
48
|
...t,
|
46
49
|
mode: a,
|
47
50
|
textColor: u,
|
48
51
|
activeTextColor: v,
|
49
|
-
bgColor:
|
52
|
+
bgColor: i,
|
50
53
|
activate: N,
|
51
54
|
open: _,
|
52
55
|
close: W
|
@@ -57,25 +60,25 @@ function J({
|
|
57
60
|
a,
|
58
61
|
u,
|
59
62
|
v,
|
60
|
-
|
63
|
+
i,
|
61
64
|
N,
|
62
65
|
_,
|
63
66
|
W
|
64
|
-
]), $ = T(null), p = T([]), w = T(null), q = T(0), S = t.hiddenItemCount === ((O = p.current) == null ? void 0 : O.length), K = S ? { marginLeft: "0px" } : void 0, Q = L(() => S ? /* @__PURE__ */ o(
|
67
|
+
]), $ = T(null), p = T([]), w = T(null), q = T(0), S = t.hiddenItemCount === ((O = p.current) == null ? void 0 : O.length), K = S ? { marginLeft: "0px" } : void 0, Q = L(() => S ? /* @__PURE__ */ o(ie, {}) : /* @__PURE__ */ o(le, {}), [S]), X = (e) => V.map(e, (l, h) => re(l, {
|
65
68
|
ref: (b) => {
|
66
69
|
p.current[h] = b;
|
67
70
|
}
|
68
71
|
})), x = de($.current), { run: R } = me(
|
69
72
|
A(() => {
|
70
|
-
let e = 0,
|
73
|
+
let e = 0, l = 0, h = !1;
|
71
74
|
const b = w.current ? w.current.offsetWidth + parseFloat(window.getComputedStyle(w.current).marginLeft) : 0;
|
72
75
|
p.current.forEach((d, P) => {
|
73
76
|
if (d) {
|
74
77
|
d.style.display = "flex";
|
75
78
|
const ee = P > 0 ? parseFloat(window.getComputedStyle(d).marginLeft) : 0, U = d.offsetWidth + ee;
|
76
|
-
q.current - b >= e + U && !h ? e += U : (d.style.display = "none", h = !0,
|
79
|
+
q.current - b >= e + U && !h ? e += U : (d.style.display = "none", h = !0, l++);
|
77
80
|
}
|
78
|
-
}),
|
81
|
+
}), l !== t.hiddenItemCount && (t.hiddenItemCount = l);
|
79
82
|
}),
|
80
83
|
{ wait: 100 }
|
81
84
|
);
|
@@ -90,7 +93,7 @@ function J({
|
|
90
93
|
}, [a, n]), j(() => {
|
91
94
|
m != null && (t.activeId = m);
|
92
95
|
}, [m]);
|
93
|
-
const Y = F("navmenu", `navmenu--${a}`, f.className), H = (e,
|
96
|
+
const Y = F("navmenu", `navmenu--${a}`, f.className), H = (e, l, h = 0) => {
|
94
97
|
const b = h === 0;
|
95
98
|
return e != null && e.children ? h > 0 ? null : /* @__PURE__ */ o(
|
96
99
|
E,
|
@@ -100,7 +103,7 @@ function J({
|
|
100
103
|
label: e.label,
|
101
104
|
variant: b ? "default" : "panel",
|
102
105
|
ref: b ? (d) => {
|
103
|
-
p.current[
|
106
|
+
p.current[l] = d;
|
104
107
|
} : void 0,
|
105
108
|
children: typeof e.children == "function" ? e.children : e.children.map(
|
106
109
|
(d, P) => H({ ...d, variant: "panel" }, P, h + 1)
|
@@ -117,29 +120,29 @@ function J({
|
|
117
120
|
active: e.active,
|
118
121
|
variant: e.variant,
|
119
122
|
ref: b ? (d) => {
|
120
|
-
p.current[
|
123
|
+
p.current[l] = d;
|
121
124
|
} : void 0
|
122
125
|
},
|
123
126
|
e.id
|
124
127
|
);
|
125
|
-
}, Z = n ? n == null ? void 0 : n.slice(-t.hiddenItemCount).map((e,
|
126
|
-
return /* @__PURE__ */ o(ve, { value: z, children: /* @__PURE__ */ o(pe, { ...f, className: Y, $textColor: u, $bgColor:
|
127
|
-
n ? n.map((e,
|
128
|
+
}, Z = n ? n == null ? void 0 : n.slice(-t.hiddenItemCount).map((e, l) => H(e, l, 1)) : c == null ? void 0 : c.slice(-t.hiddenItemCount);
|
129
|
+
return /* @__PURE__ */ o(ve, { value: z, children: /* @__PURE__ */ o(pe, { ...f, className: Y, $textColor: u, $bgColor: i, children: /* @__PURE__ */ M(he, { className: F("navmenu-root", `navmenu-root--${a}`), ref: $, children: [
|
130
|
+
n ? n.map((e, l) => H(e, l)) : X(c || []),
|
128
131
|
t.hiddenItemCount > 0 && /* @__PURE__ */ o(E, { expandIcon: !1, icon: Q, label: "", ref: w, style: K, children: Z })
|
129
132
|
] }) }) });
|
130
133
|
}
|
131
134
|
function k({
|
132
|
-
ref: n,
|
135
|
+
ref: n = void 0,
|
133
136
|
id: a = "",
|
134
137
|
icon: C = null,
|
135
138
|
label: m = "",
|
136
|
-
description: y,
|
139
|
+
description: y = void 0,
|
137
140
|
active: g = !1,
|
138
141
|
variant: I = "default",
|
139
142
|
onClick: s = fe,
|
140
143
|
...f
|
141
144
|
}) {
|
142
|
-
const r = G(a), { mode: u, activeId: v, activate:
|
145
|
+
const r = G(a), { mode: u, activeId: v, activate: i, activeTextColor: c } = B(), t = F(
|
143
146
|
"navmenu-item",
|
144
147
|
{ "navmenu-item--active": v === r },
|
145
148
|
`navmenu-item--${u}`,
|
@@ -147,7 +150,7 @@ function k({
|
|
147
150
|
f.className
|
148
151
|
);
|
149
152
|
return j(() => {
|
150
|
-
g && (
|
153
|
+
g && (i == null || i(r));
|
151
154
|
}, [g]), // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
|
152
155
|
/* @__PURE__ */ M(
|
153
156
|
Ce,
|
@@ -157,7 +160,7 @@ function k({
|
|
157
160
|
ref: n,
|
158
161
|
$activeTextColor: c,
|
159
162
|
onClick: () => {
|
160
|
-
s == null || s(),
|
163
|
+
s == null || s(), i == null || i(r);
|
161
164
|
},
|
162
165
|
children: [
|
163
166
|
C && /* @__PURE__ */ o("span", { className: "navmenu-item__icon", children: C }),
|
@@ -175,13 +178,13 @@ function k({
|
|
175
178
|
}
|
176
179
|
k.displayName = "NavMenu.Item";
|
177
180
|
function E({
|
178
|
-
ref: n,
|
181
|
+
ref: n = void 0,
|
179
182
|
id: a = "",
|
180
183
|
icon: C = null,
|
181
184
|
label: m = null,
|
182
185
|
description: y,
|
183
186
|
variant: g = "default",
|
184
|
-
children: I,
|
187
|
+
children: I = void 0,
|
185
188
|
expandIcon: s = ({ isOpen: r }) => /* @__PURE__ */ o(
|
186
189
|
ue,
|
187
190
|
{
|
@@ -192,7 +195,7 @@ function E({
|
|
192
195
|
),
|
193
196
|
...f
|
194
197
|
}) {
|
195
|
-
const r = G(a), { openedIds: u, open: v, close:
|
198
|
+
const r = G(a), { openedIds: u, open: v, close: i, mode: c, activeTextColor: t } = B(), N = (u == null ? void 0 : u.includes(r)) ?? !1, _ = c === "inline", W = F(
|
196
199
|
"navmenu-sub",
|
197
200
|
"navmenu-item",
|
198
201
|
{ "navmenu-item--panel": g === "panel" },
|
@@ -200,7 +203,7 @@ function E({
|
|
200
203
|
f.className
|
201
204
|
), z = {
|
202
205
|
onClick: () => {
|
203
|
-
u != null && u.includes(r) ?
|
206
|
+
u != null && u.includes(r) ? i == null || i(r) : v == null || v(r);
|
204
207
|
}
|
205
208
|
}, $ = _ ? { onClick: (w) => w.stopPropagation() } : {}, p = /* @__PURE__ */ M(
|
206
209
|
Ne,
|
@@ -221,7 +224,7 @@ function E({
|
|
221
224
|
]
|
222
225
|
}
|
223
226
|
);
|
224
|
-
return _ ? p : /* @__PURE__ */ o(ae, { onClickAway: () =>
|
227
|
+
return _ ? p : /* @__PURE__ */ o(ae, { onClickAway: () => i == null ? void 0 : i(r), children: p });
|
225
228
|
}
|
226
229
|
E.displayName = "NavMenu.Sub";
|
227
230
|
J.Item = k;
|
package/lib/NavMenu/products.js
CHANGED
@@ -193,7 +193,7 @@ const E = {
|
|
193
193
|
margin-top: 0px;
|
194
194
|
}
|
195
195
|
`;
|
196
|
-
function ye({ className: c, isOpen: j, ...s }) {
|
196
|
+
function ye({ className: c, isOpen: j = void 0, ...s }) {
|
197
197
|
const { mode: a } = y(), { palette: p } = h(), m = u(null), { locale: o = "en" } = _() || {}, r = w((i, n = {}) => $(E, i, o, "en", n)), b = k(() => [
|
198
198
|
{
|
199
199
|
type: "Group",
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { jsx as W } from "react/jsx-runtime";
|
2
|
-
import { useState as U, useRef as Q, Children as K, useCallback as
|
2
|
+
import { useState as U, useRef as Q, Children as K, useCallback as l, cloneElement as Z, useEffect as p } from "react";
|
3
3
|
import A from "lodash/isEqual";
|
4
4
|
import r from "lodash/isNil";
|
5
5
|
import g from "lodash/isNull";
|
@@ -9,38 +9,38 @@ const I = {
|
|
9
9
|
TOUCHMOVE: "touchmove",
|
10
10
|
KEYDOWN: "keydown"
|
11
11
|
}, ee = 500, te = "ease-in-out", ne = "100vh", se = "100vw", k = 0, B = 0, D = 100, oe = 38, re = 40, y = "rps-scroll--disabled";
|
12
|
-
let M = null,
|
12
|
+
let M = null, d = !1, a = !1, w = !0, Y = !1;
|
13
13
|
const T = [];
|
14
|
-
function
|
15
|
-
animationTimer:
|
14
|
+
function ie({
|
15
|
+
animationTimer: f = ee,
|
16
16
|
blockScrollDown: F = !1,
|
17
17
|
blockScrollUp: H = !1,
|
18
|
-
children: V,
|
18
|
+
children: V = void 0,
|
19
19
|
height: G = ne,
|
20
20
|
width: j = se,
|
21
|
-
customPageNumber: s,
|
22
|
-
onScrollUnavailable: E,
|
23
|
-
onChange: R,
|
21
|
+
customPageNumber: s = void 0,
|
22
|
+
onScrollUnavailable: E = void 0,
|
23
|
+
onChange: R = void 0,
|
24
24
|
renderAllPagesOnFirstRender: $ = !1,
|
25
25
|
transitionTimingFunction: q = te
|
26
26
|
}) {
|
27
|
-
const [n,
|
27
|
+
const [n, v] = U(k), [c, C] = U(B), m = P(n), i = Q(null), o = K.toArray(V), L = l(
|
28
28
|
(e) => {
|
29
29
|
let t = 0;
|
30
|
-
r(e) || (t = e), t = Math.max(t, c), t <= n + 1 && (r(o[n + 1]) || t++),
|
30
|
+
r(e) || (t = e), t = Math.max(t, c), t <= n + 1 && (r(o[n + 1]) || t++), C(t);
|
31
31
|
},
|
32
32
|
[o, n, c]
|
33
|
-
), X =
|
34
|
-
$ ?
|
35
|
-
}, [
|
33
|
+
), X = l(() => {
|
34
|
+
$ ? C(K.count(o)) : r(o[k + 1]) || L(B + 1);
|
35
|
+
}, [L, o, $]), O = l(() => {
|
36
36
|
w && (w = !1, window.scrollTo({
|
37
37
|
left: 0,
|
38
38
|
top: 0,
|
39
39
|
behavior: "smooth"
|
40
40
|
}), document.body.classList.add(y), document.documentElement.classList.add(y));
|
41
|
-
}, []),
|
41
|
+
}, []), _ = l(() => {
|
42
42
|
w || (w = !0, document.body.classList.remove(y), document.documentElement.classList.remove(y));
|
43
|
-
}, []), z =
|
43
|
+
}, []), z = l(() => {
|
44
44
|
const e = [];
|
45
45
|
let t = 0;
|
46
46
|
for (; t < c && !r(o[t]); )
|
@@ -48,25 +48,25 @@ function le({
|
|
48
48
|
/* @__PURE__ */ W("div", { style: { height: "100%", width: "100%" }, children: Z(o[t], { ...o[t].props }) }, t)
|
49
49
|
), t++;
|
50
50
|
return e;
|
51
|
-
}, [o, c]), h =
|
52
|
-
!
|
53
|
-
a &&
|
54
|
-
},
|
55
|
-
}, [
|
56
|
-
!
|
57
|
-
a &&
|
58
|
-
},
|
59
|
-
}, [
|
51
|
+
}, [o, c]), h = l(() => {
|
52
|
+
!d && !F && (r(T[n + 1]) ? (_(), E && E()) : (O(), d = !0, i.current.style.transform = `translate3d(0, ${(n + 1) * -100}%, 0)`, setTimeout(() => {
|
53
|
+
a && v((e) => e + 1);
|
54
|
+
}, f + D)));
|
55
|
+
}, [f, F, n, O, _, E]), u = l(() => {
|
56
|
+
!d && !H && (r(T[n - 1]) ? (_(), E && E()) : (O(), d = !0, i.current.style.transform = `translate3d(0, ${(n - 1) * -100}%, 0)`, setTimeout(() => {
|
57
|
+
a && v((e) => e - 1);
|
58
|
+
}, f + D)));
|
59
|
+
}, [f, H, n, O, _, E]), N = l(
|
60
60
|
(e) => {
|
61
61
|
g(M) ? M = e.touches[0].clientY : e.touches[0].clientY > M ? u() : h();
|
62
62
|
},
|
63
63
|
[h, u]
|
64
|
-
), J =
|
64
|
+
), J = l(
|
65
65
|
(e) => {
|
66
66
|
e.deltaY < 0 ? u() : h();
|
67
67
|
},
|
68
68
|
[h, u]
|
69
|
-
), x =
|
69
|
+
), x = l(
|
70
70
|
(e) => {
|
71
71
|
A(e.keyCode, oe) && u(), A(e.keyCode, re) && h();
|
72
72
|
},
|
@@ -74,44 +74,44 @@ function le({
|
|
74
74
|
);
|
75
75
|
return p(() => {
|
76
76
|
var e, t;
|
77
|
-
return (e =
|
77
|
+
return (e = i.current) == null || e.addEventListener(I.TOUCHMOVE, N), (t = i.current) == null || t.addEventListener(I.KEYDOWN, x), () => {
|
78
78
|
var S;
|
79
|
-
(S =
|
79
|
+
(S = i.current) != null && S.removeEventListener && (i.current.removeEventListener(I.TOUCHMOVE, N), i.current.removeEventListener(I.KEYDOWN, x));
|
80
80
|
};
|
81
81
|
}, [N, x]), p(() => (a = !0, X(), () => {
|
82
82
|
a = !1;
|
83
83
|
}), []), p(() => {
|
84
|
-
|
85
|
-
}, [
|
84
|
+
d = !1, M = null, m !== void 0 && n > m && L();
|
85
|
+
}, [L, n, m]), p(() => {
|
86
86
|
R && R(n);
|
87
87
|
}, [R, n]), p(() => {
|
88
88
|
if (!r(s) && !A(s, n)) {
|
89
89
|
let e = c;
|
90
90
|
if (!A(n, s)) {
|
91
|
-
if (!r(T[s]) && !
|
92
|
-
|
93
|
-
|
94
|
-
},
|
95
|
-
else if (!
|
91
|
+
if (!r(T[s]) && !d)
|
92
|
+
d = !0, i.current.style.transform = `translate3d(0, ${s * -100}%, 0)`, r(T[s]) && !r(o[s]) && e++, setTimeout(() => {
|
93
|
+
v(s), C(e);
|
94
|
+
}, f + D);
|
95
|
+
else if (!d && !r(o[s])) {
|
96
96
|
for (let t = c; t <= s; t++)
|
97
97
|
e++;
|
98
|
-
r(o[s]) || e++,
|
98
|
+
r(o[s]) || e++, d = !0, Y = !0, C(e);
|
99
99
|
}
|
100
100
|
}
|
101
101
|
}
|
102
102
|
}, [s]), p(() => {
|
103
|
-
Y && (Y = !1,
|
104
|
-
|
105
|
-
},
|
106
|
-
}, [
|
103
|
+
Y && (Y = !1, i.current.style.transform = `translate3d(0, ${s * -100}%, 0)`, setTimeout(() => {
|
104
|
+
v(s);
|
105
|
+
}, f + D));
|
106
|
+
}, [f, c, s]), /* @__PURE__ */ W("div", { style: { height: G, width: j, overflow: "hidden" }, children: /* @__PURE__ */ W(
|
107
107
|
"div",
|
108
108
|
{
|
109
|
-
ref:
|
109
|
+
ref: i,
|
110
110
|
onWheel: J,
|
111
111
|
style: {
|
112
112
|
height: "100%",
|
113
113
|
width: "100%",
|
114
|
-
transition: `transform ${
|
114
|
+
transition: `transform ${f}ms ${q}`,
|
115
115
|
outline: "none"
|
116
116
|
},
|
117
117
|
tabIndex: 0,
|
@@ -119,7 +119,7 @@ function le({
|
|
119
119
|
}
|
120
120
|
) });
|
121
121
|
}
|
122
|
-
const pe = b(
|
122
|
+
const pe = b(ie, { name: "PageScroller" });
|
123
123
|
export {
|
124
124
|
pe as default
|
125
125
|
};
|
@@ -1,27 +1,27 @@
|
|
1
|
-
import { jsxs as l, jsx as
|
1
|
+
import { jsxs as l, jsx as t } from "react/jsx-runtime";
|
2
2
|
import { useState as O, useMemo as x } from "react";
|
3
3
|
import { Box as C, Typography as a, Select as z, TextField as j, MenuItem as k } from "@mui/material";
|
4
4
|
import { defaultCountries as u, parseCountry as c, FlagEmoji as y } from "react-international-phone";
|
5
5
|
import P from "@arcblock/icons/lib/ArrowDown";
|
6
6
|
import { mergeSx as F } from "../Util/style.js";
|
7
7
|
function L({
|
8
|
-
ref: w,
|
8
|
+
ref: w = void 0,
|
9
9
|
value: i,
|
10
|
-
onChange: s,
|
10
|
+
onChange: s = void 0,
|
11
11
|
sx: I = {},
|
12
|
-
selectCountryProps: M,
|
12
|
+
selectCountryProps: M = void 0,
|
13
13
|
preview: p = !1,
|
14
|
-
valueField:
|
14
|
+
valueField: v = "iso2",
|
15
15
|
...m
|
16
16
|
}) {
|
17
|
-
const { hideFlag: h = !0, hideDialCode: f = !1 } = M || {}, [n,
|
18
|
-
const e = u.find((
|
17
|
+
const { hideFlag: h = !0, hideDialCode: f = !1 } = M || {}, [n, S] = O(""), r = x(() => {
|
18
|
+
const e = u.find((o) => o[1] === i);
|
19
19
|
return i && e ? c(e) : { name: "", iso2: "", dialCode: "" };
|
20
|
-
}, [i]),
|
20
|
+
}, [i]), b = x(() => {
|
21
21
|
if (!n) return u;
|
22
22
|
const e = n.toLowerCase();
|
23
|
-
return u.filter((
|
24
|
-
const d = c(
|
23
|
+
return u.filter((o) => {
|
24
|
+
const d = c(o);
|
25
25
|
return d.name.toLowerCase().includes(e) || d.iso2.toLowerCase().includes(e) || d.dialCode.includes(e);
|
26
26
|
});
|
27
27
|
}, [n]), g = /* @__PURE__ */ l(
|
@@ -35,8 +35,8 @@ function L({
|
|
35
35
|
cursor: p ? "default" : "pointer"
|
36
36
|
},
|
37
37
|
children: [
|
38
|
-
h ? null : /* @__PURE__ */
|
39
|
-
/* @__PURE__ */
|
38
|
+
h ? null : /* @__PURE__ */ t(y, { iso2: i, style: { display: "flex", width: 24, color: "inherit" } }),
|
39
|
+
/* @__PURE__ */ t(a, { component: "span", sx: { lineHeight: 1.5 }, children: f ? r == null ? void 0 : r.name : `+${r == null ? void 0 : r.dialCode}` })
|
40
40
|
]
|
41
41
|
}
|
42
42
|
);
|
@@ -71,40 +71,40 @@ function L({
|
|
71
71
|
),
|
72
72
|
value: i,
|
73
73
|
onChange: (e) => s == null ? void 0 : s(e.target.value),
|
74
|
-
IconComponent: (e) => /* @__PURE__ */
|
74
|
+
IconComponent: (e) => /* @__PURE__ */ t(P, { ...e, width: 20, height: 20 }),
|
75
75
|
renderValue: () => g,
|
76
76
|
children: [
|
77
|
-
/* @__PURE__ */
|
77
|
+
/* @__PURE__ */ t(C, { sx: { p: 1, position: "sticky", top: 0, bgcolor: "background.paper", zIndex: 1 }, children: /* @__PURE__ */ t(
|
78
78
|
j,
|
79
79
|
{
|
80
80
|
size: "small",
|
81
81
|
fullWidth: !0,
|
82
82
|
placeholder: "Search country...",
|
83
83
|
value: n,
|
84
|
-
onChange: (e) =>
|
84
|
+
onChange: (e) => S(e.target.value),
|
85
85
|
onClick: (e) => e.stopPropagation(),
|
86
86
|
onKeyDown: (e) => e.stopPropagation()
|
87
87
|
}
|
88
88
|
) }),
|
89
|
-
|
90
|
-
const
|
91
|
-
return /* @__PURE__ */ l(k, { value:
|
92
|
-
h ? null : /* @__PURE__ */
|
93
|
-
/* @__PURE__ */
|
89
|
+
b.map((e) => {
|
90
|
+
const o = c(e);
|
91
|
+
return /* @__PURE__ */ l(k, { value: o[v], children: [
|
92
|
+
h ? null : /* @__PURE__ */ t(y, { iso2: o.iso2, style: { marginRight: 8, width: 24 } }),
|
93
|
+
/* @__PURE__ */ t(
|
94
94
|
a,
|
95
95
|
{
|
96
96
|
sx: {
|
97
97
|
marginRight: 1
|
98
98
|
},
|
99
|
-
children:
|
99
|
+
children: o.name
|
100
100
|
}
|
101
101
|
),
|
102
102
|
f ? null : /* @__PURE__ */ l(a, { color: "gray", children: [
|
103
103
|
"(+",
|
104
|
-
|
104
|
+
o.dialCode,
|
105
105
|
")"
|
106
106
|
] })
|
107
|
-
] },
|
107
|
+
] }, o.iso2);
|
108
108
|
})
|
109
109
|
]
|
110
110
|
}
|
package/lib/PhoneInput/index.js
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
import { jsxs as $, jsx as m } from "react/jsx-runtime";
|
2
2
|
import { useMemo as P, useState as F, useCallback as k } from "react";
|
3
3
|
import { Box as I, Typography as A, TextField as L } from "@mui/material";
|
4
|
-
import { parsePhoneNumber as
|
4
|
+
import { parsePhoneNumber as v } from "awesome-phonenumber";
|
5
5
|
import { defaultCountries as f, parseCountry as p, usePhoneInput as R } from "react-international-phone";
|
6
6
|
import V from "./country-select.js";
|
7
7
|
import { mergeSx as q } from "../Util/style.js";
|
8
8
|
function W(e, t, n = "") {
|
9
9
|
var c, h;
|
10
10
|
if (!e) return !1;
|
11
|
-
const r = e.replace(/[\s\-()]+/g, ""), u = n ||
|
11
|
+
const r = e.replace(/[\s\-()]+/g, ""), u = n || B(t);
|
12
12
|
if (g(u) === g(r))
|
13
13
|
return !0;
|
14
|
-
const a =
|
14
|
+
const a = v(e, { regionCode: t }), d = (c = a.number) == null ? void 0 : c.input.replace(/[\s\-()]+/g, "");
|
15
15
|
return a.valid && (a.type === "mobile" || a.type === "fixed-line-or-mobile") && d === ((h = a.number) == null ? void 0 : h.e164);
|
16
16
|
}
|
17
17
|
function x(e, t) {
|
@@ -23,22 +23,22 @@ function b(e, t) {
|
|
23
23
|
function g(e) {
|
24
24
|
return e.replace(/^\+/, "");
|
25
25
|
}
|
26
|
-
function
|
26
|
+
function w(e, t) {
|
27
27
|
const n = f.find((r) => p(r).iso2 === e);
|
28
28
|
if (n)
|
29
29
|
return p(n)[t];
|
30
30
|
}
|
31
|
-
function
|
32
|
-
return
|
31
|
+
function B(e) {
|
32
|
+
return w(e, "dialCode") || "";
|
33
33
|
}
|
34
34
|
function U(e) {
|
35
|
-
return
|
35
|
+
return w(e, "name") || "";
|
36
36
|
}
|
37
37
|
function X(e) {
|
38
38
|
try {
|
39
39
|
if (!e) return;
|
40
40
|
if (e.startsWith("+")) {
|
41
|
-
const t =
|
41
|
+
const t = v(e);
|
42
42
|
if (t.valid)
|
43
43
|
return t.regionCode.toLowerCase();
|
44
44
|
for (const n of f) {
|
@@ -59,7 +59,7 @@ function X(e) {
|
|
59
59
|
}
|
60
60
|
function Y({
|
61
61
|
value: e = { country: "us", phone: "" },
|
62
|
-
onChange: t,
|
62
|
+
onChange: t = void 0,
|
63
63
|
placeholder: n = "Enter phone number",
|
64
64
|
countryDisplayOptions: r = {},
|
65
65
|
preview: u = !1,
|
@@ -105,7 +105,7 @@ function Y({
|
|
105
105
|
u || T(o);
|
106
106
|
};
|
107
107
|
if (u) {
|
108
|
-
const o = b(l,
|
108
|
+
const o = b(l, B(y)), i = l && W(o, y), s = a && i;
|
109
109
|
return /* @__PURE__ */ $(
|
110
110
|
I,
|
111
111
|
{
|
@@ -182,6 +182,6 @@ export {
|
|
182
182
|
Y as default,
|
183
183
|
X as detectCountryFromPhone,
|
184
184
|
U as getCountryNameByCountry,
|
185
|
-
|
185
|
+
B as getDialCodeByCountry,
|
186
186
|
W as validatePhoneNumber
|
187
187
|
};
|
@@ -1,16 +1,20 @@
|
|
1
1
|
import { jsxs as c, jsx as r } from "react/jsx-runtime";
|
2
|
-
import { Typography as n, Link as
|
3
|
-
function
|
2
|
+
import { Typography as n, Link as o } from "@mui/material";
|
3
|
+
function h({
|
4
|
+
linkProps: e = void 0,
|
5
|
+
showExtra: t = !1,
|
6
|
+
...l
|
7
|
+
}) {
|
4
8
|
return /* @__PURE__ */ c(n, { ...l, children: [
|
5
9
|
"Powered by",
|
6
10
|
" ",
|
7
|
-
/* @__PURE__ */ r(
|
11
|
+
/* @__PURE__ */ r(o, { href: "https://www.arcblock.io", target: "_blank", ...e, children: "ArcBlock" }),
|
8
12
|
"'s",
|
9
13
|
" ",
|
10
|
-
/* @__PURE__ */ r(
|
11
|
-
|
14
|
+
/* @__PURE__ */ r(o, { href: "https://www.blocklet.io", target: "_blank", ...e, children: "Blocklet Technology" }),
|
15
|
+
t ? ", the decentralized web engine." : null
|
12
16
|
] });
|
13
17
|
}
|
14
18
|
export {
|
15
|
-
|
19
|
+
h as default
|
16
20
|
};
|
package/lib/QRCode/index.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { jsx as d } from "react/jsx-runtime";
|
2
|
-
import { useRef as f, useMemo as m, useState as c, useEffect as
|
2
|
+
import { useRef as f, useMemo as m, useState as c, useEffect as i } from "react";
|
3
3
|
import a from "@solana/qr-code-styling";
|
4
4
|
import { Box as l } from "@mui/material";
|
5
5
|
const y = {
|
@@ -14,7 +14,7 @@ const y = {
|
|
14
14
|
type: "dot"
|
15
15
|
}
|
16
16
|
};
|
17
|
-
function C({ data: s, size: r, image: e, config: u = {}, ...
|
17
|
+
function C({ data: s, size: r, image: e = void 0, config: u = {}, ...p }) {
|
18
18
|
const o = f(null), n = m(() => ({
|
19
19
|
...y,
|
20
20
|
data: s,
|
@@ -29,11 +29,11 @@ function C({ data: s, size: r, image: e, config: u = {}, ...i }) {
|
|
29
29
|
},
|
30
30
|
...u
|
31
31
|
}), [s, r, e, u]), [t] = c(new a(n));
|
32
|
-
return
|
32
|
+
return i(() => {
|
33
33
|
o.current && t.append(o.current);
|
34
|
-
}, [t, o]),
|
34
|
+
}, [t, o]), i(() => {
|
35
35
|
t && t.update(n);
|
36
|
-
}, [n, t]), /* @__PURE__ */ d(l, { ref: o, ...
|
36
|
+
}, [n, t]), /* @__PURE__ */ d(l, { ref: o, ...p });
|
37
37
|
}
|
38
38
|
export {
|
39
39
|
C as default
|