@jetbrains/ring-ui 5.0.136 → 5.0.138

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 (193) hide show
  1. package/components/auth/auth__core.d.ts +1 -1
  2. package/components/auth/auth__core.js +21 -26
  3. package/components/auth-dialog/auth-dialog.js +3 -1
  4. package/components/button/button.css +7 -7
  5. package/components/button/button.d.ts +0 -1
  6. package/components/button/button.js +0 -1
  7. package/components/button-group/button-group.css +2 -2
  8. package/components/button-group/button-group.d.ts +0 -1
  9. package/components/button-group/button-group.js +0 -1
  10. package/components/button-group-ng/button-group-ng.js +0 -1
  11. package/components/button-ng/button-ng.js +0 -1
  12. package/components/checkbox/checkbox.css +1 -1
  13. package/components/checkbox/checkbox.d.ts +0 -1
  14. package/components/checkbox/checkbox.js +0 -1
  15. package/components/checkbox-ng/checkbox-ng.js +0 -1
  16. package/components/date-picker/date-input.js +3 -1
  17. package/components/editable-heading/editable-heading.css +7 -3
  18. package/components/editable-heading/editable-heading.js +29 -8
  19. package/components/global/react-render-adapter.js +16 -31
  20. package/components/header/profile.d.ts +54 -1
  21. package/components/header/profile.js +15 -11
  22. package/components/i18n/README.md +3 -0
  23. package/components/i18n/i18n-context.d.ts +54 -0
  24. package/components/i18n/i18n-context.js +3 -0
  25. package/components/i18n/i18n.d.ts +56 -0
  26. package/components/i18n/i18n.js +8 -0
  27. package/components/i18n/messages.json +53 -0
  28. package/components/input/input.d.ts +1 -4
  29. package/components/input/input.js +16 -16
  30. package/components/island/island.css +1 -1
  31. package/components/island/island.d.ts +0 -1
  32. package/components/island/island.js +0 -1
  33. package/components/island-ng/island-ng.js +0 -1
  34. package/components/link/link.css +1 -1
  35. package/components/link/link.d.ts +0 -1
  36. package/components/link/link.js +0 -1
  37. package/components/link-ng/link-ng.js +0 -1
  38. package/components/message/message.d.ts +1 -5
  39. package/components/message/message.js +15 -16
  40. package/components/pager/pager.d.ts +54 -8
  41. package/components/pager/pager.js +10 -12
  42. package/components/query-assist/query-assist.d.ts +1 -5
  43. package/components/query-assist/query-assist.js +30 -29
  44. package/components/select/select.css +2 -2
  45. package/components/select/select.d.ts +2 -5
  46. package/components/select/select.js +14 -12
  47. package/components/select/select__filter.d.ts +0 -1
  48. package/components/select/select__filter.js +4 -2
  49. package/components/tabs/dumb-tabs.d.ts +0 -1
  50. package/components/tabs/dumb-tabs.js +0 -1
  51. package/components/tabs/tabs.css +1 -1
  52. package/components/tabs-ng/tabs-ng.js +0 -1
  53. package/components/tag/tag.css +3 -3
  54. package/components/tag/tag.d.ts +0 -1
  55. package/components/tag/tag.js +0 -1
  56. package/components/user-agreement/user-agreement.d.ts +1 -9
  57. package/components/user-agreement/user-agreement.js +31 -30
  58. package/components/user-card/card.d.ts +65 -13
  59. package/components/user-card/card.js +19 -22
  60. package/dist/_helpers/card.js +19 -28
  61. package/dist/_helpers/select__filter.js +14 -10
  62. package/dist/alert/alert.js +0 -1
  63. package/dist/alert-service/alert-service.js +0 -1
  64. package/dist/auth/auth.js +1 -1
  65. package/dist/auth/auth__core.d.ts +1 -1
  66. package/dist/auth/auth__core.js +19 -28
  67. package/dist/auth/down-notification.js +0 -1
  68. package/dist/auth/iframe-flow.js +0 -1
  69. package/dist/auth/landing.js +1 -1
  70. package/dist/auth/storage.js +0 -1
  71. package/dist/auth-dialog/auth-dialog.js +1 -2
  72. package/dist/auth-dialog-service/auth-dialog-service.js +0 -1
  73. package/dist/auth-ng/auth-ng.js +1 -1
  74. package/dist/avatar-editor-ng/avatar-editor-ng.js +0 -1
  75. package/dist/breadcrumb-ng/breadcrumb-ng.js +0 -1
  76. package/dist/button/button.d.ts +0 -1
  77. package/dist/button/button.js +0 -1
  78. package/dist/button-group/button-group.d.ts +0 -1
  79. package/dist/button-group/button-group.js +0 -1
  80. package/dist/button-group-ng/button-group-ng.js +0 -1
  81. package/dist/button-ng/button-ng.js +0 -1
  82. package/dist/checkbox/checkbox.d.ts +0 -1
  83. package/dist/checkbox/checkbox.js +0 -1
  84. package/dist/checkbox-ng/checkbox-ng.js +0 -1
  85. package/dist/clipboard/clipboard.js +0 -1
  86. package/dist/confirm/confirm.js +0 -1
  87. package/dist/confirm-ng/confirm-ng.js +0 -1
  88. package/dist/confirm-service/confirm-service.js +0 -1
  89. package/dist/data-list/data-list.js +0 -1
  90. package/dist/data-list/data-list.mock.js +0 -1
  91. package/dist/data-list/item.js +0 -1
  92. package/dist/data-list/title.js +0 -1
  93. package/dist/data-list-ng/data-list-ng.js +0 -1
  94. package/dist/date-picker/date-input.js +3 -2
  95. package/dist/date-picker/date-picker.js +2 -1
  96. package/dist/date-picker/date-popup.js +2 -1
  97. package/dist/dialog/dialog.js +0 -1
  98. package/dist/dialog-ng/dialog-ng.js +0 -1
  99. package/dist/dropdown/anchor.js +0 -1
  100. package/dist/dropdown/dropdown.js +0 -1
  101. package/dist/dropdown-menu/dropdown-menu.js +0 -1
  102. package/dist/editable-heading/editable-heading.js +32 -10
  103. package/dist/error-message-ng/error-message-ng.js +0 -1
  104. package/dist/footer/footer.js +0 -1
  105. package/dist/footer-ng/footer-ng.js +0 -1
  106. package/dist/global/react-render-adapter.js +0 -2
  107. package/dist/header/header.js +2 -1
  108. package/dist/header/profile.d.ts +54 -1
  109. package/dist/header/profile.js +22 -16
  110. package/dist/header/services-link.js +0 -1
  111. package/dist/header/services.js +0 -1
  112. package/dist/header/smart-profile.js +2 -1
  113. package/dist/header/smart-services.js +1 -1
  114. package/dist/header/tray-icon.js +0 -1
  115. package/dist/i18n/i18n-context.d.ts +54 -0
  116. package/dist/i18n/i18n-context.js +6 -0
  117. package/dist/i18n/i18n.d.ts +56 -0
  118. package/dist/i18n/i18n.js +114 -0
  119. package/dist/input/input.d.ts +1 -4
  120. package/dist/input/input.js +6 -8
  121. package/dist/input-ng/input-ng.js +0 -1
  122. package/dist/island/island.d.ts +0 -1
  123. package/dist/island/island.js +0 -1
  124. package/dist/island-ng/island-ng.js +0 -1
  125. package/dist/link/link.d.ts +0 -1
  126. package/dist/link/link.js +0 -1
  127. package/dist/link-ng/link-ng.js +0 -1
  128. package/dist/list/list.js +0 -1
  129. package/dist/list/list__item.js +0 -1
  130. package/dist/list/list__link.js +0 -1
  131. package/dist/list/list__users-groups-source.js +0 -1
  132. package/dist/login-dialog/login-dialog.js +0 -1
  133. package/dist/login-dialog/service.js +0 -1
  134. package/dist/markdown/link.js +0 -1
  135. package/dist/markdown/markdown.js +0 -1
  136. package/dist/message/message.d.ts +1 -5
  137. package/dist/message/message.js +5 -8
  138. package/dist/pager/pager.d.ts +54 -8
  139. package/dist/pager/pager.js +19 -16
  140. package/dist/pager-ng/pager-ng.js +2 -1
  141. package/dist/permissions-ng/permissions-ng.js +1 -1
  142. package/dist/popup-menu/popup-menu.js +0 -1
  143. package/dist/promised-click-ng/promised-click-ng.js +0 -1
  144. package/dist/query-assist/query-assist.d.ts +1 -5
  145. package/dist/query-assist/query-assist.js +22 -20
  146. package/dist/query-assist/query-assist__suggestions.js +0 -1
  147. package/dist/query-assist-ng/query-assist-ng.js +2 -1
  148. package/dist/save-field-ng/save-field-ng.js +0 -1
  149. package/dist/select/select.d.ts +2 -5
  150. package/dist/select/select.js +49 -46
  151. package/dist/select/select__filter.d.ts +0 -1
  152. package/dist/select/select__filter.js +2 -1
  153. package/dist/select/select__popup.js +2 -1
  154. package/dist/select-ng/select-ng.js +2 -1
  155. package/dist/select-ng/select-ng__lazy.js +2 -1
  156. package/dist/shortcuts-hint-ng/shortcuts-hint-ng.js +0 -1
  157. package/dist/sidebar-ng/sidebar-ng.js +0 -1
  158. package/dist/storage/storage.js +0 -1
  159. package/dist/storage/storage__local.js +0 -1
  160. package/dist/style.css +1 -1
  161. package/dist/table/header.js +0 -1
  162. package/dist/table/row-with-focus-sensor.js +0 -1
  163. package/dist/table/row.js +0 -1
  164. package/dist/table/smart-table.js +0 -1
  165. package/dist/table/table.js +0 -1
  166. package/dist/table-legacy-ng/table-legacy-ng.js +2 -1
  167. package/dist/table-legacy-ng/table-legacy-ng__pager.js +2 -1
  168. package/dist/table-ng/smart-table-ng.js +0 -1
  169. package/dist/table-ng/table-ng.js +0 -1
  170. package/dist/tabs/collapsible-more.js +0 -1
  171. package/dist/tabs/collapsible-tab.js +0 -1
  172. package/dist/tabs/collapsible-tabs.js +0 -1
  173. package/dist/tabs/dumb-tabs.d.ts +0 -1
  174. package/dist/tabs/dumb-tabs.js +0 -1
  175. package/dist/tabs/smart-tabs.js +0 -1
  176. package/dist/tabs/tab-link.js +0 -1
  177. package/dist/tabs/tabs.js +0 -1
  178. package/dist/tabs-ng/tabs-ng.js +0 -1
  179. package/dist/tag/tag.d.ts +0 -1
  180. package/dist/tag/tag.js +0 -1
  181. package/dist/tags-input/tags-input.js +2 -1
  182. package/dist/tags-input-ng/tags-input-ng.js +2 -1
  183. package/dist/tags-list/tags-list.js +0 -1
  184. package/dist/user-agreement/service.js +2 -1
  185. package/dist/user-agreement/user-agreement.d.ts +1 -9
  186. package/dist/user-agreement/user-agreement.js +11 -18
  187. package/dist/user-card/card.d.ts +65 -13
  188. package/dist/user-card/card.js +2 -1
  189. package/dist/user-card/smart-user-card-tooltip.js +2 -1
  190. package/dist/user-card/tooltip.js +2 -1
  191. package/dist/user-card/user-card.js +2 -1
  192. package/dist/user-card-ng/user-card-ng.js +2 -1
  193. package/package.json +37 -38
@@ -15,7 +15,7 @@ export interface ProfileTranslations {
15
15
  export interface ProfileProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onSelect'> {
16
16
  closeOnSelect: boolean;
17
17
  renderPopupItems: (items: ListDataItem[]) => readonly ListDataItem[];
18
- translations: ProfileTranslations;
18
+ translations?: ProfileTranslations | null | undefined;
19
19
  size: Size;
20
20
  renderGuest: (props: ProfileProps) => ReactNode;
21
21
  hasUpdates?: boolean | null | undefined;
@@ -67,6 +67,59 @@ export default class Profile extends PureComponent<ProfileProps> {
67
67
  renderGuest: PropTypes.Requireable<(...args: any[]) => any>;
68
68
  };
69
69
  static defaultProps: ProfileProps;
70
+ static contextType: React.Context<{
71
+ login: string;
72
+ logout: string;
73
+ loginTo: string;
74
+ ok: string;
75
+ cancel: string;
76
+ tryAgainLabel: string;
77
+ postpone: string;
78
+ youHaveLoggedInAs: string;
79
+ applyChange: string;
80
+ backendIsNotAvailable: string;
81
+ checkAgain: string;
82
+ nothingHappensLink: string;
83
+ errorMessage: string;
84
+ applyChangedUser: string;
85
+ profile: string;
86
+ switchUser: string;
87
+ addFirstDate: string;
88
+ addSecondDate: string;
89
+ addTime: string;
90
+ selectName: string;
91
+ setDate: string;
92
+ setDateTime: string;
93
+ setPeriod: string;
94
+ clear: string;
95
+ gotIt: string;
96
+ dismiss: string;
97
+ perPage: string;
98
+ firstPage: string;
99
+ lastPage: string;
100
+ nextPage: string;
101
+ previousPage: string;
102
+ searchTitle: string;
103
+ clearTitle: string;
104
+ userAgreement: string;
105
+ accept: string;
106
+ decline: string;
107
+ close: string;
108
+ scrollToAccept: string;
109
+ remindLater: string;
110
+ filterItems: string;
111
+ selectOption: string;
112
+ progress: string;
113
+ loading: string;
114
+ noOptionsFound: string;
115
+ banned: string;
116
+ online: string;
117
+ offline: string;
118
+ copyToClipboard: string;
119
+ copiedToClipboard: string;
120
+ copingToClipboardError: string;
121
+ unverified: string;
122
+ }>;
70
123
  static Size: typeof Size;
71
124
  render(): string | number | boolean | JSX.Element | React.ReactFragment | null | undefined;
72
125
  }
@@ -6,13 +6,13 @@ import Avatar, { Size } from '../avatar/avatar.js';
6
6
  import { Button } from '../button/button.js';
7
7
  import DropdownMenu from '../dropdown-menu/dropdown-menu.js';
8
8
  import PopupMenu from '../popup-menu/popup-menu.js';
9
+ import { I18nContext } from '../i18n/i18n-context.js';
9
10
  import { isTruthy } from '../global/typescript-utils.js';
10
11
  import { m as modules_47759f5e } from '../_helpers/header.js';
11
12
  import '../global/url.js';
12
13
  import '../global/dom.js';
13
14
  import '../avatar/fallback-avatar.js';
14
15
  import '../global/get-uid.js';
15
- import 'focus-visible';
16
16
  import '@jetbrains/icons/chevron-10px';
17
17
  import '../icon/icon.js';
18
18
  import 'util-deprecate';
@@ -62,6 +62,7 @@ import '../tab-trap/tab-trap.js';
62
62
  import '../popup/position.js';
63
63
  import '../popup/popup.consts.js';
64
64
  import '../popup/popup.target.js';
65
+ import '../i18n/i18n.js';
65
66
 
66
67
  const rgItemType = PopupMenu.ListProps.Type.LINK;
67
68
  class Profile extends PureComponent {
@@ -100,7 +101,6 @@ class Profile extends PureComponent {
100
101
  static defaultProps = {
101
102
  closeOnSelect: true,
102
103
  renderPopupItems: items => items,
103
- translations: {},
104
104
  size: Size.Size32,
105
105
  renderGuest: _ref => {
106
106
  let {
@@ -109,19 +109,24 @@ class Profile extends PureComponent {
109
109
  className,
110
110
  translations
111
111
  } = _ref;
112
- return /*#__PURE__*/React.createElement("div", {
113
- className: classNames(modules_47759f5e.profileEmpty, className)
114
- }, /*#__PURE__*/React.createElement(Button, {
115
- primary: true,
116
- "data-test": "ring-header-login-button",
117
- disabled: loading,
118
- loader: loading,
119
- onClick: onLogin
120
- }, translations.login || 'Log in...'));
112
+ return /*#__PURE__*/React.createElement(I18nContext.Consumer, null, messages => {
113
+ var _translations$login;
114
+ return /*#__PURE__*/React.createElement("div", {
115
+ className: classNames(modules_47759f5e.profileEmpty, className)
116
+ }, /*#__PURE__*/React.createElement(Button, {
117
+ primary: true,
118
+ "data-test": "ring-header-login-button",
119
+ disabled: loading,
120
+ loader: loading,
121
+ onClick: onLogin
122
+ }, (_translations$login = translations?.login) !== null && _translations$login !== void 0 ? _translations$login : messages.login));
123
+ });
121
124
  }
122
125
  };
126
+ static contextType = I18nContext;
123
127
  static Size = Size;
124
128
  render() {
129
+ var _translations$applyCh, _translations$login2, _translations$profile, _translations$switchU, _translations$logout;
125
130
  const {
126
131
  className,
127
132
  closeOnSelect,
@@ -145,6 +150,7 @@ class Profile extends PureComponent {
145
150
  onLogin,
146
151
  ...props
147
152
  } = this.props;
153
+ const messages = this.context;
148
154
  if (!user) {
149
155
  return /*#__PURE__*/React.createElement("div", _extends({}, props, {
150
156
  className: classNames(modules_47759f5e.profileEmpty, className)
@@ -169,28 +175,28 @@ class Profile extends PureComponent {
169
175
  }));
170
176
  const items = [showApplyChangedUser && {
171
177
  rgItemType,
172
- label: translations.applyChangedUser || 'Apply changed user',
178
+ label: (_translations$applyCh = translations?.applyChangedUser) !== null && _translations$applyCh !== void 0 ? _translations$applyCh : messages.applyChangedUser,
173
179
  className: modules_47759f5e.profileMenuItem,
174
180
  onClick: onRevertPostponement
175
181
  }, showLogIn && {
176
182
  rgItemType,
177
- label: translations.login || 'Log in',
183
+ label: (_translations$login2 = translations?.login) !== null && _translations$login2 !== void 0 ? _translations$login2 : messages.login,
178
184
  className: modules_47759f5e.profileMenuItem,
179
185
  onClick: onRevertPostponement
180
186
  }, {
181
187
  rgItemType: PopupMenu.ListProps.Type.LINK,
182
- label: translations.profile || 'Profile',
188
+ label: (_translations$profile = translations?.profile) !== null && _translations$profile !== void 0 ? _translations$profile : messages.profile,
183
189
  target: '_self',
184
190
  href: profileUrl,
185
191
  LinkComponent
186
192
  }, showSwitchUser && {
187
193
  rgItemType,
188
- label: translations.switchUser || 'Switch user',
194
+ label: (_translations$switchU = translations?.switchUser) !== null && _translations$switchU !== void 0 ? _translations$switchU : messages.switchUser,
189
195
  className: modules_47759f5e.profileMenuItem,
190
196
  onClick: onSwitchUser
191
197
  }, showLogOut && {
192
198
  rgItemType,
193
- label: translations.logout || 'Log out',
199
+ label: (_translations$logout = translations?.logout) !== null && _translations$logout !== void 0 ? _translations$logout : messages.logout,
194
200
  onClick: onLogout
195
201
  }].filter(isTruthy);
196
202
  return /*#__PURE__*/React.createElement(DropdownMenu, _extends({}, props, {
@@ -3,7 +3,6 @@ import 'react';
3
3
  import 'prop-types';
4
4
  import '../link/link.js';
5
5
  export { S as default } from '../_helpers/services-link.js';
6
- import 'focus-visible';
7
6
  import 'classnames';
8
7
  import '../global/memoize.js';
9
8
  import '../global/data-tests.js';
@@ -19,7 +19,6 @@ import '../_helpers/icon.js';
19
19
  import '../icon/icon__svg.js';
20
20
  import '../global/memoize.js';
21
21
  import '../button/button.js';
22
- import 'focus-visible';
23
22
  import '../link/clickableLink.js';
24
23
  import '../global/controls-height.js';
25
24
  import '../_helpers/button__classes.js';
@@ -27,7 +27,6 @@ import '../global/data-tests.js';
27
27
  import '../_helpers/loader-inline.js';
28
28
  import '../global/dom.js';
29
29
  import '../button/button.js';
30
- import 'focus-visible';
31
30
  import '@jetbrains/icons/chevron-10px';
32
31
  import '../link/clickableLink.js';
33
32
  import '../global/controls-height.js';
@@ -55,6 +54,7 @@ import '../global/react-render-adapter.js';
55
54
  import '../global/listeners.js';
56
55
  import '../http/http.js';
57
56
  import '../global/promise-with-timeout.js';
57
+ import '../i18n/i18n.js';
58
58
  import '../auth/storage.js';
59
59
  import '../storage/storage.js';
60
60
  import '../storage/storage__local.js';
@@ -93,6 +93,7 @@ import '../dropdown/dropdown.js';
93
93
  import '../global/typescript-utils.js';
94
94
  import '../_helpers/anchor.js';
95
95
  import '../popup-menu/popup-menu.js';
96
+ import '../i18n/i18n-context.js';
96
97
  import '../_helpers/header.js';
97
98
 
98
99
  const CERTIFICATE_MISMATCH_HEADER = 'x-client-certificate-token-mismatch';
@@ -31,7 +31,6 @@ import '../global/data-tests.js';
31
31
  import '../_helpers/loader-inline.js';
32
32
  import '../global/dom.js';
33
33
  import '../button/button.js';
34
- import 'focus-visible';
35
34
  import '@jetbrains/icons/chevron-10px';
36
35
  import '../link/clickableLink.js';
37
36
  import '../global/controls-height.js';
@@ -55,6 +54,7 @@ import '../group/group.js';
55
54
  import '../_helpers/group.js';
56
55
  import '../global/listeners.js';
57
56
  import '../global/promise-with-timeout.js';
57
+ import '../i18n/i18n.js';
58
58
  import '../auth/storage.js';
59
59
  import '../storage/storage.js';
60
60
  import '../storage/storage__local.js';
@@ -4,7 +4,6 @@ import PropTypes from 'prop-types';
4
4
  import classNames from 'classnames';
5
5
  import { Button } from '../button/button.js';
6
6
  import { m as modules_47759f5e } from '../_helpers/header.js';
7
- import 'focus-visible';
8
7
  import '@jetbrains/icons/chevron-10px';
9
8
  import '../icon/icon.js';
10
9
  import 'util-deprecate';
@@ -0,0 +1,54 @@
1
+ import React from 'react';
2
+ export declare const I18nContext: React.Context<{
3
+ login: string;
4
+ logout: string;
5
+ loginTo: string;
6
+ ok: string;
7
+ cancel: string;
8
+ tryAgainLabel: string;
9
+ postpone: string;
10
+ youHaveLoggedInAs: string;
11
+ applyChange: string;
12
+ backendIsNotAvailable: string;
13
+ checkAgain: string;
14
+ nothingHappensLink: string;
15
+ errorMessage: string;
16
+ applyChangedUser: string;
17
+ profile: string;
18
+ switchUser: string;
19
+ addFirstDate: string;
20
+ addSecondDate: string;
21
+ addTime: string;
22
+ selectName: string;
23
+ setDate: string;
24
+ setDateTime: string;
25
+ setPeriod: string;
26
+ clear: string;
27
+ gotIt: string;
28
+ dismiss: string;
29
+ perPage: string;
30
+ firstPage: string;
31
+ lastPage: string;
32
+ nextPage: string;
33
+ previousPage: string;
34
+ searchTitle: string;
35
+ clearTitle: string;
36
+ userAgreement: string;
37
+ accept: string;
38
+ decline: string;
39
+ close: string;
40
+ scrollToAccept: string;
41
+ remindLater: string;
42
+ filterItems: string;
43
+ selectOption: string;
44
+ progress: string;
45
+ loading: string;
46
+ noOptionsFound: string;
47
+ banned: string;
48
+ online: string;
49
+ offline: string;
50
+ copyToClipboard: string;
51
+ copiedToClipboard: string;
52
+ copingToClipboardError: string;
53
+ unverified: string;
54
+ }>;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { getTranslations } from './i18n.js';
3
+
4
+ const I18nContext = /*#__PURE__*/React.createContext(getTranslations());
5
+
6
+ export { I18nContext };
@@ -0,0 +1,56 @@
1
+ import defaultMessages from './messages.json';
2
+ export type Messages = typeof defaultMessages;
3
+ export declare function setTranslations(newMessages: Messages): void;
4
+ export declare function getTranslations(): {
5
+ login: string;
6
+ logout: string;
7
+ loginTo: string;
8
+ ok: string;
9
+ cancel: string;
10
+ tryAgainLabel: string;
11
+ postpone: string;
12
+ youHaveLoggedInAs: string;
13
+ applyChange: string;
14
+ backendIsNotAvailable: string;
15
+ checkAgain: string;
16
+ nothingHappensLink: string;
17
+ errorMessage: string;
18
+ applyChangedUser: string;
19
+ profile: string;
20
+ switchUser: string;
21
+ addFirstDate: string;
22
+ addSecondDate: string;
23
+ addTime: string;
24
+ selectName: string;
25
+ setDate: string;
26
+ setDateTime: string;
27
+ setPeriod: string;
28
+ clear: string;
29
+ gotIt: string;
30
+ dismiss: string;
31
+ perPage: string;
32
+ firstPage: string;
33
+ lastPage: string;
34
+ nextPage: string;
35
+ previousPage: string;
36
+ searchTitle: string;
37
+ clearTitle: string;
38
+ userAgreement: string;
39
+ accept: string;
40
+ decline: string;
41
+ close: string;
42
+ scrollToAccept: string;
43
+ remindLater: string;
44
+ filterItems: string;
45
+ selectOption: string;
46
+ progress: string;
47
+ loading: string;
48
+ noOptionsFound: string;
49
+ banned: string;
50
+ online: string;
51
+ offline: string;
52
+ copyToClipboard: string;
53
+ copiedToClipboard: string;
54
+ copingToClipboardError: string;
55
+ unverified: string;
56
+ };
@@ -0,0 +1,114 @@
1
+ var login = "Log in";
2
+ var logout = "Log out";
3
+ var loginTo = "Log in to {{serviceName}}";
4
+ var ok = "OK";
5
+ var cancel = "Cancel";
6
+ var tryAgainLabel = "Try again";
7
+ var postpone = "Postpone";
8
+ var youHaveLoggedInAs = "You have logged in as another user: {{userName}}";
9
+ var applyChange = "Apply change";
10
+ var backendIsNotAvailable = "Connection lost";
11
+ var checkAgain = "try again";
12
+ var nothingHappensLink = "Click here if nothing happens";
13
+ var errorMessage = "There may be a problem with your network connection. Make sure that you are online and";
14
+ var applyChangedUser = "Apply changed user";
15
+ var profile = "Profile";
16
+ var switchUser = "Switch user";
17
+ var addFirstDate = "Add first date";
18
+ var addSecondDate = "Add second date";
19
+ var addTime = "Add time";
20
+ var selectName = "Select {{name}}";
21
+ var setDate = "Set a date";
22
+ var setDateTime = "Set date and time";
23
+ var setPeriod = "Set a period";
24
+ var clear = "Clear input";
25
+ var gotIt = "Got it";
26
+ var dismiss = "Dismiss";
27
+ var perPage = "per page";
28
+ var firstPage = "First page";
29
+ var lastPage = "Last page";
30
+ var nextPage = "Next page";
31
+ var previousPage = "Previous";
32
+ var searchTitle = "Search";
33
+ var clearTitle = "Clear search input";
34
+ var userAgreement = "User Agreement";
35
+ var accept = "Accept";
36
+ var decline = "Decline";
37
+ var close = "Close";
38
+ var scrollToAccept = "View the entire agreement to continue";
39
+ var remindLater = "Remind me later";
40
+ var filterItems = "Filter items";
41
+ var selectOption = "Select an option";
42
+ var progress = "Progress";
43
+ var loading = "Loading...";
44
+ var noOptionsFound = "No options found";
45
+ var banned = "banned";
46
+ var online = "online";
47
+ var offline = "offline";
48
+ var copyToClipboard = "Copy email to clipboard";
49
+ var copiedToClipboard = "Email was copied to clipboard";
50
+ var copingToClipboardError = "Failed to copy to clipboard";
51
+ var unverified = "Unverified";
52
+ var defaultMessages = {
53
+ login: login,
54
+ logout: logout,
55
+ loginTo: loginTo,
56
+ ok: ok,
57
+ cancel: cancel,
58
+ tryAgainLabel: tryAgainLabel,
59
+ postpone: postpone,
60
+ youHaveLoggedInAs: youHaveLoggedInAs,
61
+ applyChange: applyChange,
62
+ backendIsNotAvailable: backendIsNotAvailable,
63
+ checkAgain: checkAgain,
64
+ nothingHappensLink: nothingHappensLink,
65
+ errorMessage: errorMessage,
66
+ applyChangedUser: applyChangedUser,
67
+ profile: profile,
68
+ switchUser: switchUser,
69
+ addFirstDate: addFirstDate,
70
+ addSecondDate: addSecondDate,
71
+ addTime: addTime,
72
+ selectName: selectName,
73
+ setDate: setDate,
74
+ setDateTime: setDateTime,
75
+ setPeriod: setPeriod,
76
+ clear: clear,
77
+ gotIt: gotIt,
78
+ dismiss: dismiss,
79
+ perPage: perPage,
80
+ firstPage: firstPage,
81
+ lastPage: lastPage,
82
+ nextPage: nextPage,
83
+ previousPage: previousPage,
84
+ searchTitle: searchTitle,
85
+ clearTitle: clearTitle,
86
+ userAgreement: userAgreement,
87
+ accept: accept,
88
+ decline: decline,
89
+ close: close,
90
+ scrollToAccept: scrollToAccept,
91
+ remindLater: remindLater,
92
+ filterItems: filterItems,
93
+ selectOption: selectOption,
94
+ progress: progress,
95
+ loading: loading,
96
+ noOptionsFound: noOptionsFound,
97
+ banned: banned,
98
+ online: online,
99
+ offline: offline,
100
+ copyToClipboard: copyToClipboard,
101
+ copiedToClipboard: copiedToClipboard,
102
+ copingToClipboardError: copingToClipboardError,
103
+ unverified: unverified
104
+ };
105
+
106
+ let messages = defaultMessages;
107
+ function setTranslations(newMessages) {
108
+ messages = newMessages;
109
+ }
110
+ function getTranslations() {
111
+ return messages;
112
+ }
113
+
114
+ export { getTranslations, setTranslations };
@@ -28,7 +28,7 @@ export interface InputBaseProps {
28
28
  icon?: string | ComponentType | null | undefined;
29
29
  height?: ControlsHeight | undefined;
30
30
  afterInput?: ReactNode;
31
- translations: InputTranslations;
31
+ translations?: InputTranslations | null | undefined;
32
32
  }
33
33
  type Override<D, S> = Omit<D, keyof S> & S;
34
34
  export type InputSpecificProps = Override<InputHTMLAttributes<HTMLInputElement>, InputBaseProps> & {
@@ -46,9 +46,6 @@ export declare class Input extends PureComponent<InputProps> {
46
46
  onChange: typeof noop;
47
47
  inputRef: typeof noop;
48
48
  enableShortcuts: string[];
49
- translations: {
50
- clear: string;
51
- };
52
49
  };
53
50
  state: {
54
51
  empty: boolean;
@@ -7,11 +7,11 @@ import { refObject } from '../global/prop-types.js';
7
7
  import { Button } from '../button/button.js';
8
8
  import getUID from '../global/get-uid.js';
9
9
  import Icon from '../icon/icon.js';
10
+ import { I18nContext } from '../i18n/i18n-context.js';
10
11
  import composeRefs from '../global/composeRefs.js';
11
12
  import { ControlsHeightContext } from '../global/controls-height.js';
12
13
  import { m as modules_88cfaf40 } from '../_helpers/input.js';
13
14
  import { InputLabel } from './input-label.js';
14
- import 'focus-visible';
15
15
  import '@jetbrains/icons/chevron-10px';
16
16
  import '../link/clickableLink.js';
17
17
  import '../_helpers/button__classes.js';
@@ -20,6 +20,7 @@ import 'util-deprecate';
20
20
  import '../_helpers/icon.js';
21
21
  import '../icon/icon__svg.js';
22
22
  import '../global/memoize.js';
23
+ import '../i18n/i18n.js';
23
24
 
24
25
  function noop() {}
25
26
  /**
@@ -38,10 +39,7 @@ class Input extends PureComponent {
38
39
  size: Size.M,
39
40
  onChange: noop,
40
41
  inputRef: noop,
41
- enableShortcuts: ['esc'],
42
- translations: {
43
- clear: 'Clear input'
44
- }
42
+ enableShortcuts: ['esc']
45
43
  };
46
44
  state = {
47
45
  empty: true
@@ -153,7 +151,7 @@ class Input extends PureComponent {
153
151
  'aria-label': typeof label === 'string' && label ? label : placeholder,
154
152
  'data-enabled-shortcuts': Array.isArray(enableShortcuts) ? enableShortcuts.join(',') : null
155
153
  };
156
- return /*#__PURE__*/React.createElement("div", {
154
+ return /*#__PURE__*/React.createElement(I18nContext.Consumer, null, messages => /*#__PURE__*/React.createElement("div", {
157
155
  className: classes,
158
156
  "data-test": "ring-input"
159
157
  }, label && /*#__PURE__*/React.createElement(InputLabel, {
@@ -171,14 +169,14 @@ class Input extends PureComponent {
171
169
  }, commonProps, restProps)) : /*#__PURE__*/React.createElement("input", _extends({
172
170
  onChange: this.handleInputChange
173
171
  }, commonProps, restProps)), clearable && !disabled && /*#__PURE__*/React.createElement(Button, {
174
- title: translations.clear,
172
+ title: (translations !== null && translations !== void 0 ? translations : messages).clear,
175
173
  "data-test": "ring-input-clear",
176
174
  className: modules_88cfaf40.clear,
177
175
  icon: closeIcon,
178
176
  onClick: this.clear
179
177
  }), afterInput), error && /*#__PURE__*/React.createElement("div", {
180
178
  className: modules_88cfaf40.errorText
181
- }, error));
179
+ }, error)));
182
180
  }
183
181
  }
184
182
  Input.propTypes = {
@@ -4,7 +4,6 @@ import closeIcon from '@jetbrains/icons/close';
4
4
  import RingAngularComponent from '../global/ring-angular-component.js';
5
5
  import { m as modules_88cfaf40 } from '../_helpers/input.js';
6
6
  import Button from '../button-ng/button-ng.js';
7
- import 'focus-visible';
8
7
  import '../global/dom.js';
9
8
  import '../icon-ng/icon-ng.js';
10
9
  import '../icon/icon__constants.js';
@@ -1,4 +1,3 @@
1
- import 'focus-visible';
2
1
  import React, { Component, HTMLAttributes } from 'react';
3
2
  import PropTypes from 'prop-types';
4
3
  export interface IslandProps extends HTMLAttributes<HTMLElement> {
@@ -1,5 +1,4 @@
1
1
  import { _ as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
2
- import 'focus-visible';
3
2
  import React, { Component } from 'react';
4
3
  import PropTypes from 'prop-types';
5
4
  import classNames from 'classnames';
@@ -1,4 +1,3 @@
1
- import 'focus-visible';
2
1
  import angular from 'angular';
3
2
  import { m as modules_e6a056e1 } from '../_helpers/island.js';
4
3
  import IslandHeader from './island-header-ng.js';
@@ -1,4 +1,3 @@
1
- import 'focus-visible';
2
1
  import React, { ReactNode, ComponentType } from 'react';
3
2
  import PropTypes from 'prop-types';
4
3
  import { ClickableLinkProps } from './clickableLink';
package/dist/link/link.js CHANGED
@@ -1,5 +1,4 @@
1
1
  import { _ as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
2
- import 'focus-visible';
3
2
  import React, { PureComponent, memo } from 'react';
4
3
  import PropTypes from 'prop-types';
5
4
  import classNames from 'classnames';
@@ -1,4 +1,3 @@
1
- import 'focus-visible';
2
1
  import angular from 'angular';
3
2
  import { m as modules_607b0772 } from '../_helpers/link.js';
4
3
 
package/dist/list/list.js CHANGED
@@ -28,7 +28,6 @@ import '../global/sniffer.js';
28
28
  import 'sniffr';
29
29
  import '../_helpers/_rollupPluginBabelHelpers.js';
30
30
  import '../link/link.js';
31
- import 'focus-visible';
32
31
  import '../link/clickableLink.js';
33
32
  import '../_helpers/link.js';
34
33
  import '../avatar/avatar.js';
@@ -11,7 +11,6 @@ import '../_helpers/_rollupPluginBabelHelpers.js';
11
11
  import '../global/url.js';
12
12
  import '../global/dom.js';
13
13
  import '../avatar/fallback-avatar.js';
14
- import 'focus-visible';
15
14
  import '@jetbrains/icons/checkmark-14px';
16
15
  import '@jetbrains/icons/remove-14px';
17
16
  import '../global/prop-types.js';
@@ -5,7 +5,6 @@ import classNames from 'classnames';
5
5
  import Link, { linkHOC } from '../link/link.js';
6
6
  import joinDataTestAttributes from '../global/data-tests.js';
7
7
  import { m as modules_3b67a421 } from '../_helpers/list.js';
8
- import 'focus-visible';
9
8
  import '../global/memoize.js';
10
9
  import '../link/clickableLink.js';
11
10
  import '../_helpers/link.js';
@@ -25,7 +25,6 @@ import '../global/create-stateful-context.js';
25
25
  import './list__link.js';
26
26
  import '../_helpers/_rollupPluginBabelHelpers.js';
27
27
  import '../link/link.js';
28
- import 'focus-visible';
29
28
  import '../link/clickableLink.js';
30
29
  import '../_helpers/link.js';
31
30
  import '../_helpers/list.js';
@@ -19,7 +19,6 @@ import 'sniffr';
19
19
  import '../tab-trap/tab-trap.js';
20
20
  import '../global/dom.js';
21
21
  import '../button/button.js';
22
- import 'focus-visible';
23
22
  import '@jetbrains/icons/chevron-10px';
24
23
  import '../icon/icon.js';
25
24
  import 'util-deprecate';
@@ -9,7 +9,6 @@ import '../_helpers/_rollupPluginBabelHelpers.js';
9
9
  import 'classnames';
10
10
  import '@jetbrains/icons/close';
11
11
  import '../island/island.js';
12
- import 'focus-visible';
13
12
  import '../global/data-tests.js';
14
13
  import '../island/adaptive-island-hoc.js';
15
14
  import '../global/linear-function.js';
@@ -2,7 +2,6 @@ import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import Link from '../link/link.js';
4
4
  import '../_helpers/_rollupPluginBabelHelpers.js';
5
- import 'focus-visible';
6
5
  import 'classnames';
7
6
  import '../global/memoize.js';
8
7
  import '../global/data-tests.js';