@arcblock/ux 3.4.14 → 3.5.0

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 (335) hide show
  1. package/lib/Util/constant.d.ts +6 -0
  2. package/lib/Util/constant.js +25 -16
  3. package/lib/package.json.js +1 -1
  4. package/package.json +12 -9
  5. package/src/ActionButton/ActionButton.stories.jsx +0 -61
  6. package/src/ActionButton/index.jsx +0 -106
  7. package/src/ActivityIndicator/ActivityIndicator.stories.jsx +0 -9
  8. package/src/ActivityIndicator/index.jsx +0 -140
  9. package/src/Address/Address.stories.jsx +0 -38
  10. package/src/Address/compact-text.jsx +0 -76
  11. package/src/Address/did-address.tsx +0 -223
  12. package/src/Address/index.tsx +0 -21
  13. package/src/Address/responsive-did-address.tsx +0 -154
  14. package/src/Alert/Alert.stories.jsx +0 -100
  15. package/src/Alert/index.jsx +0 -130
  16. package/src/AnimationWaiter/AnimationWaiter.stories.jsx +0 -35
  17. package/src/AnimationWaiter/dark-animation.json +0 -1
  18. package/src/AnimationWaiter/default-animation.json +0 -1
  19. package/src/AnimationWaiter/index.jsx +0 -296
  20. package/src/Async/index.tsx +0 -44
  21. package/src/Avatar/Avatar.stories.jsx +0 -11
  22. package/src/Avatar/did-motif.jsx +0 -38
  23. package/src/Avatar/etherscan-blockies.js +0 -81
  24. package/src/Avatar/index.jsx +0 -195
  25. package/src/Badge/Badge.stories.jsx +0 -41
  26. package/src/Badge/index.jsx +0 -101
  27. package/src/Blocklet/Blocklet.stories.jsx +0 -21
  28. package/src/Blocklet/blocklet.jsx +0 -276
  29. package/src/Blocklet/index.js +0 -5
  30. package/src/Blocklet/utils.jsx +0 -58
  31. package/src/BlockletContext/index.tsx +0 -72
  32. package/src/BlockletNFT/BlockletNFT.stories.jsx +0 -21
  33. package/src/BlockletNFT/index.jsx +0 -378
  34. package/src/BlockletV2/Blocklet.stories.jsx +0 -34
  35. package/src/BlockletV2/blocklet.tsx +0 -247
  36. package/src/BlockletV2/components/icon-text.tsx +0 -47
  37. package/src/BlockletV2/components/tooltip-icon.tsx +0 -52
  38. package/src/BlockletV2/index.ts +0 -6
  39. package/src/BlockletV2/utils.js +0 -75
  40. package/src/Button/Button.stories.jsx +0 -24
  41. package/src/Button/index.js +0 -9
  42. package/src/Button/wrap.jsx +0 -126
  43. package/src/ButtonGroup/index.js +0 -16
  44. package/src/CardSelector/index.tsx +0 -136
  45. package/src/Center/Center.stories.jsx +0 -20
  46. package/src/Center/index.tsx +0 -33
  47. package/src/ClickToCopy/ClickToCopy.stories.jsx +0 -24
  48. package/src/ClickToCopy/copy-button.tsx +0 -43
  49. package/src/ClickToCopy/hook.ts +0 -42
  50. package/src/ClickToCopy/index.tsx +0 -96
  51. package/src/CloseButton/index.tsx +0 -37
  52. package/src/CodeBlock/CodeBlock.stories.jsx +0 -22
  53. package/src/CodeBlock/LightBox.tsx +0 -87
  54. package/src/CodeBlock/index.tsx +0 -217
  55. package/src/Colors/Colors.stories.jsx +0 -211
  56. package/src/Colors/index.ts +0 -4
  57. package/src/Colors/themes/default.ts +0 -8
  58. package/src/Colors/themes/did-connect.ts +0 -64
  59. package/src/Colors/themes/temp.ts +0 -52
  60. package/src/Config/Config.stories.jsx +0 -16
  61. package/src/Config/config-provider.tsx +0 -62
  62. package/src/Config/index.ts +0 -2
  63. package/src/Config/theme-mode-toggle.tsx +0 -38
  64. package/src/ContactForm/ContactForm.stories.jsx +0 -32
  65. package/src/ContactForm/index.tsx +0 -264
  66. package/src/CookieConsent/CookieConsent.stories.jsx +0 -33
  67. package/src/CookieConsent/index.tsx +0 -104
  68. package/src/CountDown/CountDown.stories.jsx +0 -15
  69. package/src/CountDown/index.tsx +0 -170
  70. package/src/DID/DID.stories.jsx +0 -37
  71. package/src/DID/index.tsx +0 -393
  72. package/src/DIDConnect/app-icon.tsx +0 -37
  73. package/src/DIDConnect/app-info-item.tsx +0 -93
  74. package/src/DIDConnect/auth-apps/auth-apps-info.tsx +0 -77
  75. package/src/DIDConnect/auth-apps/index.tsx +0 -278
  76. package/src/DIDConnect/auth-apps/switch-role.tsx +0 -47
  77. package/src/DIDConnect/did-connect-container.tsx +0 -326
  78. package/src/DIDConnect/did-connect-footer.tsx +0 -76
  79. package/src/DIDConnect/did-connect-logo.tsx +0 -8
  80. package/src/DIDConnect/icons/did-wallet-logo.tsx +0 -18
  81. package/src/DIDConnect/icons/github-logo.tsx +0 -17
  82. package/src/DIDConnect/index.ts +0 -11
  83. package/src/DIDConnect/landing-page.tsx +0 -218
  84. package/src/DIDConnect/powered-by.tsx +0 -48
  85. package/src/DIDConnect/provider-icon.tsx +0 -62
  86. package/src/DIDConnect/request-storage-access-api-dialog.tsx +0 -304
  87. package/src/DIDConnect/with-container.tsx +0 -323
  88. package/src/DIDConnect/with-ux-theme.tsx +0 -22
  89. package/src/DIDLogo/Logo.stories.jsx +0 -11
  90. package/src/DIDLogo/index.tsx +0 -168
  91. package/src/Datatable/CustomToolbar.jsx +0 -415
  92. package/src/Datatable/Datatable.stories.jsx +0 -92
  93. package/src/Datatable/DatatableContext.jsx +0 -35
  94. package/src/Datatable/TableSearch.jsx +0 -166
  95. package/src/Datatable/index.jsx +0 -652
  96. package/src/Datatable/utils.js +0 -161
  97. package/src/Dialog/Dialog.stories.jsx +0 -21
  98. package/src/Dialog/confirm.jsx +0 -143
  99. package/src/Dialog/dialog.jsx +0 -199
  100. package/src/Dialog/index.js +0 -4
  101. package/src/Dialog/types.d.ts +0 -20
  102. package/src/Dialog/use-confirm.jsx +0 -188
  103. package/src/DriftBot/index.tsx +0 -81
  104. package/src/Earth/Earth.stories.jsx +0 -39
  105. package/src/Earth/countries.json +0 -8057
  106. package/src/Earth/index.tsx +0 -515
  107. package/src/Earth/util.ts +0 -72
  108. package/src/Empty/Empty.stories.jsx +0 -23
  109. package/src/Empty/index.jsx +0 -48
  110. package/src/ErrorBoundary/ErrorBoundary.stories.jsx +0 -13
  111. package/src/ErrorBoundary/fallback.tsx +0 -85
  112. package/src/ErrorBoundary/index.ts +0 -1
  113. package/src/Footer/Footer.stories.jsx +0 -13
  114. package/src/Footer/index.tsx +0 -130
  115. package/src/Header/Header.stories.jsx +0 -30
  116. package/src/Header/addon-button.tsx +0 -41
  117. package/src/Header/auto-hidden.tsx +0 -31
  118. package/src/Header/header-addons.tsx +0 -37
  119. package/src/Header/header.tsx +0 -214
  120. package/src/Header/index.ts +0 -3
  121. package/src/Header/responsive-header.tsx +0 -145
  122. package/src/Icon/Icon.stories.jsx +0 -45
  123. package/src/Icon/image.tsx +0 -53
  124. package/src/Icon/index.tsx +0 -63
  125. package/src/Img/Img.stories.jsx +0 -17
  126. package/src/Img/index.jsx +0 -258
  127. package/src/InfoRow/InfoRow.stories.jsx +0 -14
  128. package/src/InfoRow/index.tsx +0 -91
  129. package/src/Layout/Layout.stories.jsx +0 -24
  130. package/src/Layout/dashboard/external-link.tsx +0 -59
  131. package/src/Layout/dashboard/full-page.tsx +0 -58
  132. package/src/Layout/dashboard/index.tsx +0 -260
  133. package/src/Layout/dashboard/sidebar.tsx +0 -198
  134. package/src/Layout/dashboard-legacy/header.tsx +0 -156
  135. package/src/Layout/dashboard-legacy/index.tsx +0 -127
  136. package/src/Layout/dashboard-legacy/sidebar.tsx +0 -129
  137. package/src/Layout/index.tsx +0 -310
  138. package/src/LoadingMask/index.tsx +0 -108
  139. package/src/Locale/LocaleSelector.stories.jsx +0 -44
  140. package/src/Locale/browser-lang.ts +0 -65
  141. package/src/Locale/context.tsx +0 -162
  142. package/src/Locale/languages.ts +0 -58
  143. package/src/Locale/selector.tsx +0 -174
  144. package/src/Locale/util.ts +0 -38
  145. package/src/Logo/Logo.stories.jsx +0 -23
  146. package/src/Logo/images/logo-dark-text.svg +0 -3
  147. package/src/Logo/images/logo-dark-top.svg +0 -6
  148. package/src/Logo/images/logo-light-text.svg +0 -3
  149. package/src/Logo/images/logo-light-top.svg +0 -6
  150. package/src/Logo/index.tsx +0 -58
  151. package/src/Metric/Metric.stories.jsx +0 -29
  152. package/src/Metric/index.tsx +0 -130
  153. package/src/MuiWrap/index.tsx +0 -10
  154. package/src/NFTDisplay/NFTBroken.svg +0 -34
  155. package/src/NFTDisplay/NFTDisplay.stories.jsx +0 -30
  156. package/src/NFTDisplay/README.md +0 -59
  157. package/src/NFTDisplay/aspect-ratio-container.tsx +0 -36
  158. package/src/NFTDisplay/broken.tsx +0 -51
  159. package/src/NFTDisplay/displayApi.ts +0 -43
  160. package/src/NFTDisplay/index.tsx +0 -393
  161. package/src/NFTDisplay/loading.tsx +0 -16
  162. package/src/NFTDisplay/preview.tsx +0 -84
  163. package/src/NFTDisplay/render-svg.tsx +0 -21
  164. package/src/NFTDisplay/svg-embedder/img.tsx +0 -27
  165. package/src/NFTDisplay/svg-embedder/inline-svg.tsx +0 -36
  166. package/src/NavMenu/NavMenu.stories.jsx +0 -17
  167. package/src/NavMenu/images/OCAP.svg +0 -1
  168. package/src/NavMenu/images/abt-network.svg +0 -1
  169. package/src/NavMenu/images/ai-kit.svg +0 -1
  170. package/src/NavMenu/images/aigne-image-smith.svg +0 -1
  171. package/src/NavMenu/images/aigne.svg +0 -1
  172. package/src/NavMenu/images/aistro.png +0 -0
  173. package/src/NavMenu/images/arcsphere.svg +0 -1
  174. package/src/NavMenu/images/blocklet-framework.svg +0 -1
  175. package/src/NavMenu/images/blocklet-launcher.svg +0 -1
  176. package/src/NavMenu/images/blocklet-server.svg +0 -1
  177. package/src/NavMenu/images/blocklet-store.svg +0 -1
  178. package/src/NavMenu/images/creator-studio.svg +0 -1
  179. package/src/NavMenu/images/did-wallet.svg +0 -1
  180. package/src/NavMenu/images/did.svg +0 -1
  181. package/src/NavMenu/images/nft-studio.svg +0 -1
  182. package/src/NavMenu/images/payment-kit.png +0 -0
  183. package/src/NavMenu/images/vc.svg +0 -1
  184. package/src/NavMenu/images/web3-kit.svg +0 -1
  185. package/src/NavMenu/index.ts +0 -3
  186. package/src/NavMenu/nav-menu-context.tsx +0 -30
  187. package/src/NavMenu/nav-menu.tsx +0 -441
  188. package/src/NavMenu/products.tsx +0 -830
  189. package/src/NavMenu/style.ts +0 -258
  190. package/src/NavMenu/sub-container.tsx +0 -125
  191. package/src/NavMenu/sub-item-group.tsx +0 -42
  192. package/src/OrgTransfer/index.tsx +0 -53
  193. package/src/OrgTransfer/locales.ts +0 -25
  194. package/src/OrgTransfer/selector.tsx +0 -252
  195. package/src/OrgTransfer/type.ts +0 -31
  196. package/src/PageScroller/index.tsx +0 -316
  197. package/src/PageScroller/story/FifthComponent.jsx +0 -7
  198. package/src/PageScroller/story/FirstComponent.jsx +0 -7
  199. package/src/PageScroller/story/FourthComponent.jsx +0 -7
  200. package/src/PageScroller/story/FullPage.jsx +0 -55
  201. package/src/PageScroller/story/PageContain.jsx +0 -59
  202. package/src/PageScroller/story/PageScroller.stories.jsx +0 -18
  203. package/src/PageScroller/story/SecondComponent.jsx +0 -7
  204. package/src/PageScroller/story/ThirdComponent.jsx +0 -7
  205. package/src/PageScroller/story/index.css +0 -115
  206. package/src/PageScroller/usePrevValue.ts +0 -11
  207. package/src/Passport/index.ts +0 -3
  208. package/src/Passport/passport.tsx +0 -118
  209. package/src/PhoneInput/PhoneInput.stories.jsx +0 -12
  210. package/src/PhoneInput/country-select.tsx +0 -148
  211. package/src/PhoneInput/index.tsx +0 -269
  212. package/src/PoweredByArcBlock/index.tsx +0 -27
  213. package/src/PricingTable/PricingPlan.tsx +0 -120
  214. package/src/PricingTable/PricingTable.stories.jsx +0 -38
  215. package/src/PricingTable/index.tsx +0 -59
  216. package/src/QRCode/QRCode.stories.jsx +0 -13
  217. package/src/QRCode/index.tsx +0 -66
  218. package/src/RelativeTime/RelativeTime.stories.jsx +0 -20
  219. package/src/RelativeTime/index.tsx +0 -334
  220. package/src/Result/Result.stories.jsx +0 -61
  221. package/src/Result/common.tsx +0 -119
  222. package/src/Result/index.tsx +0 -30
  223. package/src/Result/result.tsx +0 -65
  224. package/src/Result/translations.ts +0 -57
  225. package/src/Screenshot/BaseScreenshot/index.tsx +0 -73
  226. package/src/Screenshot/BaseScreenshot/shells/Macbook.tsx +0 -38
  227. package/src/Screenshot/BaseScreenshot/shells/Phone.tsx +0 -35
  228. package/src/Screenshot/Screenshot.stories.jsx +0 -44
  229. package/src/Screenshot/devices.css +0 -1366
  230. package/src/Screenshot/index.tsx +0 -300
  231. package/src/SessionBlocklet/index.tsx +0 -178
  232. package/src/SessionManager/SessionManager.stories.jsx +0 -9
  233. package/src/SessionManager/index.tsx +0 -3
  234. package/src/SessionPermission/index.tsx +0 -26
  235. package/src/SessionUser/components/did-space.tsx +0 -68
  236. package/src/SessionUser/components/logged-in.tsx +0 -338
  237. package/src/SessionUser/components/quick-login-item.tsx +0 -132
  238. package/src/SessionUser/components/session-user-item.tsx +0 -93
  239. package/src/SessionUser/components/session-user-switch.tsx +0 -240
  240. package/src/SessionUser/components/un-login.tsx +0 -257
  241. package/src/SessionUser/components/user-info.tsx +0 -201
  242. package/src/SessionUser/index.tsx +0 -68
  243. package/src/SessionUser/libs/translation.ts +0 -30
  244. package/src/SessionUser/libs/utils.ts +0 -39
  245. package/src/SharedBridge/index.tsx +0 -126
  246. package/src/SocialShare/index.tsx +0 -194
  247. package/src/Sparkline/Sparkline.stories.jsx +0 -13
  248. package/src/Sparkline/index.tsx +0 -231
  249. package/src/Spinner/Spinner.stories.jsx +0 -98
  250. package/src/Spinner/index.tsx +0 -20
  251. package/src/SplitButton/SplitButton.stories.jsx +0 -32
  252. package/src/SplitButton/index.tsx +0 -116
  253. package/src/SplitButton/useClickAway.tsx +0 -24
  254. package/src/Success/index.tsx +0 -175
  255. package/src/Switch/Switch.stories.jsx +0 -16
  256. package/src/Switch/index.jsx +0 -79
  257. package/src/Tabs/Tabs.stories.jsx +0 -18
  258. package/src/Tabs/index.tsx +0 -255
  259. package/src/Tag/Tag.stories.jsx +0 -15
  260. package/src/Tag/index.jsx +0 -106
  261. package/src/TextCollapse/TextCollapse.stories.jsx +0 -73
  262. package/src/TextCollapse/index.tsx +0 -85
  263. package/src/Theme/Theme.stories.jsx +0 -11
  264. package/src/Theme/index.ts +0 -21
  265. package/src/Theme/theme-provider.tsx +0 -374
  266. package/src/Theme/theme.ts +0 -229
  267. package/src/Toast/Toast.stories.jsx +0 -28
  268. package/src/Toast/index.tsx +0 -80
  269. package/src/Typography/index.tsx +0 -124
  270. package/src/UserCard/Cards/avatar-only.tsx +0 -27
  271. package/src/UserCard/Cards/basic-info.tsx +0 -43
  272. package/src/UserCard/Cards/index.tsx +0 -16
  273. package/src/UserCard/Cards/social-actions.tsx +0 -196
  274. package/src/UserCard/Container/card.tsx +0 -63
  275. package/src/UserCard/Container/dialog.tsx +0 -37
  276. package/src/UserCard/Content/basic.tsx +0 -330
  277. package/src/UserCard/Content/clock.tsx +0 -82
  278. package/src/UserCard/Content/minimal.tsx +0 -113
  279. package/src/UserCard/Content/shorten-label.tsx +0 -32
  280. package/src/UserCard/Content/tooltip-avatar.tsx +0 -80
  281. package/src/UserCard/UserCard.stories.jsx +0 -19
  282. package/src/UserCard/components.tsx +0 -81
  283. package/src/UserCard/index.tsx +0 -132
  284. package/src/UserCard/types.ts +0 -165
  285. package/src/UserCard/use-follow.tsx +0 -111
  286. package/src/UserCard/utils.ts +0 -155
  287. package/src/Util/WebWalletOpener.stories.jsx +0 -5
  288. package/src/Util/client.ts +0 -4
  289. package/src/Util/constant.ts +0 -60
  290. package/src/Util/deprecate.tsx +0 -29
  291. package/src/Util/federated.ts +0 -125
  292. package/src/Util/iframe.ts +0 -19
  293. package/src/Util/index.ts +0 -760
  294. package/src/Util/logger.ts +0 -44
  295. package/src/Util/passport.ts +0 -127
  296. package/src/Util/security.ts +0 -72
  297. package/src/Util/style.ts +0 -17
  298. package/src/Util/wallet.ts +0 -35
  299. package/src/VerificationCode/index.tsx +0 -83
  300. package/src/Video/Video.stories.jsx +0 -6
  301. package/src/Video/index.tsx +0 -70
  302. package/src/Wallet/Action.stories.jsx +0 -8
  303. package/src/Wallet/Action.tsx +0 -118
  304. package/src/Wallet/Download.stories.jsx +0 -9
  305. package/src/Wallet/Download.tsx +0 -157
  306. package/src/Wallet/Open.tsx +0 -47
  307. package/src/Wallet/OpenInWallet.stories.jsx +0 -5
  308. package/src/Wallet/images/abtwallet.png +0 -0
  309. package/src/Wallet/images/android_download.svg +0 -22
  310. package/src/Wallet/images/app-store.svg +0 -30
  311. package/src/Wallet/images/google-play.svg +0 -69
  312. package/src/WalletOSIcon/index.tsx +0 -47
  313. package/src/WebWalletSWKeeper/index.tsx +0 -117
  314. package/src/WechatPrompt/images/android.png +0 -0
  315. package/src/WechatPrompt/images/ios.png +0 -0
  316. package/src/WechatPrompt/index.tsx +0 -75
  317. package/src/global.d.ts +0 -28
  318. package/src/hooks/use-blocklet-logo.tsx +0 -32
  319. package/src/hooks/use-clock.tsx +0 -62
  320. package/src/hooks/use-location-state.tsx +0 -117
  321. package/src/hooks/use-mobile.tsx +0 -6
  322. package/src/index.ts +0 -79
  323. package/src/type.d.ts +0 -44
  324. package/src/withTheme/index.tsx +0 -72
  325. package/src/withTracker/README.md +0 -37
  326. package/src/withTracker/action/bind-wallet.tsx +0 -17
  327. package/src/withTracker/action/login.tsx +0 -18
  328. package/src/withTracker/action/pay.tsx +0 -14
  329. package/src/withTracker/action/switch-passport.tsx +0 -20
  330. package/src/withTracker/constant/index.tsx +0 -3
  331. package/src/withTracker/env.tsx +0 -1
  332. package/src/withTracker/error_boundary.jsx +0 -34
  333. package/src/withTracker/index.tsx +0 -50
  334. package/src/withTracker/libs/utm.ts +0 -46
  335. package/vite.config.mjs +0 -37
@@ -1,64 +0,0 @@
1
- /**
2
- * @deprecated 请使用 MUI theme 对象替代
3
- */
4
- const colors = {
5
- background: {
6
- overlay: 'rgba(15, 23, 42, 0.5)',
7
- default: 'white',
8
- paper0: 'white',
9
- paper1: '#FAFAFA',
10
- paper2: '#F4F4F5',
11
- paper3: '#F0F0F1',
12
- },
13
- text: {
14
- primary: '#18181B',
15
- secondary: '#71717B',
16
- disabled: '#D4D4D8',
17
- hint: '#D4D4D8',
18
- },
19
- state: {
20
- hover: '#FAFAFA',
21
- selected: '#F4F4F5',
22
- item: '#F4F4F5',
23
- itemSelected: '#E4E4E7',
24
- },
25
- primary: {
26
- main: '#2B7FFF',
27
- light: '#51A2FF',
28
- dark: '#155DFC',
29
- contrastText: '#fff',
30
- },
31
- secondary: {
32
- main: '#615FFF',
33
- light: '#7C86FF',
34
- dark: '#4F39F6',
35
- contrastText: '#fff',
36
- },
37
- error: {
38
- main: '#FB2C36',
39
- light: '#FF6467',
40
- dark: '#E7000B',
41
- contrastText: '#fff',
42
- },
43
- warning: {
44
- main: '#FF6900',
45
- light: '#FF8904',
46
- dark: '#F54900',
47
- contrastText: '#fff',
48
- },
49
- info: {
50
- main: '#2B7FFF',
51
- light: '#51A2FF',
52
- dark: '#155DFC',
53
- contrastText: '#fff',
54
- },
55
- success: {
56
- main: '#00C950',
57
- light: '#05DF72',
58
- dark: '#00A63E',
59
- contrastText: '#fff',
60
- },
61
- divider: 'rgba(18, 22, 24, 0.06)',
62
- };
63
-
64
- export default colors;
@@ -1,52 +0,0 @@
1
- /**
2
- * @deprecated 请使用 MUI theme 对象替代
3
- */
4
- const colors = {
5
- textMuted: 'rgba(18, 22, 24, 0.36)',
6
- textSubtitle: 'rgba(18, 22, 24, 0.6)',
7
- textBase: 'rgba(18, 22, 24, 1)',
8
- textPrimaryBase: 'rgba(18, 22, 24, 1)',
9
- primaryBase: 'rgba(19, 125, 250, 1)',
10
- primary100: 'rgba(19, 125, 250, 1)',
11
- gray6: 'rgba(17, 22, 24, 0.06)',
12
-
13
- // surface
14
- surfaceBgSubtitle: 'rgba(18, 22, 24, 0.03)',
15
- surfacePrimarySubtitle: 'rgba(19, 125, 250, 0.06)',
16
- surfaceSuccess: 'rgba(13, 202, 134, 1)',
17
-
18
- // background
19
- backgroundsBgSubtitle: 'rgba(249, 250, 251, 1)',
20
- backgroundsBgComponent: 'rgba(241, 243, 245, 1)',
21
- backgroundsBgField: 'rgba(249, 250, 251, 1)',
22
- backgroundsBgSubtile: 'rgba(249, 250, 251, 1)',
23
- backgroundsBgSubtileHover: 'rgba(243, 244, 246, 1)',
24
-
25
- // foreground
26
- foregroundsFgBase: 'rgba(3, 7, 18, 1)',
27
- foregroundsFgSubtile: 'rgba(75, 85, 99, 1)',
28
- foregroundsFgMuted: 'rgba(156, 163, 175, 1)',
29
- foregroundsFgInteractiveTransparent: 'rgba(59, 130, 246, 0)',
30
- foregroundsFgInteractive: 'rgba(59, 130, 246, 1)',
31
-
32
- // border
33
- strokeBorderBase: 'rgba(229, 231, 235, 1)',
34
- strokeBorderStrong: 'rgba(209, 213, 219, 1)',
35
- strokeSep: 'rgba(229, 231, 235, 1)',
36
- lineStep: 'rgba(18, 22, 24, 0.06)',
37
- lineBorderStrong: 'rgba(18, 22, 24, 0.12)',
38
- lineBorderBase: 'rgba(18, 22, 24, 0.06)',
39
- borderBase: 'rgba(18, 22, 24, 0.06)',
40
- dividerColor: 'rgba(239, 241, 245, 1)',
41
-
42
- // button
43
- buttonsButtonNeutral: 'rgba(255, 255, 255, 1)',
44
- buttonsButtonNeutralHover: 'rgba(243, 244, 246, 1)',
45
- buttonsButtonInverted: 'rgba(3, 7, 18, 1)',
46
- buttonsButtonInvertedHover: 'rgba(17, 24, 39, 1)',
47
- buttonsButtonDanger: 'rgba(225, 29, 72, 1)',
48
-
49
- red: '#FF6369',
50
- };
51
-
52
- export default colors;
@@ -1,16 +0,0 @@
1
- import SwitchMode from './demo/switch-mode';
2
- import NestedColorScheme from './demo/nested-color-scheme';
3
-
4
- export default {
5
- title: 'Theme/Config',
6
-
7
- parameters: {
8
- docs: {
9
- description: {
10
- component: 'Config is used to configure the theme and locale of the application.',
11
- },
12
- },
13
- },
14
- };
15
-
16
- export { SwitchMode, NestedColorScheme };
@@ -1,62 +0,0 @@
1
- import { type ReactNode } from 'react';
2
- import { LocaleProvider, LocaleProviderProps, useLocaleContext } from '../Locale/context';
3
- import ThemeProvider, { type ThemeProviderProps, useColorScheme } from '../Theme/theme-provider';
4
- import { useTheme } from '../Theme';
5
-
6
- export interface ConfigProviderProps extends Omit<LocaleProviderProps, 'translations'>, ThemeProviderProps {
7
- children: ReactNode;
8
- translations?: Record<string, any>;
9
- }
10
-
11
- /**
12
- * 集中化配置
13
- */
14
- export function ConfigProvider({
15
- children,
16
- // theme provider
17
- theme,
18
- injectFirst,
19
- darkSchemeClass,
20
- prefer,
21
- disableBlockletTheme = false,
22
- enableColorScheme,
23
- disableStyleCache,
24
- // locale provider
25
- locale,
26
- fallbackLocale,
27
- translations = {},
28
- languages,
29
- onLoadingTranslation,
30
- }: ConfigProviderProps) {
31
- return (
32
- <ThemeProvider
33
- theme={theme}
34
- injectFirst={injectFirst}
35
- darkSchemeClass={darkSchemeClass}
36
- prefer={prefer}
37
- disableBlockletTheme={disableBlockletTheme}
38
- enableColorScheme={enableColorScheme}
39
- disableStyleCache={disableStyleCache}>
40
- <LocaleProvider
41
- locale={locale}
42
- fallbackLocale={fallbackLocale}
43
- translations={translations}
44
- onLoadingTranslation={onLoadingTranslation}
45
- languages={languages}>
46
- {children}
47
- </LocaleProvider>
48
- </ThemeProvider>
49
- );
50
- }
51
-
52
- export function useConfig() {
53
- const theme = useTheme();
54
- const localeCtx = useLocaleContext();
55
- const colorSchemeCtx = useColorScheme();
56
-
57
- return {
58
- theme,
59
- ...localeCtx,
60
- ...colorSchemeCtx,
61
- };
62
- }
@@ -1,2 +0,0 @@
1
- export * from './config-provider';
2
- export { default as ThemeModeToggle } from './theme-mode-toggle';
@@ -1,38 +0,0 @@
1
- import { IconButton } from '@mui/material';
2
- import {
3
- LightModeOutlined as LightModeOutlinedIcon,
4
- Brightness2Outlined as Brightness2OutlinedIcon,
5
- } from '@mui/icons-material';
6
- import { useThrottleFn } from 'ahooks';
7
- import { useColorScheme } from '../Theme/theme-provider';
8
-
9
- export default function ThemeModeToggle() {
10
- const { mode, toggleMode, prefer } = useColorScheme();
11
- const { run: toggleModeThrottled } = useThrottleFn(
12
- () => {
13
- toggleMode();
14
- },
15
- {
16
- wait: 300,
17
- }
18
- );
19
-
20
- if (!toggleMode) {
21
- if (process.env.NODE_ENV !== 'production') {
22
- console.warn('Please ensure the component is wrapped with ConfigProvider context');
23
- }
24
-
25
- return null;
26
- }
27
-
28
- // 跟随系统才显示切换
29
- if (prefer === 'system' || window.blocklet?.theme?.prefer === 'system') {
30
- return (
31
- <IconButton onClick={toggleModeThrottled}>
32
- {mode === 'light' ? <Brightness2OutlinedIcon /> : <LightModeOutlinedIcon />}
33
- </IconButton>
34
- );
35
- }
36
-
37
- return null;
38
- }
@@ -1,32 +0,0 @@
1
- import ContactForm from '.';
2
- import withTheme from '../withTheme';
3
-
4
- const ThemedContactForm = withTheme(ContactForm);
5
-
6
- export default {
7
- title: 'Deprecated/ContactForm',
8
- };
9
-
10
- export function VerticalLayout() {
11
- return <ThemedContactForm />;
12
- }
13
-
14
- VerticalLayout.storyName = 'vertical layout';
15
-
16
- export function HorizontalLayout() {
17
- return <ThemedContactForm layout="horizontal" />;
18
- }
19
-
20
- HorizontalLayout.storyName = 'horizontal layout';
21
-
22
- export function WithoutTitle() {
23
- return <ThemedContactForm layout="vertical" title="" />;
24
- }
25
-
26
- WithoutTitle.storyName = 'without title';
27
-
28
- export function CustomizeFields() {
29
- return <ThemedContactForm layout="horizontal" fields={['Email', 'Name']} />;
30
- }
31
-
32
- CustomizeFields.storyName = 'customize fields';
@@ -1,264 +0,0 @@
1
- /* eslint-disable react/no-unused-prop-types */
2
- /* eslint-disable react/static-property-placement */
3
- import React from 'react';
4
- import axios from 'axios';
5
- import { Typography, CircularProgress } from '@mui/material';
6
-
7
- import { mergeProps } from '../Util';
8
- import { warn as deprecatedWarn } from '../Util/deprecate';
9
- import Button from '../Button';
10
- import { styled } from '../Theme';
11
-
12
- export function submitContactForm(
13
- { formId, portalId }: { formId: string; portalId: string },
14
- fields: Record<string, string>,
15
- context: Record<string, string>
16
- ) {
17
- const url = `https://api.hsforms.com/submissions/v3/integration/submit/${portalId}/${formId}`;
18
- return axios
19
- .post(url, {
20
- submittedAt: Date.now(),
21
- fields: Object.keys(fields).map((x) => ({
22
- name: x.replace(/\s+/, '').toLowerCase(),
23
- value: fields[x],
24
- })),
25
- context,
26
- skipValidation: false,
27
- })
28
- .then((res) => res.data.inlineMessage)
29
- .catch((res) => (res.data ? res.data.message : 'Form Submit Failed'));
30
- }
31
-
32
- export interface ContactFormProps extends React.HTMLAttributes<HTMLFormElement> {
33
- className?: string;
34
- portalId?: string;
35
- formId?: string;
36
- title?: string;
37
- button?: string;
38
- successMessage?: string;
39
- layout?: 'horizontal' | 'vertical';
40
- fields?: string | string[];
41
- }
42
-
43
- export default class ContactForm extends React.Component<
44
- ContactFormProps,
45
- {
46
- loading: boolean;
47
- errorMessage: string;
48
- successMessage: string;
49
- [x: string]: string | boolean;
50
- }
51
- > {
52
- static defaultProps = {
53
- className: '',
54
- portalId: '4796488',
55
- formId: '929a510f-34f4-4251-98b3-34175200aebd',
56
- title: undefined,
57
- button: '',
58
- layout: 'vertical' as const,
59
- successMessage: 'Form Submit Success',
60
- fields: ['Email', 'First Name', 'Last Name'],
61
- };
62
-
63
- fields: string[];
64
-
65
- constructor(props: ContactFormProps) {
66
- super(props);
67
-
68
- if (typeof props.fields === 'string') {
69
- this.fields = props.fields.split(',').map((x) => x.trim());
70
- } else {
71
- this.fields = props.fields!;
72
- }
73
-
74
- this.state = {
75
- loading: false,
76
- errorMessage: '',
77
- successMessage: '',
78
- };
79
-
80
- this.fields.forEach((x) => {
81
- // @ts-ignore
82
- this.state[x] = '';
83
- });
84
- deprecatedWarn('ContactForm');
85
- }
86
-
87
- deriveProps() {
88
- const newProps = mergeProps(this.props, ContactForm);
89
-
90
- if (typeof newProps.title === 'undefined') {
91
- newProps.title = 'Signup for our news letter';
92
- }
93
- if (!newProps.button) {
94
- newProps.button = 'Subscribe';
95
- }
96
-
97
- return newProps;
98
- }
99
-
100
- render() {
101
- const { className, style, title, button, layout } = this.deriveProps();
102
- const { loading, errorMessage, successMessage } = this.state;
103
- return (
104
- <Form
105
- onSubmit={this.onSubmit}
106
- className={className}
107
- style={style}
108
- layout={layout}
109
- fieldCount={this.fields.length}
110
- name="subscribe">
111
- {!!title && (
112
- <Typography component="p" className="title">
113
- {title}
114
- </Typography>
115
- )}
116
- <div className="form-controls">
117
- {this.fields.map((x) => (
118
- <input
119
- required
120
- key={x}
121
- type="text"
122
- value={this.state[x] as string}
123
- onChange={this.getInputHandler(x)}
124
- className="input"
125
- placeholder={x}
126
- />
127
- ))}
128
- <Button
129
- variant="outlined"
130
- type="submit"
131
- color="inherit"
132
- size="large"
133
- disabled={loading}
134
- className="subscribe-btn-empty">
135
- {loading ? <CircularProgress size={28} /> : button}
136
- </Button>
137
- </div>
138
- {!!errorMessage && (
139
- <Typography
140
- component="p"
141
- variant="body1"
142
- className="error"
143
- color="secondary"
144
- dangerouslySetInnerHTML={{ __html: errorMessage }}
145
- />
146
- )}
147
- {!!successMessage && (
148
- <Typography
149
- component="p"
150
- variant="body1"
151
- className="success"
152
- color="primary"
153
- dangerouslySetInnerHTML={{ __html: successMessage }}
154
- />
155
- )}
156
- </Form>
157
- );
158
- }
159
-
160
- onSubmit = async (e: React.FormEvent<HTMLFormElement>) => {
161
- e.preventDefault();
162
- this.setState({ loading: true });
163
-
164
- try {
165
- const message = await submitContactForm(
166
- { formId: this.props.formId!, portalId: this.props.portalId! },
167
- this.fields.reduce<Record<string, string>>((obj, x) => {
168
- obj[x] = this.state[x] as string;
169
- return obj;
170
- }, {}),
171
- {
172
- pageUri: window.location.href,
173
- pageName: document.title,
174
- }
175
- );
176
-
177
- this.setState({
178
- loading: false,
179
- successMessage: message || this.props.successMessage,
180
- });
181
- } catch (err) {
182
- this.setState({
183
- loading: false,
184
- errorMessage: err ? (err as Error).message : 'Form submit failed',
185
- });
186
- }
187
- };
188
-
189
- getInputHandler =
190
- (name: string, state = {}) =>
191
- (e: React.ChangeEvent<HTMLInputElement>) => {
192
- this.setState(
193
- Object.assign(state, {
194
- [name]: e.target.value,
195
- })
196
- );
197
- };
198
- }
199
-
200
- interface FormProps {
201
- layout: 'vertical' | 'horizontal';
202
- fieldCount: number;
203
- }
204
-
205
- // prettier-ignore
206
- const getInputWidth = (props: FormProps) => (props.layout === 'vertical' ? '100%' : `${Math.max(95 / (props.fieldCount + 1), 20)}%`);
207
-
208
- const Form = styled('form', {
209
- shouldForwardProp: (prop) => prop !== 'layout' && prop !== 'fieldCount',
210
- })<FormProps>`
211
- display: flex;
212
- flex-direction: column;
213
- justify-content: center;
214
- align-items: center;
215
- @media (max-width: ${(props) => props.theme.breakpoints.values.sm}px) {
216
- width: 100% !important;
217
- }
218
- max-width: 800px;
219
- margin: 0px auto;
220
-
221
- .title {
222
- font-size: 30px;
223
- text-align: center;
224
- color: ${(props) => {
225
- return props.theme.typography.color.main;
226
- }};
227
- }
228
-
229
- .form-controls {
230
- width: 100%;
231
- flex-direction: ${(props) => (props.layout === 'vertical' ? 'column' : 'row')};
232
- justify-content: space-between;
233
- align-items: center;
234
-
235
- .input {
236
- width: ${(props) => getInputWidth(props)};
237
- height: 50px;
238
- border: none;
239
- border-bottom: 1px solid
240
- ${(props) => {
241
- return props.theme.typography.color.main;
242
- }};
243
- font-size: 16px;
244
- letter-spacing: 1.8px;
245
- outline: none;
246
- margin: ${(props) => (props.layout === 'vertical' ? '12px 0' : '12px')};
247
- background: transparent;
248
-
249
- &:first-of-type {
250
- margin-top: 40px;
251
- }
252
- }
253
-
254
- .subscribe-btn-empty {
255
- margin-top: ${(props) => (props.layout === 'vertical' ? '40px' : '0')};
256
- width: ${(props) => (props.layout === 'vertical' ? '100%' : 'auto')};
257
- }
258
- }
259
-
260
- .error,
261
- .success {
262
- margin-top: 20px;
263
- }
264
- `;
@@ -1,33 +0,0 @@
1
- import { Box } from '@mui/material';
2
- import { ThemeModeToggle } from '../Config';
3
- import { ThemeProvider } from '../Theme';
4
-
5
- export { default as Basic } from './demo/basic';
6
- export { default as CustomButtonText } from './demo/custom-button-text';
7
- export { default as CustomStyles } from './demo/custom-styles';
8
- export { default as I18N } from './demo/i18n';
9
-
10
- export default {
11
- title: 'Basic/CookieConsent',
12
-
13
- parameters: {
14
- docs: {
15
- description: {
16
- component: 'CookieConsent is used to alert users about the use of cookies on your website.',
17
- },
18
- inlineStories: false,
19
- iframeHeight: 400,
20
- },
21
- },
22
-
23
- decorators: [
24
- (Story) => (
25
- <ThemeProvider prefer="system">
26
- <Box sx={{ mb: 1 }}>
27
- <ThemeModeToggle />
28
- </Box>
29
- <Story />
30
- </ThemeProvider>
31
- ),
32
- ],
33
- };
@@ -1,104 +0,0 @@
1
- import { Button, type ButtonProps } from '@mui/material';
2
- import CookieConsent, { resetCookieConsentValue } from 'react-cookie-consent';
3
-
4
- import { styled } from '../Theme';
5
- import type { Locale, Translations } from '../type';
6
-
7
- export { resetCookieConsentValue };
8
-
9
- const translations: Translations = {
10
- en: {
11
- content:
12
- 'We use cookies and other tracking technologies to improve your browsing experience on our website, to show you personalized content, to analyze our website traffic, and to understand where our visitors are coming from.',
13
- agree: 'I Understand',
14
- },
15
- zh: {
16
- content:
17
- '我们使用 cookies 和其他跟踪技术来改善您在我们网站上的浏览体验,向您展示个性化的内容,分析我们的网站流量,并了解我们的访问者来自哪里。',
18
- agree: '我知道了',
19
- },
20
- };
21
-
22
- function inIframe() {
23
- try {
24
- return window.self !== window.top;
25
- } catch (e) {
26
- return true;
27
- }
28
- }
29
-
30
- function AcceptButton(props: ButtonProps) {
31
- return <Button variant="contained" {...props} />;
32
- }
33
-
34
- export interface CookieConsentProps extends React.ComponentProps<typeof CookieConsent> {
35
- locale?: Locale;
36
- displayInIframe?: false | true;
37
- }
38
-
39
- /**
40
- * DefaultCookieConsent, 对 react-cookie-consent package 封装, 以便 arcblock 内部产品可以快速使用
41
- * - 默认内容
42
- * - 默认配置/样式
43
- */
44
- export default function DefaultCookieConsent({
45
- children,
46
- locale = 'en',
47
- style = {},
48
- displayInIframe = false,
49
- ...rest
50
- }: CookieConsentProps) {
51
- if (!displayInIframe && inIframe()) {
52
- return null;
53
- }
54
- if (locale && !translations[locale]) {
55
- // eslint-disable-next-line no-param-reassign
56
- locale = 'en';
57
- }
58
- return (
59
- <Wrapper style={style}>
60
- <CookieConsent
61
- disableStyles
62
- disableButtonStyles
63
- ButtonComponent={AcceptButton}
64
- buttonText={translations[locale].agree}
65
- buttonStyle={{ marginTop: 16, padding: '6px 16px' }}
66
- {...rest}>
67
- {children || <p style={{ margin: 0 }}>{translations[locale].content}</p>}
68
- </CookieConsent>
69
- </Wrapper>
70
- );
71
- }
72
-
73
- const Wrapper = styled('div')`
74
- box-sizing: border-box;
75
- position: fixed;
76
- right: 20px;
77
- bottom: 20px;
78
- z-index: 999;
79
- max-width: 440px;
80
- padding: 16px 24px;
81
- font-size: 16px;
82
- color: ${({ theme }) => theme.palette.grey[500]};
83
- background: ${({ theme }) => theme.palette.background.paper};
84
- border: 1px solid ${({ theme }) => theme.palette.divider};
85
- border-radius: ${({ theme }) => theme.shape.borderRadius}px;
86
- box-shadow: ${({ theme }) => theme.shadows[4]};
87
- &:empty {
88
- display: none;
89
- }
90
- button {
91
- min-width: 200px;
92
- }
93
-
94
- @media screen and (max-width: 480px) {
95
- left: 16px;
96
- right: 16px;
97
- bottom: 16px;
98
- width: auto;
99
- button {
100
- display: block;
101
- width: 100%;
102
- }
103
- }
104
- `;
@@ -1,15 +0,0 @@
1
- export { default as LightMode } from './demo/light-mode';
2
- export { default as DarkMode } from './demo/dark-mode';
3
- export { default as CustomStyle } from './demo/custom-style';
4
-
5
- export default {
6
- title: 'Basic/CountDown',
7
-
8
- parameters: {
9
- docs: {
10
- description: {
11
- component: 'CountDown is used to display a countdown clock on your page',
12
- },
13
- },
14
- },
15
- };