@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
package/Tabs/Tabs.d.ts CHANGED
@@ -1,12 +1,16 @@
1
1
  import React, { ReactNode } from "react";
2
- export declare type TabsRenderProps = {
2
+ export interface TabsRenderProps {
3
3
  switchTab(tabIndex: number): void;
4
- };
5
- export declare type TabsProps = {
4
+ }
5
+ export interface TabsPropsChildrenCallable {
6
+ (props: TabsRenderProps): ReactNode;
7
+ }
8
+ declare type TabsPropsChildren = TabsPropsChildrenCallable | ReactNode;
9
+ export interface TabsProps {
6
10
  /**
7
11
  * A collection of tabs that needs to be rendered.
8
12
  */
9
- children: ((props: TabsRenderProps) => ReactNode) | ReactNode;
13
+ children: TabsPropsChildren;
10
14
  /**
11
15
  * Append a class name.
12
16
  */
@@ -23,19 +27,21 @@ export declare type TabsProps = {
23
27
  * Function to change active tab.
24
28
  */
25
29
  updateValue?: (index: number) => void;
26
- };
27
- declare type State = {
30
+ /**
31
+ * Tab ID for the testing.
32
+ */
33
+ "data-testid"?: string;
34
+ }
35
+ interface State {
28
36
  activeTabIndex: number;
29
- };
37
+ }
30
38
  /**
31
39
  * Use Tabs component to display a list of choices, once the handler is triggered.
32
40
  */
33
41
  export declare class Tabs extends React.Component<TabsProps, State> {
34
- state: {
35
- activeTabIndex: number;
36
- };
37
- switchTab(activeTabIndex: any): void;
38
- renderChildren(children: any, activeIndex: any): JSX.Element;
42
+ state: State;
43
+ switchTab(activeTabIndex: number): void;
44
+ renderChildren(children: React.ReactNode, activeIndex: number): JSX.Element;
39
45
  render(): JSX.Element;
40
46
  }
41
47
  export {};
package/Tabs/Tabs.js CHANGED
@@ -131,8 +131,8 @@ export var Tabs = /*#__PURE__*/function (_React$Component) {
131
131
  var children = this.props.children;
132
132
 
133
133
  if (typeof this.props.children === "function") {
134
- // @ts-ignore
135
- children = this.props.children({
134
+ var childrenCallable = this.props.children;
135
+ children = childrenCallable({
136
136
  switchTab: this.switchTab.bind(this)
137
137
  });
138
138
  }
package/Tags/Tags.d.ts CHANGED
@@ -45,14 +45,8 @@ declare type State = {
45
45
  inputValue: string;
46
46
  };
47
47
  export declare class Tags extends React.Component<Props, State> {
48
- state: {
49
- inputValue: string;
50
- };
51
- static defaultProps: {
52
- validation: {
53
- isValid: any;
54
- };
55
- };
48
+ state: State;
49
+ static defaultProps: Partial<Props>;
56
50
  render(): JSX.Element;
57
51
  }
58
52
  export default Tags;
package/Tags/Tags.js CHANGED
@@ -79,15 +79,18 @@ export var Tags = /*#__PURE__*/function (_React$Component) {
79
79
  inputValue: inputValue
80
80
  });
81
81
  },
82
- onKeyDown: function onKeyDown(e) {
82
+ onKeyDown: function onKeyDown(ev) {
83
83
  if (!onChange) {
84
84
  return;
85
85
  }
86
86
 
87
87
  var newValue = Array.isArray(value) ? _toConsumableArray(value) : [];
88
88
  var inputValue = _this2.state.inputValue || "";
89
+ /**
90
+ * We must cast as keycode only works with Event | string type.
91
+ */
89
92
 
90
- switch (keycode(e)) {
93
+ switch (keycode(ev)) {
91
94
  case "enter":
92
95
  if (inputValue) {
93
96
  newValue.push(inputValue);
@@ -141,7 +144,8 @@ export var Tags = /*#__PURE__*/function (_React$Component) {
141
144
 
142
145
  _defineProperty(Tags, "defaultProps", {
143
146
  validation: {
144
- isValid: null
147
+ isValid: null,
148
+ message: null
145
149
  }
146
150
  });
147
151
 
@@ -1,23 +1,21 @@
1
1
  import * as React from "react";
2
2
  import "rc-tooltip/assets/bootstrap_white.css";
3
3
  import "./style.scss";
4
- declare type TooltipProps = {
4
+ interface TooltipProps {
5
5
  children: React.ReactNode;
6
6
  content: React.ReactNode;
7
7
  trigger?: string;
8
8
  placement?: string;
9
9
  className?: string;
10
- };
11
- declare type State = {
10
+ }
11
+ interface State {
12
12
  tooltipIsOpen: boolean;
13
- };
13
+ }
14
14
  /**
15
15
  * Use Tooltip component to display a list of choices, once the handler is triggered.
16
16
  */
17
17
  declare class Tooltip extends React.Component<TooltipProps, State> {
18
- state: {
19
- tooltipIsOpen: boolean;
20
- };
18
+ state: State;
21
19
  onVisibleChange: (visible: boolean) => void;
22
20
  render(): JSX.Element;
23
21
  }
@@ -44,7 +44,12 @@ var Tooltip = /*#__PURE__*/function (_React$Component) {
44
44
  _createClass(Tooltip, [{
45
45
  key: "render",
46
46
  value: function render() {
47
- return /*#__PURE__*/React.createElement(RcTooltip, Object.assign({
47
+ return /*#__PURE__*/React.createElement(RcTooltip
48
+ /**
49
+ * rc-tooltip types do not have animation as prop, but the rc-tooltip lib has.
50
+ */
51
+ // @ts-ignore
52
+ , Object.assign({
48
53
  animation: "fade",
49
54
  onVisibleChange: this.onVisibleChange,
50
55
  overlay: this.props.content
@@ -1,15 +1,15 @@
1
1
  import * as React from "react";
2
2
  import nprogress from "nprogress";
3
3
  import "./style.scss";
4
- export declare type TopProgressBarRender = {
4
+ export interface TopProgressBarRender {
5
5
  start: () => void;
6
6
  finish: () => void;
7
- nprogress: nprogress;
8
- };
9
- export declare type TopProgressBarProps = {
7
+ nprogress: typeof nprogress;
8
+ }
9
+ export interface TopProgressBarProps {
10
10
  /**
11
11
  * Elements that require top loading bar to be shown.
12
12
  */
13
13
  children: (params: TopProgressBarRender) => React.ReactElement;
14
- };
14
+ }
15
15
  export declare const TopProgressBar: (props: TopProgressBarProps) => 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>)>;
@@ -1,13 +1,13 @@
1
1
  import * as React from "react";
2
2
  import { TypographyProps as RmwcTypographyProps } from "@rmwc/typography";
3
- declare type TypographyProps = RmwcTypographyProps & {
3
+ export interface TypographyProps extends RmwcTypographyProps {
4
4
  children?: React.ReactNode;
5
5
  className?: string;
6
6
  style?: React.CSSProperties;
7
7
  tag?: string;
8
- };
8
+ }
9
9
  /**
10
10
  * Use Ripple component to display a list of choices, once the handler is triggered.
11
11
  */
12
- declare const Typography: (props: TypographyProps) => JSX.Element;
12
+ declare const Typography: React.FC<TypographyProps>;
13
13
  export { Typography };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/ui",
3
- "version": "5.23.1",
3
+ "version": "5.24.0-beta.0",
4
4
  "main": "index.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -81,11 +81,16 @@
81
81
  "@storybook/addon-knobs": "^5.0.5",
82
82
  "@storybook/addon-links": "^5.0.5",
83
83
  "@storybook/react": "^5.2.8",
84
- "@webiny/cli": "^5.23.1",
85
- "@webiny/form": "^5.23.1",
86
- "@webiny/project-utils": "^5.23.1",
87
- "@webiny/storybook-utils": "^5.23.1",
88
- "@webiny/validation": "^5.23.1",
84
+ "@types/nprogress": "^0.2.0",
85
+ "@types/rc-tooltip": "^3.7.6",
86
+ "@types/react-custom-scrollbars": "^4.0.10",
87
+ "@types/react-transition-group": "^4.4.4",
88
+ "@types/shortid": "^0.0.29",
89
+ "@webiny/cli": "^5.24.0-beta.0",
90
+ "@webiny/form": "^5.24.0-beta.0",
91
+ "@webiny/project-utils": "^5.24.0-beta.0",
92
+ "@webiny/storybook-utils": "^5.24.0-beta.0",
93
+ "@webiny/validation": "^5.24.0-beta.0",
89
94
  "babel-loader": "^8.0.0-beta.6",
90
95
  "babel-plugin-emotion": "^9.2.8",
91
96
  "execa": "^5.0.0",
@@ -133,5 +138,5 @@
133
138
  ]
134
139
  }
135
140
  },
136
- "gitHead": "a726d09d2647d13e5a4f376cef23463564ef7ca0"
141
+ "gitHead": "05b90b92bbaf2ef3adf275d008c4641580cf5f42"
137
142
  }