@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
@@ -25,13 +25,13 @@ type LandingPageProps = {
|
|
25
25
|
export default function LandingPage({
|
26
26
|
did,
|
27
27
|
children,
|
28
|
-
title,
|
29
|
-
description,
|
30
|
-
actions,
|
31
|
-
logo,
|
28
|
+
title = undefined,
|
29
|
+
description = undefined,
|
30
|
+
actions = undefined,
|
31
|
+
logo = undefined,
|
32
32
|
logoSize = 50,
|
33
|
-
poweredBy,
|
34
|
-
termsOfUse,
|
33
|
+
poweredBy = undefined,
|
34
|
+
termsOfUse = undefined,
|
35
35
|
standalone = false,
|
36
36
|
}: LandingPageProps) {
|
37
37
|
const blockletData = globalThis?.blocklet || globalThis?.env || {};
|
@@ -68,7 +68,7 @@ const translations: Record<
|
|
68
68
|
};
|
69
69
|
|
70
70
|
function RequestStorageAccessApiDialog({
|
71
|
-
ref,
|
71
|
+
ref = undefined,
|
72
72
|
locale = 'en',
|
73
73
|
src,
|
74
74
|
storageAccessState,
|
@@ -289,7 +289,6 @@ function RequestStorageAccessApiDialog({
|
|
289
289
|
|
290
290
|
currentState.callback(value, 'broswer');
|
291
291
|
}}
|
292
|
-
locale={locale}
|
293
292
|
src={src}
|
294
293
|
sx={{
|
295
294
|
zIndex: 1,
|
@@ -32,7 +32,7 @@ function useMobile() {
|
|
32
32
|
return useMediaQuery(theme.breakpoints.down('sm'));
|
33
33
|
}
|
34
34
|
|
35
|
-
export default function CustomToolbar(props) {
|
35
|
+
export default function CustomToolbar({ ...props }) {
|
36
36
|
const [menuIconEl, setMenuIconEl] = useState(null);
|
37
37
|
const moreBtn = useRef(null);
|
38
38
|
const isMobile = useMobile();
|
package/src/Datatable/index.jsx
CHANGED
@@ -78,7 +78,7 @@ const FilterLine = styled('div')`
|
|
78
78
|
}
|
79
79
|
`;
|
80
80
|
|
81
|
-
function WrapFilterList(props) {
|
81
|
+
function WrapFilterList({ ...props }) {
|
82
82
|
const { filterLabel } = useDatatableContext();
|
83
83
|
const hasFilter = !!(props.filterList ?? []).filter((e) => e.length).length;
|
84
84
|
if (hasFilter) {
|
@@ -163,7 +163,7 @@ const fixCellProp = (tempObj, cellProps) => {
|
|
163
163
|
* @returns
|
164
164
|
*/
|
165
165
|
function ReDataTable({
|
166
|
-
data: originData
|
166
|
+
data: originData,
|
167
167
|
columns: originColumns,
|
168
168
|
locale = 'en',
|
169
169
|
options = {}, // The options object is usually a property supported by mui-datatable
|
package/src/Dialog/confirm.jsx
CHANGED
@@ -125,7 +125,7 @@ Confirm.propTypes = {
|
|
125
125
|
open: PropTypes.bool.isRequired,
|
126
126
|
onConfirm: PropTypes.func.isRequired,
|
127
127
|
onCancel: PropTypes.func.isRequired,
|
128
|
-
children: PropTypes.node,
|
128
|
+
children: PropTypes.node.isRequired,
|
129
129
|
showCancelButton: PropTypes.bool,
|
130
130
|
showConfirmButton: PropTypes.bool,
|
131
131
|
showCloseButton: PropTypes.bool,
|
package/src/Earth/index.tsx
CHANGED
package/src/Footer/index.tsx
CHANGED
@@ -14,7 +14,7 @@ export interface FooterProps {
|
|
14
14
|
addon?: React.ReactNode;
|
15
15
|
}
|
16
16
|
|
17
|
-
export default function Footer(props: FooterProps) {
|
17
|
+
export default function Footer({ ...props }: FooterProps) {
|
18
18
|
const newProps = mergeProps(props, Footer, ['dark', 'style']);
|
19
19
|
const { className = '', copyStart = '2017', style = {}, brand = 'ArcBlock', dark = false, addon = null } = newProps;
|
20
20
|
|
@@ -84,7 +84,10 @@ const Container = styled('div', {
|
|
84
84
|
flex-wrap: wrap;
|
85
85
|
|
86
86
|
.footer-item {
|
87
|
-
color: ${(props) =>
|
87
|
+
color: ${(props) => {
|
88
|
+
// @ts-expect-error
|
89
|
+
return props.theme.palette.text.hint;
|
90
|
+
}};
|
88
91
|
display: flex;
|
89
92
|
align-items: center;
|
90
93
|
flex-wrap: wrap;
|
@@ -2,11 +2,16 @@ import { Button, ButtonProps } from '@mui/material';
|
|
2
2
|
|
3
3
|
type Props<D extends React.ElementType, P = {}> = {
|
4
4
|
icon?: React.ReactNode;
|
5
|
-
children
|
5
|
+
children: React.ReactNode;
|
6
6
|
} & ButtonProps<D, P>;
|
7
7
|
|
8
8
|
// eslint-disable-next-line import/prefer-default-export
|
9
|
-
export function AddonButton<D extends React.ElementType, P = {}>({
|
9
|
+
export function AddonButton<D extends React.ElementType, P = {}>({
|
10
|
+
icon = undefined,
|
11
|
+
children,
|
12
|
+
sx,
|
13
|
+
...rest
|
14
|
+
}: Props<D, P>) {
|
10
15
|
const mergedSx = [
|
11
16
|
{
|
12
17
|
height: 32,
|
package/src/Header/header.tsx
CHANGED
@@ -18,7 +18,7 @@ export interface ResponsiveHeaderProps extends Omit<HeaderProps, 'children'> {
|
|
18
18
|
*
|
19
19
|
* 注意: 暂时不要通过 display: none 隐藏 logo, https://blog.patw.me/archives/1820/inline-svg-same-id-and-display-none-issue/
|
20
20
|
*/
|
21
|
-
function ResponsiveHeader({
|
21
|
+
function ResponsiveHeader({ prepend, children = null, ...rest }: ResponsiveHeaderProps) {
|
22
22
|
const theme = useTheme();
|
23
23
|
const isMobile = useMediaQuery(theme.breakpoints.down('md'));
|
24
24
|
const [drawerOpen, setDrawerOpen] = useState(false);
|
@@ -69,7 +69,6 @@ function ResponsiveHeader({ menu, prepend, children, ...rest }: ResponsiveHeader
|
|
69
69
|
prepend || (
|
70
70
|
<Button
|
71
71
|
sx={{ color: theme.palette.grey[500] }}
|
72
|
-
edge="start"
|
73
72
|
className="header-menu"
|
74
73
|
aria-label="header menu button"
|
75
74
|
onClick={() => setDrawerOpen(!drawerOpen)}>
|
package/src/Icon/index.tsx
CHANGED
@@ -21,7 +21,7 @@ function Icon({
|
|
21
21
|
variant = 'regular',
|
22
22
|
rounded = false,
|
23
23
|
className = '',
|
24
|
-
forwardedRef,
|
24
|
+
forwardedRef = undefined,
|
25
25
|
}: IconProps) {
|
26
26
|
const iconName = variant === 'solid' ? `fa-solid:${name}` : `fa-regular:${name}`;
|
27
27
|
const content = <IconifyIcon icon={iconName} color={color} width={size} height={size} className={className} />;
|
package/src/InfoRow/index.tsx
CHANGED
@@ -6,7 +6,7 @@ import { styled } from '../Theme';
|
|
6
6
|
|
7
7
|
export interface InfoRowProps {
|
8
8
|
name: React.ReactNode;
|
9
|
-
nameFormatter
|
9
|
+
nameFormatter?: (name: React.ReactNode) => React.ReactNode;
|
10
10
|
layout?: 'horizontal' | 'vertical';
|
11
11
|
children: React.ReactNode;
|
12
12
|
valueComponent?: React.ElementType;
|
@@ -15,7 +15,6 @@ export interface InfoRowProps {
|
|
15
15
|
|
16
16
|
function InfoRow({
|
17
17
|
name,
|
18
|
-
// eslint-disable-next-line no-shadow
|
19
18
|
nameFormatter = (rawName) => {
|
20
19
|
if (typeof rawName === 'string') {
|
21
20
|
return rawName
|
@@ -43,7 +43,7 @@ export interface LinkProps extends RouterLinkProps {
|
|
43
43
|
external?: false | true;
|
44
44
|
}
|
45
45
|
|
46
|
-
export function Link(props: LinkProps) {
|
46
|
+
export function Link({ ...props }: LinkProps) {
|
47
47
|
return <ExternalLink routerLinkComponent={RouterLink} {...props} />;
|
48
48
|
}
|
49
49
|
|
@@ -29,7 +29,7 @@ export const useFullPage = (initialState?: FullPageState) => {
|
|
29
29
|
return ctx;
|
30
30
|
};
|
31
31
|
|
32
|
-
export function FullPageProvider({ children, ...rest }: { children?: React.ReactNode }) {
|
32
|
+
export function FullPageProvider({ children = undefined, ...rest }: { children?: React.ReactNode }) {
|
33
33
|
const [state, setState] = useState({
|
34
34
|
inFullPage: false,
|
35
35
|
showToggleButton: false,
|
@@ -54,7 +54,7 @@ export interface SidebarProps {
|
|
54
54
|
dense?: false | true;
|
55
55
|
}
|
56
56
|
|
57
|
-
function Sidebar({ links, addons, dense = false, ...rest }: SidebarProps) {
|
57
|
+
function Sidebar({ links, addons = undefined, dense = false, ...rest }: SidebarProps) {
|
58
58
|
return (
|
59
59
|
<Root {...rest} className={clsx({ 'layout-sidebar-dense': dense })}>
|
60
60
|
<ul>{links.map(renderItem)}</ul>
|
@@ -177,7 +177,10 @@ const Root = styled('div')`
|
|
177
177
|
line-height: 1;
|
178
178
|
}
|
179
179
|
.layout-sidebar-group {
|
180
|
-
color: ${(props) =>
|
180
|
+
color: ${(props) => {
|
181
|
+
// @ts-expect-error
|
182
|
+
return props.theme.palette.text.hint;
|
183
|
+
}};
|
181
184
|
.layout-sidebar-group-title {
|
182
185
|
display: inline-block;
|
183
186
|
padding: 8px 0 8px 24px;
|
@@ -104,12 +104,12 @@ export interface HeaderProps extends AppBarProps {
|
|
104
104
|
*/
|
105
105
|
export default function Header({
|
106
106
|
onToggleMenu,
|
107
|
-
brand,
|
108
|
-
description,
|
109
|
-
addons,
|
110
|
-
brandAddon,
|
107
|
+
brand = undefined,
|
108
|
+
description = undefined,
|
109
|
+
addons = undefined,
|
110
|
+
brandAddon = undefined,
|
111
111
|
homeUrl = '/',
|
112
|
-
logo,
|
112
|
+
logo = undefined,
|
113
113
|
children,
|
114
114
|
...rest
|
115
115
|
}: HeaderProps) {
|
@@ -60,14 +60,14 @@ export default function Dashboard({
|
|
60
60
|
description = '',
|
61
61
|
images,
|
62
62
|
title = 'Home',
|
63
|
-
brandAddon,
|
64
|
-
headerAddon,
|
63
|
+
brandAddon = undefined,
|
64
|
+
headerAddon = undefined,
|
65
65
|
prefix = '/images',
|
66
66
|
fullWidth = false,
|
67
67
|
contentLayout = 'column',
|
68
68
|
className = '',
|
69
69
|
homeUrl = '/',
|
70
|
-
logo,
|
70
|
+
logo = undefined,
|
71
71
|
children,
|
72
72
|
...rest
|
73
73
|
}: DashboardProps) {
|
@@ -19,13 +19,20 @@ export type LinkItem = {
|
|
19
19
|
export interface SidebarProps extends React.HTMLAttributes<HTMLDivElement> {
|
20
20
|
images: Record<string, string>;
|
21
21
|
links: LinkItem[];
|
22
|
-
prefix
|
22
|
+
prefix?: string;
|
23
23
|
addons?: React.ReactNode;
|
24
24
|
logo?: React.ReactNode;
|
25
25
|
sx?: SxProps;
|
26
26
|
}
|
27
27
|
|
28
|
-
export default function Sidebar({
|
28
|
+
export default function Sidebar({
|
29
|
+
images,
|
30
|
+
links,
|
31
|
+
prefix = '/images',
|
32
|
+
addons = undefined,
|
33
|
+
logo = undefined,
|
34
|
+
...rest
|
35
|
+
}: SidebarProps) {
|
29
36
|
const theme = useTheme();
|
30
37
|
const location = useLocation();
|
31
38
|
const isSelected = (_: string, name: string) => {
|
@@ -45,6 +52,7 @@ export default function Sidebar({ images, links, prefix = '/images', addons, log
|
|
45
52
|
<ImageIcon
|
46
53
|
name={images[name]}
|
47
54
|
size={36}
|
55
|
+
// @ts-expect-error
|
48
56
|
color={selected ? '#00c2c4' : theme.typography.color.main}
|
49
57
|
prefix={prefix}
|
50
58
|
showBadge={showBadge}
|
package/src/Layout/index.tsx
CHANGED
@@ -42,11 +42,11 @@ export interface LayoutProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
42
42
|
export default function Layout({
|
43
43
|
title,
|
44
44
|
brand,
|
45
|
-
description,
|
45
|
+
description = undefined,
|
46
46
|
links = [],
|
47
47
|
logo = <Logo showText={false} style={{ width: '40px', height: '40px' }} />,
|
48
48
|
showLogo = false,
|
49
|
-
addons,
|
49
|
+
addons = undefined,
|
50
50
|
footer = (
|
51
51
|
<Container>
|
52
52
|
<Footer />
|
@@ -6,15 +6,15 @@ export interface LoadingMaskProps {
|
|
6
6
|
borderWidth?: number;
|
7
7
|
borderRadius?: number;
|
8
8
|
duration?: number;
|
9
|
-
children
|
9
|
+
children: React.ReactNode;
|
10
10
|
}
|
11
11
|
|
12
12
|
export default function LoadingMask({
|
13
13
|
size = 64,
|
14
|
-
padding,
|
15
|
-
borderWidth,
|
16
|
-
borderRadius,
|
17
|
-
duration,
|
14
|
+
padding = undefined,
|
15
|
+
borderWidth = undefined,
|
16
|
+
borderRadius = undefined,
|
17
|
+
duration = undefined,
|
18
18
|
children,
|
19
19
|
}: LoadingMaskProps) {
|
20
20
|
const finialSize = size;
|
package/src/Locale/context.tsx
CHANGED
@@ -94,10 +94,10 @@ const { Provider, Consumer } = LocaleContext;
|
|
94
94
|
|
95
95
|
function LocaleProvider({
|
96
96
|
children,
|
97
|
-
locale,
|
98
|
-
fallbackLocale,
|
97
|
+
locale = undefined,
|
98
|
+
fallbackLocale = undefined,
|
99
99
|
translations,
|
100
|
-
onLoadingTranslation,
|
100
|
+
onLoadingTranslation = undefined,
|
101
101
|
languages = [],
|
102
102
|
...rest
|
103
103
|
}: LocaleProviderProps) {
|
package/src/Locale/selector.tsx
CHANGED
@@ -29,7 +29,7 @@ export interface LocaleSelectorProps extends Omit<React.HTMLAttributes<HTMLDivEl
|
|
29
29
|
onChange?: (locale: Locale) => void;
|
30
30
|
}
|
31
31
|
|
32
|
-
export default function LocaleSelector(props: LocaleSelectorProps) {
|
32
|
+
export default function LocaleSelector({ ...props }: LocaleSelectorProps) {
|
33
33
|
const { showText = true, popperProps = {}, popperType = 'click', icon: Icon, size = 24, ...rest } = props;
|
34
34
|
const { locale, changeLocale, languages } = use(LocaleContext);
|
35
35
|
const anchorEl = useRef<HTMLButtonElement>(null);
|
package/src/Logo/index.tsx
CHANGED
package/src/NFTDisplay/index.tsx
CHANGED
@@ -94,6 +94,7 @@ function NFTDisplay({
|
|
94
94
|
...rest
|
95
95
|
}: NFTDisplayProps) {
|
96
96
|
const wrapRoot = (children: React.ReactNode) => (
|
97
|
+
// @ts-expect-error
|
97
98
|
<Root component={component} {...rest} className={clsx(className, { 'nft-display--inset': inset })}>
|
98
99
|
{children}
|
99
100
|
</Root>
|
@@ -375,7 +376,7 @@ const Root = styled(Box)`
|
|
375
376
|
|
376
377
|
function withAspectRatio(Component: React.ComponentType<NFTDisplayProps>) {
|
377
378
|
// eslint-disable-next-line func-names, react/prop-types
|
378
|
-
return function ({ aspect, inset, ...rest }: NFTDisplayProps) {
|
379
|
+
return function ({ aspect = undefined, inset = false, ...rest }: NFTDisplayProps) {
|
379
380
|
// inset 比 aspect ratio 优先级高, 如果同时设置了 inset 和 aspect, 则后者不生效
|
380
381
|
const applyAspectRatio = aspect && aspect > 0 && !inset;
|
381
382
|
if (applyAspectRatio) {
|
@@ -4,7 +4,7 @@ import axios from 'axios';
|
|
4
4
|
import { useState } from 'react';
|
5
5
|
import InlineSvg from './svg-embedder/inline-svg';
|
6
6
|
|
7
|
-
function RenderSvg({ src, onLoad }: { src: string; onLoad?: () => void }) {
|
7
|
+
function RenderSvg({ src, onLoad = undefined }: { src: string; onLoad?: () => void }) {
|
8
8
|
const [svgContent, setSvgContent] = useState('');
|
9
9
|
|
10
10
|
useAsyncEffect(async () => {
|
package/src/NavMenu/nav-menu.tsx
CHANGED
@@ -63,10 +63,13 @@ function NavMenu({
|
|
63
63
|
mode = 'horizontal',
|
64
64
|
children: _childs = null,
|
65
65
|
activeId = null,
|
66
|
+
// eslint-disable-next-line react/require-default-props
|
66
67
|
textColor,
|
68
|
+
// eslint-disable-next-line react/require-default-props
|
67
69
|
activeTextColor,
|
70
|
+
// eslint-disable-next-line react/require-default-props
|
68
71
|
bgColor,
|
69
|
-
onSelected,
|
72
|
+
onSelected = undefined,
|
70
73
|
...rest
|
71
74
|
}: NavMenuProps) {
|
72
75
|
const theme = useTheme();
|
@@ -294,11 +297,11 @@ export interface ItemProps extends React.HTMLAttributes<HTMLLIElement> {
|
|
294
297
|
}
|
295
298
|
|
296
299
|
export function Item({
|
297
|
-
ref,
|
300
|
+
ref = undefined,
|
298
301
|
id: _id = '',
|
299
302
|
icon = null,
|
300
303
|
label = '',
|
301
|
-
description,
|
304
|
+
description = undefined,
|
302
305
|
active = false,
|
303
306
|
variant = 'default',
|
304
307
|
onClick = noop,
|
@@ -353,13 +356,13 @@ export interface SubProps extends Omit<ItemProps, 'children' | 'active'> {
|
|
353
356
|
}
|
354
357
|
|
355
358
|
export function Sub({
|
356
|
-
ref,
|
359
|
+
ref = undefined,
|
357
360
|
id: _id = '',
|
358
361
|
icon = null,
|
359
362
|
label = null,
|
360
363
|
description,
|
361
364
|
variant = 'default',
|
362
|
-
children,
|
365
|
+
children = undefined,
|
363
366
|
|
364
367
|
expandIcon = ({ isOpen }) => (
|
365
368
|
<ExpandMoreIcon
|
package/src/NavMenu/products.tsx
CHANGED
@@ -201,7 +201,9 @@ export interface ProductsProps extends BoxProps {
|
|
201
201
|
isOpen?: boolean;
|
202
202
|
}
|
203
203
|
|
204
|
-
|
204
|
+
// FIXME: @lixl39505 isOpen 没有用,是否要移除?
|
205
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
206
|
+
export default function Products({ className, isOpen = undefined, ...rest }: ProductsProps) {
|
205
207
|
const { mode } = useNavMenuContext();
|
206
208
|
const { palette } = useTheme();
|
207
209
|
const wrapperRef = useRef<HTMLDivElement>(null);
|
@@ -49,12 +49,12 @@ function PageScroller({
|
|
49
49
|
animationTimer = DEFAULT_ANIMATION_TIMER,
|
50
50
|
blockScrollDown = false,
|
51
51
|
blockScrollUp = false,
|
52
|
-
children: _children,
|
52
|
+
children: _children = undefined,
|
53
53
|
height = DEFAULT_CONTAINER_HEIGHT,
|
54
54
|
width = DEFAULT_CONTAINER_WIDTH,
|
55
|
-
customPageNumber,
|
56
|
-
onScrollUnavailable,
|
57
|
-
onChange,
|
55
|
+
customPageNumber = undefined,
|
56
|
+
onScrollUnavailable = undefined,
|
57
|
+
onChange = undefined,
|
58
58
|
renderAllPagesOnFirstRender = false,
|
59
59
|
transitionTimingFunction = DEFAULT_ANIMATION,
|
60
60
|
}: PageScrollerProps) {
|
@@ -27,11 +27,11 @@ type CountrySelectComponent = <T extends keyof ParsedCountry = 'iso2'>(
|
|
27
27
|
|
28
28
|
// 实现组件
|
29
29
|
function CountrySelectInner<T extends keyof ParsedCountry = 'iso2'>({
|
30
|
-
ref,
|
30
|
+
ref = undefined,
|
31
31
|
value,
|
32
|
-
onChange,
|
32
|
+
onChange = undefined,
|
33
33
|
sx = {},
|
34
|
-
selectCountryProps,
|
34
|
+
selectCountryProps = undefined,
|
35
35
|
preview = false,
|
36
36
|
valueField = 'iso2' as T,
|
37
37
|
...rest
|
package/src/PhoneInput/index.tsx
CHANGED
@@ -125,7 +125,7 @@ export function detectCountryFromPhone(phoneNumber?: string): CountryIso2 | unde
|
|
125
125
|
|
126
126
|
export default function PhoneInput({
|
127
127
|
value = { country: 'us', phone: '' },
|
128
|
-
onChange,
|
128
|
+
onChange = undefined,
|
129
129
|
placeholder = 'Enter phone number',
|
130
130
|
countryDisplayOptions = {},
|
131
131
|
preview = false,
|
@@ -6,7 +6,11 @@ export interface PoweredByArcBlockProps extends TypographyProps {
|
|
6
6
|
showExtra?: boolean;
|
7
7
|
}
|
8
8
|
|
9
|
-
export default function PoweredByArcBlock({
|
9
|
+
export default function PoweredByArcBlock({
|
10
|
+
linkProps = undefined,
|
11
|
+
showExtra = false,
|
12
|
+
...props
|
13
|
+
}: PoweredByArcBlockProps) {
|
10
14
|
return (
|
11
15
|
<Typography {...props}>
|
12
16
|
Powered by{' '}
|
package/src/QRCode/index.tsx
CHANGED
@@ -28,7 +28,7 @@ export interface QRCodeProps {
|
|
28
28
|
|
29
29
|
// 该组件用于生成与 android wallet 样式风格相似的 qrcode
|
30
30
|
// 注意: 依赖的 @solana/qr-code-styling 是一份 fork 版本, 原版本的 margin 配置存在 bug
|
31
|
-
function QRCode({ data, size, image, config = {}, ...rest }: QRCodeProps) {
|
31
|
+
function QRCode({ data, size, image = undefined, config = {}, ...rest }: QRCodeProps) {
|
32
32
|
const ref = useRef(null);
|
33
33
|
const options = useMemo(() => {
|
34
34
|
return {
|
@@ -167,7 +167,7 @@ function useRelativeTime({
|
|
167
167
|
|
168
168
|
function UTCChip({
|
169
169
|
locale,
|
170
|
-
isUtc,
|
170
|
+
isUtc = false,
|
171
171
|
setIsUtc,
|
172
172
|
useShortTimezone = true,
|
173
173
|
}: {
|
@@ -213,8 +213,8 @@ export default function RelativeTime({
|
|
213
213
|
from = '',
|
214
214
|
to = '',
|
215
215
|
type = 'relative',
|
216
|
-
tz,
|
217
|
-
relativeRange,
|
216
|
+
tz = undefined,
|
217
|
+
relativeRange = undefined,
|
218
218
|
enableTooltip = true,
|
219
219
|
useShortTimezone = false,
|
220
220
|
disableTimezone = false,
|
package/src/Result/result.tsx
CHANGED
@@ -9,7 +9,7 @@ export interface ResultProps {
|
|
9
9
|
extra?: React.ReactNode;
|
10
10
|
}
|
11
11
|
|
12
|
-
function Result({ icon, title = '', description = '', extra, ...rest }: ResultProps) {
|
12
|
+
function Result({ icon = null, title = '', description = '', extra = null, ...rest }: ResultProps) {
|
13
13
|
return (
|
14
14
|
<Root {...rest}>
|
15
15
|
{icon}
|
package/src/Screenshot/index.tsx
CHANGED
@@ -126,7 +126,7 @@ const findChildren = (
|
|
126
126
|
};
|
127
127
|
|
128
128
|
export interface OldScreenshotProps extends React.ComponentProps<'div'> {
|
129
|
-
type
|
129
|
+
type: keyof typeof types;
|
130
130
|
className?: string;
|
131
131
|
style?: React.CSSProperties;
|
132
132
|
width?: number;
|
@@ -222,7 +222,7 @@ export interface ScreenFixerProps extends OldScreenshotProps {}
|
|
222
222
|
* @param {*} props params to OldScreenshot
|
223
223
|
* @returns <OldScreenshot />
|
224
224
|
*/
|
225
|
-
function ScreenFixer(props: ScreenFixerProps) {
|
225
|
+
function ScreenFixer({ ...props }: ScreenFixerProps) {
|
226
226
|
const screenEl = useRef<HTMLDivElement>(null);
|
227
227
|
const [height, setHeight] = useState<number>();
|
228
228
|
const [scale, setScale] = useState<number | null>(null);
|
@@ -9,11 +9,11 @@ import { mergeSx } from '../Util/style';
|
|
9
9
|
import { callIframe, getCallbackAction } from '../Util/iframe';
|
10
10
|
|
11
11
|
function SharedBridge({
|
12
|
-
ref,
|
12
|
+
ref = undefined,
|
13
13
|
src,
|
14
14
|
onClick,
|
15
15
|
onLoad = noop,
|
16
|
-
sx,
|
16
|
+
sx = {},
|
17
17
|
...rest
|
18
18
|
}: {
|
19
19
|
src: string;
|
package/src/Spinner/index.tsx
CHANGED
@@ -7,7 +7,7 @@ export interface SpinnerProps extends Omit<CircularProgressProps, 'size'> {
|
|
7
7
|
}
|
8
8
|
|
9
9
|
/** 之前的 Spinner 实现由内外 2 个环构成, 现在改为基于 @mui/material/CircularProgress 的实现 */
|
10
|
-
function Spinner(props: SpinnerProps) {
|
10
|
+
function Spinner({ ...props }: SpinnerProps) {
|
11
11
|
const _props = { ...props } as CircularProgressProps;
|
12
12
|
|
13
13
|
// 兼容之前的 size prop (设置外圈/内圈的尺寸)
|
@@ -26,7 +26,7 @@ export interface SplitButtonProps extends Omit<ButtonGroupProps, 'children'> {
|
|
26
26
|
menuButtonProps?: ButtonProps;
|
27
27
|
}
|
28
28
|
|
29
|
-
export default function SplitButton(props: SplitButtonProps) {
|
29
|
+
export default function SplitButton({ ...props }: SplitButtonProps) {
|
30
30
|
const {
|
31
31
|
size = 'medium',
|
32
32
|
color = 'primary',
|