@jetbrains/ring-ui 7.0.74 → 7.0.75

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.
package/babel.config.js CHANGED
@@ -9,6 +9,7 @@ module.exports = function config(api) {
9
9
  'babel-plugin-react-compiler',
10
10
  {
11
11
  target: '18', // should be the minimal supported version from peerDependencies
12
+ panicThreshold: 'all_errors',
12
13
  },
13
14
  ],
14
15
  [
@@ -10,9 +10,10 @@ import Link from '../link/link';
10
10
  import Tooltip from '../tooltip/tooltip';
11
11
  import styles from './banner.css';
12
12
  export function Banner(props) {
13
- const { title, children, mode = 'info', withIcon = false, inline = false, onClose, closeButtonTitle, className, ['data-test']: dataTest, translations = {
13
+ const { title, children, mode = 'info', withIcon = false, inline = false, onClose, closeButtonTitle, className, translations = {
14
14
  close: 'Close',
15
15
  }, } = props;
16
+ const dataTest = props['data-test'];
16
17
  let icon = infoIcon;
17
18
  if (mode === 'error') {
18
19
  icon = exceptionIcon;
@@ -5,6 +5,7 @@ export interface ContentLayoutProps extends HTMLAttributes<HTMLElement> {
5
5
  }
6
6
  /**
7
7
  * @name Content Layout
8
+ * @deprecated Will be removed in Ring UI 8.0.
8
9
  */
9
10
  export default class ContentLayout extends Component<ContentLayoutProps> {
10
11
  static defaultProps: {
@@ -4,6 +4,7 @@ import Sidebar from './sidebar';
4
4
  import styles from './content-layout.css';
5
5
  /**
6
6
  * @name Content Layout
7
+ * @deprecated Will be removed in Ring UI 8.0.
7
8
  */
8
9
  export default class ContentLayout extends Component {
9
10
  static defaultProps = {
@@ -6,6 +6,10 @@ export interface SidebarProps extends HTMLAttributes<HTMLElement> {
6
6
  fixedClassName?: string | null | undefined;
7
7
  contentNode?: HTMLElement | null | undefined;
8
8
  }
9
+ /**
10
+ * @name Sidebar
11
+ * @deprecated Will be removed in Ring UI 8.0.
12
+ */
9
13
  export default class Sidebar extends Component<SidebarProps> {
10
14
  state: {
11
15
  topIsOutside: boolean;
@@ -4,6 +4,10 @@ import { Waypoint } from 'react-waypoint';
4
4
  import styles from './content-layout.css';
5
5
  const ABOVE = 'above';
6
6
  const INSIDE = 'inside';
7
+ /**
8
+ * @name Sidebar
9
+ * @deprecated Will be removed in Ring UI 8.0.
10
+ */
7
11
  export default class Sidebar extends Component {
8
12
  state = {
9
13
  topIsOutside: true,
@@ -59,7 +59,7 @@ export interface DatePopupState {
59
59
  active: Field;
60
60
  text: string | null;
61
61
  hoverDate: Date | null;
62
- scrollDate: number | null;
62
+ scrollDate: number | Date | null;
63
63
  }
64
64
  export interface DatePopupBaseProps {
65
65
  date?: Date | number | string | null | undefined;
@@ -35,13 +35,14 @@ export default class DatePopup extends Component {
35
35
  if (!range) {
36
36
  const parsedDate = this.parse(props.date, 'date');
37
37
  const active = withTime && parsedDate && !props.time ? 'time' : 'date';
38
- this.state = { ...defaultState, active };
39
- }
40
- else if (props.from && !props.to) {
41
- this.state = { ...defaultState, active: 'to' };
38
+ this.state = { ...defaultState, active, scrollDate: parsedDate };
42
39
  }
43
40
  else {
44
- this.state = { ...defaultState, active: 'from' };
41
+ this.state = {
42
+ ...defaultState,
43
+ active: props.from && !props.to ? 'to' : 'from',
44
+ scrollDate: this.parse(props.from, 'from'),
45
+ };
45
46
  }
46
47
  }
47
48
  componentDidMount() {
@@ -245,7 +246,7 @@ export default class DatePopup extends Component {
245
246
  };
246
247
  // eslint-disable-next-line complexity
247
248
  render() {
248
- const { range, withTime, locale } = this.props;
249
+ const { range, locale } = this.props;
249
250
  const { from, to, date, time, ...restProps } = this.props;
250
251
  const parsedDate = this.parse(this.props.date, 'date');
251
252
  const parsedTo = this.parse(this.props.to, 'to');
@@ -284,9 +285,7 @@ export default class DatePopup extends Component {
284
285
  break;
285
286
  }
286
287
  }
287
- const scrollDate = withTime && !range
288
- ? this.state.scrollDate || dates.date || new Date()
289
- : this.state.scrollDate || dates[this.state.active] || new Date();
288
+ const scrollDate = this.state.scrollDate || new Date();
290
289
  const calendarProps = {
291
290
  ...restProps,
292
291
  ...dates,
@@ -1,6 +1,7 @@
1
1
  import { Component, type HTMLAttributes } from 'react';
2
2
  /**
3
3
  * @name Grid
4
+ * @deprecated Will be removed in Ring UI 8.0. Use flexbox or another layout library instead.
4
5
  */
5
6
  export declare class Grid extends Component<HTMLAttributes<HTMLDivElement>> {
6
7
  render(): import("react").JSX.Element;
@@ -3,6 +3,7 @@ import classNames from 'classnames';
3
3
  import styles from './grid.css';
4
4
  /**
5
5
  * @name Grid
6
+ * @deprecated Will be removed in Ring UI 8.0. Use flexbox or another layout library instead.
6
7
  */
7
8
  export class Grid extends Component {
8
9
  render() {
@@ -94,6 +94,7 @@ export default class Popup<P extends BasePopupProps = PopupProps> extends PureCo
94
94
  parent?: HTMLElement | null;
95
95
  container?: HTMLElement | null;
96
96
  ringPopupTarget?: string | Element;
97
+ clickStartedInsidePopup: boolean;
97
98
  shouldUseShortcuts(): boolean;
98
99
  listeners: Listeners;
99
100
  redrawScheduler: (cb: () => void) => void;
@@ -136,8 +137,9 @@ export default class Popup<P extends BasePopupProps = PopupProps> extends PureCo
136
137
  isVisible(): boolean;
137
138
  _onCloseAttempt(evt?: Event | SyntheticEvent, isEsc?: boolean): void;
138
139
  private _onEscPress;
140
+ private _onDocumentPointerDown;
139
141
  /**
140
- * @param {jQuery.Event} evt
142
+ * @param {MouseEvent} evt
141
143
  * @private
142
144
  */
143
145
  private _onDocumentClick;
@@ -41,7 +41,7 @@ const stop = (event) => {
41
41
  event.stopPropagation();
42
42
  }
43
43
  };
44
- export const getPopupContainer = (target) => (typeof target === 'string' ? document.querySelector(`[data-portaltarget=${target}]`) : target);
44
+ export const getPopupContainer = (target) => typeof target === 'string' ? document.querySelector(`[data-portaltarget=${target}]`) : target;
45
45
  /**
46
46
  * @constructor
47
47
  * @name Popup
@@ -100,6 +100,7 @@ export default class Popup extends PureComponent {
100
100
  parent;
101
101
  container;
102
102
  ringPopupTarget;
103
+ clickStartedInsidePopup = false;
103
104
  shouldUseShortcuts() {
104
105
  const { shortcuts, hidden } = this.props;
105
106
  return shortcuts && !hidden;
@@ -239,7 +240,8 @@ export default class Popup extends PureComponent {
239
240
  el = el.parentElement;
240
241
  }
241
242
  }
242
- this.listeners.add(document, 'pointerdown', this._onDocumentClick, true);
243
+ this.listeners.add(document, 'pointerdown', this._onDocumentPointerDown, true);
244
+ this.listeners.add(document, 'click', this._onDocumentClick, true);
243
245
  }, 0);
244
246
  return;
245
247
  }
@@ -263,12 +265,20 @@ export default class Popup extends PureComponent {
263
265
  this.props.onEscPress(evt);
264
266
  this._onCloseAttempt(evt, true);
265
267
  };
268
+ _onDocumentPointerDown = (evt) => {
269
+ this.clickStartedInsidePopup = !!(evt.target instanceof Node &&
270
+ this.container &&
271
+ this.container.contains(evt.target));
272
+ };
266
273
  /**
267
- * @param {jQuery.Event} evt
274
+ * @param {MouseEvent} evt
268
275
  * @private
269
276
  */
270
277
  _onDocumentClick = (evt) => {
278
+ const clickStartedInsidePopup = this.clickStartedInsidePopup;
279
+ this.clickStartedInsidePopup = false;
271
280
  if ((this.container && evt.target instanceof Node && this.container.contains(evt.target)) ||
281
+ clickStartedInsidePopup ||
272
282
  !this._listenersEnabled ||
273
283
  (this.props.dontCloseOnAnchorClick && evt.target instanceof Node && this._getAnchor()?.contains(evt.target)) ||
274
284
  // ignore clicks in shadow DOM, e.g., Grammarly suggestions
@@ -8,12 +8,9 @@ const TabTitle = React.memo(function TabTitle({ selected, child, handleSelect, c
8
8
  return child;
9
9
  }
10
10
  const { title, titleProps, disabled, href, className, activeClassName, collapsedClassName, collapsedActiveClassName } = child.props;
11
- const titleClasses = classNames(styles.title, className, {
11
+ const titleClasses = classNames(styles.title, className, selected && activeClassName, collapsed && collapsedClassName, collapsed && selected && collapsedActiveClassName, {
12
12
  [styles.selected]: selected,
13
13
  [styles.collapsed]: collapsed,
14
- [activeClassName ?? '']: selected,
15
- [collapsedClassName ?? '']: collapsed,
16
- [collapsedActiveClassName ?? '']: collapsed && selected,
17
14
  });
18
15
  return (<TabLink title={title} isSelected={selected} active href={href} className={titleClasses} disabled={disabled} onPlainLeftClick={handleSelect} tabIndex={tabIndex} collapsed={collapsed} {...titleProps}/>);
19
16
  });
@@ -3,7 +3,8 @@ import classNames from 'classnames';
3
3
  import attachmentIcon from '@jetbrains/icons/attachment';
4
4
  import Icon from '../icon';
5
5
  import styles from './upload.css';
6
- export const Upload = forwardRef(function Upload({ children, className, onFilesSelected, onFilesRejected, validate = () => true, variant = 'empty', multiple, renderIcon = () => <Icon className={styles.attachmentIcon} glyph={attachmentIcon}/>, accept, disabled, }, ref) {
6
+ const defaultRenderIcon = () => <Icon className={styles.attachmentIcon} glyph={attachmentIcon}/>;
7
+ export const Upload = forwardRef(function Upload({ children, className, onFilesSelected, onFilesRejected, validate = () => true, variant = 'empty', multiple, renderIcon = defaultRenderIcon, accept, disabled, }, ref) {
7
8
  const fileInputRef = useRef(null);
8
9
  const [dragOver, setDragOver] = useState(false);
9
10
  useImperativeHandle(ref, () => ({ openFilePicker: () => fileInputRef.current?.click() }), []);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetbrains/ring-ui",
3
- "version": "7.0.74",
3
+ "version": "7.0.75",
4
4
  "description": "JetBrains UI library",
5
5
  "author": {
6
6
  "name": "JetBrains"
@@ -93,31 +93,30 @@
93
93
  "@babel/eslint-parser": "^7.28.5",
94
94
  "@csstools/css-parser-algorithms": "^3.0.4",
95
95
  "@csstools/stylelint-no-at-nest-rule": "^4.0.0",
96
- "@eslint/compat": "^1.4.0",
96
+ "@eslint/compat": "^1.4.1",
97
97
  "@eslint/eslintrc": "^3.2.0",
98
- "@eslint/js": "^9.38.0",
99
- "@figma/code-connect": "^1.3.7",
98
+ "@eslint/js": "^9.39.1",
99
+ "@figma/code-connect": "^1.3.8",
100
100
  "@jetbrains/eslint-config": "^6.0.5",
101
101
  "@jetbrains/logos": "3.0.0-canary.734b213.0",
102
102
  "@jetbrains/rollup-css-plugin": "./packages/rollup-css-plugin",
103
103
  "@jetbrains/stylelint-config": "^4.0.2",
104
- "@primer/octicons": "^19.19.0",
104
+ "@primer/octicons": "^19.20.0",
105
105
  "@rollup/plugin-babel": "^6.1.0",
106
106
  "@rollup/plugin-json": "^6.1.0",
107
107
  "@rollup/plugin-node-resolve": "^16.0.3",
108
- "@rollup/plugin-replace": "^6.0.2",
109
- "@storybook/addon-a11y": "9.1.15",
110
- "@storybook/addon-docs": "^9.1.15",
111
- "@storybook/addon-themes": "^9.1.15",
108
+ "@rollup/plugin-replace": "^6.0.3",
109
+ "@storybook/addon-a11y": "10.0.6",
110
+ "@storybook/addon-docs": "^10.0.6",
111
+ "@storybook/addon-themes": "^10.0.6",
112
112
  "@storybook/csf": "^0.1.13",
113
- "@storybook/react-webpack5": "9.1.15",
114
- "@storybook/test-runner": "^0.23.0",
113
+ "@storybook/react-webpack5": "10.0.6",
114
+ "@storybook/test-runner": "^0.24.1",
115
115
  "@testing-library/dom": "^10.4.1",
116
116
  "@testing-library/react": "^16.3.0",
117
117
  "@testing-library/user-event": "^14.6.1",
118
118
  "@types/chai-as-promised": "^8.0.2",
119
119
  "@types/chai-dom": "1.11.3",
120
- "@types/eslint__js": "^9.14.0",
121
120
  "@types/markdown-it": "^14.1.2",
122
121
  "@types/react": "^19.2.2",
123
122
  "@types/react-dom": "^19.2.2",
@@ -127,14 +126,14 @@
127
126
  "acorn": "^8.15.0",
128
127
  "babel-plugin-react-compiler": "^1.0.0",
129
128
  "babel-plugin-require-context-hook": "^1.0.0",
130
- "caniuse-lite": "^1.0.30001751",
129
+ "caniuse-lite": "^1.0.30001754",
131
130
  "chai-as-promised": "^8.0.2",
132
131
  "chai-dom": "^1.12.1",
133
132
  "cheerio": "^1.1.2",
134
133
  "core-js": "^3.46.0",
135
134
  "cpy-cli": "^6.0.0",
136
- "dotenv-cli": "^10.0.0",
137
- "eslint": "^9.38.0",
135
+ "dotenv-cli": "^11.0.0",
136
+ "eslint": "^9.39.1",
138
137
  "eslint-config-prettier": "^10.1.8",
139
138
  "eslint-import-resolver-exports": "^1.0.0-beta.5",
140
139
  "eslint-import-resolver-typescript": "^4.4.4",
@@ -144,11 +143,11 @@
144
143
  "eslint-plugin-prettier": "^5.5.4",
145
144
  "eslint-plugin-react": "^7.37.5",
146
145
  "eslint-plugin-react-hooks": "^7.0.1",
147
- "eslint-plugin-storybook": "^9.1.15",
146
+ "eslint-plugin-storybook": "^10.0.6",
148
147
  "eslint-plugin-unicorn": "^62.0.0",
149
148
  "events": "^3.3.0",
150
149
  "glob": "^11.0.3",
151
- "globals": "^16.4.0",
150
+ "globals": "^16.5.0",
152
151
  "html-webpack-plugin": "^5.6.4",
153
152
  "http-server": "^14.1.1",
154
153
  "husky": "^9.1.7",
@@ -165,24 +164,22 @@
165
164
  "react": "^19.2.0",
166
165
  "react-dom": "^19.2.0",
167
166
  "regenerator-runtime": "^0.14.1",
168
- "rimraf": "^6.0.1",
169
- "rollup": "^4.52.5",
167
+ "rimraf": "^6.1.0",
168
+ "rollup": "^4.53.1",
170
169
  "rollup-plugin-clear": "^2.0.7",
171
170
  "storage-mock": "^2.1.0",
172
- "storybook": "9.1.15",
171
+ "storybook": "10.0.6",
173
172
  "stylelint": "^16.25.0",
174
173
  "stylelint-config-sass-guidelines": "^12.1.0",
175
174
  "svg-inline-loader": "^0.8.2",
176
175
  "teamcity-service-messages": "^0.1.14",
177
176
  "terser-webpack-plugin": "^5.3.14",
178
177
  "typescript": "~5.9.3",
179
- "typescript-eslint": "^8.46.2",
178
+ "typescript-eslint": "^8.46.3",
180
179
  "vitest": "^3.2.4",
181
180
  "vitest-teamcity-reporter": "^0.3.1",
182
- "wallaby-webpack": "^3.9.16",
183
181
  "webpack": "^5.102.1",
184
- "webpack-cli": "^6.0.1",
185
- "xmlappend": "^1.0.4"
182
+ "webpack-cli": "^6.0.1"
186
183
  },
187
184
  "peerDependencies": {
188
185
  "@types/react": ">=18.0.0",
@@ -226,7 +223,7 @@
226
223
  "element-resize-detector": "^1.2.4",
227
224
  "fastdom": "^1.0.12",
228
225
  "file-loader": "^6.2.0",
229
- "focus-trap": "^7.6.5",
226
+ "focus-trap": "^7.6.6",
230
227
  "highlight.js": "^10.7.2",
231
228
  "just-debounce-it": "^3.2.0",
232
229
  "memoize-one": "^6.0.0",