@jetbrains/ring-ui 5.0.146 → 5.0.148

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 (76) hide show
  1. package/components/data-list/data-list.css +2 -1
  2. package/components/date-picker/date-picker.css +1 -1
  3. package/components/editable-heading/editable-heading.css +5 -5
  4. package/components/heading/heading.css +5 -5
  5. package/components/input/input-legacy.css +2 -2
  6. package/components/input/input.css +5 -5
  7. package/components/list/list.css +2 -2
  8. package/components/query-assist/query-assist.css +12 -11
  9. package/components/select/select-popup.css +2 -2
  10. package/components/select/select.css +3 -3
  11. package/components/select/select.js +1 -1
  12. package/components/tags-input/tags-input.css +1 -1
  13. package/components/text/text.css +12 -0
  14. package/components/text/text.d.ts +6 -0
  15. package/components/text/text.js +12 -2
  16. package/components/toggle/toggle.css +1 -1
  17. package/dist/_helpers/card.js +5 -5
  18. package/dist/analytics/analytics__custom-plugin.js +6 -2
  19. package/dist/analytics/analytics__ga-plugin.js +2 -1
  20. package/dist/auth/auth__core.js +100 -63
  21. package/dist/auth/iframe-flow.js +2 -1
  22. package/dist/auth/landing.js +2 -1
  23. package/dist/auth/request-builder.js +2 -1
  24. package/dist/auth/token-validator.js +6 -2
  25. package/dist/auth/window-flow.js +4 -2
  26. package/dist/caret/caret.js +16 -13
  27. package/dist/clipboard/clipboard-fallback.js +3 -3
  28. package/dist/data-list/data-list.js +6 -3
  29. package/dist/data-list/item.js +1 -1
  30. package/dist/date-picker/date-input.js +4 -4
  31. package/dist/date-picker/date-picker.js +7 -6
  32. package/dist/date-picker/date-popup.js +3 -2
  33. package/dist/dialog-ng/dialog-ng.js +3 -2
  34. package/dist/dropdown/dropdown.js +4 -2
  35. package/dist/editable-heading/editable-heading.js +2 -2
  36. package/dist/global/focus-sensor-hoc.js +13 -8
  37. package/dist/global/normalize-indent.js +2 -2
  38. package/dist/global/react-render-adapter.js +4 -1
  39. package/dist/global/rerender-hoc.js +2 -1
  40. package/dist/global/schedule-raf.js +2 -1
  41. package/dist/header/profile.js +6 -6
  42. package/dist/header/smart-profile.js +3 -2
  43. package/dist/header/smart-services.js +6 -3
  44. package/dist/http/http.js +13 -7
  45. package/dist/hub-source/hub-source__user.js +3 -2
  46. package/dist/input/input.js +7 -4
  47. package/dist/island/content.js +2 -1
  48. package/dist/list/list__users-groups-source.js +10 -7
  49. package/dist/loader/loader.js +2 -1
  50. package/dist/loader/loader__core.js +2 -1
  51. package/dist/markdown/code.js +3 -2
  52. package/dist/message/message.js +8 -6
  53. package/dist/pager/pager.js +16 -12
  54. package/dist/permissions/permissions__cache.js +1 -1
  55. package/dist/popup/popup.js +2 -1
  56. package/dist/popup/position.js +1 -1
  57. package/dist/query-assist/query-assist.js +46 -34
  58. package/dist/select/select.js +18 -11
  59. package/dist/select/select__popup.js +10 -3
  60. package/dist/select-ng/select-ng.js +2 -1
  61. package/dist/select-ng/select-ng__lazy.js +2 -1
  62. package/dist/shortcuts/core.js +2 -1
  63. package/dist/style.css +1 -1
  64. package/dist/tab-trap/tab-trap.js +4 -2
  65. package/dist/table/header.js +2 -2
  66. package/dist/table/multitable.js +14 -7
  67. package/dist/table/row-with-focus-sensor.js +8 -4
  68. package/dist/table/selection-shortcuts-hoc.js +11 -11
  69. package/dist/tabs/collapsible-tabs.js +1 -1
  70. package/dist/tag/tag.js +2 -1
  71. package/dist/tags-input/tags-input.js +23 -13
  72. package/dist/text/text.d.ts +6 -0
  73. package/dist/text/text.js +13 -2
  74. package/dist/tooltip/tooltip.js +4 -2
  75. package/dist/user-agreement/user-agreement.js +8 -8
  76. package/package.json +31 -30
@@ -28,8 +28,9 @@ class TabTrap extends Component {
28
28
  if (this.props.autoFocusFirst) {
29
29
  this.focusFirst();
30
30
  } else if (!this.props.trapDisabled && (!this.node || !this.node.contains(this.previousFocusedNode))) {
31
+ var _this$trapButtonNode;
31
32
  this.trapWithoutFocus = true;
32
- this.trapButtonNode?.focus();
33
+ (_this$trapButtonNode = this.trapButtonNode) === null || _this$trapButtonNode === void 0 ? void 0 : _this$trapButtonNode.focus();
33
34
  }
34
35
  }
35
36
  componentWillUnmount() {
@@ -89,6 +90,7 @@ class TabTrap extends Component {
89
90
  }
90
91
  };
91
92
  handleBlurIfWithoutFocus = event => {
93
+ var _this$node;
92
94
  if (!this.trapWithoutFocus) {
93
95
  return;
94
96
  }
@@ -97,7 +99,7 @@ class TabTrap extends Component {
97
99
  if (!newFocused) {
98
100
  return;
99
101
  }
100
- if (newFocused instanceof Element && this.node?.contains(newFocused)) {
102
+ if (newFocused instanceof Element && (_this$node = this.node) !== null && _this$node !== void 0 && _this$node.contains(newFocused)) {
101
103
  return;
102
104
  }
103
105
  this.focusLast();
@@ -85,8 +85,8 @@ class Header extends PureComponent {
85
85
  calculateColumnsWidths(columnsRowNode) {
86
86
  var _columnsRowNode$child;
87
87
  this.setState({
88
- headerWidth: columnsRowNode?.clientWidth,
89
- widths: [...((_columnsRowNode$child = columnsRowNode?.childNodes) !== null && _columnsRowNode$child !== void 0 ? _columnsRowNode$child : [])].map(column => column instanceof Element ? column.clientWidth : 0)
88
+ headerWidth: columnsRowNode === null || columnsRowNode === void 0 ? void 0 : columnsRowNode.clientWidth,
89
+ widths: [...((_columnsRowNode$child = columnsRowNode === null || columnsRowNode === void 0 ? void 0 : columnsRowNode.childNodes) !== null && _columnsRowNode$child !== void 0 ? _columnsRowNode$child : [])].map(column => column instanceof Element ? column.clientWidth : 0)
90
90
  });
91
91
  }
92
92
  createCells() {
@@ -13,7 +13,8 @@ class MultiTable extends PureComponent {
13
13
  const currentSelections = this.props.children.map(element => element.props.selection);
14
14
  const currentFocused = currentSelections.filter(selection => selection.getFocused());
15
15
  if (currentFocused.includes(prevFocused)) {
16
- prevProps.children[prevFocusedIndex].props.onSelect?.(prevFocused.resetFocus());
16
+ var _prevProps$children$p, _prevProps$children$p2;
17
+ (_prevProps$children$p = (_prevProps$children$p2 = prevProps.children[prevFocusedIndex].props).onSelect) === null || _prevProps$children$p === void 0 ? void 0 : _prevProps$children$p.call(_prevProps$children$p2, prevFocused.resetFocus());
17
18
  }
18
19
  }
19
20
  }
@@ -33,12 +34,15 @@ class MultiTable extends PureComponent {
33
34
  const prevTable = tables[tableIndex - 1] ? tables[tableIndex - 1].props : null;
34
35
  let newSelection = currentTable.selection.moveUp();
35
36
  if (newSelection) {
36
- currentTable.onSelect?.(newSelection);
37
+ var _currentTable$onSelec;
38
+ (_currentTable$onSelec = currentTable.onSelect) === null || _currentTable$onSelec === void 0 ? void 0 : _currentTable$onSelec.call(currentTable, newSelection);
37
39
  } else if (prevTable) {
38
- currentTable.onSelect?.(currentTable.selection.resetFocus());
40
+ var _currentTable$onSelec2;
41
+ (_currentTable$onSelec2 = currentTable.onSelect) === null || _currentTable$onSelec2 === void 0 ? void 0 : _currentTable$onSelec2.call(currentTable, currentTable.selection.resetFocus());
39
42
  newSelection = prevTable.selection.moveUp();
40
43
  if (newSelection) {
41
- prevTable.onSelect?.(newSelection);
44
+ var _prevTable$onSelect;
45
+ (_prevTable$onSelect = prevTable.onSelect) === null || _prevTable$onSelect === void 0 ? void 0 : _prevTable$onSelect.call(prevTable, newSelection);
42
46
  }
43
47
  }
44
48
  return false;
@@ -59,12 +63,15 @@ class MultiTable extends PureComponent {
59
63
  const nextTable = tables[tableIndex + 1] ? tables[tableIndex + 1].props : null;
60
64
  let newSelection = currentTable.selection.moveDown();
61
65
  if (newSelection) {
62
- currentTable.onSelect?.(newSelection);
66
+ var _currentTable$onSelec3;
67
+ (_currentTable$onSelec3 = currentTable.onSelect) === null || _currentTable$onSelec3 === void 0 ? void 0 : _currentTable$onSelec3.call(currentTable, newSelection);
63
68
  } else if (nextTable) {
64
- currentTable.onSelect?.(currentTable.selection.resetFocus());
69
+ var _currentTable$onSelec4;
70
+ (_currentTable$onSelec4 = currentTable.onSelect) === null || _currentTable$onSelec4 === void 0 ? void 0 : _currentTable$onSelec4.call(currentTable, currentTable.selection.resetFocus());
65
71
  newSelection = nextTable.selection.moveDown();
66
72
  if (newSelection) {
67
- nextTable.onSelect?.(newSelection);
73
+ var _nextTable$onSelect;
74
+ (_nextTable$onSelect = nextTable.onSelect) === null || _nextTable$onSelect === void 0 ? void 0 : _nextTable$onSelect.call(nextTable, newSelection);
68
75
  }
69
76
  }
70
77
  return false;
@@ -48,16 +48,20 @@ class RowWithFocusSensorCallbacks extends PureComponent {
48
48
  // https://stackoverflow.com/a/53882322/6304152
49
49
  RowWithFocusSensor = getContainer();
50
50
  onFocus = () => {
51
- this.props.onFocus?.(this.props.item);
51
+ var _this$props$onFocus, _this$props;
52
+ (_this$props$onFocus = (_this$props = this.props).onFocus) === null || _this$props$onFocus === void 0 ? void 0 : _this$props$onFocus.call(_this$props, this.props.item);
52
53
  };
53
54
  onSelect = (item, selected) => {
54
- this.props.onSelect?.(item, selected);
55
+ var _this$props$onSelect, _this$props2;
56
+ (_this$props$onSelect = (_this$props2 = this.props).onSelect) === null || _this$props$onSelect === void 0 ? void 0 : _this$props$onSelect.call(_this$props2, item, selected);
55
57
  };
56
58
  onCollapse = () => {
57
- this.props.onCollapse?.(this.props.item);
59
+ var _this$props$onCollaps, _this$props3;
60
+ (_this$props$onCollaps = (_this$props3 = this.props).onCollapse) === null || _this$props$onCollaps === void 0 ? void 0 : _this$props$onCollaps.call(_this$props3, this.props.item);
58
61
  };
59
62
  onExpand = () => {
60
- this.props.onExpand?.(this.props.item);
63
+ var _this$props$onExpand, _this$props4;
64
+ (_this$props$onExpand = (_this$props4 = this.props).onExpand) === null || _this$props$onExpand === void 0 ? void 0 : _this$props$onExpand.call(_this$props4, this.props.item);
61
65
  };
62
66
  render() {
63
67
  return /*#__PURE__*/React.createElement(this.RowWithFocusSensor, _extends({}, this.props, {
@@ -28,7 +28,7 @@ function selectionShortcutsHOC(ComposedComponent) {
28
28
  } = this.props;
29
29
  const newSelection = selection.moveUp();
30
30
  if (newSelection) {
31
- onSelect?.(newSelection);
31
+ onSelect === null || onSelect === void 0 ? void 0 : onSelect(newSelection);
32
32
  }
33
33
  return false;
34
34
  };
@@ -39,7 +39,7 @@ function selectionShortcutsHOC(ComposedComponent) {
39
39
  } = this.props;
40
40
  const newSelection = selection.moveDown();
41
41
  if (newSelection) {
42
- onSelect?.(newSelection);
42
+ onSelect === null || onSelect === void 0 ? void 0 : onSelect(newSelection);
43
43
  }
44
44
  return false;
45
45
  };
@@ -74,9 +74,9 @@ function selectionShortcutsHOC(ComposedComponent) {
74
74
  const newSelection = this.shiftSelect(selection);
75
75
  const newMovedSelection = newSelection.moveUp();
76
76
  if (newMovedSelection) {
77
- onSelect?.(newMovedSelection);
77
+ onSelect === null || onSelect === void 0 ? void 0 : onSelect(newMovedSelection);
78
78
  } else {
79
- onSelect?.(newSelection);
79
+ onSelect === null || onSelect === void 0 ? void 0 : onSelect(newSelection);
80
80
  }
81
81
  };
82
82
  onShiftDownPress = e => {
@@ -92,9 +92,9 @@ function selectionShortcutsHOC(ComposedComponent) {
92
92
  const newSelection = this.shiftSelect(selection);
93
93
  const newMovedSelection = newSelection.moveDown();
94
94
  if (newMovedSelection) {
95
- onSelect?.(newMovedSelection);
95
+ onSelect === null || onSelect === void 0 ? void 0 : onSelect(newMovedSelection);
96
96
  } else {
97
- onSelect?.(newSelection);
97
+ onSelect === null || onSelect === void 0 ? void 0 : onSelect(newSelection);
98
98
  }
99
99
  };
100
100
  onHomePress = () => {
@@ -104,7 +104,7 @@ function selectionShortcutsHOC(ComposedComponent) {
104
104
  } = this.props;
105
105
  const newSelection = selection.moveStart();
106
106
  if (newSelection) {
107
- onSelect?.(newSelection);
107
+ onSelect === null || onSelect === void 0 ? void 0 : onSelect(newSelection);
108
108
  }
109
109
  return false;
110
110
  };
@@ -115,7 +115,7 @@ function selectionShortcutsHOC(ComposedComponent) {
115
115
  } = this.props;
116
116
  const newSelection = selection.moveEnd();
117
117
  if (newSelection) {
118
- onSelect?.(newSelection);
118
+ onSelect === null || onSelect === void 0 ? void 0 : onSelect(newSelection);
119
119
  }
120
120
  return false;
121
121
  };
@@ -128,7 +128,7 @@ function selectionShortcutsHOC(ComposedComponent) {
128
128
  if (!selectable) {
129
129
  return true;
130
130
  }
131
- onSelect?.(selection.toggleSelection());
131
+ onSelect === null || onSelect === void 0 ? void 0 : onSelect(selection.toggleSelection());
132
132
  return false;
133
133
  };
134
134
  onEscPress = () => {
@@ -136,7 +136,7 @@ function selectionShortcutsHOC(ComposedComponent) {
136
136
  selection,
137
137
  onSelect
138
138
  } = this.props;
139
- onSelect?.(selection.reset());
139
+ onSelect === null || onSelect === void 0 ? void 0 : onSelect(selection.reset());
140
140
  //this.restoreFocusWithoutScroll();
141
141
  };
142
142
 
@@ -149,7 +149,7 @@ function selectionShortcutsHOC(ComposedComponent) {
149
149
  if (!selectable) {
150
150
  return true;
151
151
  }
152
- onSelect?.(selection.selectAll());
152
+ onSelect === null || onSelect === void 0 ? void 0 : onSelect(selection.selectAll());
153
153
  return false;
154
154
  };
155
155
  shortcutsMap = {
@@ -205,7 +205,7 @@ const CollapsibleTabs = _ref => {
205
205
  const measureTask = fastdom.measure(() => {
206
206
  var _container$children;
207
207
  const container = measureRef.current;
208
- const descendants = [...((_container$children = container?.children) !== null && _container$children !== void 0 ? _container$children : [])];
208
+ const descendants = [...((_container$children = container === null || container === void 0 ? void 0 : container.children) !== null && _container$children !== void 0 ? _container$children : [])];
209
209
  const moreButton = descendants.pop();
210
210
  let moreButtonWidth = moreButton.offsetWidth;
211
211
  const {
package/dist/tag/tag.js CHANGED
@@ -58,7 +58,8 @@ class Tag extends PureComponent {
58
58
  });
59
59
  }
60
60
  if (this.state.focused) {
61
- this.tagNode?.focus();
61
+ var _this$tagNode;
62
+ (_this$tagNode = this.tagNode) === null || _this$tagNode === void 0 ? void 0 : _this$tagNode.focus();
62
63
  }
63
64
  this.setDocumentClickListener(this.state.focused);
64
65
  }
@@ -170,9 +170,10 @@ class TagsInput extends PureComponent {
170
170
  }
171
171
  componentDidMount() {
172
172
  if (this.props.autoOpen && !this.props.disabled) {
173
+ var _this$select;
173
174
  this.focusInput();
174
175
  this.loadSuggestions();
175
- this.select?._showPopup();
176
+ (_this$select = this.select) === null || _this$select === void 0 ? void 0 : _this$select._showPopup();
176
177
  }
177
178
  }
178
179
  static ngModelStateField = 'tags';
@@ -187,7 +188,8 @@ class TagsInput extends PureComponent {
187
188
  caret;
188
189
  getInputNode() {
189
190
  if (!this.input) {
190
- this.input = this.select?.filter;
191
+ var _this$select2;
192
+ this.input = (_this$select2 = this.select) === null || _this$select2 === void 0 ? void 0 : _this$select2.filter;
191
193
  if (this.input) {
192
194
  this.caret = new Caret(this.input);
193
195
  }
@@ -200,15 +202,17 @@ class TagsInput extends PureComponent {
200
202
  });
201
203
  }
202
204
  focusInput = () => {
203
- this.getInputNode()?.focus();
205
+ var _this$getInputNode;
206
+ (_this$getInputNode = this.getInputNode()) === null || _this$getInputNode === void 0 ? void 0 : _this$getInputNode.focus();
204
207
  };
205
208
  addTag = tag => {
209
+ var _this$select3, _this$select4;
206
210
  if (tag == null) {
207
211
  return;
208
212
  }
209
213
  const isUniqueTag = this.state.tags.filter(item => tag.key === item.key).length === 0;
210
- this.select?.clear();
211
- this.select?.filterValue('');
214
+ (_this$select3 = this.select) === null || _this$select3 === void 0 ? void 0 : _this$select3.clear();
215
+ (_this$select4 = this.select) === null || _this$select4 === void 0 ? void 0 : _this$select4.filterValue('');
212
216
  if (isUniqueTag) {
213
217
  this.setState(prevState => ({
214
218
  tags: prevState.tags.concat([tag])
@@ -234,10 +238,11 @@ class TagsInput extends PureComponent {
234
238
  }, this.focusInput);
235
239
  }
236
240
  clickHandler = event => {
241
+ var _this$select5;
237
242
  if (event.target !== this.node && event.target.parentElement !== this.node) {
238
243
  return;
239
244
  }
240
- this.select?._clickHandler();
245
+ (_this$select5 = this.select) === null || _this$select5 === void 0 ? void 0 : _this$select5._clickHandler();
241
246
  };
242
247
  filterExistingTags = suggestions => {
243
248
  const tagsMap = new Map(this.state.tags.map(tag => [tag.key, tag]));
@@ -295,20 +300,22 @@ class TagsInput extends PureComponent {
295
300
  }
296
301
  };
297
302
  handleKeyDown = event => {
303
+ var _this$select6, _this$select6$_popup;
298
304
  const key = getEventKey(event);
299
305
  const isInputFocused = () => {
300
- var _this$getInputNode$ta;
301
- return event.target instanceof Element && event.target.matches((_this$getInputNode$ta = this.getInputNode()?.tagName) !== null && _this$getInputNode$ta !== void 0 ? _this$getInputNode$ta : '');
306
+ var _this$getInputNode$ta, _this$getInputNode2;
307
+ return event.target instanceof Element && event.target.matches((_this$getInputNode$ta = (_this$getInputNode2 = this.getInputNode()) === null || _this$getInputNode2 === void 0 ? void 0 : _this$getInputNode2.tagName) !== null && _this$getInputNode$ta !== void 0 ? _this$getInputNode$ta : '');
302
308
  };
303
309
  if (key === ' ' && this.props.allowAddNewTags) {
310
+ var _this$getInputNode3;
304
311
  event.stopPropagation();
305
- const value = this.getInputNode()?.value;
312
+ const value = (_this$getInputNode3 = this.getInputNode()) === null || _this$getInputNode3 === void 0 ? void 0 : _this$getInputNode3.value;
306
313
  if (value != null && value !== '') {
307
314
  this.handleTagCreation(value);
308
315
  }
309
316
  return true;
310
317
  }
311
- if (this.select?._popup?.isVisible()) {
318
+ if ((_this$select6 = this.select) !== null && _this$select6 !== void 0 && (_this$select6$_popup = _this$select6._popup) !== null && _this$select6$_popup !== void 0 && _this$select6$_popup.isVisible()) {
312
319
  return true;
313
320
  }
314
321
  if (key === 'ArrowLeft') {
@@ -321,7 +328,8 @@ class TagsInput extends PureComponent {
321
328
  if (key === 'ArrowRight' && !isInputFocused()) {
322
329
  if (this.state.activeIndex === this.state.tags.length - 1) {
323
330
  if (!this.props.disabled) {
324
- this.getInputNode()?.focus();
331
+ var _this$getInputNode4;
332
+ (_this$getInputNode4 = this.getInputNode()) === null || _this$getInputNode4 === void 0 ? void 0 : _this$getInputNode4.focus();
325
333
  this.setActiveIndex();
326
334
  }
327
335
  } else {
@@ -330,10 +338,12 @@ class TagsInput extends PureComponent {
330
338
  return false;
331
339
  }
332
340
  if (!this.props.disabled) {
333
- if (key === 'Backspace' && !this.getInputNode()?.value) {
341
+ var _this$getInputNode5;
342
+ if (key === 'Backspace' && !((_this$getInputNode5 = this.getInputNode()) !== null && _this$getInputNode5 !== void 0 && _this$getInputNode5.value)) {
343
+ var _this$select7;
334
344
  event.preventDefault();
335
345
  const tagsLength = this.state.tags.length;
336
- this.select?._hidePopup(true); // otherwise confirmation may be overlapped by popup
346
+ (_this$select7 = this.select) === null || _this$select7 === void 0 ? void 0 : _this$select7._hidePopup(true); // otherwise confirmation may be overlapped by popup
337
347
  this.onRemoveTag(this.state.tags[tagsLength - 1]);
338
348
  return false;
339
349
  }
@@ -1,9 +1,12 @@
1
1
  import React, { Component, HTMLAttributes } from 'react';
2
2
  import PropTypes from 'prop-types';
3
+ type TextSize = 's' | 'm' | 'l';
3
4
  export interface TextProps extends HTMLAttributes<HTMLElement> {
4
5
  info?: boolean | null | undefined;
6
+ size?: TextSize;
5
7
  'data-test'?: string | null | undefined;
6
8
  }
9
+ declare const TextSize: Record<string, TextSize>;
7
10
  /**
8
11
  * @name Text
9
12
  */
@@ -11,7 +14,10 @@ export default class Text extends Component<TextProps> {
11
14
  static propTypes: {
12
15
  children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
13
16
  info: PropTypes.Requireable<boolean>;
17
+ size: PropTypes.Requireable<TextSize>;
14
18
  className: PropTypes.Requireable<string>;
15
19
  };
20
+ static Size: Record<string, TextSize>;
16
21
  render(): React.JSX.Element;
17
22
  }
23
+ export {};
package/dist/text/text.js CHANGED
@@ -3,8 +3,13 @@ import React, { Component } from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import classNames from 'classnames';
5
5
 
6
- var modules_78d1bce6 = {"light":"light_rui_2ac4","text":"text_rui_6f30","info":"info_rui_6f30"};
6
+ var modules_78d1bce6 = {"light":"light_rui_2ac4","text":"text_rui_6f30","sizeS":"sizeS_rui_6f30","sizeM":"sizeM_rui_6f30","sizeL":"sizeL_rui_6f30","info":"info_rui_6f30"};
7
7
 
8
+ const TextSize = {
9
+ S: 's',
10
+ M: 'm',
11
+ L: 'l'
12
+ };
8
13
  /**
9
14
  * @name Text
10
15
  */
@@ -12,17 +17,23 @@ class Text extends Component {
12
17
  static propTypes = {
13
18
  children: PropTypes.node,
14
19
  info: PropTypes.bool,
20
+ size: PropTypes.oneOf(Object.keys(TextSize).map(it => TextSize[it])),
15
21
  className: PropTypes.string
16
22
  };
23
+ static Size = TextSize;
17
24
  render() {
18
25
  const {
19
26
  children,
20
27
  className,
21
28
  info,
29
+ size,
22
30
  ...restProps
23
31
  } = this.props;
24
32
  const classes = classNames(modules_78d1bce6.text, className, {
25
- [modules_78d1bce6.info]: info
33
+ [modules_78d1bce6.info]: info,
34
+ [modules_78d1bce6.sizeS]: size === Text.Size.S,
35
+ [modules_78d1bce6.sizeM]: size === Text.Size.M,
36
+ [modules_78d1bce6.sizeL]: size === Text.Size.L
26
37
  });
27
38
  return /*#__PURE__*/React.createElement("span", _extends({
28
39
  className: classes
@@ -82,6 +82,7 @@ class Tooltip extends Component {
82
82
  }
83
83
  };
84
84
  showPopup = () => {
85
+ var _this$context;
85
86
  if (this.props.selfOverflowOnly) {
86
87
  const {
87
88
  containerNode
@@ -101,14 +102,15 @@ class Tooltip extends Component {
101
102
  return;
102
103
  }
103
104
  }
104
- this.context?.onNestedTooltipShow();
105
+ (_this$context = this.context) === null || _this$context === void 0 ? void 0 : _this$context.onNestedTooltipShow();
105
106
  this.setState({
106
107
  showPopup: true
107
108
  });
108
109
  };
109
110
  hidePopup = () => {
111
+ var _this$context2;
110
112
  clearTimeout(this.timeout);
111
- this.context?.onNestedTooltipHide();
113
+ (_this$context2 = this.context) === null || _this$context2 === void 0 ? void 0 : _this$context2.onNestedTooltipHide();
112
114
  this.setState({
113
115
  showPopup: false
114
116
  });
@@ -113,38 +113,38 @@ class UserAgreement extends PureComponent {
113
113
  translate
114
114
  } = _ref;
115
115
  return /*#__PURE__*/React.createElement(Dialog, {
116
- label: (_translations$userAgr = translations?.userAgreement) !== null && _translations$userAgr !== void 0 ? _translations$userAgr : translate('userAgreement'),
116
+ label: (_translations$userAgr = translations === null || translations === void 0 ? void 0 : translations.userAgreement) !== null && _translations$userAgr !== void 0 ? _translations$userAgr : translate('userAgreement'),
117
117
  show: show,
118
118
  className: classNames(modules_f5ed85cf.agreementDialog, className),
119
119
  contentClassName: modules_f5ed85cf.dialogContent,
120
120
  trapFocus: true,
121
121
  autoFocusFirst: false,
122
122
  "data-test": "user-agreement"
123
- }, /*#__PURE__*/React.createElement(HeaderWrapper, null, (_translations$userAgr2 = translations?.userAgreement) !== null && _translations$userAgr2 !== void 0 ? _translations$userAgr2 : translate('userAgreement')), /*#__PURE__*/React.createElement(ContentWrapper, {
123
+ }, /*#__PURE__*/React.createElement(HeaderWrapper, null, (_translations$userAgr2 = translations === null || translations === void 0 ? void 0 : translations.userAgreement) !== null && _translations$userAgr2 !== void 0 ? _translations$userAgr2 : translate('userAgreement')), /*#__PURE__*/React.createElement(ContentWrapper, {
124
124
  fade: true,
125
125
  onScrollToBottom: this.onScrollToBottom
126
126
  }, /*#__PURE__*/React.createElement(Markdown, null, text)), !preview && /*#__PURE__*/React.createElement(Panel, null, onRemindLater && !scrolledDown && /*#__PURE__*/React.createElement("div", {
127
127
  className: modules_f5ed85cf.suggestion
128
- }, (_translations$scrollT = translations?.scrollToAccept) !== null && _translations$scrollT !== void 0 ? _translations$scrollT : translate('scrollToAccept')), /*#__PURE__*/React.createElement(Button, {
128
+ }, (_translations$scrollT = translations === null || translations === void 0 ? void 0 : translations.scrollToAccept) !== null && _translations$scrollT !== void 0 ? _translations$scrollT : translate('scrollToAccept')), /*#__PURE__*/React.createElement(Button, {
129
129
  primary: true,
130
130
  disabled: !scrolledDown,
131
131
  onClick: onAccept,
132
132
  "data-test": "accept"
133
- }, (_translations$accept = translations?.accept) !== null && _translations$accept !== void 0 ? _translations$accept : translate('accept')), /*#__PURE__*/React.createElement(Button, {
133
+ }, (_translations$accept = translations === null || translations === void 0 ? void 0 : translations.accept) !== null && _translations$accept !== void 0 ? _translations$accept : translate('accept')), /*#__PURE__*/React.createElement(Button, {
134
134
  onClick: onDecline,
135
135
  autoFocus: true,
136
136
  "data-test": "decline"
137
- }, (_translations$decline = translations?.decline) !== null && _translations$decline !== void 0 ? _translations$decline : translate('decline')), !onRemindLater && !scrolledDown && /*#__PURE__*/React.createElement("span", {
137
+ }, (_translations$decline = translations === null || translations === void 0 ? void 0 : translations.decline) !== null && _translations$decline !== void 0 ? _translations$decline : translate('decline')), !onRemindLater && !scrolledDown && /*#__PURE__*/React.createElement("span", {
138
138
  className: modules_f5ed85cf.suggestion
139
- }, (_translations$scrollT2 = translations?.scrollToAccept) !== null && _translations$scrollT2 !== void 0 ? _translations$scrollT2 : translate('scrollToAccept')), onRemindLater && /*#__PURE__*/React.createElement(Button, {
139
+ }, (_translations$scrollT2 = translations === null || translations === void 0 ? void 0 : translations.scrollToAccept) !== null && _translations$scrollT2 !== void 0 ? _translations$scrollT2 : translate('scrollToAccept')), onRemindLater && /*#__PURE__*/React.createElement(Button, {
140
140
  className: modules_f5ed85cf.remindLaterButton,
141
141
  onClick: onRemindLater,
142
142
  "data-test": "later"
143
- }, (_translations$remindL = translations?.remindLater) !== null && _translations$remindL !== void 0 ? _translations$remindL : translate('remindLater'))), preview && /*#__PURE__*/React.createElement(Panel, null, /*#__PURE__*/React.createElement(Button, {
143
+ }, (_translations$remindL = translations === null || translations === void 0 ? void 0 : translations.remindLater) !== null && _translations$remindL !== void 0 ? _translations$remindL : translate('remindLater'))), preview && /*#__PURE__*/React.createElement(Panel, null, /*#__PURE__*/React.createElement(Button, {
144
144
  onClick: onClose,
145
145
  autoFocus: true,
146
146
  "data-test": "close"
147
- }, (_translations$close = translations?.close) !== null && _translations$close !== void 0 ? _translations$close : translate('close'))));
147
+ }, (_translations$close = translations === null || translations === void 0 ? void 0 : translations.close) !== null && _translations$close !== void 0 ? _translations$close : translate('close'))));
148
148
  });
149
149
  }
150
150
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetbrains/ring-ui",
3
- "version": "5.0.146",
3
+ "version": "5.0.148",
4
4
  "description": "JetBrains UI library",
5
5
  "author": "JetBrains",
6
6
  "license": "Apache-2.0",
@@ -77,26 +77,27 @@
77
77
  "devDependencies": {
78
78
  "@babel/cli": "^7.22.5",
79
79
  "@babel/eslint-parser": "^7.22.5",
80
+ "@csstools/stylelint-no-at-nest-rule": "^1.0.0",
80
81
  "@jetbrains/eslint-config": "^5.4.1",
81
82
  "@jetbrains/stylelint-config": "^4.0.1",
82
- "@primer/octicons": "^19.2.0",
83
+ "@primer/octicons": "^19.4.0",
83
84
  "@rollup/plugin-babel": "^6.0.3",
84
85
  "@rollup/plugin-json": "^6.0.0",
85
86
  "@rollup/plugin-node-resolve": "^15.1.0",
86
87
  "@rollup/plugin-replace": "^5.0.2",
87
- "@storybook/addon-a11y": "7.0.21",
88
- "@storybook/addon-docs": "7.0.21",
89
- "@storybook/addon-essentials": "7.0.21",
90
- "@storybook/addon-storyshots": "7.0.20",
91
- "@storybook/addon-storyshots-puppeteer": "7.0.21",
92
- "@storybook/addon-storysource": "7.0.21",
93
- "@storybook/addons": "7.0.21",
94
- "@storybook/html": "7.0.20",
95
- "@storybook/html-webpack5": "^7.0.21",
96
- "@storybook/preview-api": "7.0.20",
97
- "@storybook/react": "7.0.21",
98
- "@storybook/source-loader": "7.0.21",
99
- "@storybook/theming": "7.0.21",
88
+ "@storybook/addon-a11y": "7.0.23",
89
+ "@storybook/addon-docs": "7.0.23",
90
+ "@storybook/addon-essentials": "7.0.23",
91
+ "@storybook/addon-storyshots": "7.0.21",
92
+ "@storybook/addon-storyshots-puppeteer": "7.0.23",
93
+ "@storybook/addon-storysource": "7.0.23",
94
+ "@storybook/addons": "7.0.23",
95
+ "@storybook/html": "7.0.21",
96
+ "@storybook/html-webpack5": "^7.0.23",
97
+ "@storybook/preview-api": "7.0.21",
98
+ "@storybook/react": "7.0.23",
99
+ "@storybook/source-loader": "7.0.23",
100
+ "@storybook/theming": "7.0.23",
100
101
  "@testing-library/react": "^14.0.0",
101
102
  "@testing-library/user-event": "^14.4.3",
102
103
  "@types/chai": "^4.3.5",
@@ -104,20 +105,20 @@
104
105
  "@types/chai-dom": "0.0.10",
105
106
  "@types/chai-enzyme": "^0.6.8",
106
107
  "@types/enzyme": "^3.10.13",
107
- "@types/react": "^18.2.12",
108
- "@types/react-dom": "^18.2.5",
108
+ "@types/react": "^18.2.13",
109
+ "@types/react-dom": "^18.2.6",
109
110
  "@types/sinon": "^10.0.15",
110
111
  "@types/sinon-chai": "^3.2.9",
111
- "@typescript-eslint/eslint-plugin": "^5.59.11",
112
- "@typescript-eslint/parser": "^5.59.11",
112
+ "@typescript-eslint/eslint-plugin": "^5.60.0",
113
+ "@typescript-eslint/parser": "^5.60.0",
113
114
  "@wojtekmaj/enzyme-adapter-react-17": "^0.8.0",
114
- "acorn": "^8.8.2",
115
+ "acorn": "^8.9.0",
115
116
  "angular": "^1.8.3",
116
117
  "angular-mocks": "^1.8.3",
117
118
  "angular-route": "^1.8.3",
118
119
  "babel-plugin-react-docgen": "^4.2.1",
119
120
  "babel-plugin-require-context-hook": "^1.0.0",
120
- "caniuse-lite": "^1.0.30001503",
121
+ "caniuse-lite": "^1.0.30001507",
121
122
  "chai": "^4.3.7",
122
123
  "chai-as-promised": "^7.1.1",
123
124
  "chai-dom": "^1.10.0",
@@ -126,7 +127,7 @@
126
127
  "core-js": "^3.31.0",
127
128
  "cpy-cli": "^3.1.1",
128
129
  "enzyme": "^3.11.0",
129
- "eslint": "^8.42.0",
130
+ "eslint": "^8.43.0",
130
131
  "eslint-import-resolver-webpack": "^0.13.2",
131
132
  "eslint-plugin-angular": "^4.1.0",
132
133
  "eslint-plugin-bdd": "^2.1.1",
@@ -154,7 +155,7 @@
154
155
  "mocha": "^10.2.0",
155
156
  "pinst": "^3.0.0",
156
157
  "prettier": "^2.8.8",
157
- "puppeteer": "^20.7.1",
158
+ "puppeteer": "^20.7.3",
158
159
  "raw-loader": "^4.0.2",
159
160
  "react": "^18.2.0",
160
161
  "react-dom": "^18.2.0",
@@ -164,19 +165,19 @@
164
165
  "rollup": "^3.25.1",
165
166
  "rollup-plugin-clear": "^2.0.7",
166
167
  "rollup-plugin-styles": "^4.0.0",
167
- "sinon": "^15.1.2",
168
+ "sinon": "^15.2.0",
168
169
  "sinon-chai": "^3.7.0",
169
170
  "storage-mock": "^2.1.0",
170
- "storybook": "^7.0.21",
171
+ "storybook": "^7.0.23",
171
172
  "storybook-addon-themes": "^6.1.0",
172
- "storybook-zeplin": "^2.0.0",
173
- "stylelint": "^15.7.0",
173
+ "storybook-zeplin": "^2.0.1",
174
+ "stylelint": "^15.9.0",
174
175
  "svg-inline-loader": "^0.8.2",
175
176
  "teamcity-service-messages": "^0.1.14",
176
177
  "terser-webpack-plugin": "^5.3.9",
177
178
  "typescript": "~5.1.3",
178
179
  "wallaby-webpack": "^3.9.16",
179
- "webpack": "^5.87.0",
180
+ "webpack": "^5.88.0",
180
181
  "webpack-cli": "^5.1.4",
181
182
  "xmlappend": "^1.0.4"
182
183
  },
@@ -216,7 +217,7 @@
216
217
  "@ungap/url-search-params": "^0.2.2",
217
218
  "babel-loader": "9.1.2",
218
219
  "babel-plugin-transform-define": "^2.1.2",
219
- "browserslist": "^4.21.8",
220
+ "browserslist": "^4.21.9",
220
221
  "change-case": "^4.1.1",
221
222
  "classnames": "^2.3.2",
222
223
  "combokeys": "^3.0.1",
@@ -243,7 +244,7 @@
243
244
  "postcss-font-family-system-ui": "^5.0.0",
244
245
  "postcss-loader": "^7.3.3",
245
246
  "postcss-modules-values-replace": "^4.1.0",
246
- "postcss-preset-env": "^8.5.0",
247
+ "postcss-preset-env": "^8.5.1",
247
248
  "prop-types": "^15.8.1",
248
249
  "react-markdown": "^8.0.7",
249
250
  "react-movable": "^3.0.4",