@arcblock/ux 2.10.66 → 2.10.68

Sign up to get free protection for your applications and to get access to all the features.
Files changed (294) hide show
  1. package/lib/Address/did-address.d.ts +6 -5
  2. package/lib/Address/index.d.ts +1 -1
  3. package/lib/Avatar/index.d.ts +10 -8
  4. package/lib/Avatar/index.js +6 -4
  5. package/lib/Blocklet/blocklet.d.ts +4 -4
  6. package/lib/Blocklet/blocklet.js +2 -2
  7. package/lib/BlockletContext/index.d.ts +3 -3
  8. package/lib/BlockletNFT/index.d.ts +6 -6
  9. package/lib/BlockletNFT/index.js +3 -3
  10. package/lib/BlockletV2/blocklet.d.ts +2 -2
  11. package/lib/Button/wrap.d.ts +4 -4
  12. package/lib/Button/wrap.js +2 -2
  13. package/lib/CardSelector/index.js +0 -1
  14. package/lib/Center/index.d.ts +1 -1
  15. package/lib/ClickToCopy/copy-button.d.ts +5 -4
  16. package/lib/ClickToCopy/copy-button.js +0 -1
  17. package/lib/ClickToCopy/hook.d.ts +3 -8
  18. package/lib/ClickToCopy/index.d.ts +6 -4
  19. package/lib/CodeBlock/index.d.ts +3 -1
  20. package/lib/CookieConsent/index.d.ts +8 -29
  21. package/lib/CookieConsent/index.js +3 -17
  22. package/lib/CountDown/index.d.ts +21 -25
  23. package/lib/CountDown/index.js +12 -11
  24. package/lib/DID/index.d.ts +9 -8
  25. package/lib/Datatable/index.d.ts +5 -5
  26. package/lib/Datatable/index.js +5 -5
  27. package/lib/Dialog/confirm.d.ts +6 -6
  28. package/lib/Dialog/confirm.js +3 -3
  29. package/lib/Dialog/types.d.ts +1 -1
  30. package/lib/DidLogo/index.d.ts +5 -25
  31. package/lib/DidLogo/index.js +4 -15
  32. package/lib/DriftBot/index.d.ts +13 -19
  33. package/lib/DriftBot/index.js +5 -6
  34. package/lib/Earth/index.d.ts +28 -10
  35. package/lib/Earth/index.js +12 -52
  36. package/lib/Earth/util.d.ts +10 -5
  37. package/lib/Earth/util.js +1 -0
  38. package/lib/ErrorBoundary/fallback.d.ts +12 -19
  39. package/lib/ErrorBoundary/fallback.js +2 -19
  40. package/lib/ErrorBoundary/index.d.ts +1 -1
  41. package/lib/Footer/index.d.ts +17 -24
  42. package/lib/Footer/index.js +2 -11
  43. package/lib/Header/header.d.ts +2 -2
  44. package/lib/Icon/image.d.ts +3 -2
  45. package/lib/Icon/index.d.ts +6 -4
  46. package/lib/Img/index.d.ts +1 -1
  47. package/lib/Img/index.js +1 -1
  48. package/lib/InfoRow/index.d.ts +9 -32
  49. package/lib/InfoRow/index.js +10 -23
  50. package/lib/Layout/dashboard/external-link.d.ts +13 -14
  51. package/lib/Layout/dashboard/external-link.js +5 -22
  52. package/lib/Layout/dashboard/full-page.d.ts +19 -11
  53. package/lib/Layout/dashboard/full-page.js +2 -6
  54. package/lib/Layout/dashboard/index.d.ts +20 -39
  55. package/lib/Layout/dashboard/index.js +10 -38
  56. package/lib/Layout/dashboard/sidebar.d.ts +17 -20
  57. package/lib/Layout/dashboard/sidebar.js +3 -16
  58. package/lib/Layout/dashboard-legacy/header.d.ts +10 -36
  59. package/lib/Layout/dashboard-legacy/header.js +5 -24
  60. package/lib/Layout/dashboard-legacy/index.d.ts +17 -56
  61. package/lib/Layout/dashboard-legacy/index.js +12 -41
  62. package/lib/Layout/dashboard-legacy/sidebar.d.ts +15 -26
  63. package/lib/Layout/dashboard-legacy/sidebar.js +5 -15
  64. package/lib/Layout/index.d.ts +17 -56
  65. package/lib/Layout/index.js +24 -50
  66. package/lib/LoadingMask/index.d.ts +8 -31
  67. package/lib/LoadingMask/index.js +2 -18
  68. package/lib/Locale/browser-lang.d.ts +4 -1
  69. package/lib/Locale/browser-lang.js +8 -3
  70. package/lib/Locale/context.d.ts +18 -8
  71. package/lib/Locale/context.js +1 -1
  72. package/lib/Locale/languages.d.ts +9 -55
  73. package/lib/Locale/selector.d.ts +10 -26
  74. package/lib/Locale/selector.js +8 -25
  75. package/lib/Locale/util.d.ts +4 -3
  76. package/lib/Locale/util.js +0 -1
  77. package/lib/Logo/index.d.ts +9 -40
  78. package/lib/Logo/index.js +88 -46
  79. package/lib/Metric/index.d.ts +9 -31
  80. package/lib/Metric/index.js +5 -20
  81. package/lib/NFTDisplay/aspect-ratio-container.d.ts +5 -12
  82. package/lib/NFTDisplay/aspect-ratio-container.js +0 -5
  83. package/lib/NFTDisplay/broken.d.ts +3 -13
  84. package/lib/NFTDisplay/broken.js +80 -10
  85. package/lib/NFTDisplay/displayApi.d.ts +1 -1
  86. package/lib/NFTDisplay/index.d.ts +28 -6
  87. package/lib/NFTDisplay/index.js +17 -51
  88. package/lib/NFTDisplay/svg-embedder/img.d.ts +8 -23
  89. package/lib/NFTDisplay/svg-embedder/img.js +3 -17
  90. package/lib/NFTDisplay/svg-embedder/inline-svg.d.ts +7 -13
  91. package/lib/NFTDisplay/svg-embedder/inline-svg.js +1 -8
  92. package/lib/NavMenu/nav-menu.d.ts +2 -0
  93. package/lib/NavMenu/nav-menu.js +0 -1
  94. package/lib/PageScroller/index.d.ts +14 -13
  95. package/lib/PageScroller/index.js +12 -37
  96. package/lib/PageScroller/usePrevValue.d.ts +1 -1
  97. package/lib/PageScroller/usePrevValue.js +1 -2
  98. package/lib/Passport/index.d.ts +1 -1
  99. package/lib/Passport/passport.d.ts +10 -30
  100. package/lib/Passport/passport.js +5 -19
  101. package/lib/PoweredByArcBlock/index.d.ts +4 -14
  102. package/lib/PoweredByArcBlock/index.js +1 -8
  103. package/lib/PricingTable/PricingPlan.d.ts +11 -9
  104. package/lib/PricingTable/PricingPlan.js +0 -4
  105. package/lib/PricingTable/index.d.ts +5 -3
  106. package/lib/PricingTable/index.js +1 -5
  107. package/lib/QRCode/index.d.ts +11 -22
  108. package/lib/QRCode/index.js +1 -15
  109. package/lib/RelativeTime/index.d.ts +12 -40
  110. package/lib/RelativeTime/index.js +7 -27
  111. package/lib/Result/common.d.ts +26 -45
  112. package/lib/Result/common.js +2 -4
  113. package/lib/Result/index.d.ts +5 -18
  114. package/lib/Result/index.js +1 -9
  115. package/lib/Result/result.d.ts +7 -29
  116. package/lib/Result/result.js +2 -17
  117. package/lib/Result/translations.d.ts +2 -54
  118. package/lib/Screenshot/BaseScreenshot/index.d.ts +7 -24
  119. package/lib/Screenshot/BaseScreenshot/index.js +2 -15
  120. package/lib/Screenshot/BaseScreenshot/shells/Macbook.d.ts +25 -19
  121. package/lib/Screenshot/BaseScreenshot/shells/Phone.d.ts +25 -19
  122. package/lib/Screenshot/index.d.ts +84 -28
  123. package/lib/Screenshot/index.js +14 -43
  124. package/lib/SessionBlocklet/index.d.ts +6 -19
  125. package/lib/SessionBlocklet/index.js +3 -14
  126. package/lib/SessionManager/index.d.ts +1 -1
  127. package/lib/SessionPermission/index.d.ts +9 -17
  128. package/lib/SessionPermission/index.js +3 -11
  129. package/lib/SessionUser/components/logged-in.d.ts +9 -31
  130. package/lib/SessionUser/components/logged-in.js +13 -29
  131. package/lib/SessionUser/components/session-user-item.d.ts +8 -1
  132. package/lib/SessionUser/components/session-user-item.js +2 -12
  133. package/lib/SessionUser/components/session-user-switch.d.ts +9 -21
  134. package/lib/SessionUser/components/session-user-switch.js +3 -15
  135. package/lib/SessionUser/components/un-login.d.ts +7 -23
  136. package/lib/SessionUser/components/un-login.js +4 -16
  137. package/lib/SessionUser/components/user-info.d.ts +12 -29
  138. package/lib/SessionUser/components/user-info.js +4 -19
  139. package/lib/SessionUser/index.d.ts +7 -30
  140. package/lib/SessionUser/index.js +5 -26
  141. package/lib/SessionUser/libs/translation.d.ts +2 -31
  142. package/lib/SessionUser/libs/translation.js +1 -0
  143. package/lib/SessionUser/libs/utils.d.ts +10 -9
  144. package/lib/Sparkline/index.d.ts +22 -1
  145. package/lib/Sparkline/index.js +25 -17
  146. package/lib/Spinner/index.d.ts +6 -1
  147. package/lib/Spinner/index.js +4 -11
  148. package/lib/Success/index.d.ts +5 -21
  149. package/lib/Success/index.js +4 -16
  150. package/lib/Tabs/index.d.ts +12 -26
  151. package/lib/Tabs/index.js +7 -37
  152. package/lib/TextCollapse/index.d.ts +10 -10
  153. package/lib/TextCollapse/index.js +4 -21
  154. package/lib/Theme/index.js +0 -2
  155. package/lib/Theme/theme-provider.d.ts +1 -1
  156. package/lib/Theme/theme.d.ts +4 -1
  157. package/lib/Theme/theme.js +1 -2
  158. package/lib/Typography/index.d.ts +5 -24
  159. package/lib/Typography/index.js +5 -17
  160. package/lib/Util/index.d.ts +11 -6
  161. package/lib/Util/index.js +6 -0
  162. package/lib/Video/index.d.ts +12 -16
  163. package/lib/Video/index.js +0 -14
  164. package/lib/Wallet/Action.d.ts +13 -18
  165. package/lib/Wallet/Action.js +0 -7
  166. package/lib/Wallet/Download.d.ts +24 -30
  167. package/lib/Wallet/Download.js +201 -18
  168. package/lib/Wallet/Open.d.ts +5 -15
  169. package/lib/Wallet/Open.js +5 -11
  170. package/lib/WalletOSIcon/index.d.ts +6 -25
  171. package/lib/WalletOSIcon/index.js +3 -16
  172. package/lib/WebWalletSWKeeper/index.d.ts +8 -20
  173. package/lib/WebWalletSWKeeper/index.js +14 -19
  174. package/lib/WechatPrompt/index.js +2 -0
  175. package/lib/global.d.ts +15 -0
  176. package/lib/type.d.ts +12 -3
  177. package/lib/withTheme/index.d.ts +8 -6
  178. package/lib/withTracker/index.d.ts +1 -1
  179. package/lib/withTracker/index.js +3 -0
  180. package/package.json +9 -5
  181. package/src/Address/did-address.tsx +7 -6
  182. package/src/Address/index.tsx +1 -1
  183. package/src/Avatar/index.jsx +6 -4
  184. package/src/Blocklet/blocklet.jsx +2 -2
  185. package/src/BlockletContext/index.tsx +3 -3
  186. package/src/BlockletNFT/index.jsx +3 -3
  187. package/src/BlockletV2/blocklet.tsx +2 -2
  188. package/src/Button/wrap.jsx +2 -2
  189. package/src/CardSelector/index.tsx +0 -1
  190. package/src/Center/index.tsx +1 -1
  191. package/src/ClickToCopy/copy-button.tsx +4 -4
  192. package/src/ClickToCopy/hook.ts +3 -2
  193. package/src/ClickToCopy/index.tsx +6 -5
  194. package/src/CodeBlock/index.tsx +3 -1
  195. package/src/CookieConsent/{index.jsx → index.tsx} +16 -19
  196. package/src/CountDown/{index.jsx → index.tsx} +30 -16
  197. package/src/DID/index.tsx +9 -8
  198. package/src/Datatable/index.jsx +5 -5
  199. package/src/Dialog/confirm.jsx +3 -3
  200. package/src/Dialog/types.d.ts +1 -1
  201. package/src/DidLogo/{index.jsx → index.tsx} +7 -14
  202. package/src/DriftBot/{index.jsx → index.tsx} +13 -11
  203. package/src/Earth/{index.jsx → index.tsx} +94 -66
  204. package/src/Earth/{util.js → util.ts} +20 -17
  205. package/src/ErrorBoundary/{fallback.jsx → fallback.tsx} +20 -21
  206. package/src/Footer/{index.jsx → index.tsx} +17 -14
  207. package/src/Header/header.tsx +2 -3
  208. package/src/Header/responsive-header.tsx +0 -1
  209. package/src/Icon/image.tsx +3 -3
  210. package/src/Icon/index.tsx +7 -4
  211. package/src/Img/index.jsx +1 -1
  212. package/src/InfoRow/{index.jsx → index.tsx} +32 -25
  213. package/src/Layout/dashboard/external-link.tsx +46 -0
  214. package/src/Layout/dashboard/{full-page.jsx → full-page.tsx} +20 -9
  215. package/src/Layout/dashboard/{index.jsx → index.tsx} +42 -44
  216. package/src/Layout/dashboard/{sidebar.jsx → sidebar.tsx} +23 -20
  217. package/src/Layout/dashboard-legacy/{header.jsx → header.tsx} +16 -26
  218. package/src/Layout/dashboard-legacy/{index.jsx → index.tsx} +32 -46
  219. package/src/Layout/dashboard-legacy/{sidebar.jsx → sidebar.tsx} +27 -19
  220. package/src/Layout/{index.jsx → index.tsx} +41 -47
  221. package/src/LoadingMask/{index.jsx → index.tsx} +17 -19
  222. package/src/Locale/{browser-lang.js → browser-lang.ts} +9 -7
  223. package/src/Locale/context.tsx +18 -11
  224. package/src/Locale/{languages.js → languages.ts} +1 -1
  225. package/src/Locale/{selector.jsx → selector.tsx} +32 -29
  226. package/src/Locale/{util.js → util.ts} +9 -2
  227. package/src/Logo/index.tsx +58 -0
  228. package/src/Metric/{index.jsx → index.tsx} +23 -18
  229. package/src/NFTDisplay/{aspect-ratio-container.jsx → aspect-ratio-container.tsx} +9 -7
  230. package/src/NFTDisplay/{broken.jsx → broken.tsx} +7 -12
  231. package/src/NFTDisplay/{displayApi.js → displayApi.ts} +4 -4
  232. package/src/NFTDisplay/{index.jsx → index.tsx} +59 -64
  233. package/src/NFTDisplay/svg-embedder/{img.jsx → img.tsx} +10 -18
  234. package/src/NFTDisplay/svg-embedder/{inline-svg.jsx → inline-svg.tsx} +8 -9
  235. package/src/NavMenu/nav-menu.tsx +2 -3
  236. package/src/PageScroller/{index.jsx → index.tsx} +40 -53
  237. package/src/PageScroller/{usePrevValue.js → usePrevValue.ts} +2 -3
  238. package/src/Passport/{passport.jsx → passport.tsx} +22 -19
  239. package/src/PoweredByArcBlock/{index.jsx → index.tsx} +6 -11
  240. package/src/PricingTable/{PricingPlan.jsx → PricingPlan.tsx} +15 -5
  241. package/src/PricingTable/{index.jsx → index.tsx} +9 -6
  242. package/src/QRCode/{index.jsx → index.tsx} +13 -17
  243. package/src/RelativeTime/{index.jsx → index.tsx} +24 -24
  244. package/src/Result/{common.jsx → common.tsx} +17 -13
  245. package/src/Result/index.tsx +30 -0
  246. package/src/Result/{result.jsx → result.tsx} +8 -17
  247. package/src/Result/{translations.js → translations.ts} +3 -1
  248. package/src/Screenshot/BaseScreenshot/{index.jsx → index.tsx} +9 -15
  249. package/src/Screenshot/BaseScreenshot/shells/{Macbook.jsx → Macbook.tsx} +3 -1
  250. package/src/Screenshot/BaseScreenshot/shells/{Phone.jsx → Phone.tsx} +3 -1
  251. package/src/Screenshot/{index.jsx → index.tsx} +60 -54
  252. package/src/SessionBlocklet/{index.jsx → index.tsx} +8 -14
  253. package/src/SessionPermission/index.tsx +25 -0
  254. package/src/SessionUser/components/{logged-in.jsx → logged-in.tsx} +49 -31
  255. package/src/SessionUser/components/session-user-item.tsx +97 -0
  256. package/src/SessionUser/components/{session-user-switch.jsx → session-user-switch.tsx} +16 -21
  257. package/src/SessionUser/components/{un-login.jsx → un-login.tsx} +10 -15
  258. package/src/SessionUser/components/{user-info.jsx → user-info.tsx} +16 -22
  259. package/src/SessionUser/index.tsx +26 -0
  260. package/src/SessionUser/libs/{translation.js → translation.ts} +3 -1
  261. package/src/SessionUser/libs/utils.ts +39 -0
  262. package/src/Sparkline/{index.jsx → index.tsx} +38 -22
  263. package/src/Spinner/index.tsx +20 -0
  264. package/src/Success/{index.jsx → index.tsx} +7 -13
  265. package/src/Tabs/{index.jsx → index.tsx} +26 -40
  266. package/src/TextCollapse/{index.jsx → index.tsx} +26 -21
  267. package/src/Theme/index.ts +0 -1
  268. package/src/Theme/theme-provider.tsx +1 -1
  269. package/src/Theme/theme.ts +6 -3
  270. package/src/Typography/{index.jsx → index.tsx} +19 -22
  271. package/src/Util/index.ts +14 -8
  272. package/src/Video/{index.jsx → index.tsx} +7 -10
  273. package/src/Wallet/{Action.jsx → Action.tsx} +16 -12
  274. package/src/Wallet/{Download.jsx → Download.tsx} +25 -21
  275. package/src/Wallet/{Open.jsx → Open.tsx} +8 -11
  276. package/src/WalletOSIcon/{index.jsx → index.tsx} +8 -16
  277. package/src/WebWalletSWKeeper/{index.jsx → index.tsx} +21 -24
  278. package/src/WechatPrompt/{index.jsx → index.tsx} +1 -0
  279. package/src/global.d.ts +15 -0
  280. package/src/type.d.ts +12 -3
  281. package/src/withTheme/{index.jsx → index.tsx} +12 -2
  282. package/src/withTracker/{index.jsx → index.tsx} +6 -4
  283. package/src/Layout/dashboard/external-link.jsx +0 -47
  284. package/src/Logo/index.jsx +0 -66
  285. package/src/Result/index.jsx +0 -33
  286. package/src/SessionPermission/index.jsx +0 -28
  287. package/src/SessionUser/components/session-user-item.jsx +0 -93
  288. package/src/SessionUser/index.jsx +0 -38
  289. package/src/SessionUser/libs/utils.js +0 -37
  290. package/src/Spinner/index.jsx +0 -21
  291. /package/src/ErrorBoundary/{index.jsx → index.ts} +0 -0
  292. /package/src/NFTDisplay/{loading.jsx → loading.tsx} +0 -0
  293. /package/src/Passport/{index.jsx → index.ts} +0 -0
  294. /package/src/SessionManager/{index.jsx → index.tsx} +0 -0
@@ -1,6 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { memo } from 'react';
3
- import PropTypes from 'prop-types';
4
3
  import { Link, useLocation } from 'react-router-dom';
5
4
  import Button from '@mui/material/Button';
6
5
  import Typography from '@mui/material/Typography';
@@ -8,17 +7,20 @@ import { teal } from '@mui/material/colors';
8
7
  import ImageIcon from '../../Icon/image';
9
8
  import Logo from '../../Logo';
10
9
  import { styled, useTheme } from '../../Theme';
10
+
11
+ // const a: LinkItem = {};
12
+
11
13
  export default function Sidebar({
12
14
  images,
13
15
  links,
14
- prefix,
16
+ prefix = '/images',
15
17
  addons,
16
18
  logo,
17
19
  ...rest
18
20
  }) {
19
21
  const theme = useTheme();
20
22
  const location = useLocation();
21
- const isSelected = (url, name) => {
23
+ const isSelected = (_, name) => {
22
24
  const pattern = new RegExp(`/${name}`);
23
25
  return pattern.test(location.pathname);
24
26
  };
@@ -61,18 +63,6 @@ export default function Sidebar({
61
63
  }), addons]
62
64
  });
63
65
  }
64
- Sidebar.propTypes = {
65
- images: PropTypes.object.isRequired,
66
- links: PropTypes.array.isRequired,
67
- prefix: PropTypes.string,
68
- addons: PropTypes.any,
69
- logo: PropTypes.any
70
- };
71
- Sidebar.defaultProps = {
72
- prefix: '/images',
73
- addons: null,
74
- logo: null
75
- };
76
66
  const MenuItems = /*#__PURE__*/memo(styled('div')`
77
67
  flex: 1;
78
68
  display: flex;
@@ -1,57 +1,18 @@
1
- declare function Layout({ title, brand, description, links, logo, showLogo, addons, footer, baseUrl, homeUrl, children, variant, contentOnly, ...rest }: {
2
- [x: string]: any;
3
- title: any;
4
- brand: any;
5
- description: any;
6
- links: any;
7
- logo: any;
8
- showLogo: any;
9
- addons: any;
10
- footer: any;
11
- baseUrl: any;
12
- homeUrl: any;
13
- children: any;
14
- variant: any;
15
- contentOnly: any;
16
- }): import("react/jsx-runtime").JSX.Element;
17
- declare namespace Layout {
18
- namespace propTypes {
19
- let title: PropTypes.Validator<string>;
20
- let brand: PropTypes.Validator<any>;
21
- let description: PropTypes.Requireable<any>;
22
- let addons: PropTypes.Requireable<any>;
23
- let showLogo: PropTypes.Requireable<boolean>;
24
- let logo: PropTypes.Requireable<any>;
25
- let links: PropTypes.Requireable<any[]>;
26
- let children: PropTypes.Validator<any>;
27
- let baseUrl: PropTypes.Requireable<string>;
28
- let homeUrl: PropTypes.Requireable<string>;
29
- let variant: PropTypes.Requireable<string>;
30
- let footer: PropTypes.Requireable<any>;
31
- let contentOnly: PropTypes.Requireable<boolean>;
32
- }
33
- namespace defaultProps {
34
- let contentOnly_1: boolean;
35
- export { contentOnly_1 as contentOnly };
36
- let baseUrl_1: string;
37
- export { baseUrl_1 as baseUrl };
38
- let homeUrl_1: string;
39
- export { homeUrl_1 as homeUrl };
40
- let links_1: never[];
41
- export { links_1 as links };
42
- let showLogo_1: boolean;
43
- export { showLogo_1 as showLogo };
44
- let logo_1: import("react/jsx-runtime").JSX.Element;
45
- export { logo_1 as logo };
46
- let variant_1: string;
47
- export { variant_1 as variant };
48
- let addons_1: undefined;
49
- export { addons_1 as addons };
50
- let description_1: undefined;
51
- export { description_1 as description };
52
- let footer_1: import("react/jsx-runtime").JSX.Element;
53
- export { footer_1 as footer };
54
- }
1
+ import { type SxProps } from '@mui/material';
2
+ import { type LinkItem } from './dashboard/sidebar';
3
+ export interface LayoutProps extends React.HTMLAttributes<HTMLDivElement> {
4
+ title: string;
5
+ brand: React.ReactNode;
6
+ description?: React.ReactNode;
7
+ links?: LinkItem[];
8
+ logo?: React.ReactNode;
9
+ showLogo?: false | true;
10
+ addons?: React.ReactNode;
11
+ footer?: React.ReactNode;
12
+ baseUrl?: string;
13
+ homeUrl?: string;
14
+ variant?: 'shadow' | 'border';
15
+ contentOnly?: false | true;
16
+ sx?: SxProps;
55
17
  }
56
- export default Layout;
57
- import PropTypes from 'prop-types';
18
+ export default function Layout({ title, brand, description, links, logo, showLogo, addons, footer, baseUrl, homeUrl, variant, contentOnly, children, ...rest }: LayoutProps): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { useEffect, useState } from 'react';
3
- import PropTypes from 'prop-types';
4
3
  import Helmet from 'react-helmet';
5
4
  import { AppBar, Container, Drawer, Divider, IconButton, Link, List, ListItem, ListItemText, Toolbar, Typography } from '@mui/material';
6
5
  import MenuIcon from '@mui/icons-material/Menu';
@@ -13,16 +12,24 @@ export default function Layout({
13
12
  title,
14
13
  brand,
15
14
  description,
16
- links,
17
- logo,
18
- showLogo,
15
+ links = [],
16
+ logo = /*#__PURE__*/_jsx(Logo, {
17
+ showText: false,
18
+ style: {
19
+ width: '40px',
20
+ height: '40px'
21
+ }
22
+ }),
23
+ showLogo = false,
19
24
  addons,
20
- footer,
21
- baseUrl,
22
- homeUrl,
25
+ footer = /*#__PURE__*/_jsx(Container, {
26
+ children: /*#__PURE__*/_jsx(Footer, {})
27
+ }),
28
+ baseUrl = '',
29
+ homeUrl = '/',
30
+ variant = 'shadow',
31
+ contentOnly = false,
23
32
  children,
24
- variant,
25
- contentOnly,
26
33
  ...rest
27
34
  }) {
28
35
  const [drawerOpen, setDrawerOpen] = useState(false);
@@ -33,8 +40,9 @@ export default function Layout({
33
40
  const {
34
41
  searchParams
35
42
  } = new URL(window.location.href);
36
- if (searchParams.get('inviter')) {
37
- window.localStorage.setItem('inviter', searchParams.get('inviter'));
43
+ const inviter = searchParams.get('inviter');
44
+ if (inviter) {
45
+ window.localStorage.setItem('inviter', inviter);
38
46
  }
39
47
  }, []);
40
48
  if (contentOnly) {
@@ -43,6 +51,7 @@ export default function Layout({
43
51
  });
44
52
  }
45
53
  let activeLink = '';
54
+ // @ts-expect-error
46
55
  const {
47
56
  pathname: currentPath
48
57
  } = new URL(window.location);
@@ -74,14 +83,14 @@ export default function Layout({
74
83
  button: true,
75
84
  className: activeLink === x.url ? 'drawer-highlight-nav' : '',
76
85
  children: /*#__PURE__*/_jsxs(ListItemText, {
77
- children: [x.icon && /*#__PURE__*/_jsx(Icon, {
86
+ children: [typeof x.icon === 'string' ? /*#__PURE__*/_jsx(Icon, {
78
87
  name: x.icon,
79
88
  size: 18 * (x.iconZoom || 1),
80
89
  color: "inherit",
81
90
  style: {
82
91
  marginRight: '5px'
83
92
  }
84
- }), x.title]
93
+ }) : x.icon, x.title]
85
94
  })
86
95
  })
87
96
  }, x.url))
@@ -141,14 +150,14 @@ export default function Layout({
141
150
  className: `nav-link ${activeLink === x.url ? 'highlight-nav' : ''}`,
142
151
  color: x.color,
143
152
  underline: "hover",
144
- children: [x.icon && /*#__PURE__*/_jsx(Icon, {
153
+ children: [typeof x.icon === 'string' ? /*#__PURE__*/_jsx(Icon, {
145
154
  name: x.icon,
146
155
  size: 20 * (x.iconZoom || 1),
147
156
  color: "inherit",
148
157
  style: {
149
158
  marginRight: '5px'
150
159
  }
151
- }), x.title]
160
+ }) : x.icon, x.title]
152
161
  }, x.url))
153
162
  }), addons]
154
163
  })
@@ -183,41 +192,6 @@ export default function Layout({
183
192
  })]
184
193
  });
185
194
  }
186
- Layout.propTypes = {
187
- title: PropTypes.string.isRequired,
188
- brand: PropTypes.any.isRequired,
189
- description: PropTypes.any,
190
- addons: PropTypes.any,
191
- showLogo: PropTypes.bool,
192
- logo: PropTypes.any,
193
- links: PropTypes.array,
194
- children: PropTypes.any.isRequired,
195
- baseUrl: PropTypes.string,
196
- homeUrl: PropTypes.string,
197
- variant: PropTypes.oneOf(['shadow', 'border']),
198
- footer: PropTypes.any,
199
- contentOnly: PropTypes.bool
200
- };
201
- Layout.defaultProps = {
202
- contentOnly: false,
203
- baseUrl: '',
204
- homeUrl: '/',
205
- links: [],
206
- showLogo: false,
207
- logo: /*#__PURE__*/_jsx(Logo, {
208
- showText: false,
209
- style: {
210
- width: '40px',
211
- height: '40px'
212
- }
213
- }),
214
- variant: 'shadow',
215
- addons: undefined,
216
- description: undefined,
217
- footer: /*#__PURE__*/_jsx(Container, {
218
- children: /*#__PURE__*/_jsx(Footer, {})
219
- })
220
- };
221
195
  const Div = styled('div')`
222
196
  width: 100%;
223
197
  min-height: 100vh;
@@ -1,32 +1,9 @@
1
- declare function LoadingMask({ size, padding, borderWidth, borderRadius, duration, children }: {
2
- size: any;
3
- padding: any;
4
- borderWidth: any;
5
- borderRadius: any;
6
- duration: any;
7
- children: any;
8
- }): import("react/jsx-runtime").JSX.Element;
9
- declare namespace LoadingMask {
10
- namespace propTypes {
11
- let size: PropTypes.Requireable<number>;
12
- let padding: PropTypes.Requireable<number>;
13
- let borderRadius: PropTypes.Requireable<number>;
14
- let borderWidth: PropTypes.Requireable<number>;
15
- let duration: PropTypes.Requireable<number>;
16
- let children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
17
- }
18
- namespace defaultProps {
19
- let size_1: number;
20
- export { size_1 as size };
21
- let padding_1: undefined;
22
- export { padding_1 as padding };
23
- let borderWidth_1: undefined;
24
- export { borderWidth_1 as borderWidth };
25
- let duration_1: undefined;
26
- export { duration_1 as duration };
27
- let borderRadius_1: undefined;
28
- export { borderRadius_1 as borderRadius };
29
- }
1
+ export interface LoadingMaskProps {
2
+ size?: number;
3
+ padding?: number;
4
+ borderWidth?: number;
5
+ borderRadius?: number;
6
+ duration?: number;
7
+ children?: React.ReactNode;
30
8
  }
31
- export default LoadingMask;
32
- import PropTypes from 'prop-types';
9
+ export default function LoadingMask({ size, padding, borderWidth, borderRadius, duration, children, }: LoadingMaskProps): import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import PropTypes from 'prop-types';
3
2
  import { Box } from '@mui/material';
4
3
  import { temp as colors } from '../Colors';
5
4
  export default function LoadingMask({
6
- size,
5
+ size = 64,
7
6
  padding,
8
7
  borderWidth,
9
8
  borderRadius,
@@ -83,19 +82,4 @@ export default function LoadingMask({
83
82
  children: children
84
83
  })]
85
84
  });
86
- }
87
- LoadingMask.propTypes = {
88
- size: PropTypes.number,
89
- padding: PropTypes.number,
90
- borderRadius: PropTypes.number,
91
- borderWidth: PropTypes.number,
92
- duration: PropTypes.number,
93
- children: PropTypes.node.isRequired
94
- };
95
- LoadingMask.defaultProps = {
96
- size: 64,
97
- padding: undefined,
98
- borderWidth: undefined,
99
- duration: undefined,
100
- borderRadius: undefined
101
- };
85
+ }
@@ -1,2 +1,5 @@
1
+ declare function getPreferredLanguage(options?: {
2
+ languages?: string[];
3
+ fallback: string;
4
+ }): string | null;
1
5
  export default getPreferredLanguage;
2
- declare function getPreferredLanguage(options: any): any;
@@ -1,9 +1,8 @@
1
1
  /* eslint-disable no-param-reassign */
2
- function startsWith(string, target, position) {
2
+ function startsWith(string, target, position = 0) {
3
3
  const {
4
4
  length
5
5
  } = string;
6
- position = position == null ? 0 : position;
7
6
  if (position < 0) {
8
7
  position = 0;
9
8
  } else if (position > length) {
@@ -17,7 +16,13 @@ function getBrowserLang() {
17
16
  if (typeof window === 'undefined') {
18
17
  return null;
19
18
  }
20
- const lang = window.navigator.languages && window.navigator.languages[0] || window.navigator.language || window.navigator.browserLanguage || window.navigator.userLanguage || window.navigator.systemLanguage || null;
19
+ const lang = window.navigator.languages && window.navigator.languages[0] || window.navigator.language ||
20
+ // @ts-expect-error
21
+ window.navigator.browserLanguage ||
22
+ // @ts-expect-error
23
+ window.navigator.userLanguage ||
24
+ // @ts-expect-error
25
+ window.navigator.systemLanguage || null;
21
26
  return lang;
22
27
  }
23
28
  function normalizeCode(code) {
@@ -1,14 +1,15 @@
1
- import React, { ReactNode } from 'react';
1
+ import { ReactNode } from 'react';
2
+ import type { Locale } from '../type';
2
3
  declare const getLocale: (languages?: {
3
4
  code: string;
4
5
  }[]) => string;
5
- declare const setLocale: (locale: string) => void;
6
+ declare const setLocale: (locale: Locale) => void;
6
7
  interface LocaleProviderProps {
7
8
  children: ReactNode;
8
- locale?: string;
9
- fallbackLocale?: string;
9
+ locale?: Locale;
10
+ fallbackLocale?: Locale;
10
11
  translations: Record<string, any>;
11
- onLoadingTranslation?: (locale: string, languages: {
12
+ onLoadingTranslation?: (locale: Locale, languages: {
12
13
  code: string;
13
14
  }[]) => void;
14
15
  languages?: {
@@ -16,8 +17,17 @@ interface LocaleProviderProps {
16
17
  name: string;
17
18
  }[];
18
19
  }
19
- declare const LocaleContext: React.Context<any>;
20
- declare const Consumer: React.Consumer<any>;
20
+ export interface LocaleContextType {
21
+ locale: Locale;
22
+ changeLocale: (locale: Locale) => void;
23
+ t: (key: string, data?: Record<string, string>) => string;
24
+ languages: {
25
+ code: string;
26
+ name: string;
27
+ }[];
28
+ }
29
+ declare const LocaleContext: import("react").Context<LocaleContextType>;
30
+ declare const Consumer: import("react").Consumer<LocaleContextType>;
21
31
  declare function LocaleProvider({ children, locale, fallbackLocale, translations, onLoadingTranslation, languages, ...rest }: LocaleProviderProps): import("react/jsx-runtime").JSX.Element;
22
- declare function useLocaleContext(): any;
32
+ declare function useLocaleContext(): LocaleContextType;
23
33
  export { LocaleProvider, Consumer as LocaleConsumer, LocaleContext, useLocaleContext, setLocale, getLocale };
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  /* eslint-disable no-prototype-builtins */
3
- import React, { createContext, useState, useEffect, useContext, useRef, useCallback } from 'react';
3
+ import { createContext, useState, useEffect, useContext, useRef, useCallback } from 'react';
4
4
  import get from 'lodash/get';
5
5
  import Cookie from 'js-cookie';
6
6
  import browserLang from './browser-lang';
@@ -1,57 +1,11 @@
1
- declare const _default: any[];
1
+ declare const languages: Record<string, {
2
+ name: string;
3
+ nativeName: string;
4
+ }>;
5
+ declare const _default: {
6
+ name: string;
7
+ nativeName: string;
8
+ code: string;
9
+ }[];
2
10
  export default _default;
3
11
  export { languages as map };
4
- declare const languages: {
5
- ar: {
6
- name: string;
7
- nativeName: string;
8
- };
9
- de: {
10
- name: string;
11
- nativeName: string;
12
- };
13
- en: {
14
- name: string;
15
- nativeName: string;
16
- };
17
- es: {
18
- name: string;
19
- nativeName: string;
20
- };
21
- fr: {
22
- name: string;
23
- nativeName: string;
24
- };
25
- it: {
26
- name: string;
27
- nativeName: string;
28
- };
29
- ja: {
30
- name: string;
31
- nativeName: string;
32
- };
33
- ko: {
34
- name: string;
35
- nativeName: string;
36
- };
37
- mn: {
38
- name: string;
39
- nativeName: string;
40
- };
41
- pt: {
42
- name: string;
43
- nativeName: string;
44
- };
45
- ru: {
46
- name: string;
47
- nativeName: string;
48
- };
49
- zh: {
50
- name: string;
51
- nativeName: string;
52
- };
53
- 'zh-TW': {
54
- name: string;
55
- nativeName: string;
56
- };
57
- };
@@ -1,27 +1,11 @@
1
- declare function LocaleSelector(props: any): import("react/jsx-runtime").JSX.Element;
2
- declare namespace LocaleSelector {
3
- namespace propTypes {
4
- let size: PropTypes.Requireable<number>;
5
- let showText: PropTypes.Requireable<boolean>;
6
- let popperProps: PropTypes.Requireable<object>;
7
- let onChange: PropTypes.Requireable<(...args: any[]) => any>;
8
- let popperType: PropTypes.Requireable<string>;
9
- let icon: PropTypes.Requireable<any>;
10
- }
11
- namespace defaultProps {
12
- let showText_1: boolean;
13
- export { showText_1 as showText };
14
- let size_1: number;
15
- export { size_1 as size };
16
- let popperProps_1: {};
17
- export { popperProps_1 as popperProps };
18
- export { noop as onChange };
19
- let popperType_1: string;
20
- export { popperType_1 as popperType };
21
- let icon_1: null;
22
- export { icon_1 as icon };
23
- }
1
+ import React from 'react';
2
+ import type { Locale } from '../type';
3
+ export interface LocaleSelectorProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
4
+ showText?: true | false;
5
+ popperProps?: React.HTMLAttributes<HTMLDivElement>;
6
+ popperType?: 'hover' | 'click';
7
+ icon?: React.ComponentType<any>;
8
+ size?: number;
9
+ onChange?: (locale: Locale) => void;
24
10
  }
25
- export default LocaleSelector;
26
- import PropTypes from 'prop-types';
27
- import noop from 'lodash/noop';
11
+ export default function LocaleSelector(props: LocaleSelectorProps): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  /* eslint-disable react/jsx-no-bind */
3
- import { useState, useContext, useRef, useMemo } from 'react';
4
- import PropTypes from 'prop-types';
3
+ import React, { useState, useContext, useRef, useMemo } from 'react';
5
4
  import { Button, Typography, IconButton, Popper, MenuItem, MenuList, Box, ClickAwayListener } from '@mui/material';
6
5
  import { Icon as IconifyIcon } from '@iconify/react';
7
6
  import CheckIcon from '@iconify-icons/material-symbols/check';
@@ -13,11 +12,12 @@ import { LocaleContext } from './context';
13
12
  import { styled, useTheme } from '../Theme';
14
13
  export default function LocaleSelector(props) {
15
14
  const {
16
- showText,
17
- popperProps,
18
- popperType,
15
+ showText = true,
16
+ popperProps = {},
17
+ popperType = 'click',
19
18
  icon: Icon,
20
- size,
19
+ size = 24,
20
+ onChange = noop,
21
21
  ...rest
22
22
  } = props;
23
23
  const {
@@ -68,7 +68,6 @@ export default function LocaleSelector(props) {
68
68
  });
69
69
  }, [Icon, size]);
70
70
  return /*#__PURE__*/_jsxs(Div, {
71
- component: "div",
72
71
  dark: dark,
73
72
  theme: theme,
74
73
  ...rest,
@@ -84,7 +83,7 @@ export default function LocaleSelector(props) {
84
83
  children: [renderIcon, showText ? /*#__PURE__*/_jsx(Typography, {
85
84
  component: "strong",
86
85
  className: "trigger-text",
87
- children: languages.find(x => x.code === locale).name
86
+ children: languages.find(x => x.code === locale)?.name
88
87
  }) : '']
89
88
  })
90
89
  }), /*#__PURE__*/_jsx(StyledPopper, {
@@ -102,7 +101,7 @@ export default function LocaleSelector(props) {
102
101
  name
103
102
  }) => /*#__PURE__*/_jsxs(MenuItem, {
104
103
  className: "locale-item",
105
- onClick: () => onSelect(code, name),
104
+ onClick: () => onSelect(code),
106
105
  children: [/*#__PURE__*/_jsx(IconifyIcon, {
107
106
  icon: CheckIcon,
108
107
  className: code === locale ? 'check-icon check-icon-visible' : 'check-icon'
@@ -114,22 +113,6 @@ export default function LocaleSelector(props) {
114
113
  })]
115
114
  });
116
115
  }
117
- LocaleSelector.propTypes = {
118
- size: PropTypes.number,
119
- showText: PropTypes.bool,
120
- popperProps: PropTypes.object,
121
- onChange: PropTypes.func,
122
- popperType: PropTypes.oneOf(['hover', 'click']),
123
- icon: PropTypes.any
124
- };
125
- LocaleSelector.defaultProps = {
126
- showText: true,
127
- size: 24,
128
- popperProps: {},
129
- onChange: noop,
130
- popperType: 'click',
131
- icon: null
132
- };
133
116
  const Div = styled('div', {
134
117
  shouldForwardProp: prop => prop !== 'dark'
135
118
  })`
@@ -1,3 +1,4 @@
1
- export function replace(template: any, data: any): any;
2
- export function translate(translations: any, key: any, locale: any, fallbackLocale?: string, data?: {}): any;
3
- export function t(translations: any, key: any, locale: any, fallbackLocale?: string, data?: {}): any;
1
+ import type { Locale, Translations } from '../type';
2
+ export declare const replace: (template: string, data: Record<string, any>) => string;
3
+ export declare const translate: (translations: Translations, key: string, locale: Locale, fallbackLocale?: string, data?: {}) => string;
4
+ export declare const t: (translations: Translations, key: string, locale: Locale, fallbackLocale?: string, data?: {}) => string;
@@ -1,5 +1,4 @@
1
1
  import get from 'lodash/get';
2
-
3
2
  /* eslint-disable no-prototype-builtins */
4
3
  export const replace = (template, data) => template.replace(/{(\w*)}/g, (m, key) => data.hasOwnProperty(key) ? data[key] : '');
5
4
  export const translate = (translations, key, locale, fallbackLocale = 'en', data = {}) => {
@@ -1,41 +1,10 @@
1
- /**
2
- @typedef {import('react').HTMLAttributes<HTMLSpanElement> & {
3
- mode?: 'light' | 'dark',
4
- layout?: 'vertical' | 'horizontal',
5
- showText?: boolean,
6
- showLogo?: boolean,
7
- }} LogoProps
8
- */
9
- /**
10
- * @description
11
- * @export
12
- * @param {LogoProps} props
13
- * @return {React.ReactComponentElement}
14
- */
15
- declare function Logo({ showText, showLogo, mode, layout, ...rest }: LogoProps): import("react").ReactComponentElement<any, Pick<any, string | number | symbol>>;
16
- declare namespace Logo {
17
- namespace propTypes {
18
- let mode: PropTypes.Requireable<string>;
19
- let layout: PropTypes.Requireable<string>;
20
- let showText: PropTypes.Requireable<boolean>;
21
- let showLogo: PropTypes.Requireable<boolean>;
22
- }
23
- namespace defaultProps {
24
- let mode_1: string;
25
- export { mode_1 as mode };
26
- let layout_1: string;
27
- export { layout_1 as layout };
28
- let showText_1: boolean;
29
- export { showText_1 as showText };
30
- let showLogo_1: boolean;
31
- export { showLogo_1 as showLogo };
32
- }
1
+ import { type SxProps } from '@mui/material';
2
+ export interface LogoProps extends React.HTMLAttributes<HTMLSpanElement> {
3
+ mode?: 'light' | 'dark';
4
+ layout?: 'vertical' | 'horizontal';
5
+ showText?: true | false;
6
+ showLogo?: true | false;
7
+ size?: number;
8
+ sx?: SxProps;
33
9
  }
34
- export default Logo;
35
- export type LogoProps = import("react").HTMLAttributes<HTMLSpanElement> & {
36
- mode?: "light" | "dark";
37
- layout?: "vertical" | "horizontal";
38
- showText?: boolean;
39
- showLogo?: boolean;
40
- };
41
- import PropTypes from 'prop-types';
10
+ export default function Logo({ showText, showLogo, mode, layout, size, style, ...rest }: LogoProps): import("react/jsx-runtime").JSX.Element;