@jetbrains/ring-ui 5.0.137 → 5.0.139

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 (87) 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/date-picker/date-input.js +3 -1
  5. package/components/editable-heading/editable-heading.css +7 -3
  6. package/components/editable-heading/editable-heading.js +29 -8
  7. package/components/global/react-render-adapter.js +16 -31
  8. package/components/header/profile.d.ts +3 -1
  9. package/components/header/profile.js +15 -11
  10. package/components/i18n/README.md +46 -0
  11. package/components/i18n/i18n-context.d.ts +13 -0
  12. package/components/i18n/i18n-context.js +14 -0
  13. package/components/i18n/i18n.d.ts +59 -0
  14. package/components/i18n/i18n.js +26 -0
  15. package/components/i18n/messages.json +53 -0
  16. package/components/input/input.d.ts +1 -4
  17. package/components/input/input.js +16 -16
  18. package/components/message/message.d.ts +1 -5
  19. package/components/message/message.js +17 -16
  20. package/components/pager/pager.d.ts +3 -8
  21. package/components/pager/pager.js +11 -12
  22. package/components/query-assist/query-assist.d.ts +1 -5
  23. package/components/query-assist/query-assist.js +30 -29
  24. package/components/select/select.d.ts +2 -4
  25. package/components/select/select.js +14 -11
  26. package/components/select/select__filter.d.ts +0 -1
  27. package/components/select/select__filter.js +4 -2
  28. package/components/user-agreement/user-agreement.d.ts +1 -9
  29. package/components/user-agreement/user-agreement.js +31 -30
  30. package/components/user-card/card.d.ts +14 -13
  31. package/components/user-card/card.js +26 -27
  32. package/dist/_helpers/card.js +28 -33
  33. package/dist/_helpers/select__filter.js +17 -10
  34. package/dist/auth/auth.js +1 -0
  35. package/dist/auth/auth__core.d.ts +1 -1
  36. package/dist/auth/auth__core.js +18 -27
  37. package/dist/auth/landing.js +1 -0
  38. package/dist/auth-dialog/auth-dialog.js +1 -1
  39. package/dist/auth-ng/auth-ng.js +1 -0
  40. package/dist/date-picker/date-input.js +3 -1
  41. package/dist/date-picker/date-picker.js +2 -0
  42. package/dist/date-picker/date-popup.js +2 -0
  43. package/dist/editable-heading/editable-heading.js +32 -9
  44. package/dist/global/react-render-adapter.js +0 -2
  45. package/dist/header/header.js +2 -0
  46. package/dist/header/profile.d.ts +3 -1
  47. package/dist/header/profile.js +27 -15
  48. package/dist/header/smart-profile.js +2 -0
  49. package/dist/header/smart-services.js +1 -0
  50. package/dist/i18n/i18n-context.d.ts +13 -0
  51. package/dist/i18n/i18n-context.js +24 -0
  52. package/dist/i18n/i18n.d.ts +59 -0
  53. package/dist/i18n/i18n.js +136 -0
  54. package/dist/input/input.d.ts +1 -4
  55. package/dist/input/input.js +35 -30
  56. package/dist/link/link.js +1 -1
  57. package/dist/message/message.d.ts +1 -5
  58. package/dist/message/message.js +41 -35
  59. package/dist/pager/pager.d.ts +3 -8
  60. package/dist/pager/pager.js +25 -15
  61. package/dist/pager-ng/pager-ng.js +2 -0
  62. package/dist/permissions-ng/permissions-ng.js +1 -0
  63. package/dist/query-assist/query-assist.d.ts +1 -5
  64. package/dist/query-assist/query-assist.js +105 -93
  65. package/dist/query-assist-ng/query-assist-ng.js +2 -0
  66. package/dist/select/select.d.ts +2 -4
  67. package/dist/select/select.js +54 -47
  68. package/dist/select/select__filter.d.ts +0 -1
  69. package/dist/select/select__filter.js +2 -0
  70. package/dist/select/select__popup.js +2 -0
  71. package/dist/select-ng/select-ng.js +2 -0
  72. package/dist/select-ng/select-ng__lazy.js +2 -0
  73. package/dist/style.css +1 -1
  74. package/dist/table-legacy-ng/table-legacy-ng.js +2 -0
  75. package/dist/table-legacy-ng/table-legacy-ng__pager.js +2 -0
  76. package/dist/tags-input/tags-input.js +2 -0
  77. package/dist/tags-input-ng/tags-input-ng.js +2 -0
  78. package/dist/user-agreement/service.js +2 -0
  79. package/dist/user-agreement/user-agreement.d.ts +1 -9
  80. package/dist/user-agreement/user-agreement.js +41 -41
  81. package/dist/user-card/card.d.ts +14 -13
  82. package/dist/user-card/card.js +2 -0
  83. package/dist/user-card/smart-user-card-tooltip.js +2 -0
  84. package/dist/user-card/tooltip.js +2 -0
  85. package/dist/user-card/user-card.js +2 -0
  86. package/dist/user-card-ng/user-card-ng.js +2 -0
  87. package/package.json +32 -32
@@ -6,6 +6,7 @@ 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';
@@ -61,6 +62,7 @@ import '../tab-trap/tab-trap.js';
61
62
  import '../popup/position.js';
62
63
  import '../popup/popup.consts.js';
63
64
  import '../popup/popup.target.js';
65
+ import '../i18n/i18n.js';
64
66
 
65
67
  const rgItemType = PopupMenu.ListProps.Type.LINK;
66
68
  class Profile extends PureComponent {
@@ -99,7 +101,6 @@ class Profile extends PureComponent {
99
101
  static defaultProps = {
100
102
  closeOnSelect: true,
101
103
  renderPopupItems: items => items,
102
- translations: {},
103
104
  size: Size.Size32,
104
105
  renderGuest: _ref => {
105
106
  let {
@@ -108,19 +109,27 @@ class Profile extends PureComponent {
108
109
  className,
109
110
  translations
110
111
  } = _ref;
111
- return /*#__PURE__*/React.createElement("div", {
112
- className: classNames(modules_47759f5e.profileEmpty, className)
113
- }, /*#__PURE__*/React.createElement(Button, {
114
- primary: true,
115
- "data-test": "ring-header-login-button",
116
- disabled: loading,
117
- loader: loading,
118
- onClick: onLogin
119
- }, translations.login || 'Log in...'));
112
+ return /*#__PURE__*/React.createElement(I18nContext.Consumer, null, _ref2 => {
113
+ var _translations$login;
114
+ let {
115
+ translate
116
+ } = _ref2;
117
+ return /*#__PURE__*/React.createElement("div", {
118
+ className: classNames(modules_47759f5e.profileEmpty, className)
119
+ }, /*#__PURE__*/React.createElement(Button, {
120
+ primary: true,
121
+ "data-test": "ring-header-login-button",
122
+ disabled: loading,
123
+ loader: loading,
124
+ onClick: onLogin
125
+ }, (_translations$login = translations?.login) !== null && _translations$login !== void 0 ? _translations$login : translate('login')));
126
+ });
120
127
  }
121
128
  };
129
+ static contextType = I18nContext;
122
130
  static Size = Size;
123
131
  render() {
132
+ var _translations$applyCh, _translations$login2, _translations$profile, _translations$switchU, _translations$logout;
124
133
  const {
125
134
  className,
126
135
  closeOnSelect,
@@ -144,6 +153,9 @@ class Profile extends PureComponent {
144
153
  onLogin,
145
154
  ...props
146
155
  } = this.props;
156
+ const {
157
+ translate
158
+ } = this.context;
147
159
  if (!user) {
148
160
  return /*#__PURE__*/React.createElement("div", _extends({}, props, {
149
161
  className: classNames(modules_47759f5e.profileEmpty, className)
@@ -168,28 +180,28 @@ class Profile extends PureComponent {
168
180
  }));
169
181
  const items = [showApplyChangedUser && {
170
182
  rgItemType,
171
- label: translations.applyChangedUser || 'Apply changed user',
183
+ label: (_translations$applyCh = translations?.applyChangedUser) !== null && _translations$applyCh !== void 0 ? _translations$applyCh : translate('applyChangedUser'),
172
184
  className: modules_47759f5e.profileMenuItem,
173
185
  onClick: onRevertPostponement
174
186
  }, showLogIn && {
175
187
  rgItemType,
176
- label: translations.login || 'Log in',
188
+ label: (_translations$login2 = translations?.login) !== null && _translations$login2 !== void 0 ? _translations$login2 : translate('login'),
177
189
  className: modules_47759f5e.profileMenuItem,
178
190
  onClick: onRevertPostponement
179
191
  }, {
180
192
  rgItemType: PopupMenu.ListProps.Type.LINK,
181
- label: translations.profile || 'Profile',
193
+ label: (_translations$profile = translations?.profile) !== null && _translations$profile !== void 0 ? _translations$profile : translate('profile'),
182
194
  target: '_self',
183
195
  href: profileUrl,
184
196
  LinkComponent
185
197
  }, showSwitchUser && {
186
198
  rgItemType,
187
- label: translations.switchUser || 'Switch user',
199
+ label: (_translations$switchU = translations?.switchUser) !== null && _translations$switchU !== void 0 ? _translations$switchU : translate('switchUser'),
188
200
  className: modules_47759f5e.profileMenuItem,
189
201
  onClick: onSwitchUser
190
202
  }, showLogOut && {
191
203
  rgItemType,
192
- label: translations.logout || 'Log out',
204
+ label: (_translations$logout = translations?.logout) !== null && _translations$logout !== void 0 ? _translations$logout : translate('logout'),
193
205
  onClick: onLogout
194
206
  }].filter(isTruthy);
195
207
  return /*#__PURE__*/React.createElement(DropdownMenu, _extends({}, props, {
@@ -54,6 +54,7 @@ import '../global/react-render-adapter.js';
54
54
  import '../global/listeners.js';
55
55
  import '../http/http.js';
56
56
  import '../global/promise-with-timeout.js';
57
+ import '../i18n/i18n.js';
57
58
  import '../auth/storage.js';
58
59
  import '../storage/storage.js';
59
60
  import '../storage/storage__local.js';
@@ -92,6 +93,7 @@ import '../dropdown/dropdown.js';
92
93
  import '../global/typescript-utils.js';
93
94
  import '../_helpers/anchor.js';
94
95
  import '../popup-menu/popup-menu.js';
96
+ import '../i18n/i18n-context.js';
95
97
  import '../_helpers/header.js';
96
98
 
97
99
  const CERTIFICATE_MISMATCH_HEADER = 'x-client-certificate-token-mismatch';
@@ -54,6 +54,7 @@ import '../group/group.js';
54
54
  import '../_helpers/group.js';
55
55
  import '../global/listeners.js';
56
56
  import '../global/promise-with-timeout.js';
57
+ import '../i18n/i18n.js';
57
58
  import '../auth/storage.js';
58
59
  import '../storage/storage.js';
59
60
  import '../storage/storage__local.js';
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { type Messages } from './i18n';
3
+ export interface I18nContextProps {
4
+ translate(key: keyof Messages): string;
5
+ messages: Messages;
6
+ }
7
+ export declare const I18nContext: React.Context<I18nContextProps>;
8
+ interface I18nContextHolderProps {
9
+ messages: Messages;
10
+ children?: React.ReactNode;
11
+ }
12
+ export declare const I18nContextHolder: React.FC<I18nContextHolderProps>;
13
+ export {};
@@ -0,0 +1,24 @@
1
+ import React, { useEffect } from 'react';
2
+ import { getTranslations, translate, setTranslations } from './i18n.js';
3
+
4
+ const I18nContext = /*#__PURE__*/React.createContext({
5
+ messages: getTranslations(),
6
+ translate
7
+ });
8
+ const I18nContextHolder = _ref => {
9
+ let {
10
+ children,
11
+ messages
12
+ } = _ref;
13
+ useEffect(() => {
14
+ setTranslations(messages);
15
+ }, [messages]);
16
+ return /*#__PURE__*/React.createElement(I18nContext.Provider, {
17
+ value: {
18
+ messages,
19
+ translate
20
+ }
21
+ }, children);
22
+ };
23
+
24
+ export { I18nContext, I18nContextHolder };
@@ -0,0 +1,59 @@
1
+ import defaultMessages from './messages.json';
2
+ export type MessagesStrict = typeof defaultMessages;
3
+ export type Messages = Partial<MessagesStrict>;
4
+ export declare function setTranslations(newMessages: Messages): void;
5
+ export declare function getTranslations(): Partial<{
6
+ login: string;
7
+ logout: string;
8
+ loginTo: string;
9
+ ok: string;
10
+ cancel: string;
11
+ tryAgainLabel: string;
12
+ postpone: string;
13
+ youHaveLoggedInAs: string;
14
+ applyChange: string;
15
+ backendIsNotAvailable: string;
16
+ checkAgain: string;
17
+ nothingHappensLink: string;
18
+ errorMessage: string;
19
+ applyChangedUser: string;
20
+ profile: string;
21
+ switchUser: string;
22
+ addFirstDate: string;
23
+ addSecondDate: string;
24
+ addTime: string;
25
+ selectName: string;
26
+ setDate: string;
27
+ setDateTime: string;
28
+ setPeriod: string;
29
+ clear: string;
30
+ gotIt: string;
31
+ dismiss: string;
32
+ perPage: string;
33
+ firstPage: string;
34
+ lastPage: string;
35
+ nextPage: string;
36
+ previousPage: string;
37
+ searchTitle: string;
38
+ clearTitle: string;
39
+ userAgreement: string;
40
+ accept: string;
41
+ decline: string;
42
+ close: string;
43
+ scrollToAccept: string;
44
+ remindLater: string;
45
+ filterItems: string;
46
+ selectOption: string;
47
+ progress: string;
48
+ loading: string;
49
+ noOptionsFound: string;
50
+ banned: string;
51
+ online: string;
52
+ offline: string;
53
+ copyToClipboard: string;
54
+ copiedToClipboard: string;
55
+ copingToClipboardError: string;
56
+ unverified: string;
57
+ }>;
58
+ export declare function getTranslationsWithFallback(): MessagesStrict;
59
+ export declare function translate(key: keyof MessagesStrict): string;
@@ -0,0 +1,136 @@
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
+ const warned = new Set();
108
+ function warnMissedKeyOnce(key) {
109
+ if (warned.has(key)) {
110
+ return;
111
+ }
112
+ warned.add(key);
113
+ // eslint-disable-next-line no-console
114
+ console.warn(`Missing localisation for key "${key}"`);
115
+ }
116
+ function setTranslations(newMessages) {
117
+ messages = newMessages;
118
+ }
119
+ function getTranslations() {
120
+ return messages;
121
+ }
122
+ function getTranslationsWithFallback() {
123
+ return {
124
+ ...defaultMessages,
125
+ ...messages
126
+ };
127
+ }
128
+ function translate(key) {
129
+ var _messages$key;
130
+ if (!(key in messages)) {
131
+ warnMissedKeyOnce(key);
132
+ }
133
+ return (_messages$key = messages[key]) !== null && _messages$key !== void 0 ? _messages$key : defaultMessages[key];
134
+ }
135
+
136
+ export { getTranslations, getTranslationsWithFallback, setTranslations, translate };
@@ -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,6 +7,7 @@ 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';
@@ -19,6 +20,7 @@ import 'util-deprecate';
19
20
  import '../_helpers/icon.js';
20
21
  import '../icon/icon__svg.js';
21
22
  import '../global/memoize.js';
23
+ import '../i18n/i18n.js';
22
24
 
23
25
  function noop() {}
24
26
  /**
@@ -37,10 +39,7 @@ class Input extends PureComponent {
37
39
  size: Size.M,
38
40
  onChange: noop,
39
41
  inputRef: noop,
40
- enableShortcuts: ['esc'],
41
- translations: {
42
- clear: 'Clear input'
43
- }
42
+ enableShortcuts: ['esc']
44
43
  };
45
44
  state = {
46
45
  empty: true
@@ -152,32 +151,38 @@ class Input extends PureComponent {
152
151
  'aria-label': typeof label === 'string' && label ? label : placeholder,
153
152
  'data-enabled-shortcuts': Array.isArray(enableShortcuts) ? enableShortcuts.join(',') : null
154
153
  };
155
- return /*#__PURE__*/React.createElement("div", {
156
- className: classes,
157
- "data-test": "ring-input"
158
- }, label && /*#__PURE__*/React.createElement(InputLabel, {
159
- htmlFor: this.getId(),
160
- disabled: disabled,
161
- label: label
162
- }), /*#__PURE__*/React.createElement("div", {
163
- className: modules_88cfaf40.container
164
- }, icon && /*#__PURE__*/React.createElement(Icon, {
165
- glyph: icon,
166
- className: modules_88cfaf40.icon
167
- }), multiline ? /*#__PURE__*/React.createElement("textarea", _extends({
168
- onChange: this.handleTextareaChange,
169
- rows: 1
170
- }, commonProps, restProps)) : /*#__PURE__*/React.createElement("input", _extends({
171
- onChange: this.handleInputChange
172
- }, commonProps, restProps)), clearable && !disabled && /*#__PURE__*/React.createElement(Button, {
173
- title: translations.clear,
174
- "data-test": "ring-input-clear",
175
- className: modules_88cfaf40.clear,
176
- icon: closeIcon,
177
- onClick: this.clear
178
- }), afterInput), error && /*#__PURE__*/React.createElement("div", {
179
- className: modules_88cfaf40.errorText
180
- }, error));
154
+ return /*#__PURE__*/React.createElement(I18nContext.Consumer, null, _ref => {
155
+ var _translations$clear;
156
+ let {
157
+ translate
158
+ } = _ref;
159
+ return /*#__PURE__*/React.createElement("div", {
160
+ className: classes,
161
+ "data-test": "ring-input"
162
+ }, label && /*#__PURE__*/React.createElement(InputLabel, {
163
+ htmlFor: this.getId(),
164
+ disabled: disabled,
165
+ label: label
166
+ }), /*#__PURE__*/React.createElement("div", {
167
+ className: modules_88cfaf40.container
168
+ }, icon && /*#__PURE__*/React.createElement(Icon, {
169
+ glyph: icon,
170
+ className: modules_88cfaf40.icon
171
+ }), multiline ? /*#__PURE__*/React.createElement("textarea", _extends({
172
+ onChange: this.handleTextareaChange,
173
+ rows: 1
174
+ }, commonProps, restProps)) : /*#__PURE__*/React.createElement("input", _extends({
175
+ onChange: this.handleInputChange
176
+ }, commonProps, restProps)), clearable && !disabled && /*#__PURE__*/React.createElement(Button, {
177
+ title: (_translations$clear = translations?.clear) !== null && _translations$clear !== void 0 ? _translations$clear : translate('clear'),
178
+ "data-test": "ring-input-clear",
179
+ className: modules_88cfaf40.clear,
180
+ icon: closeIcon,
181
+ onClick: this.clear
182
+ }), afterInput), error && /*#__PURE__*/React.createElement("div", {
183
+ className: modules_88cfaf40.errorText
184
+ }, error));
185
+ });
181
186
  }
182
187
  }
183
188
  Input.propTypes = {
package/dist/link/link.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { _ as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
2
- import React, { PureComponent, memo } from 'react';
2
+ import React, { memo, PureComponent } from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import classNames from 'classnames';
5
5
  import memoize from '../global/memoize.js';
@@ -11,7 +11,7 @@ export interface MessageTranslations {
11
11
  export interface MessageProps {
12
12
  icon: string | IconType | null;
13
13
  directions: readonly Directions[];
14
- translations: MessageTranslations;
14
+ translations?: MessageTranslations | null | undefined;
15
15
  theme: Theme;
16
16
  title?: string | null | undefined;
17
17
  children?: ReactNode;
@@ -34,10 +34,6 @@ export default class Message extends Component<MessageProps> {
34
34
  static defaultProps: {
35
35
  icon: string;
36
36
  directions: Directions[];
37
- translations: {
38
- gotIt: string;
39
- dismiss: string;
40
- };
41
37
  theme: Theme;
42
38
  };
43
39
  state: MessageState;
@@ -7,6 +7,7 @@ import Popup from '../popup/popup.js';
7
7
  import { Directions } from '../popup/popup.consts.js';
8
8
  import Icon from '../icon/icon.js';
9
9
  import { Button } from '../button/button.js';
10
+ import { I18nContext } from '../i18n/i18n-context.js';
10
11
  import { T as Theme, m as modules_59717246, W as WithThemeClasses, a as ThemeProvider } from '../_helpers/theme.js';
11
12
  import 'react-dom';
12
13
  import '../global/get-uid.js';
@@ -30,6 +31,7 @@ import '@jetbrains/icons/chevron-10px';
30
31
  import '../link/clickableLink.js';
31
32
  import '../global/controls-height.js';
32
33
  import '../_helpers/button__classes.js';
34
+ import '../i18n/i18n.js';
33
35
 
34
36
  var modules_8b837449 = {"unit":"i__const_unit_0","padding":"12px","light":"light_rui_f3db","container":"container_rui_f3db","message":"message_rui_f3db","icon":"icon_rui_f3db","title":"title_rui_f3db font-lower_rui_8bff font_rui_8bff","description":"description_rui_f3db","button":"button_rui_f3db","tail":"tail_rui_f3db"};
35
37
 
@@ -107,10 +109,6 @@ class Message extends Component {
107
109
  static defaultProps = {
108
110
  icon: gift,
109
111
  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],
110
- translations: {
111
- gotIt: 'Got it',
112
- dismiss: 'Dismiss'
113
- },
114
112
  theme: Theme.DARK
115
113
  };
116
114
  state = {};
@@ -166,37 +164,45 @@ class Message extends Component {
166
164
  const {
167
165
  direction
168
166
  } = this.state;
169
- return /*#__PURE__*/React.createElement(WithThemeClasses, {
170
- theme: theme
171
- }, themeClasses => /*#__PURE__*/React.createElement(Popup, _extends({
172
- ref: this.popupRef,
173
- hidden: false,
174
- directions: popupDirections,
175
- className: classNames(classes, themeClasses),
176
- offset: UNIT * 2,
177
- onDirectionChange: this._onDirectionChange
178
- }, popupProps), /*#__PURE__*/React.createElement(ThemeProvider, {
179
- theme: theme,
180
- passToPopups: true
181
- }, direction && /*#__PURE__*/React.createElement("div", {
182
- className: tailClasses,
183
- style: getTailOffsets(this.getTailOffset())[direction]
184
- }), icon && /*#__PURE__*/React.createElement(Icon, {
185
- className: modules_8b837449.icon,
186
- glyph: icon
187
- }), title && /*#__PURE__*/React.createElement("h1", {
188
- "data-test": "rgMessageTitle",
189
- className: modules_8b837449.title
190
- }, title), children && /*#__PURE__*/React.createElement("div", {
191
- className: modules_8b837449.description
192
- }, children), (onClose || buttonProps) && /*#__PURE__*/React.createElement(Button, _extends({
193
- className: modules_8b837449.button,
194
- onClick: onClose,
195
- primary: true
196
- }, buttonProps), translations.gotIt), onDismiss && /*#__PURE__*/React.createElement(Button, {
197
- onClick: onDismiss,
198
- text: true
199
- }, translations.dismiss))));
167
+ return /*#__PURE__*/React.createElement(I18nContext.Consumer, null, _ref => {
168
+ let {
169
+ translate
170
+ } = _ref;
171
+ return /*#__PURE__*/React.createElement(WithThemeClasses, {
172
+ theme: theme
173
+ }, themeClasses => {
174
+ var _translations$gotIt, _translations$dismiss;
175
+ return /*#__PURE__*/React.createElement(Popup, _extends({
176
+ ref: this.popupRef,
177
+ hidden: false,
178
+ directions: popupDirections,
179
+ className: classNames(classes, themeClasses),
180
+ offset: UNIT * 2,
181
+ onDirectionChange: this._onDirectionChange
182
+ }, popupProps), /*#__PURE__*/React.createElement(ThemeProvider, {
183
+ theme: theme,
184
+ passToPopups: true
185
+ }, direction && /*#__PURE__*/React.createElement("div", {
186
+ className: tailClasses,
187
+ style: getTailOffsets(this.getTailOffset())[direction]
188
+ }), icon && /*#__PURE__*/React.createElement(Icon, {
189
+ className: modules_8b837449.icon,
190
+ glyph: icon
191
+ }), title && /*#__PURE__*/React.createElement("h1", {
192
+ "data-test": "rgMessageTitle",
193
+ className: modules_8b837449.title
194
+ }, title), children && /*#__PURE__*/React.createElement("div", {
195
+ className: modules_8b837449.description
196
+ }, children), (onClose || buttonProps) && /*#__PURE__*/React.createElement(Button, _extends({
197
+ className: modules_8b837449.button,
198
+ onClick: onClose,
199
+ primary: true
200
+ }, buttonProps), (_translations$gotIt = translations?.gotIt) !== null && _translations$gotIt !== void 0 ? _translations$gotIt : translate('gotIt')), onDismiss && /*#__PURE__*/React.createElement(Button, {
201
+ onClick: onDismiss,
202
+ text: true
203
+ }, (_translations$dismiss = translations?.dismiss) !== null && _translations$dismiss !== void 0 ? _translations$dismiss : translate('dismiss'))));
204
+ });
205
+ });
200
206
  }
201
207
  }
202
208
  Message.propTypes = {
@@ -19,7 +19,7 @@ export interface PagerProps {
19
19
  disablePageSizeSelector: boolean;
20
20
  openTotal: boolean;
21
21
  canLoadLastPageWithOpenTotal: boolean;
22
- translations: PagerTranslations;
22
+ translations?: PagerTranslations | null | undefined;
23
23
  loader: boolean;
24
24
  loaderNavigation: boolean;
25
25
  onPageSizeChange: (size: number) => void;
@@ -40,18 +40,13 @@ export default class Pager extends PureComponent<PagerProps> {
40
40
  disablePageSizeSelector: boolean;
41
41
  openTotal: boolean;
42
42
  canLoadLastPageWithOpenTotal: boolean;
43
- translations: {
44
- perPage: string;
45
- firstPage: string;
46
- lastPage: string;
47
- nextPage: string;
48
- previousPage: string;
49
- };
50
43
  loader: boolean;
51
44
  loaderNavigation: boolean;
52
45
  onPageSizeChange: () => void;
53
46
  onLoadPage: () => void;
54
47
  };
48
+ static contextType: React.Context<import("../i18n/i18n-context").I18nContextProps>;
49
+ context: React.ContextType<typeof Pager.contextType>;
55
50
  getSelectOptions(): {
56
51
  selected: SelectItem<PagerSizeItem> | undefined;
57
52
  data: SelectItem<PagerSizeItem>[];