@arcblock/ux 2.10.23 → 2.10.25

Sign up to get free protection for your applications and to get access to all the features.
Files changed (156) hide show
  1. package/babel.config.es.js +1 -0
  2. package/lib/ActionButton/index.js +1 -1
  3. package/lib/ActivityIndicator/index.d.ts +34 -0
  4. package/lib/ActivityIndicator/index.js +1 -1
  5. package/lib/Address/compact-text.js +1 -1
  6. package/lib/Address/did-address.js +1 -1
  7. package/lib/Address/index.js +1 -1
  8. package/lib/Address/responsive-did-address.js +1 -1
  9. package/lib/Alert/index.d.ts +12 -0
  10. package/lib/Alert/index.js +1 -1
  11. package/lib/AnimationWaiter/index.js +1 -1
  12. package/lib/Async/index.js +1 -1
  13. package/lib/Avatar/did-motif.d.ts +29 -0
  14. package/lib/Avatar/did-motif.js +1 -1
  15. package/lib/Avatar/etherscan-blockies.d.ts +5 -0
  16. package/lib/Avatar/index.d.ts +64 -0
  17. package/lib/Avatar/index.js +1 -1
  18. package/lib/Badge/index.d.ts +12 -0
  19. package/lib/Badge/index.js +1 -1
  20. package/lib/Blocklet/blocklet.d.ts +84 -0
  21. package/lib/Blocklet/blocklet.js +1 -1
  22. package/lib/Blocklet/index.d.ts +5 -0
  23. package/lib/Blocklet/utils.d.ts +3 -0
  24. package/lib/BlockletContext/index.js +1 -1
  25. package/lib/BlockletNFT/index.js +1 -1
  26. package/lib/Button/index.d.ts +3 -0
  27. package/lib/Button/wrap.d.ts +27 -0
  28. package/lib/Button/wrap.js +4 -3
  29. package/lib/CardSelector/index.js +1 -1
  30. package/lib/Center/index.js +1 -1
  31. package/lib/ClickToCopy/copy-button.js +1 -1
  32. package/lib/ClickToCopy/index.js +1 -1
  33. package/lib/CodeBlock/index.js +1 -1
  34. package/lib/Colors/index.d.ts +2 -0
  35. package/lib/Colors/themes/default.d.ts +76 -0
  36. package/lib/Colors/themes/temp.d.ts +36 -0
  37. package/lib/ContactForm/index.js +1 -1
  38. package/lib/CookieConsent/index.js +1 -1
  39. package/lib/CountDown/index.js +1 -1
  40. package/lib/DID/index.js +1 -1
  41. package/lib/Datatable/CustomToolbar.d.ts +37 -0
  42. package/lib/Datatable/CustomToolbar.js +1 -1
  43. package/lib/Datatable/DatatableContext.d.ts +4 -0
  44. package/lib/Datatable/DatatableContext.js +1 -1
  45. package/lib/Datatable/TableSearch.d.ts +28 -0
  46. package/lib/Datatable/TableSearch.js +1 -1
  47. package/lib/Datatable/index.d.ts +53 -0
  48. package/lib/Datatable/index.js +11 -3
  49. package/lib/Datatable/utils.d.ts +5 -0
  50. package/lib/Dialog/confirm.d.ts +86 -0
  51. package/lib/Dialog/confirm.js +23 -13
  52. package/lib/Dialog/dialog.d.ts +115 -0
  53. package/lib/Dialog/dialog.js +12 -7
  54. package/lib/Dialog/index.d.ts +3 -0
  55. package/lib/Dialog/use-confirm.d.ts +8 -0
  56. package/lib/Dialog/use-confirm.js +1 -1
  57. package/lib/DidLogo/index.js +1 -1
  58. package/lib/Earth/index.js +1 -1
  59. package/lib/Empty/index.d.ts +39 -0
  60. package/lib/Empty/index.js +1 -1
  61. package/lib/ErrorBoundary/fallback.js +1 -1
  62. package/lib/Footer/index.js +1 -1
  63. package/lib/Header/auto-hidden.js +1 -1
  64. package/lib/Header/header.js +1 -1
  65. package/lib/Header/responsive-header.js +1 -1
  66. package/lib/Icon/image.js +1 -1
  67. package/lib/Icon/index.d.ts +2 -0
  68. package/lib/Icon/index.js +1 -1
  69. package/lib/Img/index.d.ts +77 -0
  70. package/lib/Img/index.js +2 -1
  71. package/lib/InfoRow/index.js +1 -1
  72. package/lib/Layout/dashboard/external-link.js +1 -1
  73. package/lib/Layout/dashboard/full-page.js +1 -1
  74. package/lib/Layout/dashboard/index.js +1 -1
  75. package/lib/Layout/dashboard/sidebar.js +1 -1
  76. package/lib/Layout/dashboard-legacy/header.js +1 -1
  77. package/lib/Layout/dashboard-legacy/index.js +1 -1
  78. package/lib/Layout/dashboard-legacy/sidebar.js +1 -1
  79. package/lib/Layout/index.js +1 -1
  80. package/lib/LoadingMask/index.js +1 -1
  81. package/lib/Locale/context.js +1 -1
  82. package/lib/Locale/selector.js +1 -1
  83. package/lib/Logo/index.d.ts +42 -0
  84. package/lib/Logo/index.js +1 -1
  85. package/lib/Metric/index.js +1 -1
  86. package/lib/NFTDisplay/aspect-ratio-container.js +1 -1
  87. package/lib/NFTDisplay/broken.js +1 -1
  88. package/lib/NFTDisplay/index.js +1 -1
  89. package/lib/NFTDisplay/loading.js +1 -1
  90. package/lib/NFTDisplay/svg-embedder/img.js +1 -1
  91. package/lib/NFTDisplay/svg-embedder/inline-svg.js +1 -1
  92. package/lib/NavMenu/nav-menu.js +1 -1
  93. package/lib/PageScroller/index.js +1 -1
  94. package/lib/PageScroller/story/FullPage.js +1 -1
  95. package/lib/PageScroller/story/PageContain.js +1 -1
  96. package/lib/Passport/passport.js +1 -1
  97. package/lib/PoweredByArcBlock/index.js +1 -1
  98. package/lib/PricingTable/PricingPlan.js +1 -1
  99. package/lib/PricingTable/index.js +1 -1
  100. package/lib/QRCode/index.js +1 -1
  101. package/lib/RelativeTime/index.js +1 -1
  102. package/lib/Result/common.js +1 -1
  103. package/lib/Result/index.js +1 -1
  104. package/lib/Result/result.js +1 -1
  105. package/lib/Screenshot/BaseScreenshot/index.js +1 -1
  106. package/lib/Screenshot/index.js +1 -1
  107. package/lib/SessionBlocklet/index.js +1 -1
  108. package/lib/SessionUser/components/logged-in.js +1 -1
  109. package/lib/SessionUser/components/session-user-item.js +1 -1
  110. package/lib/SessionUser/components/session-user-switch.js +1 -1
  111. package/lib/SessionUser/components/un-login.js +1 -1
  112. package/lib/SessionUser/components/user-info.js +1 -1
  113. package/lib/SessionUser/index.js +1 -1
  114. package/lib/Spinner/index.js +1 -1
  115. package/lib/SplitButton/index.js +8 -8
  116. package/lib/Success/index.js +1 -1
  117. package/lib/Switch/index.d.ts +31 -0
  118. package/lib/Switch/index.js +1 -1
  119. package/lib/Tabs/index.js +1 -1
  120. package/lib/Tag/index.d.ts +14 -0
  121. package/lib/Tag/index.js +11 -7
  122. package/lib/TextCollapse/index.js +1 -1
  123. package/lib/Theme/index.d.ts +14 -0
  124. package/lib/Theme/index.js +9 -0
  125. package/lib/Theme/theme-provider.d.ts +25 -0
  126. package/lib/Theme/theme-provider.js +1 -1
  127. package/lib/Theme/theme.d.ts +17 -0
  128. package/lib/Theme/theme.js +21 -3
  129. package/lib/Toast/index.d.ts +11 -0
  130. package/lib/Toast/index.js +2 -1
  131. package/lib/Typography/index.js +1 -1
  132. package/lib/Util/constant.d.ts +33 -0
  133. package/lib/Util/deprecate.d.ts +5 -0
  134. package/lib/Util/deprecate.js +1 -1
  135. package/lib/Util/index.d.ts +81 -0
  136. package/lib/Util/index.js +3 -1
  137. package/lib/Video/index.js +1 -1
  138. package/lib/Wallet/Action.js +1 -1
  139. package/lib/Wallet/Download.js +1 -1
  140. package/lib/Wallet/Open.js +1 -1
  141. package/lib/WalletOSIcon/index.js +1 -1
  142. package/lib/WebWalletSWKeeper/index.js +1 -1
  143. package/lib/WechatPrompt/index.js +1 -1
  144. package/lib/withTheme/index.js +1 -1
  145. package/lib/withTracker/error_boundary.js +1 -1
  146. package/lib/withTracker/index.js +1 -1
  147. package/package.json +13 -7
  148. package/src/Button/wrap.js +3 -2
  149. package/src/Datatable/index.jsx +9 -2
  150. package/src/Dialog/confirm.jsx +22 -12
  151. package/src/Dialog/dialog.jsx +11 -6
  152. package/src/SplitButton/index.js +7 -7
  153. package/src/Tag/index.js +10 -6
  154. package/src/Theme/index.js +8 -0
  155. package/src/Theme/theme.js +20 -3
  156. package/src/Util/index.js +3 -1
@@ -1,17 +1,19 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  import PropTypes from 'prop-types';
2
3
  import CloseIcon from '@mui/icons-material/Close';
3
4
  import { Typography, Dialog as MuiDialog, DialogContent as MuiDialogContent, DialogActions, IconButton, useMediaQuery, Box } from '@mui/material';
4
5
  import { styled, useTheme } from '../Theme';
5
6
 
6
7
  /**
7
- @typedef {import('@mui/material').PaperProps & {
8
- minWidth: number | string,
9
- minHeight: number | string,
10
- }} PaperStyle
11
- */
8
+ * @typedef {import('@mui/material').DialogProps} MuiDialogProps
9
+ * @typedef {import('@mui/material').PaperProps & {
10
+ * minWidth?: number | string,
11
+ * minHeight?: number | string,
12
+ * }} PaperStyle
13
+ */
12
14
 
13
15
  /**
14
- @typedef {Object} DialogProps
16
+ @typedef {Object} UxDialogProps
15
17
  @property {React.ReactNode} children - The content of the dialog.
16
18
  @property {React.ReactNode} [title] - The title of the dialog.
17
19
  @property {React.ReactNode} [prepend] - Content to be displayed before the dialog title.
@@ -23,6 +25,10 @@ import { styled, useTheme } from '../Theme';
23
25
  @property {(event: React.SyntheticEvent, reason: string) => void} [onClose] - Callback function fired when the dialog is closed.
24
26
  */
25
27
 
28
+ /**
29
+ * @typedef {MuiDialogProps & UxDialogProps} DialogProps
30
+ */
31
+
26
32
  /**
27
33
  * Dialog
28
34
  *
@@ -35,7 +41,6 @@ import { styled, useTheme } from '../Theme';
35
41
  * @param {DialogProps} props
36
42
  * @return {React.ReactComponentElement<any, DialogProps>}
37
43
  */
38
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
39
44
  function Dialog({
40
45
  children,
41
46
  title,
@@ -0,0 +1,3 @@
1
+ export { default } from "./dialog";
2
+ export { default as Confirm } from "./confirm";
3
+ export { default as useConfirm } from "./use-confirm";
@@ -0,0 +1,8 @@
1
+ export default function useConfirm(props?: {}): {
2
+ confirmHolder: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
3
+ confirmApi: {
4
+ open: import("./types").OpenConfirm;
5
+ close: import("./types").CloseConfirm;
6
+ update: import("./types").UpdateConfirm;
7
+ };
8
+ };
@@ -1,8 +1,8 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  import { forwardRef, useImperativeHandle, useRef, useState } from 'react';
2
3
  import { useMemoizedFn, useReactive } from 'ahooks';
3
4
  import noop from 'lodash/noop';
4
5
  import Confirm from './confirm';
5
- import { jsx as _jsx } from "react/jsx-runtime";
6
6
  const ConfirmHolder = /*#__PURE__*/forwardRef((props, ref) => {
7
7
  // HACK: 这里默认值不使用 null,来避免开发环境中的字段必填警告
8
8
  // HACK: useReactive 无法存储 react-node,所以只能使用 useState
@@ -1,6 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  import PropTypes from 'prop-types';
2
3
  import DidLogoIcon from '@arcblock/icons/lib/DidLogo';
3
- import { jsx as _jsx } from "react/jsx-runtime";
4
4
  const defaultStyle = {
5
5
  width: 'auto',
6
6
  height: '1em',
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  /* eslint-disable consistent-return */
2
3
  import { useReducer, useRef, useEffect } from 'react';
3
4
  import useSpring from 'react-use/lib/useSpring';
@@ -9,7 +10,6 @@ import json from './countries.json';
9
10
  import util from './util';
10
11
  import { withDeprecated } from '../Util/deprecate';
11
12
  import { styled } from '../Theme';
12
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  const geoJson = topojson.feature(json, json.objects.ne_110m_admin_0_countries);
14
14
  const themes = {
15
15
  light: {
@@ -0,0 +1,39 @@
1
+ export default Empty;
2
+ /**
3
+ * Empty component to display empty state
4
+ */
5
+ export type EmptyProps = {
6
+ color?: string;
7
+ size?: number;
8
+ children?: import("react").ReactNode;
9
+ } & import("react").ComponentPropsWithoutRef<"div">;
10
+ /**
11
+ * Empty component to display empty state
12
+ * @typedef {{
13
+ * color?: string;
14
+ * size?: number;
15
+ * children?: import('react').ReactNode;
16
+ * } & import('react').ComponentPropsWithoutRef<"div"> } EmptyProps
17
+ */
18
+ /**
19
+ * Empty state component
20
+ * @param {EmptyProps} props
21
+ * @returns {JSX.Element}
22
+ */
23
+ declare function Empty({ color, size, children, ...rest }: EmptyProps): JSX.Element;
24
+ declare namespace Empty {
25
+ namespace propTypes {
26
+ let color: PropTypes.Requireable<string>;
27
+ let size: PropTypes.Requireable<number>;
28
+ let children: PropTypes.Requireable<any>;
29
+ }
30
+ namespace defaultProps {
31
+ let color_1: string;
32
+ export { color_1 as color };
33
+ let size_1: number;
34
+ export { size_1 as size };
35
+ let children_1: any;
36
+ export { children_1 as children };
37
+ }
38
+ }
39
+ import PropTypes from 'prop-types';
@@ -1,8 +1,8 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  import PropTypes from 'prop-types';
2
3
  import { Box } from '@mui/material';
3
4
  import EmptyIcon from '@arcblock/icons/lib/EmptyIcon';
4
5
  import { styled } from '../Theme';
5
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
6
  const Wrapper = styled(Box)`
7
7
  display: flex;
8
8
  justify-content: center;
@@ -1,8 +1,8 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  import PropTypes from 'prop-types';
2
3
  import { red } from '@mui/material/colors';
3
4
  import Button from '../Button';
4
5
  import { styled } from '../Theme';
5
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
6
  function InternalErrorFallback({
7
7
  title,
8
8
  desc,
@@ -1,3 +1,4 @@
1
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
1
2
  /* eslint-disable react/no-unused-prop-types */
2
3
  import PropTypes from 'prop-types';
3
4
  import Typography from '@mui/material/Typography';
@@ -6,7 +7,6 @@ import Box from '@mui/material/Box';
6
7
  import { mergeProps } from '../Util';
7
8
  import Logo from '../Logo';
8
9
  import { styled } from '../Theme';
9
- import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
10
10
  export default function Footer(props) {
11
11
  const newProps = mergeProps(props, Footer, ['dark', 'style']);
12
12
  const {
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  import PropTypes from 'prop-types';
2
3
  import Box from '@mui/material/Box';
3
4
  import { styled } from '../Theme';
@@ -5,7 +6,6 @@ import { styled } from '../Theme';
5
6
  /**
6
7
  * 一个容器组件, 当子元素 width 超出该容器时自动隐藏子元素, 必须设置明确的 height 值
7
8
  */
8
- import { jsx as _jsx } from "react/jsx-runtime";
9
9
  function AutoHidden({
10
10
  height,
11
11
  ...rest
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
2
  import PropTypes from 'prop-types';
2
3
  import { Box, Container } from '@mui/material';
3
4
  import { useRef, useState, useEffect } from 'react';
@@ -8,7 +9,6 @@ import { styled } from '../Theme';
8
9
  * Header 组件
9
10
  * TODO: Layout/dashboard 可以复用此处的 header
10
11
  */
11
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
12
12
  function Header({
13
13
  logo,
14
14
  brand,
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  import { useState } from 'react';
2
3
  import PropTypes from 'prop-types';
3
4
  import { useCreation, useReactive } from 'ahooks';
@@ -17,7 +18,6 @@ import { styled, useTheme } from '../Theme';
17
18
  *
18
19
  * 注意: 暂时不要通过 display: none 隐藏 logo, https://blog.patw.me/archives/1820/inline-svg-same-id-and-display-none-issue/
19
20
  */
20
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
21
21
  function ResponsiveHeader({
22
22
  menu,
23
23
  prepend,
package/lib/Icon/image.js CHANGED
@@ -1,7 +1,7 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  import PropTypes from 'prop-types';
2
3
  import Img from '../Img';
3
4
  import { styled } from '../Theme';
4
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
5
  export default function ImageIcon({
6
6
  name,
7
7
  size,
@@ -0,0 +1,2 @@
1
+ declare const _default: (props: any) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
2
+ export default _default;
package/lib/Icon/index.js CHANGED
@@ -1,9 +1,9 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  import { forwardRef } from 'react';
2
3
  import PropTypes from 'prop-types';
3
4
  import colors from '../Colors';
4
5
  import { styled } from '../Theme';
5
6
  import { withDeprecated } from '../Util/deprecate';
6
- import { jsx as _jsx } from "react/jsx-runtime";
7
7
  const variants = {
8
8
  light: 'fal',
9
9
  regular: 'far',
@@ -0,0 +1,77 @@
1
+ export default Img;
2
+ export type ImgExProps = {
3
+ /**
4
+ * - required
5
+ */
6
+ src: string;
7
+ alt?: string;
8
+ size?: string;
9
+ position?: string;
10
+ style?: object;
11
+ ratio?: number;
12
+ repeat?: string;
13
+ width?: number;
14
+ height?: number;
15
+ lazy?: boolean;
16
+ placeholder?: string;
17
+ fallback?: string;
18
+ className?: string;
19
+ onError?: Function;
20
+ onSuccess?: Function;
21
+ };
22
+ export type ImgProps = ImgExProps & import("react").ComponentPropsWithoutRef<"div">;
23
+ /**
24
+ *
25
+ * @param {ImgProps} props
26
+ * @returns {React.ReactComponentElement}
27
+ */
28
+ declare function Img({ lazy, width, height, repeat, ratio, alt, size, position, src, placeholder, fallback, style, className, onError, onSuccess, ...rest }: ImgProps): import("react").ReactComponentElement<any, Pick<any, string | number | symbol>>;
29
+ declare namespace Img {
30
+ namespace propTypes {
31
+ let src: PropTypes.Validator<string>;
32
+ let alt: PropTypes.Requireable<string>;
33
+ let size: PropTypes.Requireable<string>;
34
+ let position: PropTypes.Requireable<string>;
35
+ let style: PropTypes.Requireable<object>;
36
+ let ratio: PropTypes.Requireable<number>;
37
+ let repeat: PropTypes.Requireable<string>;
38
+ let width: PropTypes.Requireable<number>;
39
+ let height: PropTypes.Requireable<number>;
40
+ let lazy: PropTypes.Requireable<boolean>;
41
+ let placeholder: PropTypes.Requireable<string>;
42
+ let fallback: PropTypes.Requireable<string>;
43
+ let className: PropTypes.Requireable<string>;
44
+ let onError: PropTypes.Requireable<(...args: any[]) => any>;
45
+ let onSuccess: PropTypes.Requireable<(...args: any[]) => any>;
46
+ }
47
+ namespace defaultProps {
48
+ let alt_1: any;
49
+ export { alt_1 as alt };
50
+ let size_1: string;
51
+ export { size_1 as size };
52
+ let position_1: string;
53
+ export { position_1 as position };
54
+ let repeat_1: string;
55
+ export { repeat_1 as repeat };
56
+ let style_1: any;
57
+ export { style_1 as style };
58
+ let ratio_1: number;
59
+ export { ratio_1 as ratio };
60
+ let width_1: any;
61
+ export { width_1 as width };
62
+ let height_1: any;
63
+ export { height_1 as height };
64
+ let lazy_1: boolean;
65
+ export { lazy_1 as lazy };
66
+ let placeholder_1: any;
67
+ export { placeholder_1 as placeholder };
68
+ let fallback_1: any;
69
+ export { fallback_1 as fallback };
70
+ let className_1: string;
71
+ export { className_1 as className };
72
+ export { noop as onError };
73
+ export { noop as onSuccess };
74
+ }
75
+ }
76
+ import PropTypes from 'prop-types';
77
+ import noop from 'lodash/noop';
package/lib/Img/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  import { useEffect, useMemo, useState } from 'react';
2
3
  import PropTypes from 'prop-types';
3
4
  import { useInView } from 'react-intersection-observer';
@@ -29,7 +30,7 @@ import noop from 'lodash/noop';
29
30
  /**
30
31
  * @typedef {ImgExProps & import('react').ComponentPropsWithoutRef<"div">} ImgProps
31
32
  */
32
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
33
+
33
34
  const PREFIX = 'Img';
34
35
  const classes = {
35
36
  root: `${PREFIX}-root`
@@ -1,9 +1,9 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  import PropTypes from 'prop-types';
2
3
  import camelCase from 'lodash/camelCase';
3
4
  import upperFirst from 'lodash/upperFirst';
4
5
  import Typography from '@mui/material/Typography';
5
6
  import { styled } from '../Theme';
6
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
7
  function InfoRow({
8
8
  name,
9
9
  nameFormatter,
@@ -1,8 +1,8 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  import PropTypes from 'prop-types';
2
3
  import { Link as RouterLink, NavLink as RouterNavLink } from 'react-router-dom';
3
4
 
4
5
  // 包裹 router Link/NavLink 组件, 支持 external link (external 为 true 时渲染为 a 标签)
5
- import { jsx as _jsx } from "react/jsx-runtime";
6
6
  function ExternalLink({
7
7
  children,
8
8
  routerLinkComponent: RouterLinkComponent,
@@ -1,6 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  import { useState, useContext, createContext, useMemo, useLayoutEffect } from 'react';
2
3
  import PropTypes from 'prop-types';
3
- import { jsx as _jsx } from "react/jsx-runtime";
4
4
  export const FullPageContext = /*#__PURE__*/createContext();
5
5
  export const useFullPage = initialState => {
6
6
  const ctx = useContext(FullPageContext);
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  import { useEffect, useMemo } from 'react';
2
3
  import PropTypes from 'prop-types';
3
4
  import { useLocation, matchPath } from 'react-router-dom';
@@ -20,7 +21,6 @@ import { FullPageProvider, useFullPage } from './full-page';
20
21
  // 监听 location 变化并关闭 header 中的 menu (确保 drawer - disablePortal:false, keepMounted:true)
21
22
  // 直接监听 menu 中 link 点击来触发 closeMenu 会有问题 (Suspense & lazy)
22
23
  // eslint-disable-next-line react/prop-types
23
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
24
  function NavMenuWrapper({
25
25
  closeMenu,
26
26
  ...rest
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  /* eslint-disable react/no-array-index-key */
2
3
  import PropTypes from 'prop-types';
3
4
  import Typography from '@mui/material/Typography';
@@ -5,7 +6,6 @@ import { teal } from '@mui/material/colors';
5
6
  import clsx from 'clsx';
6
7
  import { styled } from '../../Theme';
7
8
  import { NavLink } from './external-link';
8
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
9
  function renderItem(item, index) {
10
10
  if (item.children?.length) {
11
11
  // eslint-disable-next-line no-use-before-define
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  import PropTypes from 'prop-types';
2
3
  import Button from '@mui/material/IconButton';
3
4
  import AppBar from '@mui/material/AppBar';
@@ -9,7 +10,6 @@ import MenuIcon from '@mui/icons-material/Menu';
9
10
  import { Link } from 'react-router-dom';
10
11
  import Logo from '../../Logo';
11
12
  import { styled } from '../../Theme';
12
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  const StyledAppBar = styled(AppBar)`
14
14
  && {
15
15
  z-index: ${props => props.theme.zIndex.drawer};
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  import { useEffect, useState } from 'react';
2
3
  import PropTypes from 'prop-types';
3
4
  import Helmet from 'react-helmet';
@@ -9,7 +10,6 @@ import Sidebar from './sidebar';
9
10
  import Header from './header';
10
11
  import Footer from '../../Footer';
11
12
  import { styled } from '../../Theme';
12
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  const Wrapper = styled('div')`
14
14
  &.dashboard {
15
15
  display: flex;
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  import { memo } from 'react';
2
3
  import PropTypes from 'prop-types';
3
4
  import { Link, useLocation } from 'react-router-dom';
@@ -7,7 +8,6 @@ import { teal } from '@mui/material/colors';
7
8
  import ImageIcon from '../../Icon/image';
8
9
  import Logo from '../../Logo';
9
10
  import { styled, useTheme } from '../../Theme';
10
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
11
  export default function Sidebar({
12
12
  images,
13
13
  links,
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
2
  import { useState } from 'react';
2
3
  import PropTypes from 'prop-types';
3
4
  import Helmet from 'react-helmet';
@@ -8,7 +9,6 @@ import OpenInWallet from '../Wallet/Open';
8
9
  import Icon from '../Icon';
9
10
  import Logo from '../Logo';
10
11
  import { styled } from '../Theme';
11
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
12
12
  export default function Layout({
13
13
  title,
14
14
  brand,
@@ -1,7 +1,7 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  import PropTypes from 'prop-types';
2
3
  import { Box } from '@mui/material';
3
4
  import { temp as colors } from '../Colors';
4
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
5
  export default function LoadingMask({
6
6
  size,
7
7
  padding,
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  /* eslint-disable no-prototype-builtins */
2
3
  import { createContext, useState, useEffect, useContext, useRef, useCallback } from 'react';
3
4
  import get from 'lodash/get';
@@ -6,7 +7,6 @@ import Cookie from 'js-cookie';
6
7
  import browserLang from './browser-lang';
7
8
  import { translate } from './util';
8
9
  import { getCookieOptions } from '../Util';
9
- import { jsx as _jsx } from "react/jsx-runtime";
10
10
  const cookieName = 'nf_lang';
11
11
 
12
12
  // 跨应用传递多语言选择的方式是在 query string 中添加 locale 参数,LocaleSelector 要高优先级遵守这个参数
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  /* eslint-disable react/jsx-no-bind */
2
3
  import { useState, useContext, useRef, useMemo } from 'react';
3
4
  import PropTypes from 'prop-types';
@@ -10,7 +11,6 @@ import { getColor, getBackground } from '../Util';
10
11
  import { temp as colors } from '../Colors';
11
12
  import { LocaleContext } from './context';
12
13
  import { styled, useTheme } from '../Theme';
13
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
14
  export default function LocaleSelector(props) {
15
15
  const {
16
16
  showText,
@@ -0,0 +1,42 @@
1
+ /**
2
+ @typedef {import('react').HTMLAttributes<HTMLSpanElement> & {
3
+ mode?: 'light' | 'dark',
4
+ layout?: 'vertical' | 'horizontal',
5
+ showText?: boolean,
6
+ showLogo?: boolean,
7
+ }} LogoProps
8
+ */
9
+ /**
10
+ * @description
11
+ * @export
12
+ * @param {LogoProps} props
13
+ * @return {React.ReactComponentElement}
14
+ */
15
+ declare function Logo({ showText, showLogo, mode, layout, ...rest }: LogoProps): React.ReactComponentElement<any, Pick<any, string | number | symbol>>;
16
+ declare namespace Logo {
17
+ namespace propTypes {
18
+ let mode: PropTypes.Requireable<string>;
19
+ let layout: PropTypes.Requireable<string>;
20
+ let showText: PropTypes.Requireable<boolean>;
21
+ let showLogo: PropTypes.Requireable<boolean>;
22
+ }
23
+ namespace defaultProps {
24
+ let mode_1: string;
25
+ export { mode_1 as mode };
26
+ let layout_1: string;
27
+ export { layout_1 as layout };
28
+ let showText_1: boolean;
29
+ export { showText_1 as showText };
30
+ let showLogo_1: boolean;
31
+ export { showLogo_1 as showLogo };
32
+ }
33
+ }
34
+ export default Logo;
35
+ export type LogoProps = import("react").HTMLAttributes<HTMLSpanElement> & {
36
+ mode?: "light" | "dark";
37
+ layout?: "vertical" | "horizontal";
38
+ showText?: boolean;
39
+ showLogo?: boolean;
40
+ };
41
+ import React from "react";
42
+ import PropTypes from 'prop-types';
package/lib/Logo/index.js CHANGED
@@ -1,7 +1,7 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  import React from "react";
2
3
  import PropTypes from 'prop-types';
3
4
  import { styled } from '../Theme';
4
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
5
  var LightLogo = function LightLogo(props) {
6
6
  return /*#__PURE__*/_jsx("svg", {
7
7
  ...props,
@@ -1,8 +1,8 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
2
  /* eslint-disable react/no-danger */
2
3
  import PropTypes from 'prop-types';
3
4
  import ImageIcon from '../Icon/image';
4
5
  import { styled } from '../Theme';
5
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
6
6
  export default function Metric({
7
7
  icon,
8
8
  value,
@@ -1,6 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  import PropTypes from 'prop-types';
2
3
  import { styled } from '../Theme';
3
- import { jsx as _jsx } from "react/jsx-runtime";
4
4
  function AspectRatioContainer({
5
5
  aspect,
6
6
  children,
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  import React from "react";
2
3
  import Box from '@mui/material/Box';
3
4
  import PropTypes from 'prop-types';
@@ -80,7 +81,6 @@ NFTBroken.defaultProps = {
80
81
  xmlns: "http://www.w3.org/2000/svg"
81
82
  };
82
83
  import { styled } from '../Theme';
83
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
84
84
  export default function Broken({
85
85
  children
86
86
  } = {}) {
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  /* eslint-disable react-hooks/rules-of-hooks */
2
3
  import { useRef, useEffect, useState } from 'react';
3
4
  import PropTypes from 'prop-types';
@@ -21,7 +22,6 @@ import displayApi from './displayApi';
21
22
  * - 旧: assetState.data.value (.credentialSubject.display)
22
23
  * - 新: assetState.display
23
24
  */
24
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
25
25
  export function getNFTData(assetState) {
26
26
  return assetState?.display || assetState?.data?.value;
27
27
  }
@@ -1,5 +1,5 @@
1
- import { styled } from '../Theme';
2
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { styled } from '../Theme';
3
3
  export default function Loading() {
4
4
  return /*#__PURE__*/_jsx(Root, {
5
5
  className: "nft-display__loading",
@@ -1,6 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  import PropTypes from 'prop-types';
2
3
  import InlineSvgEmbedder from './inline-svg';
3
- import { jsx as _jsx } from "react/jsx-runtime";
4
4
  const svgToImgUrl = svg => {
5
5
  // fix: #225, https://stackoverflow.com/a/52135328)
6
6
  const blob = new Blob([svg], {
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  import PropTypes from 'prop-types';
2
3
  import root from 'react-shadow/emotion';
3
4
  import { styled } from '../../Theme';
@@ -5,7 +6,6 @@ import { styled } from '../../Theme';
5
6
  /**
6
7
  * inline svg 的方式嵌入 svg, 使用 shadow DOM 避免样式污染
7
8
  */
8
- import { jsx as _jsx } from "react/jsx-runtime";
9
9
  function InlineSvg({
10
10
  svg,
11
11
  ...rest
@@ -1,10 +1,10 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  import { Children, cloneElement, useEffect, createContext, useContext, useRef, forwardRef, useLayoutEffect } from 'react';
2
3
  import PropTypes from 'prop-types';
3
4
  import clsx from 'clsx';
4
5
  import { MoreHoriz as MoreHorizIcon, ExpandMore as ExpandMoreIcon, Menu as MenuIcon } from '@mui/icons-material';
5
6
  import { useCreation, useMemoizedFn, useReactive, useSize, useThrottleFn } from 'ahooks';
6
7
  import { HorizontalStyle, InlineStyle } from './style';
7
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
8
8
  const NavMenuContext = /*#__PURE__*/createContext();
9
9
 
10
10
  // 过滤 children 中的 Item/Sub, 忽略其它类型的 element
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  /* eslint-disable jsx-a11y/no-noninteractive-tabindex */
2
3
  import { Children, cloneElement, useCallback, useEffect, useRef, useState } from 'react';
3
4
  import PropTypes from 'prop-types';
@@ -6,7 +7,6 @@ import isNil from 'lodash/isNil';
6
7
  import isNull from 'lodash/isNull';
7
8
  import usePrevious from './usePrevValue';
8
9
  import { withDeprecated } from '../Util/deprecate';
9
- import { jsx as _jsx } from "react/jsx-runtime";
10
10
  const Events = {
11
11
  TOUCHMOVE: 'touchmove',
12
12
  KEYDOWN: 'keydown'