@arcblock/ux 2.10.65 → 2.10.67

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 (121) hide show
  1. package/lib/ActionButton/index.d.ts +1 -1
  2. package/lib/Alert/index.d.ts +1 -1
  3. package/lib/AnimationWaiter/index.d.ts +27 -15
  4. package/lib/AnimationWaiter/index.js +15 -14
  5. package/lib/Async/index.d.ts +50 -17
  6. package/lib/Badge/index.d.ts +1 -1
  7. package/lib/Badge/index.js +7 -1
  8. package/lib/BlockletContext/index.d.ts +12 -28
  9. package/lib/BlockletContext/index.js +3 -21
  10. package/lib/Button/wrap.d.ts +5 -3
  11. package/lib/Button/wrap.js +2 -1
  12. package/lib/ButtonGroup/index.d.ts +12 -2
  13. package/lib/ButtonGroup/index.js +13 -3
  14. package/lib/CardSelector/index.d.ts +11 -33
  15. package/lib/CardSelector/index.js +16 -32
  16. package/lib/Center/index.d.ts +6 -21
  17. package/lib/Center/index.js +2 -17
  18. package/lib/ClickToCopy/copy-button.d.ts +9 -26
  19. package/lib/ClickToCopy/copy-button.js +5 -17
  20. package/lib/ClickToCopy/hook.d.ts +11 -5
  21. package/lib/ClickToCopy/hook.js +3 -3
  22. package/lib/ClickToCopy/index.d.ts +18 -29
  23. package/lib/ClickToCopy/index.js +0 -13
  24. package/lib/CodeBlock/LightBox.d.ts +1 -1
  25. package/lib/CodeBlock/index.d.ts +7 -26
  26. package/lib/CodeBlock/index.js +4 -17
  27. package/lib/Colors/index.d.ts +2 -2
  28. package/lib/Colors/themes/default.d.ts +54 -61
  29. package/lib/Colors/themes/temp.d.ts +35 -35
  30. package/lib/ContactForm/index.d.ts +26 -30
  31. package/lib/ContactForm/index.js +7 -17
  32. package/lib/Dialog/confirm.d.ts +3 -3
  33. package/lib/Dialog/confirm.js +2 -2
  34. package/lib/Earth/index.d.ts +10 -1
  35. package/lib/Header/auto-hidden.d.ts +6 -11
  36. package/lib/Header/auto-hidden.js +0 -5
  37. package/lib/Header/header.d.ts +20 -51
  38. package/lib/Header/header.js +10 -42
  39. package/lib/Header/index.d.ts +2 -2
  40. package/lib/Header/responsive-header.d.ts +10 -22
  41. package/lib/Header/responsive-header.js +1 -13
  42. package/lib/Icon/image.d.ts +8 -36
  43. package/lib/Icon/image.js +6 -24
  44. package/lib/Icon/index.d.ts +9 -1
  45. package/lib/Icon/index.js +6 -25
  46. package/lib/NavMenu/index.d.ts +1 -1
  47. package/lib/NavMenu/nav-menu.d.ts +37 -51
  48. package/lib/NavMenu/nav-menu.js +47 -102
  49. package/lib/NavMenu/style.d.ts +8 -2
  50. package/lib/NavMenu/style.js +3 -1
  51. package/lib/PageScroller/index.d.ts +13 -1
  52. package/lib/Passport/passport.js +1 -1
  53. package/lib/PricingTable/index.d.ts +3 -1
  54. package/lib/RelativeTime/index.d.ts +1 -1
  55. package/lib/Screenshot/BaseScreenshot/index.js +1 -1
  56. package/lib/SplitButton/index.d.ts +0 -19
  57. package/lib/SplitButton/index.js +7 -27
  58. package/lib/TextCollapse/index.d.ts +10 -1
  59. package/lib/Theme/index.d.ts +5 -13
  60. package/lib/Theme/index.js +4 -11
  61. package/lib/Theme/theme-provider.d.ts +16 -18
  62. package/lib/Theme/theme.d.ts +37 -11
  63. package/lib/Theme/theme.js +13 -22
  64. package/lib/Util/constant.d.ts +31 -31
  65. package/lib/Util/deprecate.d.ts +7 -5
  66. package/lib/Util/federated.d.ts +21 -21
  67. package/lib/Util/federated.js +1 -1
  68. package/lib/Util/index.d.ts +59 -60
  69. package/lib/Util/index.js +16 -43
  70. package/lib/Util/passport.d.ts +6 -6
  71. package/lib/Util/wallet.d.ts +15 -3
  72. package/lib/WebWalletSWKeeper/index.js +1 -1
  73. package/lib/global.d.ts +13 -0
  74. package/lib/index.d.ts +4 -2
  75. package/lib/index.js +2 -2
  76. package/lib/type.d.ts +31 -1
  77. package/package.json +5 -5
  78. package/src/AnimationWaiter/index.jsx +15 -14
  79. package/src/Async/{index.jsx → index.tsx} +13 -4
  80. package/src/Badge/index.jsx +8 -1
  81. package/src/BlockletContext/{index.jsx → index.tsx} +17 -22
  82. package/src/Button/wrap.jsx +2 -1
  83. package/src/ButtonGroup/index.js +13 -3
  84. package/src/CardSelector/{index.jsx → index.tsx} +32 -33
  85. package/src/Center/index.tsx +33 -0
  86. package/src/ClickToCopy/{copy-button.jsx → copy-button.tsx} +15 -16
  87. package/src/ClickToCopy/{hook.js → hook.ts} +5 -5
  88. package/src/ClickToCopy/{index.jsx → index.tsx} +12 -17
  89. package/src/CodeBlock/{index.jsx → index.tsx} +15 -17
  90. package/src/ContactForm/{index.jsx → index.tsx} +47 -29
  91. package/src/Dialog/confirm.jsx +2 -2
  92. package/src/Header/{auto-hidden.jsx → auto-hidden.tsx} +6 -7
  93. package/src/Header/{header.jsx → header.tsx} +32 -46
  94. package/src/Header/{responsive-header.jsx → responsive-header.tsx} +9 -15
  95. package/src/Icon/{image.jsx → image.tsx} +19 -22
  96. package/src/Icon/{index.jsx → index.tsx} +22 -24
  97. package/src/NavMenu/{nav-menu.jsx → nav-menu.tsx} +161 -144
  98. package/src/NavMenu/{style.js → style.ts} +9 -1
  99. package/src/Passport/passport.jsx +1 -1
  100. package/src/Screenshot/BaseScreenshot/index.jsx +1 -1
  101. package/src/SplitButton/index.tsx +10 -23
  102. package/src/Theme/{index.js → index.ts} +6 -12
  103. package/src/Theme/{theme-provider.jsx → theme-provider.tsx} +10 -2
  104. package/src/Theme/{theme.js → theme.ts} +54 -23
  105. package/src/Util/{deprecate.jsx → deprecate.tsx} +8 -4
  106. package/src/Util/{federated.js → federated.ts} +3 -3
  107. package/src/Util/{index.js → index.ts} +85 -59
  108. package/src/Util/{passport.js → passport.ts} +2 -2
  109. package/src/Util/{wallet.js → wallet.ts} +1 -1
  110. package/src/WebWalletSWKeeper/index.jsx +1 -1
  111. package/src/global.d.ts +13 -0
  112. package/src/{index.js → index.ts} +2 -2
  113. package/src/type.d.ts +31 -1
  114. package/src/Center/index.jsx +0 -41
  115. /package/src/CodeBlock/{LightBox.jsx → LightBox.tsx} +0 -0
  116. /package/src/Colors/{index.js → index.ts} +0 -0
  117. /package/src/Colors/themes/{default.js → default.ts} +0 -0
  118. /package/src/Colors/themes/{temp.js → temp.ts} +0 -0
  119. /package/src/Header/{index.js → index.ts} +0 -0
  120. /package/src/NavMenu/{index.js → index.ts} +0 -0
  121. /package/src/Util/{constant.js → constant.ts} +0 -0
@@ -1,9 +1,15 @@
1
1
  export default function useCopy({ content, locale }: {
2
- content: any;
3
- locale?: string | undefined;
2
+ content?: string;
3
+ locale?: 'en' | 'zh';
4
4
  }): {
5
- containerRef: import("react").MutableRefObject<undefined>;
5
+ containerRef: import("react").MutableRefObject<HTMLElement | null>;
6
6
  copied: boolean;
7
- copy: (e: any) => void;
8
- texts: any;
7
+ copy: (e: React.MouseEvent) => void;
8
+ texts: {
9
+ copy: string;
10
+ copied: string;
11
+ } | {
12
+ copy: string;
13
+ copied: string;
14
+ };
9
15
  };
@@ -15,16 +15,16 @@ export default function useCopy({
15
15
  locale = 'en'
16
16
  }) {
17
17
  const [copied, setCopied] = useState(false);
18
- const containerRef = useRef();
18
+ const containerRef = useRef(null);
19
19
  const copy = e => {
20
20
  if (e) {
21
21
  e.stopPropagation();
22
22
  }
23
- Copy(content || containerRef.current.textContent);
23
+ Copy(content || (containerRef.current?.textContent ?? ''));
24
24
  setCopied(true);
25
25
  };
26
26
  useEffect(() => {
27
- let timer = null;
27
+ let timer;
28
28
  if (copied) {
29
29
  timer = setTimeout(() => setCopied(false), 2000);
30
30
  }
@@ -1,32 +1,21 @@
1
- declare function ClickToCopy(props: any): import("react/jsx-runtime").JSX.Element;
1
+ export { default as CopyButton } from './copy-button';
2
+ export interface ClickToCopyProps extends React.HTMLAttributes<HTMLDivElement> {
3
+ content?: string;
4
+ locale?: 'en' | 'zh';
5
+ tip?: string;
6
+ tipPlacement?: string;
7
+ copiedTip?: string;
8
+ unstyled?: boolean;
9
+ }
10
+ declare function ClickToCopy(props: ClickToCopyProps): import("react/jsx-runtime").JSX.Element;
2
11
  declare namespace ClickToCopy {
3
- namespace propTypes {
4
- let children: PropTypes.Validator<any>;
5
- let content: PropTypes.Requireable<string>;
6
- let tip: PropTypes.Requireable<string>;
7
- let tipPlacement: PropTypes.Requireable<string>;
8
- let copiedTip: PropTypes.Requireable<string>;
9
- let locale: PropTypes.Requireable<string>;
10
- let style: PropTypes.Requireable<object>;
11
- let unstyled: PropTypes.Requireable<boolean>;
12
- }
13
- namespace defaultProps {
14
- let content_1: string;
15
- export { content_1 as content };
16
- let tip_1: string;
17
- export { tip_1 as tip };
18
- let copiedTip_1: string;
19
- export { copiedTip_1 as copiedTip };
20
- let tipPlacement_1: string;
21
- export { tipPlacement_1 as tipPlacement };
22
- let locale_1: string;
23
- export { locale_1 as locale };
24
- let style_1: {};
25
- export { style_1 as style };
26
- let unstyled_1: boolean;
27
- export { unstyled_1 as unstyled };
28
- }
12
+ var defaultProps: {
13
+ content: string;
14
+ tip: string;
15
+ copiedTip: string;
16
+ tipPlacement: string;
17
+ locale: "en";
18
+ unstyled: boolean;
19
+ };
29
20
  }
30
21
  export default ClickToCopy;
31
- export { default as CopyButton } from "./copy-button";
32
- import PropTypes from 'prop-types';
@@ -1,5 +1,4 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
- import PropTypes from 'prop-types';
3
2
  import { useSize } from 'ahooks';
4
3
  import Tooltip from '@mui/material/Tooltip';
5
4
  import { useSnackbar } from 'notistack';
@@ -79,23 +78,11 @@ export default function ClickToCopy(props) {
79
78
  children: contentChild
80
79
  });
81
80
  }
82
- ClickToCopy.propTypes = {
83
- children: PropTypes.any.isRequired,
84
- content: PropTypes.string,
85
- tip: PropTypes.string,
86
- tipPlacement: PropTypes.string,
87
- copiedTip: PropTypes.string,
88
- locale: PropTypes.oneOf(['en', 'zh']),
89
- style: PropTypes.object,
90
- // 仅提供点击复制功能, 不提供样式
91
- unstyled: PropTypes.bool
92
- };
93
81
  ClickToCopy.defaultProps = {
94
82
  content: '',
95
83
  tip: '',
96
84
  copiedTip: '',
97
85
  tipPlacement: 'right',
98
86
  locale: 'en',
99
- style: {},
100
87
  unstyled: false
101
88
  };
@@ -1,5 +1,5 @@
1
- export default LightBox;
2
1
  declare const LightBox: import("@emotion/styled").StyledComponent<{
3
2
  theme?: import("@emotion/react").Theme;
4
3
  as?: import("react").ElementType;
5
4
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
5
+ export default LightBox;
@@ -1,27 +1,8 @@
1
- declare function CodeBlock({ code, language, children, dark, ...rest }: {
2
- [x: string]: any;
3
- code: any;
4
- language: any;
5
- children: any;
6
- dark: any;
7
- }): import("react/jsx-runtime").JSX.Element;
8
- declare namespace CodeBlock {
9
- namespace propTypes {
10
- let code: PropTypes.Requireable<string>;
11
- let language: PropTypes.Requireable<string>;
12
- let children: PropTypes.Requireable<any>;
13
- let dark: PropTypes.Requireable<boolean>;
14
- }
15
- namespace defaultProps {
16
- let code_1: string;
17
- export { code_1 as code };
18
- let language_1: string;
19
- export { language_1 as language };
20
- let children_1: null;
21
- export { children_1 as children };
22
- let dark_1: boolean;
23
- export { dark_1 as dark };
24
- }
1
+ import 'highlight.js/styles/atom-one-dark.css';
2
+ export interface CodeBlockProps extends React.HTMLAttributes<HTMLPreElement> {
3
+ code?: string;
4
+ language?: string;
5
+ children?: React.ReactNode;
6
+ dark?: boolean;
25
7
  }
26
- export default CodeBlock;
27
- import PropTypes from 'prop-types';
8
+ export default function CodeBlock({ code, language, children, dark, ...rest }: CodeBlockProps): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,6 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  /* eslint-disable react/no-danger */
3
3
  import { useState } from 'react';
4
- import PropTypes from 'prop-types';
5
4
  import Copy from 'copy-to-clipboard';
6
5
  import hljs from 'highlight.js/lib/core';
7
6
  import javascript from 'highlight.js/lib/languages/javascript';
@@ -53,10 +52,10 @@ hljs.registerLanguage('objectivec', objectivec);
53
52
  hljs.registerLanguage('oc', objectivec);
54
53
  hljs.registerLanguage('markdown', markdown);
55
54
  export default function CodeBlock({
56
- code,
57
- language,
58
- children,
59
- dark,
55
+ code = '',
56
+ language = 'text',
57
+ children = null,
58
+ dark = true,
60
59
  ...rest
61
60
  }) {
62
61
  const [copied, setCopied] = useState(false);
@@ -115,18 +114,6 @@ export default function CodeBlock({
115
114
  }
116
115
  return originEl;
117
116
  }
118
- CodeBlock.propTypes = {
119
- code: PropTypes.string,
120
- language: PropTypes.string,
121
- children: PropTypes.any,
122
- dark: PropTypes.bool
123
- };
124
- CodeBlock.defaultProps = {
125
- code: '',
126
- language: 'text',
127
- children: null,
128
- dark: true
129
- };
130
117
  const fontFamily = 'source-code-pro, Menlo, Monaco, Consolas, Courier New, monospace !important';
131
118
  const Pre = styled('pre')`
132
119
  font-family: ${fontFamily};
@@ -1,2 +1,2 @@
1
- export { default } from "./themes/default";
2
- export { default as temp } from "./themes/temp";
1
+ export { default } from './themes/default';
2
+ export { default as temp } from './themes/temp';
@@ -1,44 +1,41 @@
1
- export default colors;
2
- declare namespace colors {
3
- namespace common {
4
- let black: string;
5
- let white: string;
6
- }
7
- namespace primary {
8
- let main: string;
9
- let contrastText: string;
10
- }
11
- namespace secondary {
12
- let main_1: string;
13
- export { main_1 as main };
14
- let contrastText_1: string;
15
- export { contrastText_1 as contrastText };
16
- }
17
- namespace error {
18
- let main_2: string;
19
- export { main_2 as main };
20
- let contrastText_2: string;
21
- export { contrastText_2 as contrastText };
22
- }
23
- namespace warning {
24
- let main_3: string;
25
- export { main_3 as main };
26
- let contrastText_3: string;
27
- export { contrastText_3 as contrastText };
28
- }
29
- namespace info {
30
- let main_4: string;
31
- export { main_4 as main };
32
- let contrastText_4: string;
33
- export { contrastText_4 as contrastText };
34
- }
35
- namespace success {
36
- let main_5: string;
37
- export { main_5 as main };
38
- let contrastText_5: string;
39
- export { contrastText_5 as contrastText };
40
- }
41
- let grey: {
1
+ /**
2
+ * 默认 colors, ABT 系列
3
+ *
4
+ * - colors object 结构是在 mui theme#palette object 基础上调整后的结构
5
+ * - 色值在 mui default theme 基础上将 figma 中常用的 colors 进行覆盖
6
+ * - 扩展一些常用色值 (如 DID 系列)
7
+ * - figma: https://www.figma.com/file/1qHyMF137EXOQpSFVByszG/UX-Library?node-id=295%3A1518
8
+ */
9
+ declare const colors: {
10
+ common: {
11
+ black: string;
12
+ white: string;
13
+ };
14
+ primary: {
15
+ main: string;
16
+ contrastText: string;
17
+ };
18
+ secondary: {
19
+ main: string;
20
+ contrastText: string;
21
+ };
22
+ error: {
23
+ main: string;
24
+ contrastText: string;
25
+ };
26
+ warning: {
27
+ main: string;
28
+ contrastText: string;
29
+ };
30
+ info: {
31
+ main: string;
32
+ contrastText: string;
33
+ };
34
+ success: {
35
+ main: string;
36
+ contrastText: string;
37
+ };
38
+ grey: {
42
39
  50: string;
43
40
  100: string;
44
41
  200: string;
@@ -54,23 +51,19 @@ declare namespace colors {
54
51
  A400: string;
55
52
  A700: string;
56
53
  };
57
- namespace text {
58
- let primary_1: string;
59
- export { primary_1 as primary };
60
- let secondary_1: string;
61
- export { secondary_1 as secondary };
62
- export let disabled: string;
63
- export let hint: string;
64
- }
65
- let divider: string;
66
- namespace background {
67
- let _default: string;
68
- export { _default as default };
69
- }
70
- namespace did {
71
- let primary_2: string;
72
- export { primary_2 as primary };
73
- let secondary_2: string;
74
- export { secondary_2 as secondary };
75
- }
76
- }
54
+ text: {
55
+ primary: string;
56
+ secondary: string;
57
+ disabled: string;
58
+ hint: string;
59
+ };
60
+ divider: string;
61
+ background: {
62
+ default: string;
63
+ };
64
+ did: {
65
+ primary: string;
66
+ secondary: string;
67
+ };
68
+ };
69
+ export default colors;
@@ -1,36 +1,36 @@
1
+ declare const colors: {
2
+ textMuted: string;
3
+ textSubtitle: string;
4
+ textBase: string;
5
+ textPrimaryBase: string;
6
+ primaryBase: string;
7
+ primary100: string;
8
+ gray6: string;
9
+ surfaceBgSubtitle: string;
10
+ surfacePrimarySubtitle: string;
11
+ surfaceSuccess: string;
12
+ backgroundsBgSubtitle: string;
13
+ backgroundsBgComponent: string;
14
+ backgroundsBgField: string;
15
+ backgroundsBgSubtile: string;
16
+ backgroundsBgSubtileHover: string;
17
+ foregroundsFgBase: string;
18
+ foregroundsFgSubtile: string;
19
+ foregroundsFgMuted: string;
20
+ foregroundsFgInteractiveTransparent: string;
21
+ foregroundsFgInteractive: string;
22
+ strokeBorderBase: string;
23
+ strokeBorderStrong: string;
24
+ strokeSep: string;
25
+ lineStep: string;
26
+ lineBorderStrong: string;
27
+ lineBorderBase: string;
28
+ borderBase: string;
29
+ buttonsButtonNeutral: string;
30
+ buttonsButtonNeutralHover: string;
31
+ buttonsButtonInverted: string;
32
+ buttonsButtonInvertedHover: string;
33
+ buttonsButtonDanger: string;
34
+ red: string;
35
+ };
1
36
  export default colors;
2
- declare namespace colors {
3
- let textMuted: string;
4
- let textSubtitle: string;
5
- let textBase: string;
6
- let textPrimaryBase: string;
7
- let primaryBase: string;
8
- let primary100: string;
9
- let gray6: string;
10
- let surfaceBgSubtitle: string;
11
- let surfacePrimarySubtitle: string;
12
- let surfaceSuccess: string;
13
- let backgroundsBgSubtitle: string;
14
- let backgroundsBgComponent: string;
15
- let backgroundsBgField: string;
16
- let backgroundsBgSubtile: string;
17
- let backgroundsBgSubtileHover: string;
18
- let foregroundsFgBase: string;
19
- let foregroundsFgSubtile: string;
20
- let foregroundsFgMuted: string;
21
- let foregroundsFgInteractiveTransparent: string;
22
- let foregroundsFgInteractive: string;
23
- let strokeBorderBase: string;
24
- let strokeBorderStrong: string;
25
- let strokeSep: string;
26
- let lineStep: string;
27
- let lineBorderStrong: string;
28
- let lineBorderBase: string;
29
- let borderBase: string;
30
- let buttonsButtonNeutral: string;
31
- let buttonsButtonNeutralHover: string;
32
- let buttonsButtonInverted: string;
33
- let buttonsButtonInvertedHover: string;
34
- let buttonsButtonDanger: string;
35
- let red: string;
36
- }
@@ -1,41 +1,37 @@
1
- export function submitContactForm({ formId, portalId }: {
2
- formId: any;
3
- portalId: any;
4
- }, fields: any, context: any): Promise<any>;
5
- export default class ContactForm extends React.Component<any, any, any> {
6
- static propTypes: {
7
- style: PropTypes.Requireable<object>;
8
- className: PropTypes.Requireable<string>;
9
- portalId: PropTypes.Requireable<string>;
10
- formId: PropTypes.Requireable<string>;
11
- title: PropTypes.Requireable<string>;
12
- button: PropTypes.Requireable<string>;
13
- successMessage: PropTypes.Requireable<string>;
14
- layout: PropTypes.Requireable<string>;
15
- fields: PropTypes.Requireable<NonNullable<string | any[] | null | undefined>>;
16
- };
1
+ import React from 'react';
2
+ export declare function submitContactForm({ formId, portalId }: {
3
+ formId: string;
4
+ portalId: string;
5
+ }, fields: Record<string, string>, context: Record<string, string>): Promise<any>;
6
+ export interface ContactFormProps extends React.HTMLAttributes<HTMLFormElement> {
7
+ portalId?: string;
8
+ formId?: string;
9
+ title?: string;
10
+ button?: string;
11
+ successMessage?: string;
12
+ layout?: 'horizontal' | 'vertical';
13
+ fields?: string | string[];
14
+ }
15
+ export default class ContactForm extends React.Component<ContactFormProps, {
16
+ loading: boolean;
17
+ errorMessage: string;
18
+ successMessage: string;
19
+ [x: string]: string | boolean;
20
+ }> {
17
21
  static defaultProps: {
18
- style: {};
19
22
  className: string;
20
23
  portalId: string;
21
24
  formId: string;
22
25
  title: undefined;
23
26
  button: string;
24
- layout: string;
27
+ layout: "vertical";
25
28
  successMessage: string;
26
29
  fields: string[];
27
30
  };
28
- constructor(props: any);
29
- fields: any;
30
- state: {
31
- loading: boolean;
32
- errorMessage: string;
33
- successMessage: string;
34
- };
35
- deriveProps(): any;
31
+ fields: string[];
32
+ constructor(props: ContactFormProps);
33
+ deriveProps(): Record<string, any>;
36
34
  render(): import("react/jsx-runtime").JSX.Element;
37
- onSubmit: (e: any) => Promise<void>;
38
- getInputHandler: (name: any, state?: {}) => (e: any) => void;
35
+ onSubmit: (e: React.FormEvent<HTMLFormElement>) => Promise<void>;
36
+ getInputHandler: (name: string, state?: {}) => (e: React.ChangeEvent<HTMLInputElement>) => void;
39
37
  }
40
- import React from 'react';
41
- import PropTypes from 'prop-types';
@@ -5,7 +5,6 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
5
5
  /* eslint-disable react/no-unused-prop-types */
6
6
  /* eslint-disable react/static-property-placement */
7
7
  import React from 'react';
8
- import PropTypes from 'prop-types';
9
8
  import axios from 'axios';
10
9
  import Typography from '@mui/material/Typography';
11
10
  import CircularProgress from '@mui/material/CircularProgress';
@@ -31,6 +30,7 @@ export function submitContactForm({
31
30
  export default class ContactForm extends React.Component {
32
31
  constructor(props) {
33
32
  super(props);
33
+ _defineProperty(this, "fields", void 0);
34
34
  _defineProperty(this, "onSubmit", async e => {
35
35
  e.preventDefault();
36
36
  this.setState({
@@ -45,7 +45,7 @@ export default class ContactForm extends React.Component {
45
45
  return obj;
46
46
  }, {}), {
47
47
  pageUri: window.location.href,
48
- pageName: window.location.title
48
+ pageName: document.title
49
49
  });
50
50
  this.setState({
51
51
  loading: false,
@@ -74,6 +74,7 @@ export default class ContactForm extends React.Component {
74
74
  successMessage: ''
75
75
  };
76
76
  this.fields.forEach(x => {
77
+ // @ts-ignore
77
78
  this.state[x] = '';
78
79
  });
79
80
  deprecatedWarn('ContactForm');
@@ -152,21 +153,7 @@ export default class ContactForm extends React.Component {
152
153
  });
153
154
  }
154
155
  }
155
-
156
- // prettier-ignore
157
- _defineProperty(ContactForm, "propTypes", {
158
- style: PropTypes.object,
159
- className: PropTypes.string,
160
- portalId: PropTypes.string,
161
- formId: PropTypes.string,
162
- title: PropTypes.string,
163
- button: PropTypes.string,
164
- successMessage: PropTypes.string,
165
- layout: PropTypes.oneOf(['horizontal', 'vertical']),
166
- fields: PropTypes.oneOfType([PropTypes.string, PropTypes.array])
167
- });
168
156
  _defineProperty(ContactForm, "defaultProps", {
169
- style: {},
170
157
  className: '',
171
158
  portalId: '4796488',
172
159
  formId: '929a510f-34f4-4251-98b3-34175200aebd',
@@ -176,8 +163,11 @@ _defineProperty(ContactForm, "defaultProps", {
176
163
  successMessage: 'Form Submit Success',
177
164
  fields: ['Email', 'First Name', 'Last Name']
178
165
  });
166
+ // prettier-ignore
179
167
  const getInputWidth = props => props.layout === 'vertical' ? '100%' : `${Math.max(95 / (props.fieldCount + 1), 20)}%`;
180
- const Form = styled('form')`
168
+ const Form = styled('form', {
169
+ shouldForwardProp: prop => prop !== 'layout' && prop !== 'fieldCount'
170
+ })`
181
171
  display: flex;
182
172
  flex-direction: column;
183
173
  justify-content: center;
@@ -4,9 +4,9 @@
4
4
  * @typedef {{
5
5
  * title: React.ReactNode,
6
6
  * open: boolean,
7
- * children: React.ReactNode,
8
7
  * onConfirm: Function,
9
8
  * onCancel: Function,
9
+ * children?: React.ReactNode,
10
10
  * showCancelButton?: boolean,
11
11
  * showCloseButton?: boolean,
12
12
  * fullScreen?: boolean,
@@ -25,9 +25,9 @@ declare namespace Confirm {
25
25
  namespace propTypes {
26
26
  let title: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
27
27
  let open: PropTypes.Validator<boolean>;
28
- let children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
29
28
  let onConfirm: PropTypes.Validator<(...args: any[]) => any>;
30
29
  let onCancel: PropTypes.Validator<(...args: any[]) => any>;
30
+ let children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
31
31
  let showCancelButton: PropTypes.Requireable<boolean>;
32
32
  let showCloseButton: PropTypes.Requireable<boolean>;
33
33
  let fullScreen: PropTypes.Requireable<boolean>;
@@ -67,9 +67,9 @@ export type PaperProps = import("@mui/material").PaperProps;
67
67
  export type ConfirmProps = {
68
68
  title: React.ReactNode;
69
69
  open: boolean;
70
- children: React.ReactNode;
71
70
  onConfirm: Function;
72
71
  onCancel: Function;
72
+ children?: React.ReactNode;
73
73
  showCancelButton?: boolean;
74
74
  showCloseButton?: boolean;
75
75
  fullScreen?: boolean;
@@ -10,9 +10,9 @@ import Dialog from './dialog';
10
10
  * @typedef {{
11
11
  * title: React.ReactNode,
12
12
  * open: boolean,
13
- * children: React.ReactNode,
14
13
  * onConfirm: Function,
15
14
  * onCancel: Function,
15
+ * children?: React.ReactNode,
16
16
  * showCancelButton?: boolean,
17
17
  * showCloseButton?: boolean,
18
18
  * fullScreen?: boolean,
@@ -100,9 +100,9 @@ export default function Confirm({
100
100
  Confirm.propTypes = {
101
101
  title: PropTypes.node.isRequired,
102
102
  open: PropTypes.bool.isRequired,
103
- children: PropTypes.node.isRequired,
104
103
  onConfirm: PropTypes.func.isRequired,
105
104
  onCancel: PropTypes.func.isRequired,
105
+ children: PropTypes.node,
106
106
  showCancelButton: PropTypes.bool,
107
107
  showCloseButton: PropTypes.bool,
108
108
  fullScreen: PropTypes.bool,
@@ -1,2 +1,11 @@
1
- declare const _default: (props: any) => import("react/jsx-runtime").JSX.Element;
1
+ declare const _default: (props: {
2
+ theme: any;
3
+ width: any;
4
+ height: any;
5
+ enableRotation: any;
6
+ rotationSpeed: any;
7
+ markers: any;
8
+ activeMarkerId: any;
9
+ colors: any;
10
+ }) => import("react/jsx-runtime").JSX.Element;
2
11
  export default _default;
@@ -1,14 +1,9 @@
1
- export default AutoHidden;
1
+ import { type BoxProps } from '@mui/material/Box';
2
+ export interface AutoHiddenProps extends BoxProps {
3
+ height: number | string;
4
+ }
2
5
  /**
3
6
  * 一个容器组件, 当子元素 width 超出该容器时自动隐藏子元素, 必须设置明确的 height 值
4
7
  */
5
- declare function AutoHidden({ height, ...rest }: {
6
- [x: string]: any;
7
- height: any;
8
- }): import("react/jsx-runtime").JSX.Element;
9
- declare namespace AutoHidden {
10
- namespace propTypes {
11
- let height: PropTypes.Validator<NonNullable<NonNullable<string | number | null | undefined>>>;
12
- }
13
- }
14
- import PropTypes from 'prop-types';
8
+ declare function AutoHidden({ height, ...rest }: AutoHiddenProps): import("react/jsx-runtime").JSX.Element;
9
+ export default AutoHidden;
@@ -1,8 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import PropTypes from 'prop-types';
3
2
  import Box from '@mui/material/Box';
4
3
  import { styled } from '../Theme';
5
-
6
4
  /**
7
5
  * 一个容器组件, 当子元素 width 超出该容器时自动隐藏子元素, 必须设置明确的 height 值
8
6
  */
@@ -15,9 +13,6 @@ function AutoHidden({
15
13
  ...rest
16
14
  });
17
15
  }
18
- AutoHidden.propTypes = {
19
- height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired
20
- };
21
16
  const Root = styled(Box)`
22
17
  overflow: hidden;
23
18
  &:before {