@jetbrains/ring-ui 7.0.8 → 7.0.10

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/README.md CHANGED
@@ -8,6 +8,7 @@ This collection of UI components aims to provide all the necessary building bloc
8
8
  ## Try now
9
9
  * Try the [codesandbox](https://codesandbox.io/p/sandbox/ring-ui-7-0-demo-z6v6ym), based on `create-react-app` tooling, to see and try the UI components
10
10
  * Check out [list of examples](https://jetbrains.github.io/ring-ui/master/index.html) for each component
11
+ * Check out [Ring UI Design Guidelines](http://www.jetbrains.com/help/ring-ui)
11
12
 
12
13
  ## Installation
13
14
 
@@ -11,6 +11,9 @@ export interface ButtonBaseProps {
11
11
  loader?: boolean | null | undefined;
12
12
  primary?: boolean | null | undefined;
13
13
  short?: boolean | null | undefined;
14
+ /**
15
+ * @deprecated Use inline instead
16
+ */
14
17
  text?: boolean | null | undefined;
15
18
  inline?: boolean | null | undefined;
16
19
  dropdown?: boolean | null | undefined;
@@ -160,7 +160,7 @@ export default class DatePicker extends PureComponent {
160
160
  });
161
161
  return (<Dropdown className={classes} disabled={this.props.disabled} data-test="ring-date-picker" anchor={inline ? (<Link data-test-ring-dropdown-anchor className={styles.anchor} disabled={this.props.disabled ?? false} pseudo>
162
162
  {this.getAnchorText()}
163
- </Link>) : (<Button data-test-ring-dropdown-anchor className={styles.anchor} text={false} disabled={this.props.disabled ?? false} {...this.props.buttonAttributes}>
163
+ </Link>) : (<Button data-test-ring-dropdown-anchor className={styles.anchor} inline={false} disabled={this.props.disabled ?? false} {...this.props.buttonAttributes}>
164
164
  {anchorContent}
165
165
  </Button>)} {...dropdownProps}>
166
166
  <PopupComponent className={popupClassName} popupRef={this.popupRef} onClear={clear ? this.clear : null} datePopupProps={{
@@ -48,20 +48,24 @@
48
48
 
49
49
  box-sizing: border-box;
50
50
 
51
- width: 100%;
51
+ width: calc(100% - 2 * var(--ring-unit));
52
52
 
53
53
  text-align: left;
54
54
  vertical-align: bottom;
55
55
  white-space: nowrap;
56
56
  text-decoration: none;
57
57
 
58
+ border-radius: var(--ring-border-radius);
59
+
58
60
  outline: none;
59
61
 
60
62
  font-size: var(--ring-font-size);
63
+
64
+ margin-inline: var(--ring-unit);
61
65
  }
62
66
 
63
67
  .item.item {
64
- padding: 3px calc(var(--ring-unit) * 2) 5px;
68
+ padding: 3px var(--ring-unit) 5px;
65
69
 
66
70
  line-height: calc(var(--ring-unit) * 3);
67
71
  }
@@ -160,12 +164,17 @@
160
164
 
161
165
  /* Override :last-child */
162
166
  .hint.hint {
167
+ width: 100%;
168
+
163
169
  margin-bottom: 0;
164
170
 
165
171
  border-top: 1px solid var(--ring-line-color);
172
+ border-radius: 0;
166
173
  background-color: var(--ring-sidebar-background-color);
167
174
 
168
175
  font-size: var(--ring-font-size-smaller);
176
+ margin-inline: 0;
177
+ padding-inline: calc(2 * var(--ring-unit));
169
178
  }
170
179
 
171
180
  .action {
@@ -12,7 +12,7 @@ import styles from './list.css';
12
12
  * @extends {ReactComponent}
13
13
  */
14
14
  const RING_UNIT = 8;
15
- const DEFAULT_PADDING = 16;
15
+ const DEFAULT_PADDING = 8;
16
16
  const CHECKBOX_WIDTH = 28;
17
17
  export default class ListItem extends PureComponent {
18
18
  id = getUID('list-item-');
@@ -111,7 +111,7 @@ export default class Message extends Component {
111
111
  {(onClose || buttonProps) && (<Button className={styles.gotIt} onClick={onClose} primary {...buttonProps}>
112
112
  {translations?.gotIt ?? translate('gotIt')}
113
113
  </Button>)}
114
- {onDismiss && (<Button onClick={onDismiss} text>
114
+ {onDismiss && (<Button onClick={onDismiss} inline>
115
115
  {translations?.dismiss ?? translate('dismiss')}
116
116
  </Button>)}
117
117
  </ThemeProvider>
@@ -19,6 +19,10 @@
19
19
  box-shadow: var(--ring-popup-shadow);
20
20
  }
21
21
 
22
+ .largeBorderRadius {
23
+ border-radius: var(--ring-border-radius-large);
24
+ }
25
+
22
26
  .hidden {
23
27
  display: none;
24
28
  }
@@ -31,6 +31,7 @@ export interface BasePopupProps {
31
31
  legacy: boolean;
32
32
  withTail?: boolean;
33
33
  tailOffset?: number;
34
+ largeBorderRadius?: boolean;
34
35
  anchorElement?: HTMLElement | null | undefined;
35
36
  target?: string | Element | null | undefined;
36
37
  className?: string | null | undefined;
@@ -256,12 +256,13 @@ export default class Popup extends PureComponent {
256
256
  esc: this._onEscPress,
257
257
  };
258
258
  render() {
259
- const { className, style, hidden, attached, keepMounted, client, onMouseDown, onMouseUp, onMouseOver, onMouseOut, onContextMenu, 'data-test': dataTest, } = this.props;
259
+ const { className, style, hidden, attached, keepMounted, client, onMouseDown, onMouseUp, onMouseOver, onMouseOut, onContextMenu, 'data-test': dataTest, largeBorderRadius, } = this.props;
260
260
  const showing = this.state.display === Display.SHOWING;
261
261
  const classes = classNames(className, styles.popup, {
262
262
  [styles.attached]: attached,
263
263
  [styles.hidden]: hidden,
264
264
  [styles.showing]: showing,
265
+ [styles.largeBorderRadius]: largeBorderRadius,
265
266
  });
266
267
  const direction = (this.state.direction || '').toLowerCase().replace(/[_]/g, '-');
267
268
  return (<PopupTargetContext.Consumer>
@@ -27,6 +27,7 @@ export default class PopupMenu<T = unknown> extends Popup<PopupMenuProps<T>> {
27
27
  static defaultProps: {
28
28
  renderOptimization: boolean;
29
29
  closeOnSelect: boolean;
30
+ largeBorderRadius: boolean;
30
31
  shortcuts: boolean;
31
32
  hidden: boolean;
32
33
  onOutsideClick(): void;
@@ -11,6 +11,7 @@ export default class PopupMenu extends Popup {
11
11
  ...Popup.defaultProps,
12
12
  renderOptimization: false,
13
13
  closeOnSelect: false,
14
+ largeBorderRadius: true,
14
15
  };
15
16
  onSelect = (item, event) => {
16
17
  if (this.props.closeOnSelect) {
@@ -411,7 +411,7 @@ export default class Select extends Component {
411
411
  separator: reset.separator,
412
412
  key: reset.label,
413
413
  rgItemType: List.ListProps.Type.CUSTOM,
414
- template: (<Button text className={styles.button} data-test="ring-select-reset-tags-button" height={ControlsHeight.S}>
414
+ template: (<Button inline className={styles.button} data-test="ring-select-reset-tags-button" height={ControlsHeight.S}>
415
415
  {reset.label}
416
416
  </Button>),
417
417
  glyph: reset.glyph,
@@ -486,7 +486,7 @@ export default class Select extends Component {
486
486
  [styles.toolbar]: Boolean(this.state.addButton || renderBottomToolbar),
487
487
  })} data-test="ring-select-toolbar">
488
488
  {renderBottomToolbar && renderBottomToolbar()}
489
- {this.state.addButton && (<Button text delayed={delayed} className={classNames(styles.button, styles.buttonSpaced)} onClick={this.addHandler} data-test="ring-select-toolbar-button">
489
+ {this.state.addButton && (<Button inline delayed={delayed} className={classNames(styles.button, styles.buttonSpaced)} onClick={this.addHandler} data-test="ring-select-toolbar-button">
490
490
  {prefix ? `${prefix} ${label}` : label}
491
491
  </Button>)}
492
492
  {hint && <List.ListHint label={hint} data-test="ring-select-toolbar-hint"/>}
@@ -259,7 +259,7 @@ export default class SelectPopup extends PureComponent {
259
259
  const multiple = this.props.multiple;
260
260
  const activeFilters = this.props.data.filter(item => !item.disabled);
261
261
  return (Array.isArray(this.props.selected) && (<div className={styles.selectAll}>
262
- {activeFilters.length === 0 ? (<span />) : (<Button text inline onClick={this.handleSelectAll}>
262
+ {activeFilters.length === 0 ? (<span />) : (<Button inline onClick={this.handleSelectAll}>
263
263
  {activeFilters.length !== this.props.selected.length
264
264
  ? multiple.selectAllLabel || 'Select all'
265
265
  : multiple.deselectAllLabel || 'Deselect all'}
@@ -328,7 +328,7 @@ export default class SelectPopup extends PureComponent {
328
328
  const list = this.getList(this.props.ringPopupTarget || ringPopupTarget);
329
329
  const bottomLine = this.getBottomLine();
330
330
  const hasContent = filterWithTags || selectAll || list || bottomLine || toolbar || topbar;
331
- return (<Popup trapFocus={false} ref={this.popupRef} hidden={hidden || !hasContent} attached={isInputMode} className={classes} dontCloseOnAnchorClick anchorElement={anchorElement} minWidth={minWidth} onCloseAttempt={onCloseAttempt} onOutsideClick={onOutsideClick} directions={directions} top={top} left={left} offset={offset} onMouseDown={this.mouseDownHandler} target={this.props.ringPopupTarget} autoCorrectTopOverflow={false} style={style}>
331
+ return (<Popup trapFocus={false} ref={this.popupRef} hidden={hidden || !hasContent} attached={isInputMode} className={classes} dontCloseOnAnchorClick anchorElement={anchorElement} minWidth={minWidth} onCloseAttempt={onCloseAttempt} onOutsideClick={onOutsideClick} directions={directions} top={top} left={left} offset={offset} onMouseDown={this.mouseDownHandler} target={this.props.ringPopupTarget} autoCorrectTopOverflow={false} style={style} largeBorderRadius>
332
332
  <div dir={dir}>
333
333
  {!hidden && filter && <Shortcuts map={this.shortcutsMap} scope={this.shortcutsScope}/>}
334
334
  {topbar}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetbrains/ring-ui",
3
- "version": "7.0.8",
3
+ "version": "7.0.10",
4
4
  "description": "JetBrains UI library",
5
5
  "author": "JetBrains",
6
6
  "license": "Apache-2.0",
@@ -104,7 +104,7 @@
104
104
  "@storybook/preview-api": "8.4.5",
105
105
  "@storybook/react": "8.4.5",
106
106
  "@storybook/react-webpack5": "8.4.5",
107
- "@storybook/test-runner": "^0.19.1",
107
+ "@storybook/test-runner": "^0.20.0",
108
108
  "@storybook/theming": "8.4.5",
109
109
  "@testing-library/dom": "^10.4.0",
110
110
  "@testing-library/react": "^16.0.1",
@@ -121,8 +121,8 @@
121
121
  "@types/sinon": "^17.0.3",
122
122
  "@types/sinon-chai": "^4.0.0",
123
123
  "@types/webpack-env": "^1.18.5",
124
- "@vitejs/plugin-react": "^4.3.3",
125
- "@vitest/eslint-plugin": "^1.1.10",
124
+ "@vitejs/plugin-react": "^4.3.4",
125
+ "@vitest/eslint-plugin": "^1.1.12",
126
126
  "@wojtekmaj/enzyme-adapter-react-17": "^0.8.0",
127
127
  "acorn": "^8.14.0",
128
128
  "axe-playwright": "^2.0.3",
@@ -160,7 +160,7 @@
160
160
  "markdown-it": "^14.1.0",
161
161
  "merge-options": "^3.0.4",
162
162
  "pinst": "^3.0.0",
163
- "prettier": "^3.3.3",
163
+ "prettier": "^3.4.1",
164
164
  "raw-loader": "^4.0.2",
165
165
  "react": "^18.3.1",
166
166
  "react-dom": "^18.3.1",
@@ -173,13 +173,13 @@
173
173
  "sinon-chai": "^4.0.0",
174
174
  "storage-mock": "^2.1.0",
175
175
  "storybook": "8.4.5",
176
- "stylelint": "^16.10.0",
176
+ "stylelint": "^16.11.0",
177
177
  "svg-inline-loader": "^0.8.2",
178
178
  "teamcity-service-messages": "^0.1.14",
179
179
  "terser-webpack-plugin": "^5.3.10",
180
180
  "typescript": "~5.6.3",
181
- "typescript-eslint": "^8.15.0",
182
- "vitest": "^2.1.5",
181
+ "typescript-eslint": "^8.16.0",
182
+ "vitest": "^2.1.6",
183
183
  "vitest-teamcity-reporter": "^0.3.1",
184
184
  "wallaby-webpack": "^3.9.16",
185
185
  "webpack": "^5.96.1",
@@ -209,7 +209,7 @@
209
209
  "@babel/core": "^7.26.0",
210
210
  "@babel/preset-typescript": "^7.26.0",
211
211
  "@jetbrains/babel-preset-jetbrains": "^2.4.0",
212
- "@jetbrains/icons": "^5.2.0",
212
+ "@jetbrains/icons": "^5.3.0",
213
213
  "@jetbrains/postcss-require-hover": "^0.1.2",
214
214
  "@types/combokeys": "^2.4.9",
215
215
  "@types/element-resize-detector": "^1.1.6",