@webiny/ui 5.23.1 → 5.24.0-beta.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 (74) hide show
  1. package/Accordion/Accordion.d.ts +3 -3
  2. package/Accordion/AccordionItem.js +4 -0
  3. package/AutoComplete/AutoComplete.d.ts +8 -19
  4. package/AutoComplete/AutoComplete.js +3 -4
  5. package/AutoComplete/MultiAutoComplete.d.ts +18 -34
  6. package/AutoComplete/MultiAutoComplete.js +4 -8
  7. package/AutoComplete/utils.d.ts +11 -5
  8. package/AutoComplete/utils.js +1 -1
  9. package/Button/Button.d.ts +7 -7
  10. package/Checkbox/Checkbox.d.ts +4 -8
  11. package/Checkbox/Checkbox.js +2 -1
  12. package/CodeEditor/CodeEditor.d.ts +1 -5
  13. package/CodeEditor/CodeEditor.js +2 -1
  14. package/ColorPicker/ColorPicker.d.ts +3 -6
  15. package/ColorPicker/ColorPicker.js +2 -1
  16. package/ConfirmationDialog/ConfirmationDialog.d.ts +1 -1
  17. package/ConfirmationDialog/withConfirmation.d.ts +1 -1
  18. package/Dialog/Dialog.d.ts +1 -2
  19. package/DynamicFieldset/Fieldset.d.ts +22 -12
  20. package/DynamicFieldset/Fieldset.js +3 -0
  21. package/Helpers/ClassNames.d.ts +1 -1
  22. package/Icon/Icon.d.ts +2 -5
  23. package/Icon/Icon.js +0 -3
  24. package/ImageEditor/ImageEditor.d.ts +21 -23
  25. package/ImageEditor/ImageEditor.js +23 -8
  26. package/ImageEditor/toolbar/crop.js +3 -1
  27. package/ImageEditor/toolbar/filter.js +3 -1
  28. package/ImageEditor/toolbar/flip.js +3 -1
  29. package/ImageEditor/toolbar/rotate.js +3 -1
  30. package/ImageEditor/toolbar/types.d.ts +21 -11
  31. package/ImageUpload/ImageEditorDialog.d.ts +7 -3
  32. package/ImageUpload/MultiImageUpload.d.ts +7 -28
  33. package/ImageUpload/MultiImageUpload.js +15 -2
  34. package/ImageUpload/SingleImageUpload.d.ts +4 -26
  35. package/ImageUpload/SingleImageUpload.js +4 -2
  36. package/ImageUpload/styled.d.ts +10 -10
  37. package/Input/Input.d.ts +1 -7
  38. package/List/DataList/DataList.d.ts +11 -35
  39. package/List/DataList/DataList.js +5 -1
  40. package/List/DataList/DataListModalOverlay/DataListModalOverlay.d.ts +2 -2
  41. package/List/DataList/Loader.js +5 -0
  42. package/Menu/Menu.d.ts +1 -4
  43. package/Menu/Menu.stories.js +1 -1
  44. package/Mosaic/Mosaic.d.ts +4 -14
  45. package/Mosaic/Mosaic.js +11 -3
  46. package/Progress/CircularProgress.d.ts +7 -15
  47. package/Radio/Radio.d.ts +1 -5
  48. package/Radio/Radio.js +2 -1
  49. package/Radio/RadioGroup.d.ts +1 -5
  50. package/Radio/RadioGroup.js +2 -1
  51. package/RichTextEditor/RichTextEditor.d.ts +6 -6
  52. package/RichTextEditor/createPropsFromConfig.d.ts +11 -1
  53. package/RichTextEditor/createPropsFromConfig.js +7 -3
  54. package/Ripple/Ripple.d.ts +3 -4
  55. package/Ripple/Ripple.stories.js +1 -1
  56. package/Scrollbar/Scrollbar.d.ts +4 -4
  57. package/Section/index.d.ts +3 -4
  58. package/Select/Select.d.ts +5 -8
  59. package/Select/Select.js +11 -3
  60. package/Slider/Slider.d.ts +1 -5
  61. package/Slider/Slider.js +2 -1
  62. package/Snackbar/Snackbar.d.ts +1 -1
  63. package/Switch/Switch.d.ts +1 -5
  64. package/Switch/Switch.js +2 -1
  65. package/Tabs/Tab.d.ts +4 -0
  66. package/Tabs/Tabs.d.ts +18 -12
  67. package/Tabs/Tabs.js +2 -2
  68. package/Tags/Tags.d.ts +2 -8
  69. package/Tags/Tags.js +7 -3
  70. package/Tooltip/Tooltip.d.ts +5 -7
  71. package/Tooltip/Tooltip.js +6 -1
  72. package/TopProgressBar/TopProgressBar.d.ts +5 -5
  73. package/Typography/Typography.d.ts +3 -3
  74. package/package.json +12 -7
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import { ListItem } from "../List";
3
3
  import { AccordionItem } from "./AccordionItem";
4
- export declare type AccordionProps = {
4
+ export interface AccordionProps {
5
5
  /**
6
6
  * Element displayed when accordion is expanded.
7
7
  */
@@ -14,6 +14,6 @@ export declare type AccordionProps = {
14
14
  * Append a class name
15
15
  */
16
16
  className?: string;
17
- };
18
- declare const Accordion: (props: AccordionProps) => JSX.Element;
17
+ }
18
+ declare const Accordion: React.FC<AccordionProps>;
19
19
  export { Accordion };
@@ -61,6 +61,10 @@ var defaultStyle = {
61
61
  pointerEvents: "none",
62
62
  overflow: "hidden"
63
63
  };
64
+
65
+ /**
66
+ * We are casting pointerEvents as any because csstype does not have PointerEvents exported. Or at least, that is the error.
67
+ */
64
68
  var transitionStyles = {
65
69
  entering: {
66
70
  opacity: 0,
@@ -5,33 +5,22 @@ export declare enum Placement {
5
5
  top = "top",
6
6
  bottom = "bottom"
7
7
  }
8
- export declare type Props = AutoCompleteBaseProps & {
8
+ export interface AutoCompleteProps extends Omit<AutoCompleteBaseProps, "onChange"> {
9
9
  placement?: Placement;
10
- onChange?: (value: any, selection: any) => void;
10
+ onChange?: (value: any, selection?: any) => void;
11
11
  loading?: boolean;
12
12
  noResultFound?: Function;
13
- };
13
+ }
14
14
  declare type State = {
15
15
  inputValue: string;
16
16
  };
17
17
  interface RenderOptionsParams extends Omit<ControllerStateAndHelpers<any>, "getInputProps" | "openMenu"> {
18
- options: Props["options"];
19
- placement: Props["placement"];
18
+ options: AutoCompleteProps["options"];
19
+ placement: AutoCompleteProps["placement"];
20
20
  }
21
- declare class AutoComplete extends React.Component<Props, State> {
22
- static defaultProps: {
23
- valueProp: string;
24
- textProp: string;
25
- options: any[];
26
- placement: Placement;
27
- /**
28
- * We cast this as AutoComplete because renderItem() is executed via .call() where AutoComplete instance is assigned as this.
29
- */
30
- renderItem(item: any): JSX.Element;
31
- };
32
- state: {
33
- inputValue: string;
34
- };
21
+ declare class AutoComplete extends React.Component<AutoCompleteProps, State> {
22
+ static defaultProps: Partial<AutoCompleteProps>;
23
+ state: State;
35
24
  /**
36
25
  * Helps us trigger some of the downshift's methods (eg. clearSelection) and helps us to avoid adding state.
37
26
  */
@@ -7,7 +7,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
7
7
  import _createSuper from "@babel/runtime/helpers/createSuper";
8
8
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
9
  import _isEqual from "lodash/isEqual";
10
- var _excluded = ["className", "options", "onChange", "value", "valueProp", "textProp", "onInput", "validation", "placement"],
10
+ var _excluded = ["className", "options", "onChange", "value", "onInput", "validation", "placement"],
11
11
  _excluded2 = ["getInputProps", "openMenu"];
12
12
  import * as React from "react";
13
13
  import Downshift from "downshift";
@@ -204,12 +204,11 @@ var AutoComplete = /*#__PURE__*/function (_React$Component) {
204
204
  options = _this$props2.options,
205
205
  _onChange = _this$props2.onChange,
206
206
  value = _this$props2.value,
207
- valueProp = _this$props2.valueProp,
208
- textProp = _this$props2.textProp,
209
207
  onInput = _this$props2.onInput,
210
208
  _this$props2$validati = _this$props2.validation,
211
209
  validation = _this$props2$validati === void 0 ? {
212
- isValid: null
210
+ isValid: null,
211
+ message: null
213
212
  } : _this$props2$validati,
214
213
  placement = _this$props2.placement,
215
214
  otherInputProps = _objectWithoutProperties(_this$props2, _excluded); // Downshift related props.
@@ -1,8 +1,12 @@
1
1
  import * as React from "react";
2
2
  import { ControllerStateAndHelpers } from "downshift";
3
3
  import { AutoCompleteBaseProps } from "./types";
4
- import { Props } from "./AutoComplete";
5
- export declare type MultiAutoCompleteProps = AutoCompleteBaseProps & {
4
+ import { AutoCompleteProps } from "./AutoComplete";
5
+ interface SelectionItem {
6
+ name: string;
7
+ }
8
+ declare type MultiAutoCompletePropsValue = SelectionItem[];
9
+ export interface MultiAutoCompleteProps extends Omit<AutoCompleteBaseProps, "value"> {
6
10
  /**
7
11
  * Prevents adding the same item to the list twice.
8
12
  */
@@ -24,7 +28,11 @@ export declare type MultiAutoCompleteProps = AutoCompleteBaseProps & {
24
28
  */
25
29
  renderListItemLabel?: Function;
26
30
  noResultFound?: Function;
27
- };
31
+ /**
32
+ * Value is an array of strings. But can be undefined.
33
+ */
34
+ value?: MultiAutoCompletePropsValue;
35
+ }
28
36
  declare type State = {
29
37
  inputValue: string;
30
38
  multipleSelectionPage: number;
@@ -33,43 +41,19 @@ declare type State = {
33
41
  reorderFormValue: string;
34
42
  };
35
43
  interface RenderOptionsParams extends Omit<ControllerStateAndHelpers<any>, "getInputProps" | "openMenu"> {
36
- options: Props["options"];
44
+ options: AutoCompleteProps["options"];
37
45
  unique: boolean;
38
46
  }
39
47
  export declare class MultiAutoComplete extends React.Component<MultiAutoCompleteProps, State> {
40
- static defaultProps: {
41
- valueProp: string;
42
- textProp: string;
43
- unique: boolean;
44
- options: any[];
45
- useSimpleValues: boolean;
46
- useMultipleSelectionList: boolean;
47
- /**
48
- * We cast this as MultiAutoComplete because renderItem() is executed via .call() where this is MultiAutoComplete instance.
49
- */
50
- renderItem(item: any): JSX.Element;
51
- /**
52
- * We cast this as MultiAutoComplete because renderListItemLabel() is executed via .call() where this is MultiAutoComplete instance.
53
- */
54
- renderListItemLabel(item: any): any;
55
- };
56
- state: {
57
- inputValue: string;
58
- multipleSelectionPage: number;
59
- multipleSelectionSearch: string;
60
- reorderFormVisible: string;
61
- reorderFormValue: string;
62
- };
48
+ static defaultProps: Partial<MultiAutoCompleteProps>;
49
+ state: State;
63
50
  /**
64
51
  * Helps us trigger some of the downshift's methods (eg. clearSelection) and helps us to avoid adding state.
65
52
  */
66
- downshift: React.RefObject<any>;
67
- assignedValueAfterClearing: {
68
- set: boolean;
69
- selection: any;
70
- };
71
- setMultipleSelectionPage: (multipleSelectionPage: any) => void;
72
- setMultipleSelectionSearch: (multipleSelectionSearch: any) => void;
53
+ private downshift;
54
+ private assignedValueAfterClearing;
55
+ setMultipleSelectionPage: (multipleSelectionPage: number) => void;
56
+ setMultipleSelectionSearch: (multipleSelectionSearch: string) => void;
73
57
  getOptions(): any[];
74
58
  /**
75
59
  * Renders options - based on user's input. It will try to match input text with available options.
@@ -7,7 +7,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
7
7
  import _createSuper from "@babel/runtime/helpers/createSuper";
8
8
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
9
  import _objectSpread from "@babel/runtime/helpers/objectSpread2";
10
- var _excluded = ["options", "allowFreeInput", "useSimpleValues", "unique", "value", "onChange", "valueProp", "textProp", "onInput", "validation", "useMultipleSelectionList", "description"],
10
+ var _excluded = ["unique", "value", "onChange", "onInput", "validation", "useMultipleSelectionList", "description"],
11
11
  _excluded2 = ["getInputProps", "openMenu"];
12
12
  import * as React from "react";
13
13
  import Downshift from "downshift";
@@ -466,18 +466,14 @@ export var MultiAutoComplete = /*#__PURE__*/function (_React$Component) {
466
466
 
467
467
  var props = this.props,
468
468
  _this$props3 = this.props,
469
- rawOptions = _this$props3.options,
470
- allowFreeInput = _this$props3.allowFreeInput,
471
- useSimpleValues = _this$props3.useSimpleValues,
472
469
  unique = _this$props3.unique,
473
470
  value = _this$props3.value,
474
471
  _onChange = _this$props3.onChange,
475
- valueProp = _this$props3.valueProp,
476
- textProp = _this$props3.textProp,
477
472
  onInput = _this$props3.onInput,
478
473
  _this$props3$validati = _this$props3.validation,
479
474
  validation = _this$props3$validati === void 0 ? {
480
- isValid: null
475
+ isValid: null,
476
+ message: null
481
477
  } : _this$props3$validati,
482
478
  useMultipleSelectionList = _this$props3.useMultipleSelectionList,
483
479
  description = _this$props3.description,
@@ -487,7 +483,7 @@ export var MultiAutoComplete = /*#__PURE__*/function (_React$Component) {
487
483
  return /*#__PURE__*/React.createElement("div", {
488
484
  className: classNames(autoCompleteStyle, props.className)
489
485
  }, /*#__PURE__*/React.createElement(Downshift, {
490
- defaultSelectedItem: null // @ts-ignore
486
+ defaultSelectedItem: null // @ts-ignore there is no className on Downshift
491
487
  ,
492
488
  className: autoCompleteStyle,
493
489
  itemToString: function itemToString(item) {
@@ -1,9 +1,15 @@
1
- declare type Props = {
1
+ interface Option {
2
+ aliases?: string[];
3
+ index?: number;
4
+ name?: string;
5
+ [key: string]: any;
6
+ }
7
+ interface Props {
2
8
  useSimpleValues?: boolean;
3
9
  valueProp?: string;
4
10
  textProp?: string;
5
- };
6
- export declare const getOptionValue: (option: any, props: Props) => any;
7
- export declare const getOptionText: (option: any, props: Props) => any;
8
- export declare const findInAliases: (option: any, search?: string) => any;
11
+ }
12
+ export declare const getOptionValue: (option: Option | string, props: Props) => string | undefined;
13
+ export declare const getOptionText: (option: Option | string, props: Props) => string | undefined;
14
+ export declare const findInAliases: (option: Option, search?: string) => boolean;
9
15
  export {};
@@ -13,7 +13,7 @@ export var getOptionText = function getOptionText(option, props) {
13
13
  return option;
14
14
  };
15
15
  export var findInAliases = function findInAliases(option, search) {
16
- return option.aliases.some(function (alias) {
16
+ return (option.aliases || []).some(function (alias) {
17
17
  return alias.toLowerCase().includes(search.toLowerCase());
18
18
  });
19
19
  };
@@ -2,7 +2,7 @@ import * as React from "react";
2
2
  import { FabProps } from "@rmwc/fab";
3
3
  import { IconProps } from "../Icon/Icon";
4
4
  import { SyntheticEvent } from "react";
5
- export declare type ButtonProps = {
5
+ export interface ButtonProps {
6
6
  flat?: boolean;
7
7
  small?: boolean;
8
8
  onClick?: (event: React.MouseEvent<any, MouseEvent>) => void | null;
@@ -14,28 +14,28 @@ export declare type ButtonProps = {
14
14
  [key: string]: any;
15
15
  };
16
16
  "data-testid"?: string;
17
- };
17
+ }
18
18
  /**
19
19
  * Shows a default button, used typically when action is not of high priority.
20
20
  * @param props
21
21
  * @returns {*}
22
22
  * @constructor
23
23
  */
24
- export declare const ButtonDefault: (props: ButtonProps) => JSX.Element;
24
+ export declare const ButtonDefault: React.FC<ButtonProps>;
25
25
  /**
26
26
  * Shows primary button, eg. for submitting forms.
27
27
  * @param props
28
28
  * @returns {*}
29
29
  * @constructor
30
30
  */
31
- export declare const ButtonPrimary: (props: ButtonProps) => JSX.Element;
31
+ export declare const ButtonPrimary: React.FC<ButtonProps>;
32
32
  /**
33
33
  * Shows a secondary button - eg. for doing a reset on a form.
34
34
  * @param props
35
35
  * @returns {*}
36
36
  * @constructor
37
37
  */
38
- export declare const ButtonSecondary: (props: ButtonProps) => JSX.Element;
38
+ export declare const ButtonSecondary: React.FC<ButtonProps>;
39
39
  export declare type ButtonFloatingProps = ButtonProps & FabProps & {
40
40
  label?: React.ReactNode;
41
41
  icon?: React.ReactNode;
@@ -48,11 +48,11 @@ export declare type ButtonFloatingProps = ButtonProps & FabProps & {
48
48
  * @returns {*}
49
49
  * @constructor
50
50
  */
51
- export declare const ButtonFloating: (props: ButtonFloatingProps) => JSX.Element;
51
+ export declare const ButtonFloating: React.FC<ButtonFloatingProps>;
52
52
  /**
53
53
  * Shows an icon, suitable to be shown inside of a button.
54
54
  * @param props
55
55
  * @returns {*}
56
56
  * @constructor
57
57
  */
58
- export declare const ButtonIcon: (props: IconProps) => JSX.Element;
58
+ export declare const ButtonIcon: React.FC<IconProps>;
@@ -1,12 +1,12 @@
1
1
  import * as React from "react";
2
2
  import { FormComponentProps } from "../types";
3
- declare type Props = FormComponentProps & {
3
+ interface Props extends FormComponentProps {
4
4
  label?: React.ReactNode;
5
5
  disabled?: boolean;
6
- onClick?: Function;
6
+ onClick?: (value: boolean) => void;
7
7
  indeterminate?: boolean;
8
8
  description?: string;
9
- };
9
+ }
10
10
  /**
11
11
  * Single Checkbox component can be used to store simple boolean values.
12
12
  *
@@ -14,11 +14,7 @@ declare type Props = FormComponentProps & {
14
14
  * In that case, each Checkbox component must receive value and onChange callback via props.
15
15
  */
16
16
  declare class Checkbox extends React.Component<Props> {
17
- static defaultProps: {
18
- validation: {
19
- isValid: any;
20
- };
21
- };
17
+ static defaultProps: Partial<Props>;
22
18
  onChange: (e: React.SyntheticEvent<HTMLInputElement>) => void;
23
19
  render(): JSX.Element;
24
20
  }
@@ -69,7 +69,8 @@ var Checkbox = /*#__PURE__*/function (_React$Component) {
69
69
 
70
70
  _defineProperty(Checkbox, "defaultProps", {
71
71
  validation: {
72
- isValid: null
72
+ isValid: null,
73
+ message: null
73
74
  }
74
75
  });
75
76
 
@@ -11,11 +11,7 @@ declare type Props = FormComponentProps & {
11
11
  * CodeEditor component can be used to store simple boolean values.
12
12
  */
13
13
  declare class CodeEditor extends React.Component<Props> {
14
- static defaultProps: {
15
- validation: {
16
- isValid: any;
17
- };
18
- };
14
+ static defaultProps: Partial<Props>;
19
15
  onChange: (value: string) => void;
20
16
  render(): JSX.Element;
21
17
  }
@@ -81,7 +81,8 @@ var CodeEditor = /*#__PURE__*/function (_React$Component) {
81
81
 
82
82
  _defineProperty(CodeEditor, "defaultProps", {
83
83
  validation: {
84
- isValid: null
84
+ isValid: null,
85
+ message: null
85
86
  }
86
87
  });
87
88
 
@@ -1,4 +1,5 @@
1
1
  import * as React from "react";
2
+ import { ColorResult } from "react-color";
2
3
  import { FormComponentProps } from "../types";
3
4
  declare type Props = FormComponentProps & {
4
5
  label?: string;
@@ -12,14 +13,10 @@ declare class ColorPicker extends React.Component<Props> {
12
13
  state: {
13
14
  showColorPicker: boolean;
14
15
  };
15
- static defaultProps: {
16
- validation: {
17
- isValid: any;
18
- };
19
- };
16
+ static defaultProps: Partial<Props>;
20
17
  handleClick: () => void;
21
18
  handleClose: () => void;
22
- handleChange: (color: any) => void;
19
+ handleChange: (color: ColorResult) => void;
23
20
  render(): JSX.Element;
24
21
  }
25
22
  export { ColorPicker };
@@ -133,7 +133,8 @@ var ColorPicker = /*#__PURE__*/function (_React$Component) {
133
133
 
134
134
  _defineProperty(ColorPicker, "defaultProps", {
135
135
  validation: {
136
- isValid: null
136
+ isValid: null,
137
+ message: null
137
138
  }
138
139
  });
139
140
 
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  interface ChildrenRenderProp {
3
- showConfirmation: (onAccept?: Function, onCancel?: Function) => any;
3
+ showConfirmation: (onAccept?: () => void, onCancel?: () => void) => any;
4
4
  }
5
5
  interface ConfirmationCallbacks {
6
6
  onAccept: Function;
@@ -3,7 +3,7 @@ declare type ConfirmationProps = {
3
3
  title?: React.ReactNode;
4
4
  message?: React.ReactNode;
5
5
  };
6
- declare type WithConfirmationParams = (props: any) => ConfirmationProps;
6
+ declare type WithConfirmationParams = (props: Record<string, any>) => ConfirmationProps;
7
7
  export declare type WithConfirmationProps = {
8
8
  showConfirmation: (confirm: Function, cancel: Function) => void;
9
9
  };
@@ -2,7 +2,6 @@ import * as React from "react";
2
2
  import { DialogProps as RmwcDialogProps, DialogOnCloseEventT, DialogContentProps as RmwcDialogContentProps, DialogTitleProps as RmwcDialogTitleProps, DialogActionsProps as RmwcDialogActionsProps, DialogButtonProps as RmwcDialogButtonProps } from "@rmwc/dialog";
3
3
  export declare type DialogOnClose = (event: DialogOnCloseEventT) => void;
4
4
  export declare type DialogProps = RmwcDialogProps & {
5
- children: any;
6
5
  className?: string;
7
6
  style?: React.CSSProperties;
8
7
  open?: boolean;
@@ -11,7 +10,7 @@ export declare type DialogProps = RmwcDialogProps & {
11
10
  };
12
11
  export declare class Dialog extends React.Component<DialogProps> {
13
12
  container?: Element;
14
- constructor(props: any);
13
+ constructor(props: DialogProps);
15
14
  render(): React.ReactPortal;
16
15
  }
17
16
  export declare type DialogTitleProps = RmwcDialogTitleProps & {
@@ -1,14 +1,27 @@
1
1
  import * as React from "react";
2
+ interface ChildrenRenderPropRowCallableParams {
3
+ index: number;
4
+ data: Record<string, any>;
5
+ }
6
+ interface ChildrenRenderPropRowCallable {
7
+ (params: ChildrenRenderPropRowCallableParams): React.ReactNode;
8
+ }
9
+ interface ChildrenRenderPropHeaderCallable {
10
+ (): React.ReactNode;
11
+ }
12
+ interface ChildrenRenderPropEmptyCallable {
13
+ (): React.ReactNode;
14
+ }
2
15
  interface ChildrenRenderProp {
3
16
  actions: {
4
17
  add: Function;
5
18
  remove: Function;
6
19
  };
7
- header: Function;
8
- row: Function;
9
- empty: Function;
20
+ header: (cb: ChildrenRenderPropHeaderCallable) => React.ReactNode;
21
+ row: (cb: ChildrenRenderPropRowCallable) => React.ReactNode;
22
+ empty: (cb: ChildrenRenderPropEmptyCallable) => React.ReactNode;
10
23
  }
11
- declare type FieldsetProps = {
24
+ interface FieldsetProps {
12
25
  value?: Array<Object>;
13
26
  description?: string;
14
27
  validation?: {
@@ -17,12 +30,9 @@ declare type FieldsetProps = {
17
30
  };
18
31
  onChange?: Function;
19
32
  children: (props: ChildrenRenderProp) => React.ReactNode;
20
- };
33
+ }
21
34
  declare class Fieldset extends React.Component<FieldsetProps> {
22
- static defaultProps: {
23
- value: any[];
24
- description: any;
25
- };
35
+ static defaultProps: Partial<FieldsetProps>;
26
36
  header: React.ReactNode;
27
37
  rows: React.ReactNode;
28
38
  empty: React.ReactNode;
@@ -32,9 +42,9 @@ declare class Fieldset extends React.Component<FieldsetProps> {
32
42
  };
33
43
  removeData: (index: number) => void;
34
44
  addData: (index?: number) => void;
35
- renderHeader: (cb: () => React.ReactNode) => void;
36
- renderRow: (cb: (params: Object) => React.ReactNode) => void;
37
- renderEmpty: (cb: () => React.ReactNode) => void;
45
+ renderHeader: (cb: () => React.ReactNode) => React.ReactNode;
46
+ renderRow: (cb: ChildrenRenderPropRowCallable) => React.ReactNode;
47
+ renderEmpty: (cb: () => React.ReactNode) => React.ReactNode;
38
48
  renderComponent(): {};
39
49
  render(): JSX.Element;
40
50
  }
@@ -78,6 +78,7 @@ var Fieldset = /*#__PURE__*/function (_React$Component) {
78
78
 
79
79
  _defineProperty(_assertThisInitialized(_this), "renderHeader", function (cb) {
80
80
  _this.header = cb();
81
+ return null;
81
82
  });
82
83
 
83
84
  _defineProperty(_assertThisInitialized(_this), "renderRow", function (cb) {
@@ -90,10 +91,12 @@ var Fieldset = /*#__PURE__*/function (_React$Component) {
90
91
  index: index
91
92
  }));
92
93
  });
94
+ return null;
93
95
  });
94
96
 
95
97
  _defineProperty(_assertThisInitialized(_this), "renderEmpty", function (cb) {
96
98
  _this.empty = cb();
99
+ return null;
97
100
  });
98
101
 
99
102
  return _this;
@@ -6,5 +6,5 @@
6
6
  * @param {*} propList
7
7
  * @param {*} appendClasses
8
8
  */
9
- declare const getClasses: (propList: any, appendClasses: any) => any;
9
+ declare const getClasses: (propList: Record<string, any>, appendClasses: string[] | string) => Record<string, any>;
10
10
  export { getClasses };
package/Icon/Icon.d.ts CHANGED
@@ -3,7 +3,7 @@ export declare type IconProps = {
3
3
  /**
4
4
  * SvgComponent containing the svg icon
5
5
  */
6
- icon: React.ReactElement<any>;
6
+ icon: React.ReactElement;
7
7
  /**
8
8
  * Optional onclick handler
9
9
  */
@@ -16,9 +16,6 @@ export declare type IconProps = {
16
16
  };
17
17
  /**
18
18
  * Use Icon component to display an icon.
19
- * @param props
20
- * @returns {*}
21
- * @constructor
22
19
  */
23
- declare const Icon: (props: IconProps) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)>) | (new (props: any) => React.Component<any, any, any>)>;
20
+ declare const Icon: React.FC<IconProps>;
24
21
  export { Icon };
package/Icon/Icon.js CHANGED
@@ -10,9 +10,6 @@ var webinyIcon = /*#__PURE__*/css({}, {
10
10
  }, "label:webinyIcon;");
11
11
  /**
12
12
  * Use Icon component to display an icon.
13
- * @param props
14
- * @returns {*}
15
- * @constructor
16
13
  */
17
14
 
18
15
  var Icon = function Icon(props) {
@@ -1,47 +1,45 @@
1
1
  import * as React from "react";
2
- import { ImageEditorTool } from "./toolbar/types";
3
- export declare type ToolbarTool = "crop" | "flip" | "rotate" | "filter";
4
- declare type RenderPropArgs = {
2
+ import { ImageEditorTool, ToolbarTool } from "./toolbar/types";
3
+ interface RenderPropArgs {
5
4
  render: Function;
6
5
  getCanvasDataUrl: () => string;
7
6
  activeTool?: ImageEditorTool;
8
7
  applyActiveTool: Function;
9
8
  cancelActiveTool: Function;
10
- };
11
- declare type Props = {
9
+ }
10
+ interface PropsOptions {
11
+ autoEnable: boolean;
12
+ }
13
+ interface Props {
12
14
  src: string;
13
15
  tools: ToolbarTool[];
14
16
  options?: {
15
- [key: string]: any;
17
+ flip: PropsOptions;
18
+ filter: PropsOptions;
19
+ crop: PropsOptions;
20
+ rotate: PropsOptions;
16
21
  };
17
22
  onToolActivate?: Function;
18
23
  onToolDeactivate?: Function;
19
24
  children?: (props: RenderPropArgs) => React.ReactNode;
20
- };
21
- declare type State = {
22
- tool?: {
23
- [key: string]: any;
24
- };
25
+ }
26
+ interface State {
27
+ tool?: ImageEditorTool;
25
28
  src: string;
26
- };
29
+ }
27
30
  declare class ImageEditor extends React.Component<Props, State> {
28
- static defaultProps: {
29
- tools: string[];
30
- };
31
- state: {
32
- tool: any;
33
- src: string;
34
- };
35
- canvas: React.RefObject<unknown>;
36
- image: any;
31
+ static defaultProps: Partial<Props>;
32
+ state: State;
33
+ canvas: React.RefObject<HTMLCanvasElement>;
34
+ image: HTMLImageElement;
37
35
  componentDidMount(): void;
38
36
  updateCanvas: () => void;
39
- activateTool: (tool: string | ImageEditorTool) => void;
37
+ activateTool: (tool: ToolbarTool | ImageEditorTool) => void;
40
38
  deactivateTool: () => void;
41
39
  getCanvasDataUrl: () => string;
42
40
  applyActiveTool: () => Promise<void>;
43
41
  cancelActiveTool: () => Promise<void>;
44
- getToolOptions: (tool: ImageEditorTool) => any;
42
+ getToolOptions: (tool: ImageEditorTool) => {};
45
43
  render(): {};
46
44
  }
47
45
  export { ImageEditor };