@jetbrains/ring-ui 5.0.0-beta.1 → 5.0.0-beta.2

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.
@@ -1,5 +1,4 @@
1
1
  import { PureComponent } from 'react';
2
- import PropTypes from 'prop-types';
3
2
  import { ReactMarkdownProps } from 'react-markdown';
4
3
  export interface BaseMarkdownProps {
5
4
  source: string;
@@ -10,13 +9,6 @@ export declare type MarkdownProps = ReactMarkdownProps & BaseMarkdownProps;
10
9
  * @name Markdown
11
10
  */
12
11
  export default class Markdown extends PureComponent<MarkdownProps> {
13
- static propTypes: {
14
- inline: PropTypes.Requireable<boolean>;
15
- source: PropTypes.Requireable<string>;
16
- className: PropTypes.Requireable<string>;
17
- renderers: PropTypes.Requireable<object>;
18
- plugins: PropTypes.Requireable<any[]>;
19
- };
20
12
  render(): JSX.Element;
21
13
  }
22
14
  declare const md: (strings: TemplateStringsArray, ...interpolations: unknown[]) => void;
@@ -1,4 +1,4 @@
1
- import { _ as _defineProperty, a as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
1
+ import { a as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
2
2
  import React, { PureComponent } from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import ReactMarkdown from 'react-markdown';
@@ -57,15 +57,13 @@ class Markdown extends PureComponent {
57
57
  }
58
58
 
59
59
  }
60
-
61
- _defineProperty(Markdown, "propTypes", {
60
+ Markdown.propTypes = {
62
61
  inline: PropTypes.bool,
63
62
  source: PropTypes.string,
64
63
  className: PropTypes.string,
65
64
  renderers: PropTypes.object,
66
65
  plugins: PropTypes.array
67
- });
68
-
66
+ };
69
67
  const md = trivialTemplateTag(source => /*#__PURE__*/React.createElement(Markdown, {
70
68
  source
71
69
  }));
@@ -1,5 +1,4 @@
1
1
  import { Component, ReactNode } from 'react';
2
- import PropTypes from 'prop-types';
3
2
  import Popup, { PopupAttrs } from '../popup/popup';
4
3
  import { Directions } from '../popup/popup.consts';
5
4
  import { IconType } from '../icon/icon';
@@ -30,21 +29,6 @@ interface MessageState {
30
29
  * Displays a popup containing a message.
31
30
  */
32
31
  export default class Message extends Component<MessageProps> {
33
- static propTypes: {
34
- children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
35
- className: PropTypes.Requireable<string>;
36
- tailClassName: PropTypes.Requireable<string>;
37
- title: PropTypes.Validator<string>;
38
- icon: PropTypes.Requireable<PropTypes.ReactComponentLike>;
39
- directions: PropTypes.Requireable<(string | null | undefined)[]>;
40
- direction: PropTypes.Requireable<string>;
41
- popupProps: PropTypes.Requireable<object>;
42
- buttonProps: PropTypes.Requireable<object>;
43
- tailOffset: PropTypes.Requireable<number>;
44
- onClose: PropTypes.Requireable<(...args: any[]) => any>;
45
- onDismiss: PropTypes.Requireable<(...args: any[]) => any>;
46
- translations: PropTypes.Requireable<object>;
47
- };
48
32
  static defaultProps: {
49
33
  icon: string;
50
34
  directions: Directions[];
@@ -202,7 +202,20 @@ class Message extends Component {
202
202
 
203
203
  }
204
204
 
205
- _defineProperty(Message, "propTypes", {
205
+ _defineProperty(Message, "defaultProps", {
206
+ icon: gift,
207
+ directions: [Directions.TOP_RIGHT, Directions.TOP_LEFT, Directions.TOP_CENTER, Directions.BOTTOM_RIGHT, Directions.BOTTOM_LEFT, Directions.BOTTOM_CENTER, Directions.RIGHT_TOP, Directions.RIGHT_BOTTOM, Directions.RIGHT_CENTER, Directions.LEFT_TOP, Directions.LEFT_BOTTOM, Directions.LEFT_CENTER],
208
+ translations: {
209
+ gotIt: 'Got it',
210
+ dismiss: 'Dismiss'
211
+ }
212
+ });
213
+
214
+ _defineProperty(Message, "Directions", Directions);
215
+
216
+ _defineProperty(Message, "PopupProps", Popup.PopupProps);
217
+
218
+ Message.propTypes = {
206
219
  children: PropTypes.node,
207
220
  className: PropTypes.string,
208
221
  tailClassName: PropTypes.string,
@@ -216,19 +229,6 @@ _defineProperty(Message, "propTypes", {
216
229
  onClose: PropTypes.func,
217
230
  onDismiss: PropTypes.func,
218
231
  translations: PropTypes.object
219
- });
220
-
221
- _defineProperty(Message, "defaultProps", {
222
- icon: gift,
223
- directions: [Directions.TOP_RIGHT, Directions.TOP_LEFT, Directions.TOP_CENTER, Directions.BOTTOM_RIGHT, Directions.BOTTOM_LEFT, Directions.BOTTOM_CENTER, Directions.RIGHT_TOP, Directions.RIGHT_BOTTOM, Directions.RIGHT_CENTER, Directions.LEFT_TOP, Directions.LEFT_BOTTOM, Directions.LEFT_CENTER],
224
- translations: {
225
- gotIt: 'Got it',
226
- dismiss: 'Dismiss'
227
- }
228
- });
229
-
230
- _defineProperty(Message, "Directions", Directions);
231
-
232
- _defineProperty(Message, "PopupProps", Popup.PopupProps);
232
+ };
233
233
 
234
234
  export { Message as default };
@@ -2,14 +2,13 @@
2
2
  * @name Pager
3
3
  */
4
4
  import React, { PureComponent, ReactNode } from 'react';
5
- import PropTypes from 'prop-types';
6
5
  import { SelectItem } from '../select/select';
7
6
  export interface PagerTranslations {
8
- perPage: 'per page';
9
- firstPage: 'First page';
10
- lastPage: 'Last page';
11
- nextPage: 'Next page';
12
- previousPage: 'Previous';
7
+ perPage: string;
8
+ firstPage: string;
9
+ lastPage: string;
10
+ nextPage: string;
11
+ previousPage: string;
13
12
  }
14
13
  export interface PagerProps {
15
14
  total: number;
@@ -33,24 +32,6 @@ interface PagerSizeItem {
33
32
  key: number;
34
33
  }
35
34
  export default class Pager extends PureComponent<PagerProps> {
36
- static propTypes: {
37
- total: PropTypes.Validator<number>;
38
- currentPage: PropTypes.Requireable<number>;
39
- pageSize: PropTypes.Requireable<number>;
40
- pageSizes: PropTypes.Requireable<(number | null | undefined)[]>;
41
- visiblePagesLimit: PropTypes.Requireable<number>;
42
- disablePageSizeSelector: PropTypes.Requireable<boolean>;
43
- openTotal: PropTypes.Requireable<boolean>;
44
- canLoadLastPageWithOpenTotal: PropTypes.Requireable<boolean>;
45
- onPageChange: PropTypes.Requireable<(...args: any[]) => any>;
46
- onPageSizeChange: PropTypes.Requireable<(...args: any[]) => any>;
47
- onLoadPage: PropTypes.Requireable<(...args: any[]) => any>;
48
- className: PropTypes.Requireable<string>;
49
- translations: PropTypes.Requireable<object>;
50
- loader: PropTypes.Requireable<boolean>;
51
- loaderNavigation: PropTypes.Requireable<boolean>;
52
- hrefFunc: PropTypes.Requireable<(...args: any[]) => any>;
53
- };
54
35
  static defaultProps: {
55
36
  currentPage: number;
56
37
  pageSize: number;
@@ -327,26 +327,6 @@ class Pager extends PureComponent {
327
327
 
328
328
  }
329
329
 
330
- _defineProperty(Pager, "propTypes", {
331
- total: PropTypes.number.isRequired,
332
- currentPage: PropTypes.number,
333
- pageSize: PropTypes.number,
334
- pageSizes: PropTypes.arrayOf(PropTypes.number),
335
- visiblePagesLimit: PropTypes.number,
336
- disablePageSizeSelector: PropTypes.bool,
337
- openTotal: PropTypes.bool,
338
- canLoadLastPageWithOpenTotal: PropTypes.bool,
339
- onPageChange: PropTypes.func,
340
- onPageSizeChange: PropTypes.func,
341
- onLoadPage: PropTypes.func,
342
- className: PropTypes.string,
343
- translations: PropTypes.object,
344
- loader: PropTypes.bool,
345
- loaderNavigation: PropTypes.bool,
346
- hrefFunc: PropTypes.func //function which generates href for all pager's buttons based on pager state passed as a function parameter, either this function or onPageChange should be provided
347
-
348
- });
349
-
350
330
  _defineProperty(Pager, "defaultProps", {
351
331
  currentPage: 1,
352
332
  pageSize: 50,
@@ -369,4 +349,24 @@ _defineProperty(Pager, "defaultProps", {
369
349
  onLoadPage: () => {}
370
350
  });
371
351
 
352
+ Pager.propTypes = {
353
+ total: PropTypes.number.isRequired,
354
+ currentPage: PropTypes.number,
355
+ pageSize: PropTypes.number,
356
+ pageSizes: PropTypes.arrayOf(PropTypes.number),
357
+ visiblePagesLimit: PropTypes.number,
358
+ disablePageSizeSelector: PropTypes.bool,
359
+ openTotal: PropTypes.bool,
360
+ canLoadLastPageWithOpenTotal: PropTypes.bool,
361
+ onPageChange: PropTypes.func,
362
+ onPageSizeChange: PropTypes.func,
363
+ onLoadPage: PropTypes.func,
364
+ className: PropTypes.string,
365
+ translations: PropTypes.object,
366
+ loader: PropTypes.bool,
367
+ loaderNavigation: PropTypes.bool,
368
+ hrefFunc: PropTypes.func //function which generates href for all pager's buttons based on pager state passed as a function parameter, either this function or onPageChange should be provided
369
+
370
+ };
371
+
372
372
  export { Pager as default };
@@ -1,4 +1,4 @@
1
- import React, { ButtonHTMLAttributes, Component, CSSProperties, DetailedHTMLProps, HTMLAttributes, ReactNode, SyntheticEvent } from 'react';
1
+ import React, { ButtonHTMLAttributes, Component, CSSProperties, HTMLAttributes, ReactNode, RefCallback, SyntheticEvent } from 'react';
2
2
  import { SelectHandlerParams } from '../list/list';
3
3
  import { Size } from '../input/input';
4
4
  import Theme from '../global/theme';
@@ -40,8 +40,10 @@ export interface DataTestProps {
40
40
  'data-test'?: string | null | undefined;
41
41
  }
42
42
  export interface CustomAnchorProps {
43
- wrapperProps: DetailedHTMLProps<HTMLAttributes<HTMLElement> & DataTestProps, HTMLElement>;
44
- buttonProps: DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement> & DataTestProps, HTMLButtonElement>;
43
+ wrapperProps: HTMLAttributes<HTMLElement> & DataTestProps & {
44
+ ref: RefCallback<HTMLElement>;
45
+ };
46
+ buttonProps: ButtonHTMLAttributes<HTMLButtonElement> & DataTestProps;
45
47
  popup: ReactNode;
46
48
  }
47
49
  export interface BaseSelectProps<T = unknown> {
@@ -1,10 +1,8 @@
1
1
  import PropTypes from 'prop-types';
2
- import { ReactElement, ReactNode } from 'react';
3
- export interface CustomItemProps {
4
- children?: ReactNode;
5
- }
2
+ import { ReactElement } from 'react';
3
+ import { TabProps } from './tab';
6
4
  export declare const CustomItem: {
7
- ({ children }: CustomItemProps): ReactElement<any, string | import("react").JSXElementConstructor<any>>;
5
+ ({ children }: TabProps): ReactElement<any, string | import("react").JSXElementConstructor<any>>;
8
6
  propTypes: {
9
7
  children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
10
8
  };
@@ -5,7 +5,9 @@ import { CollapsibleTabsProps } from './collapsible-tabs';
5
5
  import { CustomItem } from './custom-item';
6
6
  import { TabProps } from './tab';
7
7
  export { CustomItem };
8
- export interface TabsProps extends ThemeProps, Omit<CollapsibleTabsProps, 'onSelect'> {
8
+ declare type Children = readonly Children[] | ReactElement<TabProps> | null | boolean;
9
+ export interface TabsProps extends ThemeProps, Omit<CollapsibleTabsProps, 'onSelect' | 'children'> {
10
+ children: Children;
9
11
  onSelect: (key: string) => void;
10
12
  className?: string | null | undefined;
11
13
  autoCollapse?: boolean | null | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetbrains/ring-ui",
3
- "version": "5.0.0-beta.1",
3
+ "version": "5.0.0-beta.2",
4
4
  "description": "JetBrains UI library",
5
5
  "author": "JetBrains",
6
6
  "license": "Apache-2.0",
@@ -35,8 +35,6 @@
35
35
  "console-errors": "jest console-errors.test.js --watchAll",
36
36
  "console-errors-ci": "jest console-errors.test.js --reporters=jest-teamcity",
37
37
  "test": "karma start",
38
- "pretest-generator-e2e": "npm run prebuild",
39
- "test-generator-e2e": "npm --prefix packages/generator test",
40
38
  "hermione-gui": "npm --prefix packages/hermione run gui",
41
39
  "hermione-test": "npm --prefix packages/hermione run test",
42
40
  "hermione-test-ci": "npm --prefix packages/hermione run test-ci",
@@ -116,6 +114,7 @@
116
114
  "chai-enzyme": "1.0.0-beta.1",
117
115
  "cheerio": "^0.22.0",
118
116
  "core-js": "^3.19.1",
117
+ "cpy-cli": "^3.1.1",
119
118
  "enzyme": "^3.11.0",
120
119
  "eslint": "^8.3.0",
121
120
  "eslint-import-resolver-webpack": "^0.13.2",
@@ -203,7 +202,6 @@
203
202
  "combokeys": "^3.0.1",
204
203
  "compile-code-loader": "^1.0.0",
205
204
  "conic-gradient": "^1.0.0",
206
- "cpy-cli": "^3.1.1",
207
205
  "css-loader": "^6.5.1",
208
206
  "csstype": "^3.0.9",
209
207
  "date-fns": "^2.27.0",
@@ -247,5 +245,5 @@
247
245
  "node": ">=7.4",
248
246
  "npm": ">=6.0.0"
249
247
  },
250
- "gitHead": "921cebd61f2f988b5fec0d1f7b014cd90ee43bb3"
248
+ "gitHead": "5534c66311bd65ff87beb54ef1153ed00624a927"
251
249
  }