@arcblock/ux 2.10.67 → 2.10.69

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.
Files changed (294) hide show
  1. package/lib/Address/did-address.d.ts +6 -5
  2. package/lib/Address/index.d.ts +1 -1
  3. package/lib/Avatar/index.d.ts +10 -8
  4. package/lib/Avatar/index.js +6 -4
  5. package/lib/Blocklet/blocklet.d.ts +4 -4
  6. package/lib/Blocklet/blocklet.js +2 -2
  7. package/lib/BlockletContext/index.d.ts +3 -3
  8. package/lib/BlockletNFT/index.d.ts +6 -6
  9. package/lib/BlockletNFT/index.js +3 -3
  10. package/lib/BlockletV2/blocklet.d.ts +2 -2
  11. package/lib/Button/wrap.d.ts +4 -4
  12. package/lib/Button/wrap.js +2 -2
  13. package/lib/CardSelector/index.js +0 -1
  14. package/lib/Center/index.d.ts +1 -1
  15. package/lib/ClickToCopy/copy-button.d.ts +5 -4
  16. package/lib/ClickToCopy/copy-button.js +0 -1
  17. package/lib/ClickToCopy/hook.d.ts +3 -8
  18. package/lib/ClickToCopy/index.d.ts +6 -4
  19. package/lib/CodeBlock/index.d.ts +3 -1
  20. package/lib/CookieConsent/index.d.ts +8 -29
  21. package/lib/CookieConsent/index.js +3 -17
  22. package/lib/CountDown/index.d.ts +21 -25
  23. package/lib/CountDown/index.js +12 -11
  24. package/lib/DID/index.d.ts +9 -8
  25. package/lib/Datatable/index.d.ts +5 -5
  26. package/lib/Datatable/index.js +5 -5
  27. package/lib/Dialog/confirm.d.ts +6 -6
  28. package/lib/Dialog/confirm.js +3 -3
  29. package/lib/Dialog/types.d.ts +1 -1
  30. package/lib/DidLogo/index.d.ts +5 -25
  31. package/lib/DidLogo/index.js +4 -15
  32. package/lib/DriftBot/index.d.ts +13 -19
  33. package/lib/DriftBot/index.js +5 -6
  34. package/lib/Earth/index.d.ts +28 -10
  35. package/lib/Earth/index.js +12 -52
  36. package/lib/Earth/util.d.ts +10 -5
  37. package/lib/Earth/util.js +1 -0
  38. package/lib/ErrorBoundary/fallback.d.ts +12 -19
  39. package/lib/ErrorBoundary/fallback.js +2 -19
  40. package/lib/ErrorBoundary/index.d.ts +1 -1
  41. package/lib/Footer/index.d.ts +17 -24
  42. package/lib/Footer/index.js +2 -11
  43. package/lib/Header/header.d.ts +2 -2
  44. package/lib/Icon/image.d.ts +3 -2
  45. package/lib/Icon/index.d.ts +6 -4
  46. package/lib/Img/index.d.ts +1 -1
  47. package/lib/Img/index.js +1 -1
  48. package/lib/InfoRow/index.d.ts +9 -32
  49. package/lib/InfoRow/index.js +10 -23
  50. package/lib/Layout/dashboard/external-link.d.ts +13 -14
  51. package/lib/Layout/dashboard/external-link.js +5 -22
  52. package/lib/Layout/dashboard/full-page.d.ts +19 -11
  53. package/lib/Layout/dashboard/full-page.js +2 -6
  54. package/lib/Layout/dashboard/index.d.ts +20 -39
  55. package/lib/Layout/dashboard/index.js +10 -38
  56. package/lib/Layout/dashboard/sidebar.d.ts +17 -20
  57. package/lib/Layout/dashboard/sidebar.js +3 -16
  58. package/lib/Layout/dashboard-legacy/header.d.ts +10 -36
  59. package/lib/Layout/dashboard-legacy/header.js +5 -24
  60. package/lib/Layout/dashboard-legacy/index.d.ts +17 -56
  61. package/lib/Layout/dashboard-legacy/index.js +12 -41
  62. package/lib/Layout/dashboard-legacy/sidebar.d.ts +15 -26
  63. package/lib/Layout/dashboard-legacy/sidebar.js +5 -15
  64. package/lib/Layout/index.d.ts +17 -56
  65. package/lib/Layout/index.js +24 -50
  66. package/lib/LoadingMask/index.d.ts +8 -31
  67. package/lib/LoadingMask/index.js +3 -19
  68. package/lib/Locale/browser-lang.d.ts +4 -1
  69. package/lib/Locale/browser-lang.js +8 -3
  70. package/lib/Locale/context.d.ts +18 -8
  71. package/lib/Locale/context.js +1 -1
  72. package/lib/Locale/languages.d.ts +9 -55
  73. package/lib/Locale/selector.d.ts +10 -26
  74. package/lib/Locale/selector.js +8 -25
  75. package/lib/Locale/util.d.ts +4 -3
  76. package/lib/Locale/util.js +0 -1
  77. package/lib/Logo/index.d.ts +9 -40
  78. package/lib/Logo/index.js +88 -46
  79. package/lib/Metric/index.d.ts +9 -31
  80. package/lib/Metric/index.js +5 -20
  81. package/lib/NFTDisplay/aspect-ratio-container.d.ts +5 -12
  82. package/lib/NFTDisplay/aspect-ratio-container.js +0 -5
  83. package/lib/NFTDisplay/broken.d.ts +3 -13
  84. package/lib/NFTDisplay/broken.js +80 -10
  85. package/lib/NFTDisplay/displayApi.d.ts +1 -1
  86. package/lib/NFTDisplay/index.d.ts +28 -6
  87. package/lib/NFTDisplay/index.js +17 -51
  88. package/lib/NFTDisplay/svg-embedder/img.d.ts +8 -23
  89. package/lib/NFTDisplay/svg-embedder/img.js +3 -17
  90. package/lib/NFTDisplay/svg-embedder/inline-svg.d.ts +7 -13
  91. package/lib/NFTDisplay/svg-embedder/inline-svg.js +1 -8
  92. package/lib/NavMenu/nav-menu.d.ts +2 -0
  93. package/lib/NavMenu/nav-menu.js +0 -1
  94. package/lib/PageScroller/index.d.ts +14 -13
  95. package/lib/PageScroller/index.js +12 -37
  96. package/lib/PageScroller/usePrevValue.d.ts +1 -1
  97. package/lib/PageScroller/usePrevValue.js +1 -2
  98. package/lib/Passport/index.d.ts +1 -1
  99. package/lib/Passport/passport.d.ts +10 -30
  100. package/lib/Passport/passport.js +5 -19
  101. package/lib/PoweredByArcBlock/index.d.ts +4 -14
  102. package/lib/PoweredByArcBlock/index.js +1 -8
  103. package/lib/PricingTable/PricingPlan.d.ts +11 -9
  104. package/lib/PricingTable/PricingPlan.js +0 -4
  105. package/lib/PricingTable/index.d.ts +5 -3
  106. package/lib/PricingTable/index.js +1 -5
  107. package/lib/QRCode/index.d.ts +11 -22
  108. package/lib/QRCode/index.js +2 -17
  109. package/lib/RelativeTime/index.d.ts +12 -40
  110. package/lib/RelativeTime/index.js +7 -27
  111. package/lib/Result/common.d.ts +26 -45
  112. package/lib/Result/common.js +2 -4
  113. package/lib/Result/index.d.ts +5 -18
  114. package/lib/Result/index.js +1 -9
  115. package/lib/Result/result.d.ts +7 -29
  116. package/lib/Result/result.js +2 -17
  117. package/lib/Result/translations.d.ts +2 -54
  118. package/lib/Screenshot/BaseScreenshot/index.d.ts +7 -24
  119. package/lib/Screenshot/BaseScreenshot/index.js +2 -15
  120. package/lib/Screenshot/BaseScreenshot/shells/Macbook.d.ts +25 -19
  121. package/lib/Screenshot/BaseScreenshot/shells/Phone.d.ts +25 -19
  122. package/lib/Screenshot/index.d.ts +84 -28
  123. package/lib/Screenshot/index.js +14 -43
  124. package/lib/SessionBlocklet/index.d.ts +6 -19
  125. package/lib/SessionBlocklet/index.js +5 -15
  126. package/lib/SessionManager/index.d.ts +1 -1
  127. package/lib/SessionPermission/index.d.ts +9 -17
  128. package/lib/SessionPermission/index.js +3 -11
  129. package/lib/SessionUser/components/logged-in.d.ts +9 -31
  130. package/lib/SessionUser/components/logged-in.js +13 -29
  131. package/lib/SessionUser/components/session-user-item.d.ts +8 -1
  132. package/lib/SessionUser/components/session-user-item.js +2 -12
  133. package/lib/SessionUser/components/session-user-switch.d.ts +9 -21
  134. package/lib/SessionUser/components/session-user-switch.js +3 -15
  135. package/lib/SessionUser/components/un-login.d.ts +7 -23
  136. package/lib/SessionUser/components/un-login.js +4 -16
  137. package/lib/SessionUser/components/user-info.d.ts +12 -29
  138. package/lib/SessionUser/components/user-info.js +4 -19
  139. package/lib/SessionUser/index.d.ts +7 -30
  140. package/lib/SessionUser/index.js +5 -26
  141. package/lib/SessionUser/libs/translation.d.ts +2 -31
  142. package/lib/SessionUser/libs/translation.js +1 -0
  143. package/lib/SessionUser/libs/utils.d.ts +10 -9
  144. package/lib/Sparkline/index.d.ts +22 -1
  145. package/lib/Sparkline/index.js +25 -17
  146. package/lib/Spinner/index.d.ts +6 -1
  147. package/lib/Spinner/index.js +4 -11
  148. package/lib/Success/index.d.ts +5 -21
  149. package/lib/Success/index.js +10 -19
  150. package/lib/Tabs/index.d.ts +12 -26
  151. package/lib/Tabs/index.js +7 -37
  152. package/lib/TextCollapse/index.d.ts +10 -10
  153. package/lib/TextCollapse/index.js +4 -21
  154. package/lib/Theme/index.js +0 -2
  155. package/lib/Theme/theme-provider.d.ts +1 -1
  156. package/lib/Theme/theme.d.ts +4 -1
  157. package/lib/Theme/theme.js +1 -2
  158. package/lib/Typography/index.d.ts +5 -24
  159. package/lib/Typography/index.js +5 -17
  160. package/lib/Util/index.d.ts +17 -8
  161. package/lib/Util/index.js +22 -3
  162. package/lib/Video/index.d.ts +12 -16
  163. package/lib/Video/index.js +0 -14
  164. package/lib/Wallet/Action.d.ts +13 -18
  165. package/lib/Wallet/Action.js +0 -7
  166. package/lib/Wallet/Download.d.ts +24 -30
  167. package/lib/Wallet/Download.js +201 -18
  168. package/lib/Wallet/Open.d.ts +5 -15
  169. package/lib/Wallet/Open.js +5 -11
  170. package/lib/WalletOSIcon/index.d.ts +6 -25
  171. package/lib/WalletOSIcon/index.js +3 -16
  172. package/lib/WebWalletSWKeeper/index.d.ts +8 -20
  173. package/lib/WebWalletSWKeeper/index.js +14 -19
  174. package/lib/WechatPrompt/index.js +2 -0
  175. package/lib/global.d.ts +15 -0
  176. package/lib/type.d.ts +12 -3
  177. package/lib/withTheme/index.d.ts +8 -6
  178. package/lib/withTracker/index.d.ts +1 -1
  179. package/lib/withTracker/index.js +3 -0
  180. package/package.json +9 -5
  181. package/src/Address/did-address.tsx +7 -6
  182. package/src/Address/index.tsx +1 -1
  183. package/src/Avatar/index.jsx +6 -4
  184. package/src/Blocklet/blocklet.jsx +2 -2
  185. package/src/BlockletContext/index.tsx +3 -3
  186. package/src/BlockletNFT/index.jsx +3 -3
  187. package/src/BlockletV2/blocklet.tsx +2 -2
  188. package/src/Button/wrap.jsx +2 -2
  189. package/src/CardSelector/index.tsx +0 -1
  190. package/src/Center/index.tsx +1 -1
  191. package/src/ClickToCopy/copy-button.tsx +4 -4
  192. package/src/ClickToCopy/hook.ts +3 -2
  193. package/src/ClickToCopy/index.tsx +6 -5
  194. package/src/CodeBlock/index.tsx +3 -1
  195. package/src/CookieConsent/{index.jsx → index.tsx} +16 -19
  196. package/src/CountDown/{index.jsx → index.tsx} +30 -16
  197. package/src/DID/index.tsx +9 -8
  198. package/src/Datatable/index.jsx +5 -5
  199. package/src/Dialog/confirm.jsx +3 -3
  200. package/src/Dialog/types.d.ts +1 -1
  201. package/src/DidLogo/{index.jsx → index.tsx} +7 -14
  202. package/src/DriftBot/{index.jsx → index.tsx} +13 -11
  203. package/src/Earth/{index.jsx → index.tsx} +94 -66
  204. package/src/Earth/{util.js → util.ts} +20 -17
  205. package/src/ErrorBoundary/{fallback.jsx → fallback.tsx} +20 -21
  206. package/src/Footer/{index.jsx → index.tsx} +17 -14
  207. package/src/Header/header.tsx +2 -3
  208. package/src/Header/responsive-header.tsx +0 -1
  209. package/src/Icon/image.tsx +3 -3
  210. package/src/Icon/index.tsx +7 -4
  211. package/src/Img/index.jsx +1 -1
  212. package/src/InfoRow/{index.jsx → index.tsx} +32 -25
  213. package/src/Layout/dashboard/external-link.tsx +46 -0
  214. package/src/Layout/dashboard/{full-page.jsx → full-page.tsx} +20 -9
  215. package/src/Layout/dashboard/{index.jsx → index.tsx} +42 -44
  216. package/src/Layout/dashboard/{sidebar.jsx → sidebar.tsx} +23 -20
  217. package/src/Layout/dashboard-legacy/{header.jsx → header.tsx} +16 -26
  218. package/src/Layout/dashboard-legacy/{index.jsx → index.tsx} +32 -46
  219. package/src/Layout/dashboard-legacy/{sidebar.jsx → sidebar.tsx} +27 -19
  220. package/src/Layout/{index.jsx → index.tsx} +41 -47
  221. package/src/LoadingMask/{index.jsx → index.tsx} +18 -20
  222. package/src/Locale/{browser-lang.js → browser-lang.ts} +9 -7
  223. package/src/Locale/context.tsx +18 -11
  224. package/src/Locale/{languages.js → languages.ts} +1 -1
  225. package/src/Locale/{selector.jsx → selector.tsx} +32 -29
  226. package/src/Locale/{util.js → util.ts} +9 -2
  227. package/src/Logo/index.tsx +58 -0
  228. package/src/Metric/{index.jsx → index.tsx} +23 -18
  229. package/src/NFTDisplay/{aspect-ratio-container.jsx → aspect-ratio-container.tsx} +9 -7
  230. package/src/NFTDisplay/{broken.jsx → broken.tsx} +7 -12
  231. package/src/NFTDisplay/{displayApi.js → displayApi.ts} +4 -4
  232. package/src/NFTDisplay/{index.jsx → index.tsx} +59 -64
  233. package/src/NFTDisplay/svg-embedder/{img.jsx → img.tsx} +10 -18
  234. package/src/NFTDisplay/svg-embedder/{inline-svg.jsx → inline-svg.tsx} +8 -9
  235. package/src/NavMenu/nav-menu.tsx +2 -3
  236. package/src/PageScroller/{index.jsx → index.tsx} +40 -53
  237. package/src/PageScroller/{usePrevValue.js → usePrevValue.ts} +2 -3
  238. package/src/Passport/{passport.jsx → passport.tsx} +22 -19
  239. package/src/PoweredByArcBlock/{index.jsx → index.tsx} +6 -11
  240. package/src/PricingTable/{PricingPlan.jsx → PricingPlan.tsx} +15 -5
  241. package/src/PricingTable/{index.jsx → index.tsx} +9 -6
  242. package/src/QRCode/{index.jsx → index.tsx} +14 -19
  243. package/src/RelativeTime/{index.jsx → index.tsx} +24 -24
  244. package/src/Result/{common.jsx → common.tsx} +17 -13
  245. package/src/Result/index.tsx +30 -0
  246. package/src/Result/{result.jsx → result.tsx} +8 -17
  247. package/src/Result/{translations.js → translations.ts} +3 -1
  248. package/src/Screenshot/BaseScreenshot/{index.jsx → index.tsx} +9 -15
  249. package/src/Screenshot/BaseScreenshot/shells/{Macbook.jsx → Macbook.tsx} +3 -1
  250. package/src/Screenshot/BaseScreenshot/shells/{Phone.jsx → Phone.tsx} +3 -1
  251. package/src/Screenshot/{index.jsx → index.tsx} +60 -54
  252. package/src/SessionBlocklet/{index.jsx → index.tsx} +9 -14
  253. package/src/SessionPermission/index.tsx +25 -0
  254. package/src/SessionUser/components/{logged-in.jsx → logged-in.tsx} +49 -31
  255. package/src/SessionUser/components/session-user-item.tsx +97 -0
  256. package/src/SessionUser/components/{session-user-switch.jsx → session-user-switch.tsx} +16 -21
  257. package/src/SessionUser/components/{un-login.jsx → un-login.tsx} +10 -15
  258. package/src/SessionUser/components/{user-info.jsx → user-info.tsx} +16 -22
  259. package/src/SessionUser/index.tsx +26 -0
  260. package/src/SessionUser/libs/{translation.js → translation.ts} +3 -1
  261. package/src/SessionUser/libs/utils.ts +39 -0
  262. package/src/Sparkline/{index.jsx → index.tsx} +38 -22
  263. package/src/Spinner/index.tsx +20 -0
  264. package/src/Success/{index.jsx → index.tsx} +13 -16
  265. package/src/Tabs/{index.jsx → index.tsx} +26 -40
  266. package/src/TextCollapse/{index.jsx → index.tsx} +26 -21
  267. package/src/Theme/index.ts +0 -1
  268. package/src/Theme/theme-provider.tsx +1 -1
  269. package/src/Theme/theme.ts +6 -3
  270. package/src/Typography/{index.jsx → index.tsx} +19 -22
  271. package/src/Util/index.ts +26 -9
  272. package/src/Video/{index.jsx → index.tsx} +7 -10
  273. package/src/Wallet/{Action.jsx → Action.tsx} +16 -12
  274. package/src/Wallet/{Download.jsx → Download.tsx} +25 -21
  275. package/src/Wallet/{Open.jsx → Open.tsx} +8 -11
  276. package/src/WalletOSIcon/{index.jsx → index.tsx} +8 -16
  277. package/src/WebWalletSWKeeper/{index.jsx → index.tsx} +21 -24
  278. package/src/WechatPrompt/{index.jsx → index.tsx} +1 -0
  279. package/src/global.d.ts +15 -0
  280. package/src/type.d.ts +12 -3
  281. package/src/withTheme/{index.jsx → index.tsx} +12 -2
  282. package/src/withTracker/{index.jsx → index.tsx} +6 -4
  283. package/src/Layout/dashboard/external-link.jsx +0 -47
  284. package/src/Logo/index.jsx +0 -66
  285. package/src/Result/index.jsx +0 -33
  286. package/src/SessionPermission/index.jsx +0 -28
  287. package/src/SessionUser/components/session-user-item.jsx +0 -93
  288. package/src/SessionUser/index.jsx +0 -38
  289. package/src/SessionUser/libs/utils.js +0 -37
  290. package/src/Spinner/index.jsx +0 -21
  291. /package/src/ErrorBoundary/{index.jsx → index.ts} +0 -0
  292. /package/src/NFTDisplay/{loading.jsx → loading.tsx} +0 -0
  293. /package/src/Passport/{index.jsx → index.ts} +0 -0
  294. /package/src/SessionManager/{index.jsx → index.tsx} +0 -0
@@ -1,31 +1,8 @@
1
- declare function SessionUser({ session, onBindWallet, locale, size }: {
2
- session: any;
3
- onBindWallet: any;
4
- locale: any;
5
- size: any;
6
- }): import("react/jsx-runtime").JSX.Element;
7
- declare namespace SessionUser {
8
- namespace propTypes {
9
- let session: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
10
- user: PropTypes.Requireable<PropTypes.InferProps<{
11
- did: PropTypes.Validator<string>;
12
- fullName: PropTypes.Validator<string>;
13
- avatar: PropTypes.Validator<string>;
14
- email: PropTypes.Requireable<string>;
15
- }>>;
16
- }>>>;
17
- let onBindWallet: PropTypes.Requireable<(...args: any[]) => any>;
18
- let locale: PropTypes.Requireable<string>;
19
- let size: PropTypes.Requireable<number>;
20
- }
21
- namespace defaultProps {
22
- export { noop as onBindWallet };
23
- let locale_1: string;
24
- export { locale_1 as locale };
25
- let size_1: number;
26
- export { size_1 as size };
27
- }
1
+ import type { Locale, Session } from '../type';
2
+ export interface SessionUserProps {
3
+ session: Session;
4
+ onBindWallet?: () => void;
5
+ locale?: Locale;
6
+ size?: number;
28
7
  }
29
- export default SessionUser;
30
- import PropTypes from 'prop-types';
31
- import noop from 'lodash/noop';
8
+ export default function SessionUser({ session, onBindWallet, locale, size }: SessionUserProps): import("react/jsx-runtime").JSX.Element;
@@ -1,18 +1,17 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import PropTypes from 'prop-types';
3
2
  import noop from 'lodash/noop';
4
3
  import { useCreation } from 'ahooks';
5
4
  import LoggedIn from './components/logged-in';
6
5
  import UnLogin from './components/un-login';
7
6
  export default function SessionUser({
8
7
  session,
9
- onBindWallet,
10
- locale,
11
- size
8
+ onBindWallet = noop,
9
+ locale = 'en',
10
+ size = 24
12
11
  }) {
13
12
  const isBlocklet = useCreation(() => {
14
13
  return !!globalThis?.blocklet;
15
- });
14
+ }, []);
16
15
  if (session.user) {
17
16
  return /*#__PURE__*/_jsx(LoggedIn, {
18
17
  isBlocklet: isBlocklet,
@@ -24,26 +23,6 @@ export default function SessionUser({
24
23
  }
25
24
  return /*#__PURE__*/_jsx(UnLogin, {
26
25
  session: session,
27
- isBlocklet: isBlocklet,
28
- locale: locale,
29
26
  size: size
30
27
  });
31
- }
32
- SessionUser.propTypes = {
33
- session: PropTypes.shape({
34
- user: PropTypes.shape({
35
- did: PropTypes.string.isRequired,
36
- fullName: PropTypes.string.isRequired,
37
- avatar: PropTypes.string.isRequired,
38
- email: PropTypes.string
39
- })
40
- }).isRequired,
41
- onBindWallet: PropTypes.func,
42
- locale: PropTypes.string,
43
- size: PropTypes.number
44
- };
45
- SessionUser.defaultProps = {
46
- onBindWallet: noop,
47
- locale: 'en',
48
- size: 24
49
- };
28
+ }
@@ -1,31 +1,2 @@
1
- export namespace translations {
2
- namespace en {
3
- export let connectDIDWallet: string;
4
- let _switch: string;
5
- export { _switch as switch };
6
- export let profile: string;
7
- export let invite: string;
8
- export let inviteCopied: string;
9
- export let dashboard: string;
10
- export let logout: string;
11
- export let addAnotherAccount: string;
12
- }
13
- namespace zh {
14
- let connectDIDWallet_1: string;
15
- export { connectDIDWallet_1 as connectDIDWallet };
16
- let _switch_1: string;
17
- export { _switch_1 as switch };
18
- let profile_1: string;
19
- export { profile_1 as profile };
20
- let invite_1: string;
21
- export { invite_1 as invite };
22
- let inviteCopied_1: string;
23
- export { inviteCopied_1 as inviteCopied };
24
- let dashboard_1: string;
25
- export { dashboard_1 as dashboard };
26
- let logout_1: string;
27
- export { logout_1 as logout };
28
- let addAnotherAccount_1: string;
29
- export { addAnotherAccount_1 as addAnotherAccount };
30
- }
31
- }
1
+ import type { Translations } from '../../type';
2
+ export declare const translations: Translations;
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable import/prefer-default-export */
2
+
2
3
  export const translations = {
3
4
  en: {
4
5
  connectDIDWallet: 'Connect your DID Wallet for enhanced security',
@@ -1,9 +1,10 @@
1
- export function getPermanentDid(user: any): any;
2
- export function getConnectedAccounts(user: any): any;
3
- export function getSourceProvider(user: any): any;
4
- export function getSourceProviders(user: any): any;
5
- export function getConnectedDids(user: any): any;
6
- export function getWallet(user: any): any;
7
- export function getWalletDid(user: any): any;
8
- export function getSourceAppPid(user: any): any;
9
- export function getCurrentAppPid(user: any): any;
1
+ import { User } from '../../type';
2
+ export declare const getSourceAppPid: (user: User) => any;
3
+ export declare const getCurrentAppPid: (user: User) => any;
4
+ export declare function getPermanentDid(user: User): any;
5
+ export declare function getConnectedAccounts(user: User): any;
6
+ export declare function getSourceProvider(user: User): any;
7
+ export declare function getSourceProviders(user: User): any;
8
+ export declare function getConnectedDids(user: User): any;
9
+ export declare function getWallet(user: User): any;
10
+ export declare function getWalletDid(user: User): any;
@@ -1 +1,22 @@
1
- export default function sparkline(svg: any, entries: any, options: any): void;
1
+ export interface SparklineProps {
2
+ svg: SVGElement;
3
+ entries?: number[] | {
4
+ value: number;
5
+ }[];
6
+ options?: {
7
+ fetch?: (entry: {
8
+ value: number;
9
+ }) => number;
10
+ interactive?: boolean;
11
+ onmousemove?: (event: MouseEvent, currentDataPoint: {
12
+ value: number;
13
+ index: number;
14
+ x: number;
15
+ y: number;
16
+ }) => void;
17
+ onmouseout?: (event: MouseEvent) => void;
18
+ spotRadius?: number;
19
+ cursorWidth?: number;
20
+ };
21
+ }
22
+ export default function sparkline({ svg, entries: _entries, options }: SparklineProps): void;
@@ -1,5 +1,3 @@
1
- /* eslint-disable guard-for-in */
2
- /* eslint-disable no-restricted-syntax */
3
1
  // origin: https://github.com/fnando/sparkline
4
2
  function getY(max, height, diff, value) {
5
3
  return parseFloat((height - value * height / max + diff).toFixed(2));
@@ -12,26 +10,31 @@ function defaultFetch(entry) {
12
10
  }
13
11
  function buildElement(tag, attrs) {
14
12
  const element = document.createElementNS('http://www.w3.org/2000/svg', tag);
13
+
14
+ // eslint-disable-next-line no-restricted-syntax, guard-for-in
15
15
  for (const name in attrs) {
16
16
  element.setAttribute(name, attrs[name]);
17
17
  }
18
18
  return element;
19
19
  }
20
- export default function sparkline(svg, entries, options) {
20
+ export default function sparkline({
21
+ svg,
22
+ entries: _entries = [],
23
+ options = {}
24
+ }) {
21
25
  removeChildren(svg);
22
- if (entries.length <= 1) {
26
+ if (_entries.length <= 1) {
23
27
  return;
24
28
  }
25
-
26
- // eslint-disable-next-line no-param-reassign
27
- options = options || {};
28
- if (typeof entries[0] === 'number') {
29
- // eslint-disable-next-line no-param-reassign
30
- entries = entries.map(entry => {
29
+ let entries = [];
30
+ if (typeof _entries[0] === 'number') {
31
+ entries = _entries.map(entry => {
31
32
  return {
32
33
  value: entry
33
34
  };
34
35
  });
36
+ } else {
37
+ entries = _entries;
35
38
  }
36
39
 
37
40
  // This function will be called whenever the mouse moves
@@ -60,6 +63,7 @@ export default function sparkline(svg, entries, options) {
60
63
 
61
64
  // Get the stroke width; this is used to compute the
62
65
  // rendering offset.
66
+ // @ts-expect-error
63
67
  const strokeWidth = parseFloat(svg.attributes['stroke-width'].value);
64
68
 
65
69
  // By default, data must be formatted as an array of numbers or
@@ -72,10 +76,12 @@ export default function sparkline(svg, entries, options) {
72
76
  const values = entries.map(entry => fetch(entry));
73
77
 
74
78
  // The rendering width will account for the spot size.
79
+ // @ts-expect-error
75
80
  const width = parseFloat(svg.attributes.width.value) - spotDiameter * 2;
76
81
 
77
82
  // Get the SVG element's full height.
78
83
  // This is used
84
+ // @ts-expect-error
79
85
  const fullHeight = parseFloat(svg.attributes.height.value);
80
86
 
81
87
  // The rendering height accounts for stroke width and spot size.
@@ -145,16 +151,18 @@ export default function sparkline(svg, entries, options) {
145
151
  svg.appendChild(cursor);
146
152
  svg.appendChild(spot);
147
153
  const interactionLayer = buildElement('rect', {
154
+ // @ts-expect-error
148
155
  width: svg.attributes.width.value,
156
+ // @ts-expect-error
149
157
  height: svg.attributes.height.value,
150
158
  style: 'fill: transparent; stroke: transparent',
151
159
  class: 'sparkline--interaction-layer'
152
160
  });
153
161
  svg.appendChild(interactionLayer);
154
162
  interactionLayer.addEventListener('mouseout', event => {
155
- cursor.setAttribute('x1', offscreen);
156
- cursor.setAttribute('x2', offscreen);
157
- spot.setAttribute('cx', offscreen);
163
+ cursor.setAttribute('x1', offscreen.toString());
164
+ cursor.setAttribute('x2', offscreen.toString());
165
+ spot.setAttribute('cx', offscreen.toString());
158
166
  if (onmouseout) {
159
167
  onmouseout(event);
160
168
  }
@@ -182,10 +190,10 @@ export default function sparkline(svg, entries, options) {
182
190
  const {
183
191
  y
184
192
  } = currentDataPoint;
185
- spot.setAttribute('cx', x);
186
- spot.setAttribute('cy', y);
187
- cursor.setAttribute('x1', x);
188
- cursor.setAttribute('x2', x);
193
+ spot.setAttribute('cx', x.toString());
194
+ spot.setAttribute('cy', y.toString());
195
+ cursor.setAttribute('x1', x.toString());
196
+ cursor.setAttribute('x2', x.toString());
189
197
  if (onmousemove) {
190
198
  onmousemove(event, currentDataPoint);
191
199
  }
@@ -1,2 +1,7 @@
1
- declare const _default: (props: any) => import("react/jsx-runtime").JSX.Element;
1
+ import { type CircularProgressProps } from '@mui/material/CircularProgress';
2
+ export interface SpinnerProps extends Omit<CircularProgressProps, 'size'> {
3
+ /** 之前 size prop 是 array 类型, 需要与 CircularProgress#size 兼容 */
4
+ size?: number | [number, number];
5
+ }
6
+ declare const _default: (props: SpinnerProps) => import("react/jsx-runtime").JSX.Element;
2
7
  export default _default;
@@ -1,22 +1,15 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import CircularProgress from '@mui/material/CircularProgress';
3
3
  import { withDeprecated } from '../Util/deprecate';
4
-
5
- /**
6
- * Spinner
7
- *
8
- * 之前的 Spinner 实现由内外 2 个环构成, 现在改为基于 @mui/material/CircularProgress 的实现
9
- *
10
- * - 之前 size prop 是 array 类型, 需要与 CircularProgress#size 兼容
11
- * - color 默认使用 #4598fa, 如果调用方传入了 color prop 或 style#color, 则默认 color 被覆盖
12
- */
4
+ /** 之前的 Spinner 实现由内外 2 个环构成, 现在改为基于 @mui/material/CircularProgress 的实现 */
13
5
  function Spinner(props) {
14
6
  const _props = {
15
7
  ...props
16
8
  };
9
+
17
10
  // 兼容之前的 size prop (设置外圈/内圈的尺寸)
18
- if (_props.size && Array.isArray(_props.size)) {
19
- [_props.size] = _props.size;
11
+ if (_props.size && Array.isArray(props.size)) {
12
+ [_props.size] = props.size;
20
13
  }
21
14
  return /*#__PURE__*/_jsx(CircularProgress, {
22
15
  ..._props
@@ -1,22 +1,6 @@
1
- declare function Success({ size, backgroundColor, borderWidth }: {
2
- size: any;
3
- backgroundColor: any;
4
- borderWidth: any;
5
- }): import("react/jsx-runtime").JSX.Element;
6
- declare namespace Success {
7
- namespace propTypes {
8
- let size: PropTypes.Requireable<number>;
9
- let borderWidth: PropTypes.Requireable<number>;
10
- let backgroundColor: PropTypes.Requireable<string>;
11
- }
12
- namespace defaultProps {
13
- let size_1: number;
14
- export { size_1 as size };
15
- let borderWidth_1: number;
16
- export { borderWidth_1 as borderWidth };
17
- let backgroundColor_1: string;
18
- export { backgroundColor_1 as backgroundColor };
19
- }
1
+ export interface SuccessProps {
2
+ size?: number;
3
+ backgroundColor?: string;
4
+ borderWidth?: number;
20
5
  }
21
- export default Success;
22
- import PropTypes from 'prop-types';
6
+ export default function Success({ size, backgroundColor, borderWidth }: SuccessProps): import("react/jsx-runtime").JSX.Element;
@@ -1,12 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import PropTypes from 'prop-types';
3
2
  import { Box } from '@mui/material';
4
-
5
3
  // FIXME: @zhanghan 目前无法适配各种 size,后续优化
6
4
  export default function Success({
7
- size,
8
- backgroundColor,
9
- borderWidth
5
+ size = 64,
6
+ backgroundColor = 'white',
7
+ borderWidth = 4
10
8
  }) {
11
9
  const contentSize = size - borderWidth * 2;
12
10
  return /*#__PURE__*/_jsxs(Box, {
@@ -19,7 +17,8 @@ export default function Success({
19
17
  '&, *, *::before, *::after': {
20
18
  boxSizing: 'content-box !important'
21
19
  },
22
- border: theme => `${borderWidth}px solid ${theme.palette.success.main}`,
20
+ // 转圈边框的颜色
21
+ border: theme => `${borderWidth}px solid ${theme.palette.success.light}`,
23
22
  '&::before, &::after': {
24
23
  content: '""',
25
24
  height: '125%',
@@ -44,7 +43,8 @@ export default function Success({
44
43
  },
45
44
  '.icon-line': {
46
45
  height: `${borderWidth + 1}px`,
47
- backgroundColor: theme => theme.palette.success.main,
46
+ // 对勾的颜色
47
+ backgroundColor: theme => theme.palette.success.light,
48
48
  display: 'block',
49
49
  borderRadius: '100vw',
50
50
  position: 'absolute',
@@ -145,7 +145,8 @@ export default function Success({
145
145
  borderRadius: '100%',
146
146
  position: 'absolute',
147
147
  boxSizing: 'contentBox',
148
- border: `${borderWidth}px solid rgba(76, 175, 80, 0.5)`
148
+ // 圆环的颜色
149
+ border: `${borderWidth}px solid rgba(76, 175, 80, 0.63)`
149
150
  }
150
151
  }), /*#__PURE__*/_jsx(Box, {
151
152
  className: "icon-fix",
@@ -161,14 +162,4 @@ export default function Success({
161
162
  }
162
163
  })]
163
164
  });
164
- }
165
- Success.propTypes = {
166
- size: PropTypes.number,
167
- borderWidth: PropTypes.number,
168
- backgroundColor: PropTypes.string
169
- };
170
- Success.defaultProps = {
171
- size: 64,
172
- borderWidth: 4,
173
- backgroundColor: 'white'
174
- };
165
+ }
@@ -1,27 +1,13 @@
1
- /**
2
- * @typedef {import('@mui/material').TabsProps & {
3
- * tabs: string[];
4
- * onChange: (value) => {};
5
- * variant: 'line' | 'card' | 'fullWidth' | 'scrollable' | 'standard'
6
- * }} TabsProps
7
- */
8
- /**
9
- * @description
10
- * @param {TabsProps} props
11
- * @return {import('react').ReactNode}
12
- */
13
- declare function Tabs({ tabs, current, onChange, ...rest }: TabsProps): import("react").ReactNode;
14
- declare namespace Tabs {
15
- namespace propTypes {
16
- let tabs: PropTypes.Validator<any[]>;
17
- let current: PropTypes.Validator<string>;
18
- let onChange: PropTypes.Validator<(...args: any[]) => any>;
19
- }
1
+ import { type TabsProps as MuiTabsProps } from '@mui/material';
2
+ interface TabsProps extends Omit<MuiTabsProps, 'variant' | 'onChange'> {
3
+ tabs: {
4
+ value: any;
5
+ label: React.ReactNode;
6
+ icon?: string | React.ReactElement;
7
+ }[];
8
+ current: any;
9
+ onChange: (value: string) => void;
10
+ variant?: 'card' | 'line' | MuiTabsProps['variant'];
20
11
  }
21
- export default Tabs;
22
- export type TabsProps = import("@mui/material").TabsProps & {
23
- tabs: string[];
24
- onChange: (value: any) => {};
25
- variant: "line" | "card" | "fullWidth" | "scrollable" | "standard";
26
- };
27
- import PropTypes from 'prop-types';
12
+ export default function Tabs({ tabs, current, onChange, variant, ...rest }: TabsProps): import("react/jsx-runtime").JSX.Element;
13
+ export {};
package/lib/Tabs/index.js CHANGED
@@ -1,5 +1,4 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import PropTypes from 'prop-types';
3
2
  import { Tabs as MuiTabs, Tab as MuiTab } from '@mui/material';
4
3
  import { temp as colors } from '../Colors';
5
4
  import { styled } from '../Theme';
@@ -76,15 +75,10 @@ function CardTabs({
76
75
  className: classes.tab,
77
76
  value: x.value,
78
77
  label: x.label,
79
- icon: x.icon || null
78
+ icon: x.icon
80
79
  }, x.value))
81
80
  });
82
81
  }
83
- CardTabs.propTypes = {
84
- tabs: PropTypes.array.isRequired,
85
- current: PropTypes.string.isRequired,
86
- onChange: PropTypes.func.isRequired
87
- };
88
82
  function LineTabs({
89
83
  tabs,
90
84
  current,
@@ -145,37 +139,18 @@ function LineTabs({
145
139
  className: classes.tab,
146
140
  value: x.value,
147
141
  label: x.label,
148
- icon: x.icon || null
142
+ icon: x.icon
149
143
  }, x.value))
150
144
  });
151
145
  }
152
- LineTabs.propTypes = {
153
- tabs: PropTypes.array.isRequired,
154
- current: PropTypes.string.isRequired,
155
- onChange: PropTypes.func.isRequired
156
- };
157
-
158
- /**
159
- * @typedef {import('@mui/material').TabsProps & {
160
- * tabs: string[];
161
- * onChange: (value) => {};
162
- * variant: 'line' | 'card' | 'fullWidth' | 'scrollable' | 'standard'
163
- * }} TabsProps
164
- */
165
-
166
- /**
167
- * @description
168
- * @param {TabsProps} props
169
- * @return {import('react').ReactNode}
170
- */
171
-
172
146
  export default function Tabs({
173
147
  tabs,
174
148
  current,
175
149
  onChange,
150
+ variant,
176
151
  ...rest
177
152
  }) {
178
- if (rest.variant === 'card') {
153
+ if (variant === 'card') {
179
154
  return /*#__PURE__*/_jsx(CardTabs, {
180
155
  ...rest,
181
156
  tabs: tabs,
@@ -183,7 +158,7 @@ export default function Tabs({
183
158
  onChange: onChange
184
159
  });
185
160
  }
186
- if (rest.variant === 'line') {
161
+ if (variant === 'line') {
187
162
  return /*#__PURE__*/_jsx(LineTabs, {
188
163
  ...rest,
189
164
  tabs: tabs,
@@ -203,12 +178,7 @@ export default function Tabs({
203
178
  className: classes.tab,
204
179
  value: x.value,
205
180
  label: x.label,
206
- icon: x.icon || null
181
+ icon: x.icon
207
182
  }, x.value))
208
183
  });
209
- }
210
- Tabs.propTypes = {
211
- tabs: PropTypes.array.isRequired,
212
- current: PropTypes.string.isRequired,
213
- onChange: PropTypes.func.isRequired
214
- };
184
+ }
@@ -1,11 +1,11 @@
1
- declare const _default: (props: {
2
- [x: string]: any;
3
- children: any;
4
- startChars: any;
5
- endChars: any;
6
- scaleFactor: any;
7
- maxWidth: any;
8
- style: any;
9
- fontType: any;
10
- }) => import("react/jsx-runtime").JSX.Element;
1
+ export interface TextCollapseProps {
2
+ children: string;
3
+ maxWidth: string | number;
4
+ startChars?: number;
5
+ endChars?: number;
6
+ scaleFactor?: number;
7
+ style?: React.CSSProperties;
8
+ fontType?: 'monospace' | 'normal';
9
+ }
10
+ declare const _default: (props: TextCollapseProps) => import("react/jsx-runtime").JSX.Element;
11
11
  export default _default;
@@ -1,16 +1,15 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import PropTypes from 'prop-types';
3
2
  import Typography from '@mui/material/Typography';
4
3
  import { styled } from '../Theme';
5
4
  import { withDeprecated } from '../Util/deprecate';
6
5
  function TextCollapse({
7
6
  children,
8
- startChars,
9
- endChars,
10
- scaleFactor,
11
7
  maxWidth,
8
+ startChars = 5,
9
+ endChars = 5,
10
+ scaleFactor = 0.45,
12
11
  style,
13
- fontType,
12
+ fontType = 'normal',
14
13
  ...rest
15
14
  }) {
16
15
  if (typeof children !== 'string') {
@@ -45,22 +44,6 @@ function TextCollapse({
45
44
  })]
46
45
  });
47
46
  }
48
- TextCollapse.propTypes = {
49
- children: PropTypes.string.isRequired,
50
- maxWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
51
- fontType: PropTypes.oneOf(['monospace', 'normal']),
52
- style: PropTypes.object,
53
- startChars: PropTypes.number,
54
- endChars: PropTypes.number,
55
- scaleFactor: PropTypes.number
56
- };
57
- TextCollapse.defaultProps = {
58
- style: {},
59
- startChars: 5,
60
- endChars: 5,
61
- scaleFactor: 0.45,
62
- fontType: 'normal'
63
- };
64
47
  export default withDeprecated(TextCollapse, {
65
48
  name: 'TextCollapse'
66
49
  });
@@ -1,5 +1,3 @@
1
- /* eslint-disable no-unused-vars */
2
-
3
1
  import { styled as muiStyled, useTheme } from '@mui/material/styles';
4
2
  export * from './theme';
5
3
  export { default as ThemeProvider } from './theme-provider';
@@ -4,7 +4,7 @@ import { Theme } from '@mui/material/styles';
4
4
  * 默认的 theme provider, 可以为 webapp/blocklet 快捷的配置好 mui theme provider
5
5
  */
6
6
  declare function ThemeProvider({ children, theme, injectFirst, }: {
7
- children: React.ReactNode;
7
+ children?: React.ReactNode;
8
8
  theme: Theme;
9
9
  injectFirst: boolean;
10
10
  }): import("react/jsx-runtime").JSX.Element;
@@ -8,7 +8,7 @@ import '@fontsource/inter/latin-ext-300.css';
8
8
  import '@fontsource/inter/latin-ext-400.css';
9
9
  import '@fontsource/inter/latin-ext-500.css';
10
10
  import '@fontsource/inter/latin-ext-700.css';
11
- declare module '@mui/material/styles/createTheme' {
11
+ declare module '@mui/material/styles' {
12
12
  interface Theme {
13
13
  mode?: string;
14
14
  themeName?: string;
@@ -28,6 +28,9 @@ declare module '@mui/material/styles/createTheme' {
28
28
  pageWidth?: string;
29
29
  colors?: Record<string, string>;
30
30
  }
31
+ interface TypeText {
32
+ hint: string;
33
+ }
31
34
  }
32
35
  export declare const create: ({ mode, pageWidth, typography, overrides, palette, components, ...rest }?: {
33
36
  mode?: string;
@@ -1,4 +1,3 @@
1
- /* eslint-disable no-unused-vars */
2
1
  /* eslint-disable no-shadow */
3
2
  // https://app.zeplin.io/styleguide/5d1436f1e97c2156f49c0725/colors
4
3
  import { createTheme as _createTheme, responsiveFontSizes } from '@mui/material/styles';
@@ -13,7 +12,7 @@ import '@fontsource/inter/latin-ext-500.css';
13
12
  import '@fontsource/inter/latin-ext-700.css';
14
13
  import colors from '../Colors';
15
14
 
16
- // 扩展 Theme 和 ThemeOptions 接口
15
+ // 扩展 Theme
17
16
 
18
17
  const muiDarkTheme = _createTheme({
19
18
  palette: {