graphen 1.10.10 → 1.10.11

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.
@@ -2,15 +2,20 @@ import React from "react";
2
2
  import classNames from "classnames";
3
3
 
4
4
  type Props = {
5
- className?: string,
6
- type?: string,
7
- label: string,
8
- validation?: string,
9
- onChange?: React.ChangeEventHandler<HTMLInputElement>,
5
+ className?: string;
6
+ type?: string;
7
+ label: string;
8
+ validation?: string;
9
+ onChange?: React.ChangeEventHandler<HTMLInputElement>;
10
10
  };
11
11
 
12
- function Input(props: Props) {
13
- const { type, label, className, validation, onChange } = props;
12
+ function Input({
13
+ className = "",
14
+ type = "",
15
+ label,
16
+ validation = undefined,
17
+ onChange = () => {},
18
+ }: Props) {
14
19
  const inputClasses = classNames(className, "gc-input");
15
20
  const fieldClasses = classNames("gc-input__field", {
16
21
  "gc-input__field--success": validation === "success",
@@ -28,12 +33,4 @@ function Input(props: Props) {
28
33
  );
29
34
  }
30
35
 
31
- // @ts-ignore
32
- Input.defaultProps = {
33
- className: '',
34
- type: '',
35
- validation: undefined,
36
- onChange: () => {},
37
- };
38
-
39
36
  export default Input;
@@ -1,15 +1,15 @@
1
1
  import _ from "lodash";
2
- import React from 'react';
2
+ import React from "react";
3
3
  import ReactDOM from "react-dom";
4
4
 
5
5
  type Props = {
6
- onPositionChange: (left: number, top: number) => void,
7
- isEnabled: boolean,
6
+ onPositionChange: (left: number, top: number) => void;
7
+ isEnabled: boolean;
8
8
  };
9
9
 
10
10
  type State = {
11
- left: number,
12
- top: number,
11
+ left: number;
12
+ top: number;
13
13
  };
14
14
 
15
15
  const JOYSTICK_RADIUS = 50;
@@ -10,10 +10,10 @@ type Props = {
10
10
  };
11
11
 
12
12
  function Link({
13
+ className = "",
14
+ children = null,
15
+ skin = constants.SKIN_DEFAULT,
13
16
  link,
14
- className,
15
- children,
16
- skin,
17
17
  }: Props) {
18
18
  const classes = classNames("gc-link", className, {
19
19
  "gc-link--primary": skin === constants.SKIN_PRIMARY,
@@ -27,11 +27,4 @@ function Link({
27
27
  );
28
28
  }
29
29
 
30
- // @ts-ignore
31
- Link.defaultProps = {
32
- className: '',
33
- children: null,
34
- skin: constants.SKIN_DEFAULT,
35
- };
36
-
37
30
  export default Link;
@@ -2,13 +2,11 @@ import React from "react";
2
2
  import classNames from "classnames";
3
3
 
4
4
  type Props = {
5
- className?: string,
6
- onClick?: () => void,
5
+ className?: string;
6
+ onClick?: () => void;
7
7
  };
8
8
 
9
- function Logo(props: Props) {
10
- const { onClick, className } = props;
11
-
9
+ function Logo({ className = "", onClick = () => {} }: Props) {
12
10
  const logoClasses = classNames(className, "gc-logo");
13
11
 
14
12
  /* eslint-disable jsx-a11y/no-static-element-interactions */
@@ -20,10 +18,4 @@ function Logo(props: Props) {
20
18
  /* eslint-enable jsx-a11y/no-static-element-interactions */
21
19
  }
22
20
 
23
- // @ts-ignore
24
- Logo.defaultProps = {
25
- className: '',
26
- onClick: () => {},
27
- };
28
-
29
21
  export default Logo;
@@ -8,22 +8,18 @@ type Props = {
8
8
  isBordered?: boolean;
9
9
  };
10
10
 
11
- function Panel(props: Props) {
12
- const { children, className, isSeparator, isBordered } = props;
11
+ function Panel({
12
+ children = null,
13
+ className = "",
14
+ isSeparator = false,
15
+ isBordered = false,
16
+ }: Props) {
13
17
  const dialogClasses = classNames(className, "gc-panel", {
14
- 'gc-panel--separator': isSeparator,
15
- 'gc-panel--bordered': isBordered,
18
+ "gc-panel--separator": isSeparator,
19
+ "gc-panel--bordered": isBordered,
16
20
  });
17
21
 
18
22
  return <div className={dialogClasses}>{children}</div>;
19
23
  }
20
24
 
21
- // @ts-ignore
22
- Panel.defaultProps = {
23
- className: '',
24
- children: null,
25
- isSeparator: false,
26
- isBordered: false,
27
- };
28
-
29
25
  export default Panel;
@@ -6,17 +6,10 @@ type Props = {
6
6
  children?: React.ReactNode;
7
7
  };
8
8
 
9
- function PanelContent(props: Props) {
10
- const { children, className} = props;
9
+ function PanelContent({ className = "", children = null }: Props) {
11
10
  const dialogClasses = classNames(className, "gc-panel__content");
12
11
 
13
12
  return <article className={dialogClasses}>{children}</article>;
14
13
  }
15
14
 
16
- // @ts-ignore
17
- PanelContent.defaultProps = {
18
- className: '',
19
- children: null,
20
- };
21
-
22
15
  export default PanelContent;
@@ -6,17 +6,10 @@ type Props = {
6
6
  children?: React.ReactNode;
7
7
  };
8
8
 
9
- function PanelFooter(props: Props) {
10
- const { children, className} = props;
9
+ function PanelFooter({ className = "", children = null }: Props) {
11
10
  const dialogClasses = classNames(className, "gc-panel__footer");
12
11
 
13
12
  return <div className={dialogClasses}>{children}</div>;
14
13
  }
15
14
 
16
- // @ts-ignore
17
- PanelFooter.defaultProps = {
18
- className: '',
19
- children: null,
20
- };
21
-
22
15
  export default PanelFooter;
@@ -6,17 +6,10 @@ type Props = {
6
6
  children?: React.ReactNode;
7
7
  };
8
8
 
9
- function PanelTitle(props: Props) {
10
- const { children, className} = props;
9
+ function PanelTitle({ className = "", children = null }: Props) {
11
10
  const dialogClasses = classNames(className, "gc-panel__title");
12
11
 
13
12
  return <header className={dialogClasses}>{children}</header>;
14
13
  }
15
14
 
16
- // @ts-ignore
17
- PanelTitle.defaultProps = {
18
- className: '',
19
- children: null,
20
- };
21
-
22
15
  export default PanelTitle;
@@ -6,13 +6,13 @@ const KNOB_SIZE = 12;
6
6
  const BORDER_SIZE = 1;
7
7
 
8
8
  type Props = {
9
- onScrollChange: (value: number) => void,
10
- min: number,
11
- max: number,
9
+ onScrollChange: (value: number) => void;
10
+ min: number;
11
+ max: number;
12
12
  };
13
13
 
14
14
  type State = {
15
- value: number,
15
+ value: number;
16
16
  };
17
17
 
18
18
  class Scroller extends React.PureComponent<Props, State> {
@@ -2,19 +2,13 @@ import React from "react";
2
2
  import classNames from "classnames";
3
3
 
4
4
  type Props = {
5
- className?: string,
5
+ className?: string;
6
6
  };
7
7
 
8
- function Separator(props: Props) {
9
- const { className} = props;
8
+ function Separator({ className = "" }: Props) {
10
9
  const dialogClasses = classNames(className, "gc-separator");
11
10
 
12
11
  return <div className={dialogClasses} />;
13
12
  }
14
13
 
15
- // @ts-ignore
16
- Separator.defaultProps = {
17
- className: '',
18
- };
19
-
20
14
  export default Separator;
@@ -7,8 +7,11 @@ type Props = {
7
7
  onChange?: (arg0: boolean) => void;
8
8
  };
9
9
 
10
- function Switch(props: Props) {
11
- const { onChange, type, isSwitched } = props;
10
+ function Switch({
11
+ isSwitched = false,
12
+ type = undefined,
13
+ onChange = () => {},
14
+ }: Props) {
12
15
  const [isChecked, setIsChecked] = useState(isSwitched);
13
16
 
14
17
  useEffect(() => {
@@ -16,9 +19,9 @@ function Switch(props: Props) {
16
19
  }, [isSwitched]);
17
20
 
18
21
  const switchClasses = classNames("gc-switch", {
19
- 'gc-switch--success': type === "success",
20
- 'gc-switch--info': type === "info",
21
- 'gc-switch--danger': type === "danger",
22
+ "gc-switch--success": type === "success",
23
+ "gc-switch--info": type === "info",
24
+ "gc-switch--danger": type === "danger",
22
25
  });
23
26
 
24
27
  return (
@@ -39,11 +42,4 @@ function Switch(props: Props) {
39
42
  );
40
43
  }
41
44
 
42
- // @ts-ignore
43
- Switch.defaultProps = {
44
- isSwitched: false,
45
- type: undefined,
46
- onChange: () => {},
47
- };
48
-
49
45
  export default Switch;
@@ -2,13 +2,12 @@ import React from "react";
2
2
  import classNames from "classnames";
3
3
 
4
4
  type Props = {
5
- className?: string,
6
- children?: string,
7
- type?: string,
5
+ className?: string;
6
+ children?: string;
7
+ type?: string;
8
8
  };
9
9
 
10
- function Tooltip(props: Props) {
11
- const { children, className, type } = props;
10
+ function Tooltip({ className = "", children = null, type = "success" }: Props) {
12
11
  const validationClasses = classNames(className, "gc-tooltip", {
13
12
  "gc-tooltip--success": type === "success",
14
13
  "gc-tooltip--danger": type === "danger",
@@ -17,11 +16,4 @@ function Tooltip(props: Props) {
17
16
  return <div className={validationClasses}>{children}</div>;
18
17
  }
19
18
 
20
- // @ts-ignore
21
- Tooltip.defaultProps = {
22
- className: '',
23
- children: null,
24
- type: 'success',
25
- };
26
-
27
19
  export default Tooltip;
@@ -3,14 +3,18 @@ import classNames from "classnames";
3
3
  import Tooltip from "../Tooltip";
4
4
 
5
5
  type Props = {
6
- className?: string,
7
- children?: React.ReactNode,
8
- type?: string,
9
- message?: string | null,
6
+ className?: string;
7
+ children?: React.ReactNode;
8
+ type?: string;
9
+ message?: string | null;
10
10
  };
11
11
 
12
- function Validation(props: Props) {
13
- const { message, children, className, type } = props;
12
+ function Validation({
13
+ className = "",
14
+ children = null,
15
+ type = "success",
16
+ message = null,
17
+ }: Props) {
14
18
  const validationClasses = classNames(className, "gc-validation");
15
19
 
16
20
  const tooltip = message ? (
@@ -27,12 +31,4 @@ function Validation(props: Props) {
27
31
  );
28
32
  }
29
33
 
30
- // @ts-ignore
31
- Validation.defaultProps = {
32
- className: '',
33
- children: null,
34
- type: 'success',
35
- message: null,
36
- };
37
-
38
34
  export default Validation;