@jetbrains/ring-ui 7.0.0-beta.2 → 7.0.0-beta.4

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 (245) hide show
  1. package/components/alert/alert.d.ts +7 -24
  2. package/components/alert/alert.js +0 -24
  3. package/components/alert/container.d.ts +0 -5
  4. package/components/alert/container.js +0 -5
  5. package/components/alert-service/alert-service.js +2 -2
  6. package/components/auth/auth__core.d.ts +4 -4
  7. package/components/auth/auth__core.js +24 -15
  8. package/components/auth/down-notification.js +0 -9
  9. package/components/auth-dialog/auth-dialog.d.ts +0 -18
  10. package/components/auth-dialog/auth-dialog.js +0 -18
  11. package/components/avatar/avatar.d.ts +0 -13
  12. package/components/avatar/avatar.js +0 -13
  13. package/components/avatar/fallback-avatar.d.ts +1 -10
  14. package/components/avatar/fallback-avatar.js +0 -6
  15. package/components/badge/badge.d.ts +0 -10
  16. package/components/badge/badge.js +0 -10
  17. package/components/breadcrumbs/breadcrumbs.css +1 -0
  18. package/components/button/button.d.ts +0 -21
  19. package/components/button/button.js +0 -21
  20. package/components/button-group/button-group.d.ts +0 -5
  21. package/components/button-group/button-group.js +0 -5
  22. package/components/button-group/caption.d.ts +0 -4
  23. package/components/button-group/caption.js +0 -4
  24. package/components/button-set/button-set.d.ts +0 -6
  25. package/components/button-set/button-set.js +0 -6
  26. package/components/button-toolbar/button-toolbar.d.ts +0 -6
  27. package/components/button-toolbar/button-toolbar.js +0 -6
  28. package/components/checkbox/checkbox.d.ts +0 -19
  29. package/components/checkbox/checkbox.js +0 -21
  30. package/components/code/code.d.ts +0 -12
  31. package/components/code/code.js +0 -13
  32. package/components/confirm/confirm.d.ts +0 -14
  33. package/components/confirm/confirm.js +0 -14
  34. package/components/content-layout/content-layout.d.ts +0 -7
  35. package/components/content-layout/content-layout.js +0 -7
  36. package/components/content-layout/sidebar.d.ts +0 -9
  37. package/components/content-layout/sidebar.js +0 -9
  38. package/components/contenteditable/contenteditable.d.ts +1 -22
  39. package/components/contenteditable/contenteditable.js +0 -17
  40. package/components/control-label/control-label.js +0 -6
  41. package/components/data-list/data-list.d.ts +0 -2
  42. package/components/data-list/data-list.js +0 -23
  43. package/components/data-list/item.js +0 -25
  44. package/components/data-list/title.d.ts +2 -2
  45. package/components/data-list/title.js +0 -18
  46. package/components/date-picker/consts.d.ts +0 -2
  47. package/components/date-picker/consts.js +0 -6
  48. package/components/date-picker/date-input.d.ts +0 -20
  49. package/components/date-picker/date-input.js +0 -21
  50. package/components/date-picker/date-picker.d.ts +0 -29
  51. package/components/date-picker/date-picker.js +1 -39
  52. package/components/date-picker/date-popup.d.ts +0 -22
  53. package/components/date-picker/date-popup.js +1 -23
  54. package/components/date-picker/day.d.ts +0 -14
  55. package/components/date-picker/day.js +1 -15
  56. package/components/date-picker/month-names.d.ts +1 -11
  57. package/components/date-picker/month-names.js +1 -13
  58. package/components/date-picker/month-slider.d.ts +0 -9
  59. package/components/date-picker/month-slider.js +1 -10
  60. package/components/date-picker/month.d.ts +1 -9
  61. package/components/date-picker/month.js +1 -6
  62. package/components/date-picker/months.d.ts +1 -9
  63. package/components/date-picker/months.js +1 -6
  64. package/components/date-picker/weekdays.d.ts +2 -8
  65. package/components/date-picker/weekdays.js +0 -4
  66. package/components/date-picker/years.d.ts +0 -6
  67. package/components/date-picker/years.js +1 -7
  68. package/components/dialog/dialog.d.ts +0 -20
  69. package/components/dialog/dialog.js +7 -28
  70. package/components/dropdown/anchor.d.ts +1 -8
  71. package/components/dropdown/anchor.js +0 -5
  72. package/components/dropdown/dropdown.d.ts +4 -22
  73. package/components/dropdown/dropdown.js +0 -22
  74. package/components/dropdown-menu/dropdown-menu.js +0 -18
  75. package/components/error-bubble/error-bubble.d.ts +0 -6
  76. package/components/error-bubble/error-bubble.js +0 -6
  77. package/components/error-message/error-message.d.ts +0 -10
  78. package/components/error-message/error-message.js +0 -10
  79. package/components/footer/footer.js +0 -19
  80. package/components/global/composeRefs.d.ts +0 -3
  81. package/components/global/composeRefs.js +0 -3
  82. package/components/global/create-stateful-context.d.ts +0 -4
  83. package/components/global/create-stateful-context.js +0 -4
  84. package/components/global/focus-sensor-hoc.js +0 -17
  85. package/components/global/react-dom-renderer.d.ts +0 -5
  86. package/components/global/react-dom-renderer.js +0 -5
  87. package/components/global/theme.d.ts +1 -0
  88. package/components/global/theme.js +1 -1
  89. package/components/grid/col.d.ts +0 -14
  90. package/components/grid/col.js +0 -15
  91. package/components/grid/grid.d.ts +0 -5
  92. package/components/grid/grid.js +0 -5
  93. package/components/grid/row.d.ts +0 -18
  94. package/components/grid/row.js +0 -18
  95. package/components/group/group.d.ts +0 -5
  96. package/components/group/group.js +0 -5
  97. package/components/header/header-icon.d.ts +0 -22
  98. package/components/header/header-icon.js +0 -6
  99. package/components/header/header.d.ts +0 -7
  100. package/components/header/header.js +0 -7
  101. package/components/header/logo.d.ts +0 -4
  102. package/components/header/logo.js +0 -4
  103. package/components/header/profile.d.ts +1 -39
  104. package/components/header/profile.js +1 -43
  105. package/components/header/services-link.d.ts +0 -10
  106. package/components/header/services-link.js +0 -10
  107. package/components/header/services.d.ts +0 -14
  108. package/components/header/services.js +0 -12
  109. package/components/header/smart-profile.d.ts +0 -9
  110. package/components/header/smart-profile.js +3 -11
  111. package/components/header/smart-services.d.ts +0 -4
  112. package/components/header/smart-services.js +0 -5
  113. package/components/header/tray.d.ts +0 -5
  114. package/components/header/tray.js +0 -5
  115. package/components/heading/heading.js +0 -6
  116. package/components/icon/icon.d.ts +0 -11
  117. package/components/icon/icon.js +0 -11
  118. package/components/icon/icon__svg.d.ts +0 -8
  119. package/components/icon/icon__svg.js +6 -7
  120. package/components/input/input.js +1 -29
  121. package/components/island/adaptive-island-hoc.d.ts +0 -1
  122. package/components/island/adaptive-island-hoc.js +0 -1
  123. package/components/island/content.d.ts +0 -10
  124. package/components/island/content.js +0 -10
  125. package/components/island/header.js +0 -8
  126. package/components/island/island.d.ts +0 -9
  127. package/components/island/island.js +0 -8
  128. package/components/island-legacy/content-legacy.d.ts +0 -5
  129. package/components/island-legacy/content-legacy.js +0 -5
  130. package/components/island-legacy/header-legacy.d.ts +0 -5
  131. package/components/island-legacy/header-legacy.js +0 -5
  132. package/components/island-legacy/island-legacy.d.ts +0 -5
  133. package/components/island-legacy/island-legacy.js +0 -5
  134. package/components/link/clickableLink.d.ts +0 -9
  135. package/components/link/clickableLink.js +0 -9
  136. package/components/link/link.d.ts +0 -25
  137. package/components/link/link.js +0 -13
  138. package/components/list/list.d.ts +0 -32
  139. package/components/list/list.js +1 -30
  140. package/components/list/list__custom.js +0 -21
  141. package/components/list/list__hint.d.ts +0 -4
  142. package/components/list/list__hint.js +0 -4
  143. package/components/list/list__item.js +0 -44
  144. package/components/list/list__link.js +1 -21
  145. package/components/list/list__separator.js +0 -9
  146. package/components/list/list__title.js +0 -13
  147. package/components/loader/loader.d.ts +0 -10
  148. package/components/loader/loader.js +0 -10
  149. package/components/loader-inline/loader-inline.d.ts +0 -6
  150. package/components/loader-inline/loader-inline.js +0 -6
  151. package/components/loader-screen/loader-screen.d.ts +0 -6
  152. package/components/loader-screen/loader-screen.js +0 -6
  153. package/components/login-dialog/login-dialog.d.ts +0 -11
  154. package/components/login-dialog/login-dialog.js +0 -11
  155. package/components/login-dialog/service.js +4 -1
  156. package/components/markdown/markdown.js +0 -5
  157. package/components/message/message.js +0 -16
  158. package/components/pager/pager.js +0 -19
  159. package/components/panel/panel.d.ts +0 -5
  160. package/components/panel/panel.js +0 -5
  161. package/components/popup/popup.js +0 -38
  162. package/components/popup/popup.target.js +0 -5
  163. package/components/popup-menu/popup-menu.js +0 -8
  164. package/components/progress-bar/progress-bar.css +4 -4
  165. package/components/progress-bar/progress-bar.d.ts +19 -33
  166. package/components/progress-bar/progress-bar.js +0 -33
  167. package/components/query-assist/query-assist.d.ts +63 -93
  168. package/components/query-assist/query-assist.js +0 -93
  169. package/components/radio/radio.d.ts +0 -8
  170. package/components/radio/radio.js +0 -12
  171. package/components/radio/radio__item.d.ts +0 -9
  172. package/components/radio/radio__item.js +0 -10
  173. package/components/select/select.js +8 -76
  174. package/components/select/select__filter.js +6 -9
  175. package/components/select/select__popup.js +0 -54
  176. package/components/shortcuts/core.js +3 -3
  177. package/components/shortcuts/shortcuts-hoc.d.ts +0 -5
  178. package/components/shortcuts/shortcuts-hoc.js +0 -5
  179. package/components/shortcuts/shortcuts.d.ts +0 -8
  180. package/components/shortcuts/shortcuts.js +0 -8
  181. package/components/tab-trap/tab-trap.js +0 -8
  182. package/components/table/cell.d.ts +0 -6
  183. package/components/table/cell.js +0 -6
  184. package/components/table/disable-hover-hoc.d.ts +0 -1
  185. package/components/table/disable-hover-hoc.js +0 -1
  186. package/components/table/header-cell.d.ts +0 -10
  187. package/components/table/header-cell.js +0 -10
  188. package/components/table/header.d.ts +0 -15
  189. package/components/table/header.js +0 -15
  190. package/components/table/multitable.d.ts +0 -4
  191. package/components/table/multitable.js +0 -4
  192. package/components/table/row-with-focus-sensor.d.ts +2 -2
  193. package/components/table/row-with-focus-sensor.js +0 -2
  194. package/components/table/row.js +0 -34
  195. package/components/table/selection-shortcuts-hoc.js +0 -16
  196. package/components/table/simple-table.d.ts +0 -44
  197. package/components/table/simple-table.js +0 -4
  198. package/components/table/smart-table.d.ts +0 -48
  199. package/components/table/smart-table.js +0 -7
  200. package/components/table/table.d.ts +0 -2
  201. package/components/table/table.js +1 -50
  202. package/components/tabs/collapsible-more.d.ts +1 -9
  203. package/components/tabs/collapsible-more.js +0 -23
  204. package/components/tabs/collapsible-tab.js +0 -8
  205. package/components/tabs/collapsible-tabs.d.ts +2 -29
  206. package/components/tabs/collapsible-tabs.js +0 -12
  207. package/components/tabs/custom-item.d.ts +1 -7
  208. package/components/tabs/custom-item.js +0 -4
  209. package/components/tabs/dumb-tabs.d.ts +0 -11
  210. package/components/tabs/dumb-tabs.js +0 -11
  211. package/components/tabs/smart-tabs.d.ts +0 -6
  212. package/components/tabs/smart-tabs.js +0 -6
  213. package/components/tabs/tab-link.d.ts +0 -8
  214. package/components/tabs/tab-link.js +0 -6
  215. package/components/tabs/tab.d.ts +0 -8
  216. package/components/tabs/tab.js +0 -8
  217. package/components/tag/tag.css +3 -48
  218. package/components/tag/tag.d.ts +0 -19
  219. package/components/tag/tag.js +0 -24
  220. package/components/tags-input/tags-input.d.ts +7 -33
  221. package/components/tags-input/tags-input.js +1 -31
  222. package/components/tags-list/tags-list.d.ts +0 -13
  223. package/components/tags-list/tags-list.js +0 -13
  224. package/components/text/text.d.ts +0 -7
  225. package/components/text/text.js +0 -7
  226. package/components/toggle/toggle.d.ts +0 -15
  227. package/components/toggle/toggle.js +0 -15
  228. package/components/tooltip/tooltip.d.ts +0 -9
  229. package/components/tooltip/tooltip.js +0 -9
  230. package/components/user-agreement/user-agreement.d.ts +0 -18
  231. package/components/user-agreement/user-agreement.js +0 -18
  232. package/components/user-card/card.d.ts +0 -35
  233. package/components/user-card/card.js +0 -28
  234. package/components/user-card/smart-user-card-tooltip.d.ts +0 -5
  235. package/components/user-card/smart-user-card-tooltip.js +0 -5
  236. package/components/user-card/tooltip.d.ts +0 -9
  237. package/components/user-card/tooltip.js +0 -9
  238. package/package.json +27 -29
  239. package/components/global/prop-types.d.ts +0 -4
  240. package/components/global/prop-types.js +0 -4
  241. package/components/global/react-render-adapter.d.ts +0 -1
  242. package/components/global/react-render-adapter.js +0 -3
  243. package/components/header/tray-icon.d.ts +0 -1
  244. package/components/header/tray-icon.js +0 -2
  245. package/components/palette/palette.css +0 -220
@@ -1,6 +1,5 @@
1
1
  import { PureComponent, ReactNode } from 'react';
2
2
  import * as React from 'react';
3
- import PropTypes from 'prop-types';
4
3
  import Theme from '../global/theme';
5
4
  export declare const ANIMATION_TIME = 500;
6
5
  /**
@@ -20,10 +19,17 @@ export declare enum AlertType {
20
19
  export interface AlertProps {
21
20
  theme: Theme;
22
21
  timeout: number;
22
+ /**
23
+ * Fires when alert starts closing if timeout is out or user clicks "Close" button
24
+ */
23
25
  onCloseRequest: ((event?: React.MouseEvent<HTMLElement>) => void);
24
26
  onClose: (() => void);
25
27
  isShaking: boolean;
26
28
  isClosing: boolean;
29
+ /**
30
+ * Whether an alert is rendered inside an **Alerts** container
31
+ * or standalone.
32
+ */
27
33
  inline: boolean;
28
34
  showWithAnimation: boolean;
29
35
  closeable: boolean;
@@ -46,29 +52,6 @@ interface State {
46
52
  * **Alert** is a component for displaying contextual notifications. If you want to display a stack of notifications, use **Alerts** instead.
47
53
  */
48
54
  export default class Alert extends PureComponent<AlertProps, State> {
49
- static propTypes: {
50
- timeout: PropTypes.Requireable<number>;
51
- /**
52
- * Fires when alert starts closing if timeout is out or user clicks "Close" button
53
- */
54
- onCloseRequest: PropTypes.Requireable<(...args: any[]) => any>;
55
- onClose: PropTypes.Requireable<(...args: any[]) => any>;
56
- isShaking: PropTypes.Requireable<boolean>;
57
- isClosing: PropTypes.Requireable<boolean>;
58
- /**
59
- * Whether an alert is rendered inside an **Alerts** container
60
- * or standalone.
61
- */
62
- inline: PropTypes.Requireable<boolean>;
63
- showWithAnimation: PropTypes.Requireable<boolean>;
64
- closeable: PropTypes.Requireable<boolean>;
65
- type: PropTypes.Requireable<AlertType>;
66
- children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
67
- className: PropTypes.Requireable<string>;
68
- captionClassName: PropTypes.Requireable<string>;
69
- closeButtonClassName: PropTypes.Requireable<string>;
70
- 'data-test': PropTypes.Requireable<string>;
71
- };
72
55
  /** @override */
73
56
  static defaultProps: {
74
57
  theme: Theme;
@@ -1,7 +1,6 @@
1
1
  import { PureComponent } from 'react';
2
2
  import * as React from 'react';
3
3
  import classNames from 'classnames';
4
- import PropTypes from 'prop-types';
5
4
  import exceptionIcon from '@jetbrains/icons/exception';
6
5
  import checkmarkIcon from '@jetbrains/icons/checkmark';
7
6
  import warningIcon from '@jetbrains/icons/warning';
@@ -56,29 +55,6 @@ const TypeToIconColor = {
56
55
  * **Alert** is a component for displaying contextual notifications. If you want to display a stack of notifications, use **Alerts** instead.
57
56
  */
58
57
  export default class Alert extends PureComponent {
59
- static propTypes = {
60
- timeout: PropTypes.number,
61
- /**
62
- * Fires when alert starts closing if timeout is out or user clicks "Close" button
63
- */
64
- onCloseRequest: PropTypes.func,
65
- onClose: PropTypes.func,
66
- isShaking: PropTypes.bool,
67
- isClosing: PropTypes.bool,
68
- /**
69
- * Whether an alert is rendered inside an **Alerts** container
70
- * or standalone.
71
- */
72
- inline: PropTypes.bool,
73
- showWithAnimation: PropTypes.bool,
74
- closeable: PropTypes.bool,
75
- type: PropTypes.oneOf(Object.values(AlertType)),
76
- children: PropTypes.node,
77
- className: PropTypes.string,
78
- captionClassName: PropTypes.string,
79
- closeButtonClassName: PropTypes.string,
80
- 'data-test': PropTypes.string
81
- };
82
58
  /** @override */
83
59
  static defaultProps = {
84
60
  theme: Theme.DARK,
@@ -1,5 +1,4 @@
1
1
  import { PureComponent, HTMLAttributes } from 'react';
2
- import PropTypes from 'prop-types';
3
2
  /**
4
3
  * @name Alert Container
5
4
  * @description Displays a stack of alerts on top of the page.
@@ -7,9 +6,5 @@ import PropTypes from 'prop-types';
7
6
  */
8
7
  export type AlertContainerProps = HTMLAttributes<HTMLDivElement>;
9
8
  export default class Alerts extends PureComponent<AlertContainerProps> {
10
- static propTypes: {
11
- children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
12
- className: PropTypes.Requireable<string>;
13
- };
14
9
  render(): import("react").ReactPortal | null;
15
10
  }
@@ -1,13 +1,8 @@
1
1
  import { Children, cloneElement, PureComponent, isValidElement } from 'react';
2
2
  import { createPortal } from 'react-dom';
3
3
  import classNames from 'classnames';
4
- import PropTypes from 'prop-types';
5
4
  import styles from './container.css';
6
5
  export default class Alerts extends PureComponent {
7
- static propTypes = {
8
- children: PropTypes.node,
9
- className: PropTypes.string
10
- };
11
6
  render() {
12
7
  const { children, className, ...restProps } = this.props;
13
8
  const classes = classNames(styles.alertContainer, className);
@@ -71,11 +71,11 @@ class AlertService {
71
71
  timeout,
72
72
  isClosing: false,
73
73
  onCloseRequest: () => {
74
- onCloseRequest && onCloseRequest();
74
+ onCloseRequest?.();
75
75
  this.startAlertClosing(alert);
76
76
  },
77
77
  onClose: () => {
78
- onClose && onClose();
78
+ onClose?.();
79
79
  this.removeWithoutAnimation(alert.key);
80
80
  },
81
81
  ...restOptions
@@ -1,6 +1,6 @@
1
1
  import Listeners, { Handler } from '../global/listeners';
2
2
  import HTTP, { HTTPAuth, RequestParams } from '../http/http';
3
- import AuthDialogService from '../auth-dialog-service/auth-dialog-service';
3
+ import type AuthDialogService from '../auth-dialog-service/auth-dialog-service';
4
4
  import AuthStorage, { AuthState } from './storage';
5
5
  import { AuthError, AuthResponse } from './response-parser';
6
6
  import AuthRequestBuilder from './request-builder';
@@ -129,7 +129,7 @@ export default class Auth implements HTTPAuth {
129
129
  listeners: Listeners<AuthPayloadMap>;
130
130
  http: HTTP;
131
131
  private _service;
132
- readonly _storage: AuthStorage<number> | null;
132
+ readonly _storage: AuthStorage<number>;
133
133
  private _responseParser;
134
134
  private readonly _requestBuilder;
135
135
  _backgroundFlow: BackgroundFlow | null;
@@ -174,7 +174,7 @@ export default class Auth implements HTTPAuth {
174
174
  /**
175
175
  * @return {Promise.<object>}
176
176
  */
177
- getUser(accessToken?: string | null | undefined): Promise<any> | undefined;
177
+ getUser(accessToken?: string | null | undefined): Promise<any>;
178
178
  /**
179
179
  * @return {Promise.<object>}
180
180
  */
@@ -197,7 +197,7 @@ export default class Auth implements HTTPAuth {
197
197
  */
198
198
  login(): Promise<void>;
199
199
  switchUser(): Promise<void>;
200
- _makeStateFromResponse(authResponse: AuthResponse): AuthState;
200
+ _makeStateFromResponse(authResponse: AuthResponse): AuthState | null;
201
201
  /**
202
202
  * Check if the hash contains an access token.
203
203
  * If it does, extract the state, compare with
@@ -58,7 +58,7 @@ export default class Auth {
58
58
  listeners = new Listeners();
59
59
  http;
60
60
  _service = {};
61
- _storage = null;
61
+ _storage;
62
62
  _responseParser = new AuthResponseParser();
63
63
  _requestBuilder = null;
64
64
  _backgroundFlow;
@@ -694,23 +694,24 @@ export default class Auth {
694
694
  _makeStateFromResponse(authResponse) {
695
695
  const { state } = authResponse;
696
696
  if (!state) {
697
- return {};
697
+ throw new Error('No state in AuthResponse');
698
698
  }
699
699
  const { scope: defaultScope } = this.config;
700
+ let urlFromState = null;
700
701
  try {
701
- const urlFromState = new URL(state); // checking if state contains valid URL on same origin, see HUB-11514
702
- if (urlFromState.origin !== window.location.origin) {
703
- return {};
704
- }
705
- return {
706
- restoreLocation: state,
707
- created: Date.now(),
708
- scopes: defaultScope
709
- };
702
+ urlFromState = new URL(state); // checking if state contains valid URL on same origin, see HUB-11514
710
703
  }
711
- catch (e) {
712
- return {};
704
+ catch {
705
+ return null;
706
+ }
707
+ if (urlFromState.origin !== window.location.origin) {
708
+ throw new Error(`State contains URL with different origin: "${state}"`);
713
709
  }
710
+ return {
711
+ restoreLocation: state,
712
+ created: Date.now(),
713
+ scopes: defaultScope
714
+ };
714
715
  }
715
716
  /**
716
717
  * Check if the hash contains an access token.
@@ -731,8 +732,16 @@ export default class Auth {
731
732
  return undefined;
732
733
  }
733
734
  const { state: stateId, scope, expiresIn, accessToken } = authResponse;
734
- const newState = await (stateId && this._storage?.getState(stateId)) ||
735
- this._makeStateFromResponse(authResponse);
735
+ let newState = null;
736
+ if (stateId) {
737
+ newState = await this._storage.getState(stateId);
738
+ if (!newState) {
739
+ newState = this._makeStateFromResponse(authResponse);
740
+ }
741
+ }
742
+ if (!newState) {
743
+ throw new Error(`Could not create state where stateId="${stateId}"`);
744
+ }
736
745
  const scopes = scope ? scope.split(' ') : newState.scopes || defaultScope || [];
737
746
  const effectiveExpiresIn = expiresIn ? parseInt(expiresIn, 10) : defaultExpiresIn;
738
747
  const expires = TokenValidator._epoch() + effectiveExpiresIn;
@@ -1,5 +1,4 @@
1
1
  import * as React from 'react';
2
- import PropTypes from 'prop-types';
3
2
  import alertService from '../alert-service/alert-service';
4
3
  import Alert from '../alert/alert';
5
4
  import Link from '../link/link';
@@ -27,14 +26,6 @@ function Message({ translations, onCheckAgain }) {
27
26
  <Link onClick={onCheckAgain} data-test="check-again">{checkAgain}</Link>
28
27
  </div>);
29
28
  }
30
- Message.propTypes = {
31
- translations: PropTypes.shape({
32
- backendIsNotAvailable: PropTypes.string,
33
- checkAgain: PropTypes.string,
34
- errorMessage: PropTypes.string
35
- }),
36
- onCheckAgain: PropTypes.func
37
- };
38
29
  export default function onBackendDown({ onCheckAgain, translations }) {
39
30
  async function checkAgainWithoutClosing(e) {
40
31
  // Alert has weird behaviour of handling clicks by "a" tags
@@ -1,5 +1,4 @@
1
1
  import { Component } from 'react';
2
- import PropTypes from 'prop-types';
3
2
  /**
4
3
  * @name Auth Dialog
5
4
  */
@@ -21,23 +20,6 @@ export interface AuthDialogProps {
21
20
  onTryAgain?: () => void;
22
21
  }
23
22
  export default class AuthDialog extends Component<AuthDialogProps> {
24
- static propTypes: {
25
- className: PropTypes.Requireable<string>;
26
- title: PropTypes.Requireable<string>;
27
- errorMessage: PropTypes.Requireable<string>;
28
- serviceImage: PropTypes.Requireable<string>;
29
- serviceName: PropTypes.Requireable<string>;
30
- loginCaption: PropTypes.Requireable<string>;
31
- loginToCaption: PropTypes.Requireable<string>;
32
- show: PropTypes.Requireable<boolean>;
33
- cancelOnEsc: PropTypes.Requireable<boolean>;
34
- confirmLabel: PropTypes.Requireable<string>;
35
- cancelLabel: PropTypes.Requireable<string>;
36
- tryAgainLabel: PropTypes.Requireable<string>;
37
- onConfirm: PropTypes.Requireable<(...args: any[]) => any>;
38
- onCancel: PropTypes.Requireable<(...args: any[]) => any>;
39
- onTryAgain: PropTypes.Requireable<(...args: any[]) => any>;
40
- };
41
23
  static defaultProps: {
42
24
  loginCaption: string;
43
25
  loginToCaption: string;
@@ -1,5 +1,4 @@
1
1
  import { Component } from 'react';
2
- import PropTypes from 'prop-types';
3
2
  import classNames from 'classnames';
4
3
  import { Content } from '../island/island';
5
4
  import Dialog from '../dialog/dialog';
@@ -7,23 +6,6 @@ import Button from '../button/button';
7
6
  import { H2 } from '../heading/heading';
8
7
  import styles from './auth-dialog.css';
9
8
  export default class AuthDialog extends Component {
10
- static propTypes = {
11
- className: PropTypes.string,
12
- title: PropTypes.string,
13
- errorMessage: PropTypes.string,
14
- serviceImage: PropTypes.string,
15
- serviceName: PropTypes.string,
16
- loginCaption: PropTypes.string,
17
- loginToCaption: PropTypes.string,
18
- show: PropTypes.bool,
19
- cancelOnEsc: PropTypes.bool,
20
- confirmLabel: PropTypes.string,
21
- cancelLabel: PropTypes.string,
22
- tryAgainLabel: PropTypes.string,
23
- onConfirm: PropTypes.func,
24
- onCancel: PropTypes.func,
25
- onTryAgain: PropTypes.func
26
- };
27
9
  static defaultProps = {
28
10
  loginCaption: 'Log in',
29
11
  loginToCaption: 'Log in to %serviceName%',
@@ -1,5 +1,4 @@
1
1
  import { PureComponent, ImgHTMLAttributes } from 'react';
2
- import PropTypes from 'prop-types';
3
2
  /**
4
3
  * @name Avatar
5
4
  */
@@ -24,18 +23,6 @@ export interface AvatarProps extends ImgHTMLAttributes<HTMLImageElement> {
24
23
  skipParams?: boolean | null | undefined;
25
24
  }
26
25
  export default class Avatar extends PureComponent<AvatarProps> {
27
- static propTypes: {
28
- dpr: PropTypes.Requireable<number>;
29
- className: PropTypes.Requireable<string>;
30
- size: PropTypes.Requireable<number>;
31
- style: PropTypes.Requireable<object>;
32
- url: PropTypes.Requireable<string>;
33
- round: PropTypes.Requireable<boolean>;
34
- subavatar: PropTypes.Requireable<string>;
35
- subavatarSize: PropTypes.Requireable<number>;
36
- username: PropTypes.Requireable<string>;
37
- skipParams: PropTypes.Requireable<boolean>;
38
- };
39
26
  static defaultProps: {
40
27
  dpr: number;
41
28
  size: Size;
@@ -1,5 +1,4 @@
1
1
  import { PureComponent } from 'react';
2
- import PropTypes from 'prop-types';
3
2
  import classNames from 'classnames';
4
3
  import { encodeURL, isDataURI, parseQueryString } from '../global/url';
5
4
  import { getPixelRatio } from '../global/dom';
@@ -20,18 +19,6 @@ export var Size;
20
19
  Size[Size["Size56"] = 56] = "Size56";
21
20
  })(Size || (Size = {}));
22
21
  export default class Avatar extends PureComponent {
23
- static propTypes = {
24
- dpr: PropTypes.number,
25
- className: PropTypes.string,
26
- size: PropTypes.number,
27
- style: PropTypes.object,
28
- url: PropTypes.string,
29
- round: PropTypes.bool,
30
- subavatar: PropTypes.string,
31
- subavatarSize: PropTypes.number,
32
- username: PropTypes.string,
33
- skipParams: PropTypes.bool
34
- };
35
22
  static defaultProps = {
36
23
  dpr: getPixelRatio(),
37
24
  size: Size.Size20,
@@ -1,16 +1,7 @@
1
- import PropTypes from 'prop-types';
2
1
  import { Size } from './avatar';
3
2
  export interface FallbackAvatarProps {
4
3
  username: string;
5
4
  size: Size;
6
5
  round: boolean | null | undefined;
7
6
  }
8
- declare function FallbackAvatar({ username, size, round }: FallbackAvatarProps): import("react").JSX.Element;
9
- declare namespace FallbackAvatar {
10
- var propTypes: {
11
- username: PropTypes.Validator<string>;
12
- size: PropTypes.Validator<number>;
13
- round: PropTypes.Requireable<boolean>;
14
- };
15
- }
16
- export default FallbackAvatar;
7
+ export default function FallbackAvatar({ username, size, round }: FallbackAvatarProps): import("react").JSX.Element;
@@ -1,5 +1,4 @@
1
1
  import { useMemo } from 'react';
2
- import PropTypes from 'prop-types';
3
2
  import getUID from '../global/get-uid';
4
3
  const colorPairs = [
5
4
  ['#60A800', '#D5CA00'],
@@ -106,8 +105,3 @@ export default function FallbackAvatar({ username, size, round }) {
106
105
  </g>
107
106
  </svg>);
108
107
  }
109
- FallbackAvatar.propTypes = {
110
- username: PropTypes.string.isRequired,
111
- size: PropTypes.number.isRequired,
112
- round: PropTypes.bool
113
- };
@@ -1,5 +1,4 @@
1
1
  import { PureComponent, HTMLAttributes } from 'react';
2
- import PropTypes from 'prop-types';
3
2
  export interface BadgeProps extends HTMLAttributes<HTMLElement> {
4
3
  gray?: boolean | null | undefined;
5
4
  valid?: boolean | null | undefined;
@@ -11,14 +10,5 @@ export interface BadgeProps extends HTMLAttributes<HTMLElement> {
11
10
  * @name Badge
12
11
  */
13
12
  export default class Badge extends PureComponent<BadgeProps> {
14
- static propTypes: {
15
- gray: PropTypes.Requireable<boolean>;
16
- valid: PropTypes.Requireable<boolean>;
17
- invalid: PropTypes.Requireable<boolean>;
18
- disabled: PropTypes.Requireable<boolean>;
19
- className: PropTypes.Requireable<string>;
20
- children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
21
- 'data-test': PropTypes.Requireable<string>;
22
- };
23
13
  render(): import("react").JSX.Element;
24
14
  }
@@ -1,5 +1,4 @@
1
1
  import { PureComponent } from 'react';
2
- import PropTypes from 'prop-types';
3
2
  import classNames from 'classnames';
4
3
  import deprecate from 'util-deprecate';
5
4
  import dataTests from '../global/data-tests';
@@ -10,15 +9,6 @@ const warn = deprecate(() => { }, 'Badge is deprecated and will be removed in Ri
10
9
  */
11
10
  // TODO remove in 7.0
12
11
  export default class Badge extends PureComponent {
13
- static propTypes = {
14
- gray: PropTypes.bool,
15
- valid: PropTypes.bool,
16
- invalid: PropTypes.bool,
17
- disabled: PropTypes.bool,
18
- className: PropTypes.string,
19
- children: PropTypes.node,
20
- 'data-test': PropTypes.string
21
- };
22
12
  render() {
23
13
  warn();
24
14
  const {
@@ -4,4 +4,5 @@
4
4
  color: var(--ring-borders-color);
5
5
 
6
6
  font-size: 16px;
7
+ line-height: 16px;
7
8
  }
@@ -1,6 +1,5 @@
1
1
  import { PureComponent, ButtonHTMLAttributes } from 'react';
2
2
  import * as React from 'react';
3
- import PropTypes from 'prop-types';
4
3
  import { IconProps, IconType, Size } from '../icon/icon';
5
4
  import { ClickableLinkProps } from '../link/clickableLink';
6
5
  import { ControlsHeight, ControlsHeightContext } from '../global/controls-height';
@@ -36,26 +35,6 @@ export type ButtonProps = ButtonButtonProps | ButtonLinkProps;
36
35
  * A component for displaying variously styled buttons.
37
36
  */
38
37
  export declare class Button extends PureComponent<ButtonProps> {
39
- static propTypes: {
40
- active: PropTypes.Requireable<boolean>;
41
- danger: PropTypes.Requireable<boolean>;
42
- delayed: PropTypes.Requireable<boolean>;
43
- loader: PropTypes.Requireable<boolean>;
44
- primary: PropTypes.Requireable<boolean>;
45
- short: PropTypes.Requireable<boolean>;
46
- text: PropTypes.Requireable<boolean>;
47
- inline: PropTypes.Requireable<boolean>;
48
- dropdown: PropTypes.Requireable<boolean>;
49
- href: PropTypes.Requireable<string>;
50
- target: PropTypes.Requireable<string>;
51
- icon: PropTypes.Requireable<NonNullable<PropTypes.ReactComponentLike | null | undefined>>;
52
- iconSize: PropTypes.Requireable<number>;
53
- iconClassName: PropTypes.Requireable<string>;
54
- iconSuppressSizeWarning: PropTypes.Requireable<boolean>;
55
- className: PropTypes.Requireable<string>;
56
- children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
57
- onClick: PropTypes.Requireable<(...args: any[]) => any>;
58
- };
59
38
  static IconSize: typeof Size;
60
39
  static contextType: React.Context<ControlsHeight>;
61
40
  context: React.ContextType<typeof ControlsHeightContext>;
@@ -1,6 +1,5 @@
1
1
  import { createRef, PureComponent } from 'react';
2
2
  import * as React from 'react';
3
- import PropTypes from 'prop-types';
4
3
  import classNames from 'classnames';
5
4
  import chevronDown from '@jetbrains/icons/chevron-down';
6
5
  import Icon, { Size } from '../icon/icon';
@@ -15,26 +14,6 @@ import { getButtonClasses } from './button__classes';
15
14
  * A component for displaying variously styled buttons.
16
15
  */
17
16
  export class Button extends PureComponent {
18
- static propTypes = {
19
- active: PropTypes.bool,
20
- danger: PropTypes.bool,
21
- delayed: PropTypes.bool,
22
- loader: PropTypes.bool,
23
- primary: PropTypes.bool,
24
- short: PropTypes.bool,
25
- text: PropTypes.bool,
26
- inline: PropTypes.bool,
27
- dropdown: PropTypes.bool,
28
- href: PropTypes.string,
29
- target: PropTypes.string,
30
- icon: PropTypes.oneOfType([PropTypes.string, PropTypes.elementType]),
31
- iconSize: PropTypes.number,
32
- iconClassName: PropTypes.string,
33
- iconSuppressSizeWarning: PropTypes.bool,
34
- className: PropTypes.string,
35
- children: PropTypes.node,
36
- onClick: PropTypes.func
37
- };
38
17
  static IconSize = Size;
39
18
  static contextType = ControlsHeightContext;
40
19
  buttonRef = createRef();
@@ -1,5 +1,4 @@
1
1
  import { PureComponent, HTMLAttributes, ReactNode } from 'react';
2
- import PropTypes from 'prop-types';
3
2
  import Caption from './caption';
4
3
  export interface ButtonGroupProps extends HTMLAttributes<HTMLElement> {
5
4
  split?: boolean | null | undefined;
@@ -11,10 +10,6 @@ export interface ButtonGroupProps extends HTMLAttributes<HTMLElement> {
11
10
  * @name Button Group
12
11
  */
13
12
  export default class ButtonGroup extends PureComponent<ButtonGroupProps> {
14
- static propTypes: {
15
- children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
16
- className: PropTypes.Requireable<string>;
17
- };
18
13
  render(): import("react").JSX.Element;
19
14
  }
20
15
  export { Caption };
@@ -1,5 +1,4 @@
1
1
  import { PureComponent } from 'react';
2
- import PropTypes from 'prop-types';
3
2
  import classNames from 'classnames';
4
3
  import dataTests from '../global/data-tests';
5
4
  import ControlLabel from '../control-label/control-label';
@@ -10,10 +9,6 @@ import styles from './button-group.css';
10
9
  * @name Button Group
11
10
  */
12
11
  export default class ButtonGroup extends PureComponent {
13
- static propTypes = {
14
- children: PropTypes.node,
15
- className: PropTypes.string
16
- };
17
12
  render() {
18
13
  const { className, split, 'data-test': dataTest, label, help, ...restProps } = this.props;
19
14
  const classes = classNames(split ? styles.split : styles.buttonGroup, className);
@@ -1,8 +1,4 @@
1
1
  import { PureComponent, HTMLAttributes } from 'react';
2
- import PropTypes from 'prop-types';
3
2
  export default class Caption extends PureComponent<HTMLAttributes<HTMLElement>> {
4
- static propTypes: {
5
- className: PropTypes.Requireable<PropTypes.ReactNodeLike>;
6
- };
7
3
  render(): import("react").JSX.Element;
8
4
  }
@@ -1,11 +1,7 @@
1
1
  import { PureComponent } from 'react';
2
- import PropTypes from 'prop-types';
3
2
  import classNames from 'classnames';
4
3
  import styles from './button-group.css';
5
4
  export default class Caption extends PureComponent {
6
- static propTypes = {
7
- className: PropTypes.node
8
- };
9
5
  render() {
10
6
  const { className } = this.props;
11
7
  const classes = classNames(styles.caption, className);
@@ -1,5 +1,4 @@
1
1
  import { PureComponent, HTMLAttributes } from 'react';
2
- import PropTypes from 'prop-types';
3
2
  export interface ButtonSetProps extends HTMLAttributes<HTMLElement> {
4
3
  'data-test'?: string | null | undefined;
5
4
  }
@@ -7,10 +6,5 @@ export interface ButtonSetProps extends HTMLAttributes<HTMLElement> {
7
6
  * @name Button Set
8
7
  */
9
8
  export default class ButtonSet extends PureComponent<ButtonSetProps> {
10
- static propTypes: {
11
- children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
12
- className: PropTypes.Requireable<string>;
13
- 'data-test': PropTypes.Requireable<string>;
14
- };
15
9
  render(): import("react").JSX.Element;
16
10
  }
@@ -1,17 +1,11 @@
1
1
  import { PureComponent } from 'react';
2
2
  import classNames from 'classnames';
3
- import PropTypes from 'prop-types';
4
3
  import dataTests from '../global/data-tests';
5
4
  import styles from './button-set.css';
6
5
  /**
7
6
  * @name Button Set
8
7
  */
9
8
  export default class ButtonSet extends PureComponent {
10
- static propTypes = {
11
- children: PropTypes.node,
12
- className: PropTypes.string,
13
- 'data-test': PropTypes.string
14
- };
15
9
  render() {
16
10
  const { className, 'data-test': dataTest, children, ...restProps } = this.props;
17
11
  const classes = classNames(styles.buttonSet, className);
@@ -1,5 +1,4 @@
1
1
  import { PureComponent, HTMLAttributes } from 'react';
2
- import PropTypes from 'prop-types';
3
2
  export interface ButtonToolbarProps extends HTMLAttributes<HTMLElement> {
4
3
  'data-test'?: string | null | undefined;
5
4
  }
@@ -7,10 +6,5 @@ export interface ButtonToolbarProps extends HTMLAttributes<HTMLElement> {
7
6
  * @name Button Toolbar
8
7
  */
9
8
  export default class ButtonToolbar extends PureComponent<ButtonToolbarProps> {
10
- static propTypes: {
11
- children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
12
- className: PropTypes.Requireable<string>;
13
- 'data-test': PropTypes.Requireable<string>;
14
- };
15
9
  render(): import("react").JSX.Element;
16
10
  }
@@ -1,5 +1,4 @@
1
1
  import { PureComponent } from 'react';
2
- import PropTypes from 'prop-types';
3
2
  import classNames from 'classnames';
4
3
  import dataTests from '../global/data-tests';
5
4
  import styles from './button-toolbar.css';
@@ -7,11 +6,6 @@ import styles from './button-toolbar.css';
7
6
  * @name Button Toolbar
8
7
  */
9
8
  export default class ButtonToolbar extends PureComponent {
10
- static propTypes = {
11
- children: PropTypes.node,
12
- className: PropTypes.string,
13
- 'data-test': PropTypes.string
14
- };
15
9
  render() {
16
10
  const { className, 'data-test': dataTest, ...restProps } = this.props;
17
11
  const classes = classNames(styles.buttonToolbar, className);