@arcblock/ux 3.0.5 → 3.0.7

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 (370) hide show
  1. package/lib/ActionButton/index.d.ts +1 -1
  2. package/lib/ActionButton/index.js +9 -9
  3. package/lib/ActivityIndicator/index.js +6 -7
  4. package/lib/Address/compact-text.d.ts +1 -1
  5. package/lib/Address/compact-text.js +6 -7
  6. package/lib/Address/did-address.js +4 -4
  7. package/lib/Address/index.js +6 -6
  8. package/lib/Address/responsive-did-address.js +17 -17
  9. package/lib/Alert/index.d.ts +1 -1
  10. package/lib/Alert/index.js +8 -8
  11. package/lib/AnimationWaiter/index.js +10 -10
  12. package/lib/Async/index.js +4 -4
  13. package/lib/Avatar/etherscan-blockies.js +15 -15
  14. package/lib/Avatar/index.d.ts +1 -1
  15. package/lib/Avatar/index.js +6 -6
  16. package/lib/Badge/index.js +5 -5
  17. package/lib/Blocklet/blocklet.js +10 -10
  18. package/lib/Blocklet/index.js +6 -5
  19. package/lib/Blocklet/utils.js +1 -1
  20. package/lib/BlockletContext/index.d.ts +1 -1
  21. package/lib/BlockletContext/index.js +1 -1
  22. package/lib/BlockletNFT/index.js +19 -19
  23. package/lib/BlockletV2/blocklet.d.ts +1 -1
  24. package/lib/BlockletV2/blocklet.js +36 -37
  25. package/lib/BlockletV2/components/icon-text.d.ts +1 -1
  26. package/lib/BlockletV2/components/icon-text.js +13 -13
  27. package/lib/BlockletV2/components/tooltip-icon.js +22 -20
  28. package/lib/BlockletV2/index.js +8 -7
  29. package/lib/BlockletV2/utils.js +1 -1
  30. package/lib/Button/index.js +1 -1
  31. package/lib/Button/wrap.js +3 -3
  32. package/lib/ButtonGroup/index.js +1 -1
  33. package/lib/Center/index.js +4 -4
  34. package/lib/ClickToCopy/copy-button.js +3 -3
  35. package/lib/ClickToCopy/index.js +5 -5
  36. package/lib/CloseButton/index.js +2 -2
  37. package/lib/CodeBlock/index.js +3 -3
  38. package/lib/Colors/index.js +3 -3
  39. package/lib/Config/config-provider.js +15 -16
  40. package/lib/Config/index.js +3 -5
  41. package/lib/Config/theme-mode-toggle.js +1 -1
  42. package/lib/ContactForm/index.js +26 -25
  43. package/lib/CookieConsent/index.js +1 -1
  44. package/lib/CountDown/index.js +2 -2
  45. package/lib/DID/index.js +79 -78
  46. package/lib/DIDConnect/app-icon.js +10 -10
  47. package/lib/DIDConnect/app-info-item.js +5 -5
  48. package/lib/DIDConnect/auth-apps/auth-apps-info.js +1 -1
  49. package/lib/DIDConnect/auth-apps/index.js +56 -56
  50. package/lib/DIDConnect/did-connect-container.js +35 -36
  51. package/lib/DIDConnect/did-connect-footer.js +7 -7
  52. package/lib/DIDConnect/index.js +10 -10
  53. package/lib/DIDConnect/landing-page.js +45 -46
  54. package/lib/DIDConnect/powered-by.js +2 -2
  55. package/lib/DIDConnect/request-storage-access-api-dialog.js +44 -45
  56. package/lib/DIDConnect/with-container.js +25 -26
  57. package/lib/DIDConnect/with-ux-theme.js +6 -7
  58. package/lib/Datatable/CustomToolbar.d.ts +3 -1
  59. package/lib/Datatable/CustomToolbar.js +13 -13
  60. package/lib/Datatable/TableSearch.js +2 -2
  61. package/lib/Datatable/index.js +6 -6
  62. package/lib/Dialog/confirm.d.ts +1 -1
  63. package/lib/Dialog/confirm.js +20 -20
  64. package/lib/Dialog/dialog.js +7 -7
  65. package/lib/Dialog/index.js +3 -3
  66. package/lib/Dialog/types.d.ts +20 -0
  67. package/lib/Dialog/use-confirm.js +1 -1
  68. package/lib/DriftBot/index.js +1 -1
  69. package/lib/Earth/index.js +10 -10
  70. package/lib/Empty/index.js +1 -1
  71. package/lib/ErrorBoundary/fallback.js +15 -15
  72. package/lib/ErrorBoundary/index.js +1 -6
  73. package/lib/Footer/index.d.ts +1 -1
  74. package/lib/Footer/index.js +7 -7
  75. package/lib/Header/addon-button.d.ts +1 -1
  76. package/lib/Header/addon-button.js +11 -6
  77. package/lib/Header/auto-hidden.js +1 -1
  78. package/lib/Header/header.js +4 -4
  79. package/lib/Header/index.js +3 -3
  80. package/lib/Header/responsive-header.d.ts +1 -1
  81. package/lib/Header/responsive-header.js +33 -34
  82. package/lib/Icon/image.js +2 -2
  83. package/lib/Icon/index.js +12 -12
  84. package/lib/Img/index.js +1 -1
  85. package/lib/InfoRow/index.d.ts +1 -1
  86. package/lib/InfoRow/index.js +1 -2
  87. package/lib/Layout/dashboard/external-link.d.ts +1 -1
  88. package/lib/Layout/dashboard/external-link.js +1 -1
  89. package/lib/Layout/dashboard/full-page.js +8 -8
  90. package/lib/Layout/dashboard/index.js +30 -32
  91. package/lib/Layout/dashboard/sidebar.js +3 -3
  92. package/lib/Layout/dashboard-legacy/header.js +12 -12
  93. package/lib/Layout/dashboard-legacy/index.js +20 -20
  94. package/lib/Layout/dashboard-legacy/sidebar.d.ts +1 -1
  95. package/lib/Layout/dashboard-legacy/sidebar.js +20 -13
  96. package/lib/Layout/index.js +7 -7
  97. package/lib/LoadingMask/index.d.ts +1 -1
  98. package/lib/LoadingMask/index.js +4 -4
  99. package/lib/Locale/context.js +27 -27
  100. package/lib/Locale/selector.d.ts +1 -1
  101. package/lib/Locale/selector.js +4 -4
  102. package/lib/Logo/index.js +19 -19
  103. package/lib/Metric/index.js +2 -2
  104. package/lib/NFTDisplay/aspect-ratio-container.d.ts +1 -1
  105. package/lib/NFTDisplay/aspect-ratio-container.js +1 -1
  106. package/lib/NFTDisplay/broken.js +2 -2
  107. package/lib/NFTDisplay/index.js +38 -35
  108. package/lib/NFTDisplay/loading.js +1 -1
  109. package/lib/NFTDisplay/render-svg.js +4 -4
  110. package/lib/NFTDisplay/svg-embedder/img.js +3 -3
  111. package/lib/NFTDisplay/svg-embedder/inline-svg.js +1 -1
  112. package/lib/NavMenu/index.js +2 -2
  113. package/lib/NavMenu/nav-menu.js +46 -44
  114. package/lib/NavMenu/products.js +33 -33
  115. package/lib/NavMenu/style.js +1 -1
  116. package/lib/NavMenu/sub-item-group.js +1 -1
  117. package/lib/PageScroller/index.js +53 -53
  118. package/lib/PageScroller/story/FullPage.js +27 -27
  119. package/lib/PageScroller/story/PageContain.js +8 -8
  120. package/lib/Passport/index.js +3 -2
  121. package/lib/Passport/passport.js +2 -2
  122. package/lib/PhoneInput/country-select.js +24 -24
  123. package/lib/PhoneInput/index.js +13 -13
  124. package/lib/PoweredByArcBlock/index.js +10 -6
  125. package/lib/PricingTable/PricingPlan.js +1 -1
  126. package/lib/PricingTable/index.js +3 -3
  127. package/lib/QRCode/index.js +5 -5
  128. package/lib/RelativeTime/index.js +17 -17
  129. package/lib/Result/common.js +4 -6
  130. package/lib/Result/index.js +2 -2
  131. package/lib/Result/result.js +5 -5
  132. package/lib/Screenshot/BaseScreenshot/index.js +3 -3
  133. package/lib/Screenshot/index.d.ts +1 -1
  134. package/lib/Screenshot/index.js +10 -10
  135. package/lib/SessionBlocklet/index.js +8 -8
  136. package/lib/SessionManager/index.js +3 -2
  137. package/lib/SessionUser/components/did-space.d.ts +1 -1
  138. package/lib/SessionUser/components/did-space.js +14 -14
  139. package/lib/SessionUser/components/logged-in.js +33 -33
  140. package/lib/SessionUser/components/quick-login-item.js +29 -29
  141. package/lib/SessionUser/components/session-user-item.js +27 -27
  142. package/lib/SessionUser/components/session-user-switch.js +4 -4
  143. package/lib/SessionUser/components/un-login.js +7 -7
  144. package/lib/SessionUser/components/user-info.js +16 -16
  145. package/lib/SessionUser/index.js +2 -2
  146. package/lib/SharedBridge/index.js +23 -23
  147. package/lib/Spinner/index.js +2 -2
  148. package/lib/SplitButton/index.d.ts +1 -1
  149. package/lib/SplitButton/index.js +2 -2
  150. package/lib/Success/index.js +1 -1
  151. package/lib/Switch/index.js +1 -1
  152. package/lib/Tabs/index.js +16 -9
  153. package/lib/Tag/index.d.ts +1 -1
  154. package/lib/Tag/index.js +7 -7
  155. package/lib/TextCollapse/index.js +3 -3
  156. package/lib/Theme/index.js +11 -22
  157. package/lib/Theme/theme-provider.js +60 -55
  158. package/lib/Theme/theme.js +5 -4
  159. package/lib/Toast/index.js +11 -11
  160. package/lib/Typography/index.js +13 -13
  161. package/lib/UserCard/Cards/avatar-only.js +2 -2
  162. package/lib/UserCard/Cards/basic-info.d.ts +1 -1
  163. package/lib/UserCard/Cards/basic-info.js +4 -4
  164. package/lib/UserCard/Cards/index.d.ts +1 -1
  165. package/lib/UserCard/Cards/index.js +4 -4
  166. package/lib/UserCard/Cards/name-only.js +1 -1
  167. package/lib/UserCard/Container/card.js +8 -8
  168. package/lib/UserCard/Container/dialog.js +2 -2
  169. package/lib/UserCard/Content/basic.js +3 -3
  170. package/lib/UserCard/Content/clock.js +3 -3
  171. package/lib/UserCard/Content/minimal.d.ts +1 -1
  172. package/lib/UserCard/Content/minimal.js +8 -8
  173. package/lib/UserCard/Content/tooltip-avatar.js +18 -18
  174. package/lib/UserCard/components.js +23 -23
  175. package/lib/UserCard/index.js +12 -12
  176. package/lib/Util/index.js +2 -2
  177. package/lib/VerificationCode/index.js +2 -2
  178. package/lib/Video/index.js +2 -2
  179. package/lib/Wallet/Action.js +4 -4
  180. package/lib/Wallet/Download.js +6 -6
  181. package/lib/Wallet/Open.js +1 -1
  182. package/lib/WalletOSIcon/index.d.ts +2 -2
  183. package/lib/WalletOSIcon/index.js +8 -3
  184. package/lib/WebWalletSWKeeper/index.d.ts +3 -1
  185. package/lib/WebWalletSWKeeper/index.js +6 -3
  186. package/lib/WechatPrompt/index.js +1 -1
  187. package/lib/global.d.ts +28 -0
  188. package/lib/hooks/use-blocklet-logo.js +13 -15
  189. package/lib/hooks/use-clock.js +1 -1
  190. package/lib/index.js +74 -79
  191. package/lib/type.d.ts +44 -0
  192. package/lib/withTheme/index.d.ts +3 -2
  193. package/lib/withTheme/index.js +13 -14
  194. package/lib/withTracker/error_boundary.js +1 -1
  195. package/package.json +7 -7
  196. package/src/ActionButton/index.jsx +1 -1
  197. package/src/Address/compact-text.jsx +1 -1
  198. package/src/Address/did-address.tsx +1 -1
  199. package/src/Address/index.tsx +1 -1
  200. package/src/Address/responsive-did-address.tsx +3 -3
  201. package/src/Alert/index.jsx +1 -1
  202. package/src/Avatar/index.jsx +1 -1
  203. package/src/Badge/index.jsx +1 -1
  204. package/src/BlockletContext/index.tsx +1 -1
  205. package/src/BlockletNFT/index.jsx +1 -1
  206. package/src/BlockletV2/blocklet.tsx +1 -1
  207. package/src/BlockletV2/components/icon-text.tsx +4 -4
  208. package/src/BlockletV2/components/tooltip-icon.tsx +5 -3
  209. package/src/Button/wrap.jsx +1 -1
  210. package/src/Center/index.tsx +1 -1
  211. package/src/ClickToCopy/copy-button.tsx +1 -1
  212. package/src/CloseButton/index.tsx +1 -1
  213. package/src/ContactForm/index.tsx +9 -2
  214. package/src/DID/index.tsx +5 -4
  215. package/src/DIDConnect/app-info-item.tsx +1 -1
  216. package/src/DIDConnect/auth-apps/index.tsx +8 -8
  217. package/src/DIDConnect/did-connect-container.tsx +2 -2
  218. package/src/DIDConnect/did-connect-footer.tsx +1 -1
  219. package/src/DIDConnect/landing-page.tsx +6 -6
  220. package/src/DIDConnect/request-storage-access-api-dialog.tsx +1 -2
  221. package/src/Datatable/CustomToolbar.jsx +1 -1
  222. package/src/Datatable/index.jsx +2 -2
  223. package/src/Dialog/confirm.jsx +1 -1
  224. package/src/Earth/index.tsx +1 -1
  225. package/src/Footer/index.tsx +5 -2
  226. package/src/Header/addon-button.tsx +7 -2
  227. package/src/Header/header.tsx +1 -1
  228. package/src/Header/responsive-header.tsx +1 -2
  229. package/src/Icon/index.tsx +1 -1
  230. package/src/InfoRow/index.tsx +1 -2
  231. package/src/Layout/dashboard/external-link.tsx +1 -1
  232. package/src/Layout/dashboard/full-page.tsx +1 -1
  233. package/src/Layout/dashboard/index.tsx +1 -1
  234. package/src/Layout/dashboard/sidebar.tsx +5 -2
  235. package/src/Layout/dashboard-legacy/header.tsx +5 -5
  236. package/src/Layout/dashboard-legacy/index.tsx +3 -3
  237. package/src/Layout/dashboard-legacy/sidebar.tsx +10 -2
  238. package/src/Layout/index.tsx +2 -2
  239. package/src/LoadingMask/index.tsx +5 -5
  240. package/src/Locale/context.tsx +3 -3
  241. package/src/Locale/selector.tsx +1 -1
  242. package/src/Logo/index.tsx +1 -1
  243. package/src/NFTDisplay/aspect-ratio-container.tsx +1 -1
  244. package/src/NFTDisplay/index.tsx +2 -1
  245. package/src/NFTDisplay/render-svg.tsx +1 -1
  246. package/src/NavMenu/nav-menu.tsx +8 -5
  247. package/src/NavMenu/products.tsx +3 -1
  248. package/src/PageScroller/index.tsx +4 -4
  249. package/src/PhoneInput/country-select.tsx +3 -3
  250. package/src/PhoneInput/index.tsx +1 -1
  251. package/src/PoweredByArcBlock/index.tsx +5 -1
  252. package/src/QRCode/index.tsx +1 -1
  253. package/src/RelativeTime/index.tsx +3 -3
  254. package/src/Result/result.tsx +1 -1
  255. package/src/Screenshot/index.tsx +2 -2
  256. package/src/SessionUser/components/did-space.tsx +1 -1
  257. package/src/SessionUser/components/session-user-item.tsx +1 -1
  258. package/src/SharedBridge/index.tsx +2 -2
  259. package/src/Spinner/index.tsx +1 -1
  260. package/src/SplitButton/index.tsx +1 -1
  261. package/src/Success/index.tsx +1 -1
  262. package/src/Tabs/index.tsx +10 -3
  263. package/src/Tag/index.jsx +1 -1
  264. package/src/TextCollapse/index.tsx +1 -1
  265. package/src/Theme/theme-provider.tsx +11 -6
  266. package/src/Theme/theme.ts +5 -0
  267. package/src/Typography/index.tsx +1 -1
  268. package/src/UserCard/Cards/basic-info.tsx +1 -1
  269. package/src/UserCard/Cards/index.tsx +1 -1
  270. package/src/UserCard/Container/card.tsx +2 -2
  271. package/src/UserCard/Container/dialog.tsx +1 -1
  272. package/src/UserCard/Content/basic.tsx +2 -2
  273. package/src/UserCard/Content/minimal.tsx +1 -1
  274. package/src/UserCard/Content/tooltip-avatar.tsx +4 -4
  275. package/src/VerificationCode/index.tsx +1 -1
  276. package/src/WalletOSIcon/index.tsx +7 -2
  277. package/src/WebWalletSWKeeper/index.tsx +6 -1
  278. package/src/withTheme/index.tsx +7 -3
  279. package/vite.config.mjs +5 -2
  280. package/lib/ActionButton/ActionButton.stories.d.ts +0 -18
  281. package/lib/ActivityIndicator/ActivityIndicator.stories.d.ts +0 -8
  282. package/lib/Address/Address.stories.d.ts +0 -16
  283. package/lib/Alert/Alert.stories.d.ts +0 -28
  284. package/lib/AnimationWaiter/AnimationWaiter.stories.d.ts +0 -21
  285. package/lib/AnimationWaiter/dark-animation.json.js +0 -27
  286. package/lib/AnimationWaiter/default-animation.json.js +0 -29
  287. package/lib/Avatar/Avatar.stories.d.ts +0 -11
  288. package/lib/Badge/Badge.stories.d.ts +0 -13
  289. package/lib/Blocklet/Blocklet.stories.d.ts +0 -17
  290. package/lib/BlockletNFT/BlockletNFT.stories.d.ts +0 -17
  291. package/lib/BlockletV2/Blocklet.stories.d.ts +0 -18
  292. package/lib/Button/Button.stories.d.ts +0 -19
  293. package/lib/Center/Center.stories.d.ts +0 -18
  294. package/lib/ClickToCopy/ClickToCopy.stories.d.ts +0 -16
  295. package/lib/CodeBlock/CodeBlock.stories.d.ts +0 -20
  296. package/lib/Colors/Colors.stories.d.ts +0 -34
  297. package/lib/Config/Config.stories.d.ts +0 -14
  298. package/lib/ContactForm/ContactForm.stories.d.ts +0 -23
  299. package/lib/CookieConsent/CookieConsent.stories.d.ts +0 -18
  300. package/lib/CountDown/CountDown.stories.d.ts +0 -14
  301. package/lib/DID/DID.stories.d.ts +0 -15
  302. package/lib/Datatable/Datatable.stories.d.ts +0 -32
  303. package/lib/Dialog/Dialog.stories.d.ts +0 -20
  304. package/lib/DidLogo/Logo.stories.d.ts +0 -8
  305. package/lib/Earth/Earth.stories.d.ts +0 -18
  306. package/lib/Earth/countries.json.js +0 -13
  307. package/lib/Empty/Empty.stories.d.ts +0 -17
  308. package/lib/ErrorBoundary/ErrorBoundary.stories.d.ts +0 -12
  309. package/lib/Footer/Footer.stories.d.ts +0 -12
  310. package/lib/Header/Header.stories.d.ts +0 -21
  311. package/lib/Icon/Icon.stories.d.ts +0 -23
  312. package/lib/Img/Img.stories.d.ts +0 -13
  313. package/lib/InfoRow/InfoRow.stories.d.ts +0 -14
  314. package/lib/Layout/Layout.stories.d.ts +0 -23
  315. package/lib/Locale/LocaleSelector.stories.d.ts +0 -22
  316. package/lib/Logo/Logo.stories.d.ts +0 -22
  317. package/lib/Logo/images/logo-dark-text.svg.js +0 -5
  318. package/lib/Logo/images/logo-dark-top.svg.js +0 -5
  319. package/lib/Logo/images/logo-light-text.svg.js +0 -5
  320. package/lib/Logo/images/logo-light-top.svg.js +0 -5
  321. package/lib/Metric/Metric.stories.d.ts +0 -14
  322. package/lib/NFTDisplay/NFTBroken.svg.js +0 -108
  323. package/lib/NFTDisplay/NFTDisplay.stories.d.ts +0 -15
  324. package/lib/NavMenu/NavMenu.stories.d.ts +0 -17
  325. package/lib/NavMenu/images/OCAP.svg.js +0 -5
  326. package/lib/NavMenu/images/abt-network.svg.js +0 -7
  327. package/lib/NavMenu/images/ai-kit.svg.js +0 -7
  328. package/lib/NavMenu/images/aigne.svg.js +0 -7
  329. package/lib/NavMenu/images/aistro.svg.js +0 -5
  330. package/lib/NavMenu/images/arcsphere.svg.js +0 -10
  331. package/lib/NavMenu/images/blocklet-framework.svg.js +0 -7
  332. package/lib/NavMenu/images/blocklet-launcher.svg.js +0 -5
  333. package/lib/NavMenu/images/blocklet-server.svg.js +0 -7
  334. package/lib/NavMenu/images/blocklet-store.svg.js +0 -5
  335. package/lib/NavMenu/images/creator-studio.svg.js +0 -7
  336. package/lib/NavMenu/images/did-connect.svg.js +0 -5
  337. package/lib/NavMenu/images/did-name-service.svg.js +0 -5
  338. package/lib/NavMenu/images/did-wallet.svg.js +0 -7
  339. package/lib/NavMenu/images/did.svg.js +0 -5
  340. package/lib/NavMenu/images/nft-studio.svg.js +0 -5
  341. package/lib/NavMenu/images/vc.svg.js +0 -5
  342. package/lib/NavMenu/images/web3-kit.svg.js +0 -7
  343. package/lib/PageScroller/story/PageScroller.stories.d.ts +0 -13
  344. package/lib/PhoneInput/PhoneInput.stories.d.ts +0 -12
  345. package/lib/PricingTable/PricingTable.stories.d.ts +0 -8
  346. package/lib/QRCode/QRCode.stories.d.ts +0 -13
  347. package/lib/RelativeTime/RelativeTime.stories.d.ts +0 -20
  348. package/lib/Result/Result.stories.d.ts +0 -21
  349. package/lib/Screenshot/Screenshot.stories.d.ts +0 -13
  350. package/lib/SessionManager/SessionManager.stories.d.ts +0 -9
  351. package/lib/SessionUser/images/did-spaces.svg.js +0 -5
  352. package/lib/Sparkline/Sparkline.stories.d.ts +0 -12
  353. package/lib/Spinner/Spinner.stories.d.ts +0 -18
  354. package/lib/SplitButton/SplitButton.stories.d.ts +0 -15
  355. package/lib/Switch/Switch.stories.d.ts +0 -13
  356. package/lib/Tabs/Tabs.stories.d.ts +0 -14
  357. package/lib/Tag/Tag.stories.d.ts +0 -13
  358. package/lib/TextCollapse/TextCollapse.stories.d.ts +0 -28
  359. package/lib/Theme/Theme.stories.d.ts +0 -10
  360. package/lib/Toast/Toast.stories.d.ts +0 -15
  361. package/lib/UserCard/UserCard.stories.d.ts +0 -18
  362. package/lib/Util/WebWalletOpener.stories.d.ts +0 -5
  363. package/lib/Video/Video.stories.d.ts +0 -6
  364. package/lib/Wallet/Action.stories.d.ts +0 -8
  365. package/lib/Wallet/Download.stories.d.ts +0 -9
  366. package/lib/Wallet/OpenInWallet.stories.d.ts +0 -5
  367. package/lib/Wallet/images/android_download.svg.js +0 -5
  368. package/lib/Wallet/images/app-store.svg.js +0 -5
  369. package/lib/Wallet/images/google-play.svg.js +0 -5
  370. package/lib/ux.css +0 -1
@@ -1,7 +1,7 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
2
  import { Component as s } from "react";
3
3
  import * as t from "@sentry/browser";
4
- import i from "../Alert/index.js";
4
+ import i from "../Alert";
5
5
  class m extends s {
6
6
  constructor(r) {
7
7
  super(r), this.state = { error: null };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcblock/ux",
3
- "version": "3.0.5",
3
+ "version": "3.0.7",
4
4
  "description": "Common used react components for arcblock products",
5
5
  "keywords": [
6
6
  "react",
@@ -60,16 +60,16 @@
60
60
  "react": ">=19.0.0",
61
61
  "react-router-dom": ">=6.22.3"
62
62
  },
63
- "gitHead": "1a7bd7691bda12a5d117eb57fe63e8a6486105d6",
63
+ "gitHead": "05185ed22660a8fea176616b19b6703456f2348c",
64
64
  "dependencies": {
65
- "@arcblock/bridge": "3.0.5",
65
+ "@arcblock/bridge": "3.0.7",
66
66
  "@arcblock/did": "^1.20.15",
67
67
  "@arcblock/did-motif": "^1.1.13",
68
- "@arcblock/icons": "3.0.5",
69
- "@arcblock/nft-display": "3.0.5",
70
- "@arcblock/react-hooks": "3.0.5",
68
+ "@arcblock/icons": "3.0.7",
69
+ "@arcblock/nft-display": "3.0.7",
70
+ "@arcblock/react-hooks": "3.0.7",
71
71
  "@blocklet/js-sdk": "^1.16.44",
72
- "@blocklet/theme": "3.0.5",
72
+ "@blocklet/theme": "3.0.7",
73
73
  "@fontsource/roboto": "~5.1.1",
74
74
  "@fontsource/ubuntu-mono": "^5.2.6",
75
75
  "@iconify-icons/logos": "^1.2.36",
@@ -27,7 +27,7 @@ import { withDeprecated } from '../Util/deprecate';
27
27
  * @param {ActionButtonProps} props
28
28
  * @returns {JSX.Element}
29
29
  */
30
- function ActionButton(rawProps) {
30
+ function ActionButton({ ...rawProps }) {
31
31
  const props = Object.assign({}, rawProps);
32
32
  if (isUndefined(props.gradient)) {
33
33
  props.gradient = '';
@@ -70,7 +70,7 @@ export default function CompactText({ startChars = 6, endChars = 6, children, sh
70
70
  CompactText.propTypes = {
71
71
  startChars: PropTypes.number,
72
72
  endChars: PropTypes.number,
73
- children: PropTypes.node,
73
+ children: PropTypes.node.isRequired,
74
74
  // 在 tooltip 中完整地址后显示复制按钮
75
75
  showCopyButtonInTooltip: PropTypes.bool,
76
76
  };
@@ -56,7 +56,7 @@ export interface IDidAddressProps extends BoxProps {
56
56
  * - 可配合 useMediaQuery 使用
57
57
  */
58
58
  function DidAddress({
59
- ref,
59
+ ref = undefined,
60
60
  ...props
61
61
  }: IDidAddressProps & {
62
62
  ref?: React.Ref<unknown>;
@@ -6,7 +6,7 @@ export interface IDidAddressWrapper extends IDidAddressProps {
6
6
  }
7
7
 
8
8
  function DidAddressWrapper({
9
- ref,
9
+ ref = undefined,
10
10
  responsive = true,
11
11
  ...rest
12
12
  }: IDidAddressWrapper & {
@@ -15,9 +15,9 @@ import { getFontSize } from '../Util';
15
15
  * - 监听容器宽度变化, 当容器宽度变化时, 对比容器宽度和 did address full-width, => 切换 compact 模式
16
16
  */
17
17
  export default function ResponsiveDidAddress({
18
- ref,
19
- style,
20
- className,
18
+ ref = undefined,
19
+ style = {},
20
+ className = undefined,
21
21
  component = 'span',
22
22
  size = 0,
23
23
  ...rest
@@ -55,7 +55,7 @@ const types = {
55
55
  * @param {AlertProps} props
56
56
  * @returns {JSX.Element}
57
57
  */
58
- function Alert(rawProps) {
58
+ function Alert({ ...rawProps }) {
59
59
  const props = Object.assign({}, rawProps);
60
60
  if (isUndefined(props.type)) {
61
61
  props.type = 'tip';
@@ -31,7 +31,7 @@ import { DID_PREFIX } from '../Util/constant';
31
31
  * @param {AvatarProps} props
32
32
  * @returns {JSX.Element}
33
33
  */
34
- function Avatar(rawProps) {
34
+ function Avatar({ ...rawProps }) {
35
35
  const props = Object.assign({}, rawProps);
36
36
  if (isUndefined(props.did)) {
37
37
  props.did = '';
@@ -46,7 +46,7 @@ const types = {
46
46
  * @param {BadgeProps} props
47
47
  * @returns {JSX.Element}
48
48
  */
49
- function Badge(rawProps) {
49
+ function Badge({ ...rawProps }) {
50
50
  const props = Object.assign({}, rawProps);
51
51
  if (isUndefined(props.type)) {
52
52
  props.type = 'primary';
@@ -18,7 +18,7 @@ function BlockletProvider({
18
18
  baseUrl = '',
19
19
  loading = null,
20
20
  }: {
21
- children?: React.ReactNode;
21
+ children: React.ReactNode;
22
22
  /**
23
23
  * baseUrl 为 blocklet origin + blocklet prefix
24
24
  */
@@ -226,7 +226,7 @@ BlockletIcon.propTypes = {
226
226
  */
227
227
  export default function BlockletNFT({
228
228
  title,
229
- did,
229
+ did = undefined,
230
230
  description = null,
231
231
  cover = null,
232
232
  size = 'auto',
@@ -48,7 +48,7 @@ export interface IBlockletStore extends CardProps {
48
48
  }[];
49
49
  }
50
50
 
51
- export default function BlockletStore(props: IBlockletStore) {
51
+ export default function BlockletStore({ ...props }: IBlockletStore) {
52
52
  const {
53
53
  title,
54
54
  description = '',
@@ -3,11 +3,11 @@ import React from 'react';
3
3
  import TooltipIcon from './tooltip-icon';
4
4
 
5
5
  export default function IconText({
6
- icon,
7
- children,
6
+ icon = null,
7
+ children = null,
8
8
  maxWidth = 100,
9
- title,
10
- sx,
9
+ title = undefined,
10
+ sx = {},
11
11
  }: {
12
12
  icon?: React.ReactNode;
13
13
  children?: React.ReactNode;
@@ -1,4 +1,5 @@
1
1
  import { Tooltip, TooltipProps, tooltipClasses } from '@mui/material';
2
+ import { mergeSx } from '../../Util/style';
2
3
 
3
4
  export interface TooltipIconProps extends TooltipProps {
4
5
  fontSize?: number | string;
@@ -24,7 +25,7 @@ export default function TooltipIcon({
24
25
  slotProps={{
25
26
  popper: {
26
27
  ...slotProps?.popper,
27
- sx: [
28
+ sx: mergeSx(
28
29
  {
29
30
  [`& .${tooltipClasses.tooltip}`]: {
30
31
  fontSize,
@@ -38,8 +39,9 @@ export default function TooltipIcon({
38
39
  alignItems: 'center',
39
40
  },
40
41
  },
41
- ...(Array.isArray(slotProps?.popper?.sx) ? slotProps.popper.sx : [slotProps?.popper?.sx]),
42
- ],
42
+ // @ts-expect-error
43
+ slotProps?.popper?.sx
44
+ ),
43
45
  },
44
46
  }}>
45
47
  {children}
@@ -43,7 +43,7 @@ export default function wrap(BaseComponent) {
43
43
  * @param {ButtonProps} props
44
44
  * @returns
45
45
  */
46
- function WrappedComponent(rawProps) {
46
+ function WrappedComponent({ ...rawProps }) {
47
47
  const props = Object.assign({}, rawProps);
48
48
  if (isUndefined(props.rounded)) {
49
49
  props.rounded = false;
@@ -1,7 +1,7 @@
1
1
  import { styled } from '../Theme';
2
2
 
3
3
  export default function Center({
4
- children,
4
+ children = null,
5
5
  relative = 'screen',
6
6
  }: {
7
7
  children?: React.ReactNode;
@@ -15,7 +15,7 @@ export interface CopyButtonProps extends React.HTMLAttributes<HTMLSpanElement> {
15
15
  export default function CopyButton({
16
16
  content = '',
17
17
  locale = 'en',
18
- render,
18
+ render = undefined,
19
19
  showTooltip = true,
20
20
  ...rest
21
21
  }: CopyButtonProps) {
@@ -8,7 +8,7 @@ import { mergeSx } from '../Util/style';
8
8
 
9
9
  export default function CloseButton({
10
10
  onClose = noop,
11
- sx,
11
+ sx = {},
12
12
  size = 20,
13
13
  }: {
14
14
  onClose?: () => void;
@@ -221,7 +221,10 @@ const Form = styled('form', {
221
221
  .title {
222
222
  font-size: 30px;
223
223
  text-align: center;
224
- color: ${(props) => props.theme.typography.color.main};
224
+ color: ${(props) => {
225
+ // @ts-expect-error
226
+ return props.theme.typography.color.main;
227
+ }};
225
228
  }
226
229
 
227
230
  .form-controls {
@@ -234,7 +237,11 @@ const Form = styled('form', {
234
237
  width: ${(props) => getInputWidth(props)};
235
238
  height: 50px;
236
239
  border: none;
237
- border-bottom: 1px solid ${(props) => props.theme.typography.color.main};
240
+ border-bottom: 1px solid
241
+ ${(props) => {
242
+ // @ts-expect-error
243
+ return props.theme.typography.color.main;
244
+ }};
238
245
  font-size: 16px;
239
246
  letter-spacing: 1.8px;
240
247
  outline: none;
package/src/DID/index.tsx CHANGED
@@ -7,6 +7,7 @@ import { Box, Dialog, DialogContent, ModalProps, Typography } from '@mui/materia
7
7
  import { useCreation, useMemoizedFn } from 'ahooks';
8
8
  import { useImperativeHandle, useRef, useState } from 'react';
9
9
  import { toAddress } from '@arcblock/did';
10
+ import noop from 'lodash/noop';
10
11
 
11
12
  import Address, { IDidAddressWrapper } from '../Address';
12
13
  import Avatar from '../Avatar';
@@ -137,7 +138,7 @@ export interface HTMLDIDElement extends HTMLDidAddressElement {
137
138
  }
138
139
 
139
140
  export function DID({
140
- ref,
141
+ ref = undefined,
141
142
  ...props
142
143
  }: DIDProps & {
143
144
  ref?: React.Ref<unknown>;
@@ -261,15 +262,15 @@ export interface DIDDialogProps extends DIDProps {
261
262
  }
262
263
  export function DIDDialog({
263
264
  did,
264
- chainId,
265
- roleType,
265
+ chainId = undefined,
266
+ roleType = undefined,
266
267
  showAvatar = true,
267
268
  // DialogProps
268
269
  open,
269
270
  fullScreen = false,
270
271
  fullWidth = false,
271
272
  scroll = 'paper',
272
- onClose,
273
+ onClose = noop,
273
274
  // AddressProps
274
275
  locale = 'en',
275
276
  ...rest
@@ -13,7 +13,7 @@ export default function AppInfoItem({
13
13
  appInfo,
14
14
  active = false,
15
15
  appLogo = null,
16
- sx,
16
+ sx = {},
17
17
  }: {
18
18
  appInfo: any;
19
19
  active?: boolean;
@@ -37,20 +37,20 @@ export default function AuthApps({
37
37
  session,
38
38
  requestAppInfo,
39
39
  currentAppInfo,
40
- children,
41
- userInfo,
40
+ children = null,
41
+ userInfo = undefined,
42
42
 
43
43
  hideSwitchConnect = false,
44
44
  hideAuthorize = false,
45
45
  hideCancel = false,
46
46
 
47
- notThisText,
48
- authorizeText,
49
- connectText,
50
- cancelText,
51
- useAnotherText,
47
+ notThisText = undefined,
48
+ authorizeText = undefined,
49
+ connectText = undefined,
50
+ cancelText = undefined,
51
+ useAnotherText = undefined,
52
52
 
53
- slotProps,
53
+ slotProps = undefined,
54
54
 
55
55
  onConnect = noop,
56
56
  onAuthorize = noop,
@@ -33,8 +33,8 @@ export default function DIDConnectContainer({
33
33
  popup = false,
34
34
  hideCloseButton = false,
35
35
  children,
36
- appPid,
37
- slotProps,
36
+ appPid = undefined,
37
+ slotProps = undefined,
38
38
  onClose = noop,
39
39
  keepMounted = false,
40
40
  }: {
@@ -13,7 +13,7 @@ import { DID_CONNECT_MEDIUM_WIDTH } from '../Util/constant';
13
13
  export default function DIDConnectFooter({
14
14
  currentAppInfo = globalThis.blocklet,
15
15
  currentAppColor = globalThis.blocklet?.appPid ? getDIDColor(globalThis.blocklet?.appPid) : '#fff',
16
- sx,
16
+ sx = {},
17
17
  }: {
18
18
  currentAppInfo?: any;
19
19
  currentAppColor?: string;
@@ -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();
@@ -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
@@ -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,
@@ -101,7 +101,7 @@ function Earth({
101
101
  height = 600,
102
102
  enableRotation = false,
103
103
  rotationSpeed = 5,
104
- activeMarkerId,
104
+ activeMarkerId = undefined,
105
105
  markers = [],
106
106
  colors: _colors = {},
107
107
  }: EarthProps) {
@@ -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) => props.theme.palette.text.hint};
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?: React.ReactNode;
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 = {}>({ icon, children, sx, ...rest }: Props<D, 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,
@@ -35,7 +35,7 @@ function Header({
35
35
  addons = null,
36
36
  prepend = null,
37
37
  align = 'left',
38
- maxWidth,
38
+ maxWidth = false,
39
39
  homeLink = '/',
40
40
  ...rest
41
41
  }: HeaderProps) {
@@ -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({ menu, prepend, children, ...rest }: ResponsiveHeaderProps) {
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)}>
@@ -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} />;
@@ -6,7 +6,7 @@ import { styled } from '../Theme';
6
6
 
7
7
  export interface InfoRowProps {
8
8
  name: React.ReactNode;
9
- nameFormatter: (name: React.ReactNode) => React.ReactNode;
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,
@@ -69,7 +69,7 @@ function Dashboard({
69
69
  fullWidth = false,
70
70
  dense = 'auto',
71
71
  footerProps = {},
72
- sx,
72
+ sx = {},
73
73
  children,
74
74
  ...rest
75
75
  }: DashboardProps) {
@@ -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) => props.theme.palette.text.hint};
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) {