@arcblock/ux 3.4.15 → 3.5.1

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 (333) hide show
  1. package/lib/package.json.js +1 -1
  2. package/package.json +10 -7
  3. package/src/ActionButton/ActionButton.stories.jsx +0 -61
  4. package/src/ActionButton/index.jsx +0 -106
  5. package/src/ActivityIndicator/ActivityIndicator.stories.jsx +0 -9
  6. package/src/ActivityIndicator/index.jsx +0 -140
  7. package/src/Address/Address.stories.jsx +0 -38
  8. package/src/Address/compact-text.jsx +0 -76
  9. package/src/Address/did-address.tsx +0 -223
  10. package/src/Address/index.tsx +0 -21
  11. package/src/Address/responsive-did-address.tsx +0 -154
  12. package/src/Alert/Alert.stories.jsx +0 -100
  13. package/src/Alert/index.jsx +0 -130
  14. package/src/AnimationWaiter/AnimationWaiter.stories.jsx +0 -35
  15. package/src/AnimationWaiter/dark-animation.json +0 -1
  16. package/src/AnimationWaiter/default-animation.json +0 -1
  17. package/src/AnimationWaiter/index.jsx +0 -296
  18. package/src/Async/index.tsx +0 -44
  19. package/src/Avatar/Avatar.stories.jsx +0 -11
  20. package/src/Avatar/did-motif.jsx +0 -38
  21. package/src/Avatar/etherscan-blockies.js +0 -81
  22. package/src/Avatar/index.jsx +0 -195
  23. package/src/Badge/Badge.stories.jsx +0 -41
  24. package/src/Badge/index.jsx +0 -101
  25. package/src/Blocklet/Blocklet.stories.jsx +0 -21
  26. package/src/Blocklet/blocklet.jsx +0 -276
  27. package/src/Blocklet/index.js +0 -5
  28. package/src/Blocklet/utils.jsx +0 -58
  29. package/src/BlockletContext/index.tsx +0 -72
  30. package/src/BlockletNFT/BlockletNFT.stories.jsx +0 -21
  31. package/src/BlockletNFT/index.jsx +0 -378
  32. package/src/BlockletV2/Blocklet.stories.jsx +0 -34
  33. package/src/BlockletV2/blocklet.tsx +0 -247
  34. package/src/BlockletV2/components/icon-text.tsx +0 -47
  35. package/src/BlockletV2/components/tooltip-icon.tsx +0 -52
  36. package/src/BlockletV2/index.ts +0 -6
  37. package/src/BlockletV2/utils.js +0 -75
  38. package/src/Button/Button.stories.jsx +0 -24
  39. package/src/Button/index.js +0 -9
  40. package/src/Button/wrap.jsx +0 -126
  41. package/src/ButtonGroup/index.js +0 -16
  42. package/src/CardSelector/index.tsx +0 -136
  43. package/src/Center/Center.stories.jsx +0 -20
  44. package/src/Center/index.tsx +0 -33
  45. package/src/ClickToCopy/ClickToCopy.stories.jsx +0 -24
  46. package/src/ClickToCopy/copy-button.tsx +0 -43
  47. package/src/ClickToCopy/hook.ts +0 -42
  48. package/src/ClickToCopy/index.tsx +0 -96
  49. package/src/CloseButton/index.tsx +0 -37
  50. package/src/CodeBlock/CodeBlock.stories.jsx +0 -22
  51. package/src/CodeBlock/LightBox.tsx +0 -87
  52. package/src/CodeBlock/index.tsx +0 -217
  53. package/src/Colors/Colors.stories.jsx +0 -211
  54. package/src/Colors/index.ts +0 -4
  55. package/src/Colors/themes/default.ts +0 -8
  56. package/src/Colors/themes/did-connect.ts +0 -64
  57. package/src/Colors/themes/temp.ts +0 -52
  58. package/src/Config/Config.stories.jsx +0 -16
  59. package/src/Config/config-provider.tsx +0 -62
  60. package/src/Config/index.ts +0 -2
  61. package/src/Config/theme-mode-toggle.tsx +0 -38
  62. package/src/ContactForm/ContactForm.stories.jsx +0 -32
  63. package/src/ContactForm/index.tsx +0 -264
  64. package/src/CookieConsent/CookieConsent.stories.jsx +0 -33
  65. package/src/CookieConsent/index.tsx +0 -104
  66. package/src/CountDown/CountDown.stories.jsx +0 -15
  67. package/src/CountDown/index.tsx +0 -170
  68. package/src/DID/DID.stories.jsx +0 -37
  69. package/src/DID/index.tsx +0 -393
  70. package/src/DIDConnect/app-icon.tsx +0 -37
  71. package/src/DIDConnect/app-info-item.tsx +0 -93
  72. package/src/DIDConnect/auth-apps/auth-apps-info.tsx +0 -77
  73. package/src/DIDConnect/auth-apps/index.tsx +0 -278
  74. package/src/DIDConnect/auth-apps/switch-role.tsx +0 -47
  75. package/src/DIDConnect/did-connect-container.tsx +0 -326
  76. package/src/DIDConnect/did-connect-footer.tsx +0 -76
  77. package/src/DIDConnect/did-connect-logo.tsx +0 -8
  78. package/src/DIDConnect/icons/did-wallet-logo.tsx +0 -18
  79. package/src/DIDConnect/icons/github-logo.tsx +0 -17
  80. package/src/DIDConnect/index.ts +0 -11
  81. package/src/DIDConnect/landing-page.tsx +0 -218
  82. package/src/DIDConnect/powered-by.tsx +0 -48
  83. package/src/DIDConnect/provider-icon.tsx +0 -62
  84. package/src/DIDConnect/request-storage-access-api-dialog.tsx +0 -304
  85. package/src/DIDConnect/with-container.tsx +0 -323
  86. package/src/DIDConnect/with-ux-theme.tsx +0 -22
  87. package/src/DIDLogo/Logo.stories.jsx +0 -11
  88. package/src/DIDLogo/index.tsx +0 -168
  89. package/src/Datatable/CustomToolbar.jsx +0 -415
  90. package/src/Datatable/Datatable.stories.jsx +0 -92
  91. package/src/Datatable/DatatableContext.jsx +0 -35
  92. package/src/Datatable/TableSearch.jsx +0 -166
  93. package/src/Datatable/index.jsx +0 -652
  94. package/src/Datatable/utils.js +0 -161
  95. package/src/Dialog/Dialog.stories.jsx +0 -21
  96. package/src/Dialog/confirm.jsx +0 -143
  97. package/src/Dialog/dialog.jsx +0 -199
  98. package/src/Dialog/index.js +0 -4
  99. package/src/Dialog/types.d.ts +0 -20
  100. package/src/Dialog/use-confirm.jsx +0 -188
  101. package/src/DriftBot/index.tsx +0 -81
  102. package/src/Earth/Earth.stories.jsx +0 -39
  103. package/src/Earth/countries.json +0 -8057
  104. package/src/Earth/index.tsx +0 -515
  105. package/src/Earth/util.ts +0 -72
  106. package/src/Empty/Empty.stories.jsx +0 -23
  107. package/src/Empty/index.jsx +0 -48
  108. package/src/ErrorBoundary/ErrorBoundary.stories.jsx +0 -13
  109. package/src/ErrorBoundary/fallback.tsx +0 -85
  110. package/src/ErrorBoundary/index.ts +0 -1
  111. package/src/Footer/Footer.stories.jsx +0 -13
  112. package/src/Footer/index.tsx +0 -130
  113. package/src/Header/Header.stories.jsx +0 -30
  114. package/src/Header/addon-button.tsx +0 -41
  115. package/src/Header/auto-hidden.tsx +0 -31
  116. package/src/Header/header-addons.tsx +0 -37
  117. package/src/Header/header.tsx +0 -214
  118. package/src/Header/index.ts +0 -3
  119. package/src/Header/responsive-header.tsx +0 -145
  120. package/src/Icon/Icon.stories.jsx +0 -45
  121. package/src/Icon/image.tsx +0 -53
  122. package/src/Icon/index.tsx +0 -63
  123. package/src/Img/Img.stories.jsx +0 -17
  124. package/src/Img/index.jsx +0 -258
  125. package/src/InfoRow/InfoRow.stories.jsx +0 -14
  126. package/src/InfoRow/index.tsx +0 -91
  127. package/src/Layout/Layout.stories.jsx +0 -24
  128. package/src/Layout/dashboard/external-link.tsx +0 -59
  129. package/src/Layout/dashboard/full-page.tsx +0 -58
  130. package/src/Layout/dashboard/index.tsx +0 -260
  131. package/src/Layout/dashboard/sidebar.tsx +0 -198
  132. package/src/Layout/dashboard-legacy/header.tsx +0 -156
  133. package/src/Layout/dashboard-legacy/index.tsx +0 -127
  134. package/src/Layout/dashboard-legacy/sidebar.tsx +0 -129
  135. package/src/Layout/index.tsx +0 -310
  136. package/src/LoadingMask/index.tsx +0 -108
  137. package/src/Locale/LocaleSelector.stories.jsx +0 -44
  138. package/src/Locale/browser-lang.ts +0 -65
  139. package/src/Locale/context.tsx +0 -162
  140. package/src/Locale/languages.ts +0 -58
  141. package/src/Locale/selector.tsx +0 -174
  142. package/src/Locale/util.ts +0 -38
  143. package/src/Logo/Logo.stories.jsx +0 -23
  144. package/src/Logo/images/logo-dark-text.svg +0 -3
  145. package/src/Logo/images/logo-dark-top.svg +0 -6
  146. package/src/Logo/images/logo-light-text.svg +0 -3
  147. package/src/Logo/images/logo-light-top.svg +0 -6
  148. package/src/Logo/index.tsx +0 -58
  149. package/src/Metric/Metric.stories.jsx +0 -29
  150. package/src/Metric/index.tsx +0 -130
  151. package/src/MuiWrap/index.tsx +0 -10
  152. package/src/NFTDisplay/NFTBroken.svg +0 -34
  153. package/src/NFTDisplay/NFTDisplay.stories.jsx +0 -30
  154. package/src/NFTDisplay/README.md +0 -59
  155. package/src/NFTDisplay/aspect-ratio-container.tsx +0 -36
  156. package/src/NFTDisplay/broken.tsx +0 -51
  157. package/src/NFTDisplay/displayApi.ts +0 -43
  158. package/src/NFTDisplay/index.tsx +0 -393
  159. package/src/NFTDisplay/loading.tsx +0 -16
  160. package/src/NFTDisplay/preview.tsx +0 -84
  161. package/src/NFTDisplay/render-svg.tsx +0 -21
  162. package/src/NFTDisplay/svg-embedder/img.tsx +0 -27
  163. package/src/NFTDisplay/svg-embedder/inline-svg.tsx +0 -36
  164. package/src/NavMenu/NavMenu.stories.jsx +0 -17
  165. package/src/NavMenu/images/OCAP.svg +0 -1
  166. package/src/NavMenu/images/abt-network.svg +0 -1
  167. package/src/NavMenu/images/ai-kit.svg +0 -1
  168. package/src/NavMenu/images/aigne-image-smith.svg +0 -1
  169. package/src/NavMenu/images/aigne.svg +0 -1
  170. package/src/NavMenu/images/aistro.png +0 -0
  171. package/src/NavMenu/images/arcsphere.svg +0 -1
  172. package/src/NavMenu/images/blocklet-framework.svg +0 -1
  173. package/src/NavMenu/images/blocklet-launcher.svg +0 -1
  174. package/src/NavMenu/images/blocklet-server.svg +0 -1
  175. package/src/NavMenu/images/blocklet-store.svg +0 -1
  176. package/src/NavMenu/images/creator-studio.svg +0 -1
  177. package/src/NavMenu/images/did-wallet.svg +0 -1
  178. package/src/NavMenu/images/did.svg +0 -1
  179. package/src/NavMenu/images/nft-studio.svg +0 -1
  180. package/src/NavMenu/images/payment-kit.png +0 -0
  181. package/src/NavMenu/images/vc.svg +0 -1
  182. package/src/NavMenu/images/web3-kit.svg +0 -1
  183. package/src/NavMenu/index.ts +0 -3
  184. package/src/NavMenu/nav-menu-context.tsx +0 -30
  185. package/src/NavMenu/nav-menu.tsx +0 -441
  186. package/src/NavMenu/products.tsx +0 -830
  187. package/src/NavMenu/style.ts +0 -258
  188. package/src/NavMenu/sub-container.tsx +0 -125
  189. package/src/NavMenu/sub-item-group.tsx +0 -42
  190. package/src/OrgTransfer/index.tsx +0 -53
  191. package/src/OrgTransfer/locales.ts +0 -25
  192. package/src/OrgTransfer/selector.tsx +0 -252
  193. package/src/OrgTransfer/type.ts +0 -31
  194. package/src/PageScroller/index.tsx +0 -316
  195. package/src/PageScroller/story/FifthComponent.jsx +0 -7
  196. package/src/PageScroller/story/FirstComponent.jsx +0 -7
  197. package/src/PageScroller/story/FourthComponent.jsx +0 -7
  198. package/src/PageScroller/story/FullPage.jsx +0 -55
  199. package/src/PageScroller/story/PageContain.jsx +0 -59
  200. package/src/PageScroller/story/PageScroller.stories.jsx +0 -18
  201. package/src/PageScroller/story/SecondComponent.jsx +0 -7
  202. package/src/PageScroller/story/ThirdComponent.jsx +0 -7
  203. package/src/PageScroller/story/index.css +0 -115
  204. package/src/PageScroller/usePrevValue.ts +0 -11
  205. package/src/Passport/index.ts +0 -3
  206. package/src/Passport/passport.tsx +0 -118
  207. package/src/PhoneInput/PhoneInput.stories.jsx +0 -12
  208. package/src/PhoneInput/country-select.tsx +0 -148
  209. package/src/PhoneInput/index.tsx +0 -269
  210. package/src/PoweredByArcBlock/index.tsx +0 -27
  211. package/src/PricingTable/PricingPlan.tsx +0 -120
  212. package/src/PricingTable/PricingTable.stories.jsx +0 -38
  213. package/src/PricingTable/index.tsx +0 -59
  214. package/src/QRCode/QRCode.stories.jsx +0 -13
  215. package/src/QRCode/index.tsx +0 -66
  216. package/src/RelativeTime/RelativeTime.stories.jsx +0 -20
  217. package/src/RelativeTime/index.tsx +0 -334
  218. package/src/Result/Result.stories.jsx +0 -61
  219. package/src/Result/common.tsx +0 -119
  220. package/src/Result/index.tsx +0 -30
  221. package/src/Result/result.tsx +0 -65
  222. package/src/Result/translations.ts +0 -57
  223. package/src/Screenshot/BaseScreenshot/index.tsx +0 -73
  224. package/src/Screenshot/BaseScreenshot/shells/Macbook.tsx +0 -38
  225. package/src/Screenshot/BaseScreenshot/shells/Phone.tsx +0 -35
  226. package/src/Screenshot/Screenshot.stories.jsx +0 -44
  227. package/src/Screenshot/devices.css +0 -1366
  228. package/src/Screenshot/index.tsx +0 -300
  229. package/src/SessionBlocklet/index.tsx +0 -178
  230. package/src/SessionManager/SessionManager.stories.jsx +0 -9
  231. package/src/SessionManager/index.tsx +0 -3
  232. package/src/SessionPermission/index.tsx +0 -26
  233. package/src/SessionUser/components/did-space.tsx +0 -68
  234. package/src/SessionUser/components/logged-in.tsx +0 -338
  235. package/src/SessionUser/components/quick-login-item.tsx +0 -132
  236. package/src/SessionUser/components/session-user-item.tsx +0 -93
  237. package/src/SessionUser/components/session-user-switch.tsx +0 -240
  238. package/src/SessionUser/components/un-login.tsx +0 -257
  239. package/src/SessionUser/components/user-info.tsx +0 -201
  240. package/src/SessionUser/index.tsx +0 -68
  241. package/src/SessionUser/libs/translation.ts +0 -30
  242. package/src/SessionUser/libs/utils.ts +0 -39
  243. package/src/SharedBridge/index.tsx +0 -126
  244. package/src/SocialShare/index.tsx +0 -194
  245. package/src/Sparkline/Sparkline.stories.jsx +0 -13
  246. package/src/Sparkline/index.tsx +0 -231
  247. package/src/Spinner/Spinner.stories.jsx +0 -98
  248. package/src/Spinner/index.tsx +0 -20
  249. package/src/SplitButton/SplitButton.stories.jsx +0 -32
  250. package/src/SplitButton/index.tsx +0 -116
  251. package/src/SplitButton/useClickAway.tsx +0 -24
  252. package/src/Success/index.tsx +0 -175
  253. package/src/Switch/Switch.stories.jsx +0 -16
  254. package/src/Switch/index.jsx +0 -79
  255. package/src/Tabs/Tabs.stories.jsx +0 -18
  256. package/src/Tabs/index.tsx +0 -255
  257. package/src/Tag/Tag.stories.jsx +0 -15
  258. package/src/Tag/index.jsx +0 -106
  259. package/src/TextCollapse/TextCollapse.stories.jsx +0 -73
  260. package/src/TextCollapse/index.tsx +0 -85
  261. package/src/Theme/Theme.stories.jsx +0 -11
  262. package/src/Theme/index.ts +0 -21
  263. package/src/Theme/theme-provider.tsx +0 -374
  264. package/src/Theme/theme.ts +0 -229
  265. package/src/Toast/Toast.stories.jsx +0 -28
  266. package/src/Toast/index.tsx +0 -80
  267. package/src/Typography/index.tsx +0 -124
  268. package/src/UserCard/Cards/avatar-only.tsx +0 -27
  269. package/src/UserCard/Cards/basic-info.tsx +0 -43
  270. package/src/UserCard/Cards/index.tsx +0 -16
  271. package/src/UserCard/Cards/social-actions.tsx +0 -196
  272. package/src/UserCard/Container/card.tsx +0 -63
  273. package/src/UserCard/Container/dialog.tsx +0 -37
  274. package/src/UserCard/Content/basic.tsx +0 -330
  275. package/src/UserCard/Content/clock.tsx +0 -82
  276. package/src/UserCard/Content/minimal.tsx +0 -113
  277. package/src/UserCard/Content/shorten-label.tsx +0 -32
  278. package/src/UserCard/Content/tooltip-avatar.tsx +0 -80
  279. package/src/UserCard/UserCard.stories.jsx +0 -19
  280. package/src/UserCard/components.tsx +0 -81
  281. package/src/UserCard/index.tsx +0 -132
  282. package/src/UserCard/types.ts +0 -165
  283. package/src/UserCard/use-follow.tsx +0 -111
  284. package/src/UserCard/utils.ts +0 -155
  285. package/src/Util/WebWalletOpener.stories.jsx +0 -5
  286. package/src/Util/client.ts +0 -4
  287. package/src/Util/constant.ts +0 -70
  288. package/src/Util/deprecate.tsx +0 -29
  289. package/src/Util/federated.ts +0 -125
  290. package/src/Util/iframe.ts +0 -19
  291. package/src/Util/index.ts +0 -760
  292. package/src/Util/logger.ts +0 -44
  293. package/src/Util/passport.ts +0 -127
  294. package/src/Util/security.ts +0 -72
  295. package/src/Util/style.ts +0 -17
  296. package/src/Util/wallet.ts +0 -35
  297. package/src/VerificationCode/index.tsx +0 -83
  298. package/src/Video/Video.stories.jsx +0 -6
  299. package/src/Video/index.tsx +0 -70
  300. package/src/Wallet/Action.stories.jsx +0 -8
  301. package/src/Wallet/Action.tsx +0 -118
  302. package/src/Wallet/Download.stories.jsx +0 -9
  303. package/src/Wallet/Download.tsx +0 -157
  304. package/src/Wallet/Open.tsx +0 -47
  305. package/src/Wallet/OpenInWallet.stories.jsx +0 -5
  306. package/src/Wallet/images/abtwallet.png +0 -0
  307. package/src/Wallet/images/android_download.svg +0 -22
  308. package/src/Wallet/images/app-store.svg +0 -30
  309. package/src/Wallet/images/google-play.svg +0 -69
  310. package/src/WalletOSIcon/index.tsx +0 -47
  311. package/src/WebWalletSWKeeper/index.tsx +0 -117
  312. package/src/WechatPrompt/images/android.png +0 -0
  313. package/src/WechatPrompt/images/ios.png +0 -0
  314. package/src/WechatPrompt/index.tsx +0 -75
  315. package/src/global.d.ts +0 -28
  316. package/src/hooks/use-blocklet-logo.tsx +0 -32
  317. package/src/hooks/use-clock.tsx +0 -62
  318. package/src/hooks/use-location-state.tsx +0 -117
  319. package/src/hooks/use-mobile.tsx +0 -6
  320. package/src/index.ts +0 -79
  321. package/src/type.d.ts +0 -44
  322. package/src/withTheme/index.tsx +0 -72
  323. package/src/withTracker/README.md +0 -37
  324. package/src/withTracker/action/bind-wallet.tsx +0 -17
  325. package/src/withTracker/action/login.tsx +0 -18
  326. package/src/withTracker/action/pay.tsx +0 -14
  327. package/src/withTracker/action/switch-passport.tsx +0 -20
  328. package/src/withTracker/constant/index.tsx +0 -3
  329. package/src/withTracker/env.tsx +0 -1
  330. package/src/withTracker/error_boundary.jsx +0 -34
  331. package/src/withTracker/index.tsx +0 -50
  332. package/src/withTracker/libs/utm.ts +0 -46
  333. package/vite.config.mjs +0 -37
@@ -1,3 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="99" height="18" viewBox="0 0 99 18">
2
- <path fill="#FFF" fill-rule="evenodd" d="M6.5.053h2.864L16.028 18h-2.114l-1.391-3.795H3.504L2.14 18H0L6.5.053zm1.474 1.481L4.04 12.563h7.895L7.975 1.534zm14.44 3.542c1.27 0 2.198.296 2.78.892.58.597.871 1.52.871 2.765v.36c0 .117-.008.245-.026.385h-1.826c.018-.14.027-.292.027-.452v-.48c0-.766-.186-1.283-.551-1.55-.367-.266-.916-.4-1.65-.4-.968 0-1.698.24-2.189.723-.493.48-.738 1.208-.738 2.187v8.308h-1.88V5.341h1.824l-.079 1.443c.376-.614.863-1.053 1.463-1.316a4.868 4.868 0 0 1 1.974-.392zM35.95 15.903c.501-.328.752-1.205.752-2.63h1.852c0 1.924-.403 3.178-1.208 3.765-.806.589-2.158.882-4.055.882-2.65 0-4.24-.538-4.766-1.616-.529-1.076-.793-2.781-.793-5.114 0-2.118.367-3.645 1.102-4.581.732-.934 2.209-1.401 4.43-1.401 1.378 0 2.569.221 3.572.665 1.002.446 1.503 1.497 1.503 3.153v.188a.234.234 0 0 0-.027.106v.106h-1.826c0-1.12-.228-1.851-.685-2.188-.455-.34-1.23-.507-2.322-.507-1.665 0-2.713.259-3.142.782-.43.524-.646 1.67-.646 3.44V12.2c0 1.4.161 2.448.485 3.15.322.7 1.297 1.048 2.926 1.048 1.397 0 2.346-.165 2.848-.495zm15.87-.318c.606-.328.912-1.263.912-2.805 0-.924-.147-1.69-.444-2.302-.294-.611-1.007-.917-2.133-.917H43.065v6.516h5.528c1.543 0 2.617-.165 3.226-.492zm-8.754-13.85v6.036h5.665c1.325 0 2.239-.214 2.737-.643.503-.428.755-1.288.755-2.575 0-1.09-.192-1.834-.577-2.226-.385-.394-1.116-.591-2.19-.591h-6.39zM52 8.466c1.185.322 1.956.816 2.314 1.482.359.67.54 1.581.54 2.739 0 1.6-.325 2.858-.97 3.764-.647.909-1.874 1.363-3.686 1.363H41.05V0h8.62c1.592 0 2.759.312 3.503.934.744.624 1.115 1.78 1.115 3.473 0 1.014-.129 1.855-.386 2.522-.258.669-.89 1.181-1.903 1.536zm5.43 9.348V.001h1.907v17.812H57.43zm13.374-6.168v-.708c0-1.539-.141-2.636-.426-3.297-.284-.658-1.191-.99-2.718-.99h-.401c-1.617 0-2.625.25-3.025.75-.399.5-.599 1.632-.599 3.4V12.822c0 .206.008.407.024.602a9.48 9.48 0 0 0 .216 1.474c.106.465.275.822.505 1.072.196.179.435.302.72.373.283.072.586.116.905.135h1.254c1.083 0 1.914-.151 2.492-.456.577-.302.9-1.043.972-2.22a18.338 18.338 0 0 0 .054-1.447c.015-.233.027-.47.027-.71zm-3.786-6.518c2.399 0 3.956.414 4.672 1.243.717.828 1.074 2.418 1.074 4.766 0 2.048-.219 3.704-.657 4.966C71.668 17.367 70.16 18 67.581 18c-2.237 0-3.782-.347-4.632-1.042-.85-.694-1.275-2.205-1.275-4.54v-1.174c0-2.12.318-3.669.954-4.646.635-.98 2.099-1.471 4.39-1.471zm16.434 10.776c.501-.328.752-1.205.752-2.63h1.853c0 1.924-.403 3.178-1.209 3.765-.804.589-2.157.882-4.054.882-2.648 0-4.24-.538-4.767-1.616-.528-1.076-.79-2.781-.79-5.114 0-2.118.365-3.645 1.1-4.581.732-.934 2.21-1.401 4.43-1.401 1.377 0 2.568.221 3.571.665 1.003.446 1.504 1.497 1.504 3.153v.188a.232.232 0 0 0-.026.106v.106H83.99c0-1.12-.229-1.851-.686-2.188-.455-.34-1.23-.507-2.323-.507-1.665 0-2.712.259-3.142.782-.43.524-.643 1.67-.643 3.44V12.2c0 1.4.16 2.448.482 3.15.324.7 1.298 1.048 2.927 1.048 1.397 0 2.346-.165 2.847-.495zm9.236-4.82L99 17.813h-2.47l-5.317-6.01h-.752v6.01h-1.907V0h1.907v10.362h.752l4.512-5.02h2.309l-5.346 5.741z"/>
3
- </svg>
@@ -1,6 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="45" height="52" viewBox="0 0 45 52">
2
- <g fill="none" fill-rule="evenodd" stroke="#FFF">
3
- <path d="M.5 13.077L22.15.577l21.651 12.5v25l-21.65 12.5L.5 38.077zM22.15.577v50M.5 13.077l43.301 25M.5 38.077l43.301-25"/>
4
- <path d="M22.15 38.077l10.826-6.25-10.825-18.75-10.825 18.75z"/>
5
- </g>
6
- </svg>
@@ -1,58 +0,0 @@
1
- import { type SxProps } from '@mui/material';
2
- import { styled } from '../Theme';
3
-
4
- import LightLogo from './images/logo-light-top.svg?react';
5
- import LightText from './images/logo-light-text.svg?react';
6
- import DarkLogo from './images/logo-dark-top.svg?react';
7
- import DarkText from './images/logo-dark-text.svg?react';
8
-
9
- export interface LogoProps extends React.HTMLAttributes<HTMLSpanElement> {
10
- mode?: 'light' | 'dark';
11
- layout?: 'vertical' | 'horizontal';
12
- showText?: true | false;
13
- showLogo?: true | false;
14
- size?: number;
15
- sx?: SxProps;
16
- }
17
-
18
- export default function Logo({
19
- showText = true,
20
- showLogo = true,
21
- mode = 'dark',
22
- layout = 'vertical',
23
- size = undefined,
24
- style = {},
25
- ...rest
26
- }: LogoProps) {
27
- const isLight = mode === 'light';
28
- const logo = isLight ? <LightLogo /> : <DarkLogo />;
29
- const text = isLight ? <LightText className="logo-text" /> : <DarkText className="logo-text" />;
30
-
31
- if (size) {
32
- style.width = `${size}px`;
33
- style.height = `${size}px`;
34
- }
35
-
36
- return (
37
- <Container layout={layout} style={style} {...rest}>
38
- {showLogo && logo}
39
- {showText && text}
40
- </Container>
41
- );
42
- }
43
-
44
- type ContainerProps = {
45
- layout: 'vertical' | 'horizontal';
46
- };
47
-
48
- const Container = styled('span')<ContainerProps>`
49
- display: inline-flex;
50
- flex-direction: ${(props) => (props.layout === 'horizontal' ? 'row' : 'column')};
51
- justify-content: center;
52
- align-items: center;
53
-
54
- .logo-text {
55
- ${(props) => (props.layout === 'vertical' ? 'margin-top: 8px;' : '')}
56
- ${(props) => (props.layout === 'vertical' ? '' : 'margin-left: 8px;')};
57
- }
58
- `;
@@ -1,29 +0,0 @@
1
- import { Box, Container } from '@mui/material';
2
- import { ThemeProvider } from '../Theme';
3
- import { ThemeModeToggle } from '../Config';
4
-
5
- export { default as Basic } from './demo/basic';
6
- export { default as HtmlValueAndName } from './demo/html-value-and-name';
7
-
8
- export default {
9
- title: 'Data Display/Metric',
10
- parameters: {
11
- docs: {
12
- description: {
13
- component: 'The Metric component is usually used to display statistics on dashboard pages.',
14
- },
15
- },
16
- },
17
- decorators: [
18
- (StoryFn) => (
19
- <ThemeProvider prefer="system">
20
- <Container>
21
- <Box sx={{ mb: 2 }}>
22
- <ThemeModeToggle />
23
- </Box>
24
- <StoryFn />
25
- </Container>
26
- </ThemeProvider>
27
- ),
28
- ],
29
- };
@@ -1,130 +0,0 @@
1
- /* eslint-disable react/no-danger */
2
- import { Link } from '@mui/material';
3
-
4
- import ImageIcon from '../Icon/image';
5
- import { styled } from '../Theme';
6
-
7
- export interface MetricProps {
8
- icon: string;
9
- value: string | number;
10
- name: React.ReactNode;
11
- url?: string;
12
- animated?: false | true;
13
- LinkComponent?: React.ElementType;
14
- prefix?: string;
15
- iconColor?: string;
16
- iconStyle?: React.CSSProperties;
17
- }
18
-
19
- export default function Metric({
20
- icon,
21
- value,
22
- name,
23
- url = '',
24
- animated = false,
25
- LinkComponent = Link,
26
- prefix = '/images',
27
- iconColor = '#222222',
28
- iconStyle = {},
29
- }: MetricProps) {
30
- const metric = (
31
- <>
32
- <div className="metric__image">
33
- <ImageIcon
34
- name={icon}
35
- alt={typeof name === 'string' ? name : ''}
36
- size={30}
37
- prefix={prefix}
38
- color={iconColor}
39
- style={iconStyle}
40
- />
41
- </div>
42
- <div>
43
- <div
44
- className={`metric__number ${animated ? 'metric__number--animated' : ''}`}
45
- dangerouslySetInnerHTML={{ __html: value as string }}
46
- />
47
- <div className="metric__name">{name}</div>
48
- </div>
49
- </>
50
- );
51
-
52
- return <Container>{url ? <LinkComponent to={url}>{metric}</LinkComponent> : metric}</Container>;
53
- }
54
-
55
- type ContainerProps = {
56
- size?: 'small' | 'large';
57
- };
58
-
59
- const Container = styled('div')<ContainerProps>`
60
- border-left: 1px solid ${(props) => props.theme.palette.divider};
61
- padding: 10px 0 10px 16px;
62
- @media (max-width: ${(props) => props.theme.breakpoints.values.sm}px) {
63
- padding: 0 0 0 8px;
64
- }
65
-
66
- display: flex;
67
- justify-items: center;
68
- align-items: flex-start;
69
-
70
- a {
71
- display: flex;
72
- justify-items: center;
73
- align-items: flex-start;
74
- }
75
-
76
- .metric__image {
77
- margin-right: 8px;
78
- }
79
-
80
- .metric__number {
81
- margin-bottom: 8px;
82
- font-size: ${(props) => (props.size === 'small' ? 32 : 36)}px;
83
- font-weight: 600;
84
- line-height: 36px;
85
- color: ${(props) => props.theme.palette.text.primary};
86
-
87
- small {
88
- font-size: 12px;
89
- line-height: 12px;
90
- }
91
-
92
- @media (max-width: ${(props) => props.theme.breakpoints.values.sm}px) {
93
- font-size: ${(props) => (props.size === 'small' ? 24 : 28)}px;
94
- line-height: ${(props) => (props.size === 'small' ? 24 : 28)}px;
95
- margin-bottom: 2px;
96
- }
97
- }
98
-
99
- .metric__number--animated {
100
- animation-name: blink-opacity;
101
- animation-duration: 250ms;
102
- animation-timing-function: linear;
103
- animation-iteration-count: 1;
104
- background-color: transparent !important;
105
- }
106
-
107
- .metric__name {
108
- font-size: 14px;
109
- text-transform: capitalize;
110
- line-height: 1.2;
111
- font-weight: 500;
112
- color: ${(props) => props.theme.palette.text.primary};
113
- @media (max-width: ${(props) => props.theme.breakpoints.values.sm}px) {
114
- font-size: 10px;
115
- line-height: 1;
116
- }
117
- }
118
-
119
- @keyframes blink-opacity {
120
- 0% {
121
- opacity: 1;
122
- }
123
- 50% {
124
- opacity: 0.3;
125
- }
126
- 100% {
127
- opacity: 1;
128
- }
129
- }
130
- `;
@@ -1,10 +0,0 @@
1
- import { Box, BoxProps, Typography, TypographyProps } from '@mui/material';
2
- import { ElementType } from 'react';
3
-
4
- export function TBox<C extends ElementType>({ component, ...rest }: BoxProps<C, { component: C }>) {
5
- return <Box component={component} {...rest} />;
6
- }
7
-
8
- export function TTypography<C extends ElementType>({ component, ...rest }: TypographyProps<C, { component: C }>) {
9
- return <Typography component={component} {...rest} />;
10
- }
@@ -1,34 +0,0 @@
1
- <svg width="300" height="300" viewBox="0 0 300 300" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <g clip-path="url(#clip0_317_299)">
3
- <rect x="60" width="60" height="60" fill="#F3F4F6" style="fill:#F3F4F6;fill:color(display-p3 0.9529 0.9569 0.9647);fill-opacity:1;"/>
4
- <rect width="60" height="60" fill="#F9FAFB" style="fill:#F9FAFB;fill:color(display-p3 0.9765 0.9804 0.9843);fill-opacity:1;"/>
5
- <rect x="180" width="60" height="60" fill="#F9FAFB" style="fill:#F9FAFB;fill:color(display-p3 0.9765 0.9804 0.9843);fill-opacity:1;"/>
6
- <rect x="120" width="60" height="60" fill="#E5E7EB" style="fill:#E5E7EB;fill:color(display-p3 0.8980 0.9059 0.9216);fill-opacity:1;"/>
7
- <rect x="240" width="60" height="60" fill="#E5E7EB" style="fill:#E5E7EB;fill:color(display-p3 0.8980 0.9059 0.9216);fill-opacity:1;"/>
8
- <rect y="60" width="60" height="60" fill="#E5E7EB" style="fill:#E5E7EB;fill:color(display-p3 0.8980 0.9059 0.9216);fill-opacity:1;"/>
9
- <rect x="60" y="60" width="60" height="60" fill="#F9FAFB" style="fill:#F9FAFB;fill:color(display-p3 0.9765 0.9804 0.9843);fill-opacity:1;"/>
10
- <rect x="120" y="60" width="60" height="60" fill="#F3F4F6" style="fill:#F3F4F6;fill:color(display-p3 0.9529 0.9569 0.9647);fill-opacity:1;"/>
11
- <rect x="240" y="59.9999" width="60" height="60" fill="#F3F4F6" style="fill:#F3F4F6;fill:color(display-p3 0.9529 0.9569 0.9647);fill-opacity:1;"/>
12
- <rect x="180" y="59.9999" width="60" height="60" fill="#E5E7EB" style="fill:#E5E7EB;fill:color(display-p3 0.8980 0.9059 0.9216);fill-opacity:1;"/>
13
- <rect y="120" width="60" height="60" fill="#F3F4F6" style="fill:#F3F4F6;fill:color(display-p3 0.9529 0.9569 0.9647);fill-opacity:1;"/>
14
- <rect y="180" width="60" height="60" fill="#F9FAFB" style="fill:#F9FAFB;fill:color(display-p3 0.9765 0.9804 0.9843);fill-opacity:1;"/>
15
- <rect y="240" width="60" height="60" fill="#F3F4F6" style="fill:#F3F4F6;fill:color(display-p3 0.9529 0.9569 0.9647);fill-opacity:1;"/>
16
- <rect x="60" y="120" width="60" height="60" fill="#E5E7EB" style="fill:#E5E7EB;fill:color(display-p3 0.8980 0.9059 0.9216);fill-opacity:1;"/>
17
- <rect x="60" y="180" width="60" height="60" fill="#F3F4F6" style="fill:#F3F4F6;fill:color(display-p3 0.9529 0.9569 0.9647);fill-opacity:1;"/>
18
- <rect x="60" y="240" width="60" height="60" fill="#E5E7EB" style="fill:#E5E7EB;fill:color(display-p3 0.8980 0.9059 0.9216);fill-opacity:1;"/>
19
- <rect x="120" y="120" width="60" height="60" fill="#F9FAFB" style="fill:#F9FAFB;fill:color(display-p3 0.9765 0.9804 0.9843);fill-opacity:1;"/>
20
- <rect x="180" y="180" width="60" height="60" fill="#F9FAFB" style="fill:#F9FAFB;fill:color(display-p3 0.9765 0.9804 0.9843);fill-opacity:1;"/>
21
- <rect x="120" y="240" width="60" height="60" fill="#F3F4F6" style="fill:#F3F4F6;fill:color(display-p3 0.9529 0.9569 0.9647);fill-opacity:1;"/>
22
- <rect x="240" y="120" width="60" height="60" fill="#F9FAFB" style="fill:#F9FAFB;fill:color(display-p3 0.9765 0.9804 0.9843);fill-opacity:1;"/>
23
- <rect x="120" y="180" width="60" height="60" fill="#E5E7EB" style="fill:#E5E7EB;fill:color(display-p3 0.8980 0.9059 0.9216);fill-opacity:1;"/>
24
- <rect x="180" y="240" width="60" height="60" fill="#E5E7EB" style="fill:#E5E7EB;fill:color(display-p3 0.8980 0.9059 0.9216);fill-opacity:1;"/>
25
- <rect x="180" y="120" width="60" height="60" fill="#F3F4F6" style="fill:#F3F4F6;fill:color(display-p3 0.9529 0.9569 0.9647);fill-opacity:1;"/>
26
- <rect x="240" y="180" width="60" height="60" fill="#F3F4F6" style="fill:#F3F4F6;fill:color(display-p3 0.9529 0.9569 0.9647);fill-opacity:1;"/>
27
- <rect x="240" y="240" width="60" height="60" fill="#F9FAFB" style="fill:#F9FAFB;fill:color(display-p3 0.9765 0.9804 0.9843);fill-opacity:1;"/>
28
- </g>
29
- <defs>
30
- <clipPath id="clip0_317_299">
31
- <rect width="300" height="300" fill="white" style="fill:white;fill-opacity:1;"/>
32
- </clipPath>
33
- </defs>
34
- </svg>
@@ -1,30 +0,0 @@
1
- export { default as Basic } from './demo/basic';
2
- export { default as FixedSize } from './demo/fixed-size';
3
- export { default as Inset } from './demo/inset';
4
- export { default as AspectRatio } from './demo/aspect-ratio';
5
- export { default as NftTypeUrl } from './demo/nft-type-url';
6
- export { default as MinimumLoadingTime } from './demo/minimum-loading-time';
7
- export { default as WithForeignObject } from './demo/with-foreign-object';
8
- export { default as NftTypeSvg } from './demo/nft-type-svg';
9
- export { default as CustomLoading } from './demo/custom-loading';
10
- export { default as SvgValidation } from './demo/svg-validation';
11
- export { default as BrokenImage } from './demo/broken-image';
12
- export { default as PreferredSvgEmbedderProp } from './demo/preferred-svg-embedder-prop';
13
- export { default as ImageFilter } from './demo/image-filter';
14
-
15
- /**
16
- * @type { import('@storybook/react-vite').Story}
17
- */
18
- export default {
19
- title: 'Data Display/NFTDisplay',
20
- argTypes: {
21
- imageFilter: {
22
- control: 'object',
23
- defaultValue: {
24
- imageFilter: 'resize',
25
- w: '500',
26
- f: 'webp',
27
- },
28
- },
29
- },
30
- };
@@ -1,59 +0,0 @@
1
- # NFTDisplay
2
-
3
- ## 01 使用
4
-
5
- ### 01.01 默认样式
6
-
7
- NFTDisplay 组件默认尺寸为 *150x150*, 可以通过 css 设置 width/height. 固定尺寸的使用场景感觉比较少, 多数情况应该都需要将 NFTDisplay 应用于响应式布局中.
8
-
9
- ### 01.02 aspect ratio
10
-
11
- 可以使用 aspect prop 设置 NFTDisplay 的宽高比, NFTDisplay 包裹一两层 div/span 标签 (用来控制布局, 没有直接把 img 标签渲染出来), 所以这里说的长宽比指的不是 img 的长宽比, 图片的尺寸大小不一, 长宽比也是既定的, aspect prop 控制的是包裹 img 容器的长宽比.
12
-
13
- NFTDisplay 宽高比的计算是根据父容器的 width 来确定的 (NFTDisplay 会填充整个宽度), 所以可以通过控制父容器的 width 来控制 NFTDisplay 的大小.
14
-
15
- ### 01.03 inset
16
-
17
- inset 设置为 true 时 NFTDisplay 会镶嵌/填满父容器 (并垂直+水平居中显示图片), 所以父容器必须有明确的宽高 (尤其是高度). 响应式布局中应该会比较常用.
18
-
19
- 注: inset 比 aspect ratio 优先级高, 如果同时设置了 inset 和 aspect, 则后者不生效.
20
-
21
- ### 01.04 asset data (prop)
22
-
23
- 可以为 asset data prop 传入 raw data 或 parsed data, 避免多次解析 asset data.
24
-
25
- ### 01.05 broken image & error handling
26
-
27
- * display 加载失败时会显示一个 broken-image, 可以从外部覆盖 `.nft-display--broken` 的样式来调整尺寸/颜色等样式
28
- * error handling, 这部分感觉出错原因可能性会很多, 有 json 解析错误、某字段缺失、某 object 指定路径的值缺失、nft type 不支持等等, 暂时没想到如何更合理的捕获和处理这些错误.
29
-
30
- ### 02 svg 加载
31
-
32
- 基于 `img` 标签加载 NFT Display. 几种 nft type 的加载:
33
-
34
- - url
35
- 直接使用 `<img>`
36
- - svg_gzipped
37
- content => ungzip => svgToImgUrl => `<img>`
38
- - svg (未测试, 需要测试数据)
39
- content => svgToImgUrl => `<img>`
40
- - html (TODO)
41
- 基于 `<img>` 的加载方式不适用, 目前没有发现这种 nft type 的测试数据
42
-
43
- 基于 `<img>` 标签的加载方式没有样式污染问题, 加载、尺寸控制也比较方便, 不过据说有些情况下 svg 可能无法正确显示 (比如 svg 加载了 font|image 资源), 目前没有发现问题, 还需要更多的观察
44
-
45
- ## 03 iframe 第三方嵌入 (TODO)
46
-
47
- 需要设计 iframe 的 API (iframe#src 查询参数), 目前想到的参数:
48
-
49
- - address : asset address
50
- 调用 getAssetState 接口获取 display 数据进行展示
51
- - 样式控制相关的参数 ?
52
-
53
- ## 04 参考
54
-
55
- * [提供一个 NFT display 组件 · Issue #199 · ArcBlock/ux](https://github.com/ArcBlock/ux/issues/199)
56
- * [2021徽章出现奇怪的渲染 · Issue #230 · blocklet/nft-marketplace](https://github.com/blocklet/nft-marketplace/issues/230)
57
- * [Adding vector graphics to the Web - Learn web development | MDN](https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Adding_vector_graphics_to_the_Web)
58
- * [The Best Way to Embed SVG on HTML (2021)](https://vecta.io/blog/best-way-to-embed-svg)
59
- * [javascript - Do I always need to call URL.revokeObjectURL() explicitly? - Stack Overflow](https://stackoverflow.com/questions/49209756/do-i-always-need-to-call-url-revokeobjecturl-explicitly)
@@ -1,36 +0,0 @@
1
- import { styled } from '../Theme';
2
-
3
- export interface AspectRatioContainerProps {
4
- aspect: number;
5
- children: React.ReactNode;
6
- }
7
-
8
- function AspectRatioContainer({ aspect, children, ...rest }: AspectRatioContainerProps) {
9
- return (
10
- <Root aspect={aspect} {...rest}>
11
- <span className="aspect-ratio-container__inner">{children}</span>
12
- </Root>
13
- );
14
- }
15
-
16
- type RootProps = {
17
- aspect: number;
18
- };
19
-
20
- const Root = styled('span')<RootProps>`
21
- display: block;
22
- position: relative;
23
- width: 100%;
24
- height: 0;
25
- padding-bottom: ${({ aspect }) => (1 / aspect) * 100}%;
26
-
27
- .aspect-ratio-container__inner {
28
- position: absolute;
29
- top: 0;
30
- bottom: 0;
31
- left: 0;
32
- right: 0;
33
- }
34
- `;
35
-
36
- export default AspectRatioContainer;
@@ -1,51 +0,0 @@
1
- import { Box } from '@mui/material';
2
- import { styled } from '../Theme';
3
-
4
- import NFTBroken from './NFTBroken.svg?react';
5
-
6
- export interface BrokenProps {
7
- children?: React.ReactNode;
8
- }
9
-
10
- export default function Broken({ children = 'Non-publicly accessible NFT' }: BrokenProps = {}) {
11
- return (
12
- <Root>
13
- <NFTBroken className="nft-display-broken-background" />
14
- {children && <Box className="nft-display-broken-content">{children}</Box>}
15
- </Root>
16
- );
17
- }
18
-
19
- const Root = styled(Box)`
20
- width: 100%;
21
- height: 100%;
22
- position: relative;
23
-
24
- .nft-display-broken-background {
25
- width: 100%;
26
- height: 100%;
27
- }
28
-
29
- .nft-display-broken-content {
30
- display: flex;
31
- width: 100%;
32
- height: 100%;
33
- justify-content: center;
34
- align-items: center;
35
- position: absolute;
36
- top: 0;
37
- left: 0;
38
- right: 0;
39
- bottom: 0;
40
- margin: auto;
41
- mix-blend-mode: plus-darker;
42
- font-size: 13px;
43
- color: #9aa3b0;
44
- text-align: center;
45
- text-shadow:
46
- 0 0 2px #fff,
47
- 0 0 2px #fff,
48
- 0 0 2px #fff;
49
- user-select: none;
50
- }
51
- `;
@@ -1,43 +0,0 @@
1
- import axios, { AxiosAdapter, type AxiosResponse } from 'axios';
2
- // eslint-disable-next-line import/extensions
3
- import adapter from 'axios/lib/adapters/xhr.js';
4
-
5
- const cache = new Map();
6
- const EXPIRATION_TIME_MS = 10 * 60 * 1000; // 10 minutes
7
-
8
- const cacheAdapterEnhancer: AxiosAdapter = (config) => {
9
- const { url, method } = config;
10
- const cacheKey = JSON.stringify({ url, method });
11
-
12
- if (cache.has(cacheKey)) {
13
- const cachedResult = cache.get(cacheKey);
14
- if (Date.now() - cachedResult.timestamp < EXPIRATION_TIME_MS) {
15
- if (cachedResult.error) {
16
- return Promise.reject(cachedResult.error);
17
- }
18
-
19
- return Promise.resolve({ headers: cachedResult.headers });
20
- }
21
-
22
- cache.delete(cacheKey);
23
- }
24
-
25
- return adapter(config)
26
- .then((response: AxiosResponse) => {
27
- // cache headers
28
- cache.set(cacheKey, { headers: response.headers, timestamp: Date.now() });
29
- return response;
30
- })
31
- .catch((error: unknown) => {
32
- // cache error
33
- cache.set(cacheKey, { error, timestamp: Date.now() });
34
- throw error;
35
- });
36
- };
37
-
38
- const instance = axios.create({
39
- adapter: cacheAdapterEnhancer,
40
- timeout: 5000,
41
- });
42
-
43
- export default instance;