@jetbrains/ring-ui 7.0.16 → 7.0.17

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.
@@ -39,12 +39,12 @@
39
39
  }
40
40
 
41
41
  .button {
42
- --ring-button-default-background-color: var(--ring-content-background-color);
42
+ --ring-button-default-background-color: transparent;
43
43
  --ring-button-background-color: var(--ring-button-default-background-color);
44
44
  --ring-button-hover-background-color: var(--ring-content-background-color);
45
45
  --ring-button-pressed-background-color: var(--ring-selected-background-color);
46
46
  --ring-button-active-background-color: var(--ring-hover-background-color);
47
- --ring-button-disabled-background-color: var(--ring-content-background-color);
47
+ --ring-button-disabled-background-color: var(--ring-button-default-background-color);
48
48
 
49
49
  box-sizing: border-box;
50
50
  margin: 0;
@@ -82,6 +82,7 @@
82
82
  }
83
83
 
84
84
  .block {
85
+ --ring-button-default-background-color: var(--ring-content-background-color);
85
86
  --ring-button-default-border-color: var(--ring-borders-color);
86
87
  --ring-button-border-color: var(--ring-button-default-border-color);
87
88
  --ring-button-hover-border-color: var(--ring-border-hover-color);
@@ -259,6 +260,7 @@
259
260
  }
260
261
 
261
262
  .ghost {
263
+ --ring-button-default-background-color: transparent;
262
264
  --ring-button-hover-background-color: var(--ring-tag-hover-background-color);
263
265
  --ring-button-text-color: var(--ring-secondary-color);
264
266
 
@@ -114,7 +114,9 @@ export default class Dialog extends PureComponent {
114
114
  const shortcutsMap = this.getShortcutsMap();
115
115
  const content = (_jsxs(_Fragment, { children: [_jsx(Shortcuts, { map: shortcutsMap, scope: this.state.shortcutsScope, options: this.props.shortcutOptions }), (onOverlayClick !== noop || onCloseAttempt !== noop) && (_jsx("div", {
116
116
  // click handler is duplicated in close button
117
- role: "presentation", className: styles.clickableOverlay, onClick: this.handleClick, "data-test": "ring-dialog-overlay" })), _jsx("div", { className: styles.innerContainer, children: _jsxs(AdaptiveIsland, { className: classNames(styles.content, contentClassName, { [styles.dense]: dense }), "data-test": "ring-dialog", role: "dialog", "aria-label": label, children: [children, showCloseButton && (_jsx(Button, { icon: closeIcon, "data-test": "ring-dialog-close-button", className: classNames(styles.closeButton, {
117
+ role: "presentation", className: styles.clickableOverlay, onClick: this.handleClick, "data-test": "ring-dialog-overlay" })), _jsx("div", { className: styles.innerContainer, children: _jsxs(AdaptiveIsland, { className: classNames(styles.content, contentClassName, {
118
+ [styles.dense]: dense,
119
+ }), "data-test": "ring-dialog", role: "dialog", "aria-label": label, children: [children, showCloseButton && (_jsx(Button, { icon: closeIcon, "data-test": "ring-dialog-close-button", className: classNames(styles.closeButton, {
118
120
  [styles.closeButtonOutside]: !closeButtonInside,
119
121
  [styles.closeButtonInside]: closeButtonInside,
120
122
  }), iconClassName: classNames(styles.closeIcon, {
@@ -20,7 +20,8 @@ export default function focusSensorHOC(ComposedComponent) {
20
20
  }
21
21
  componentDidUpdate(prevProps) {
22
22
  const { focused } = this.props;
23
- if (focused && !prevProps.focused) {
23
+ const isInFocus = this.node?.contains(document.activeElement);
24
+ if (focused && (!isInFocus || !prevProps.focused)) {
24
25
  this.onFocusRestore();
25
26
  }
26
27
  else if (!focused && prevProps.focused) {
@@ -365,6 +365,8 @@ export default class List extends Component {
365
365
  if (cleanedProps.href) {
366
366
  cleanedProps.rgItemType = Type.LINK;
367
367
  }
368
+ cleanedProps.description =
369
+ typeof cleanedProps.description === 'string' ? cleanedProps.description.trim() : cleanedProps.description;
368
370
  const itemProps = Object.assign({ rgItemType: DEFAULT_ITEM_TYPE }, restProps);
369
371
  itemKey = key || itemId;
370
372
  itemProps.hover = isActive;
@@ -121,6 +121,7 @@ export default class Popup<P extends BasePopupProps = PopupProps> extends PureCo
121
121
  private _redraw;
122
122
  private _getAnchor;
123
123
  private _listenersEnabled?;
124
+ private _prevTimeout?;
124
125
  /**
125
126
  * @param {boolean} enable
126
127
  * @private
@@ -70,9 +70,6 @@ export default class Popup extends PureComponent {
70
70
  display: Display.SHOWING,
71
71
  };
72
72
  componentDidMount() {
73
- if (!this.props.client) {
74
- this.setState({ client: true });
75
- }
76
73
  if (!this.props.hidden) {
77
74
  this._setListenersEnabled(true);
78
75
  }
@@ -192,13 +189,15 @@ export default class Popup extends PureComponent {
192
189
  return this.props.anchorElement || this.parent;
193
190
  }
194
191
  _listenersEnabled;
192
+ _prevTimeout;
195
193
  /**
196
194
  * @param {boolean} enable
197
195
  * @private
198
196
  */
199
197
  _setListenersEnabled(enable) {
200
198
  if (enable && !this._listenersEnabled) {
201
- setTimeout(() => {
199
+ clearTimeout(this._prevTimeout);
200
+ this._prevTimeout = window.setTimeout(() => {
202
201
  this._listenersEnabled = true;
203
202
  this.listeners.add(window, 'resize', this._redraw);
204
203
  if (this.props.autoPositioningOnScroll) {
@@ -215,6 +214,7 @@ export default class Popup extends PureComponent {
215
214
  }
216
215
  if (!enable && this._listenersEnabled) {
217
216
  this.listeners.removeAll();
217
+ clearTimeout(this._prevTimeout);
218
218
  this._listenersEnabled = false;
219
219
  }
220
220
  }
@@ -269,7 +269,7 @@ export default class Popup extends PureComponent {
269
269
  // prevent bubbling through portal
270
270
  onClick: stop,
271
271
  // This handler only blocks bubbling through React portal
272
- role: "presentation", ref: this.portalRef, children: [this.shouldUseShortcuts() && _jsx(Shortcuts, { map: this.shortcutsMap, scope: this.shortcutsScope }), (client || this.state.client) &&
272
+ role: "presentation", ref: this.portalRef, children: [this.shouldUseShortcuts() && _jsx(Shortcuts, { map: this.shortcutsMap, scope: this.shortcutsScope }), client !== false &&
273
273
  (keepMounted || !hidden) &&
274
274
  createPortal(_jsx(PopupTarget, { id: this.uid, ref: this.containerRef, onMouseOver: onMouseOver, onFocus: onMouseOver, onMouseOut: onMouseOut, onBlur: onMouseOut, onContextMenu: onContextMenu, children: _jsx("div", { "data-test": dataTests('ring-popup', dataTest), "data-test-shown": !hidden && !showing, "data-test-direction": direction, ref: this.popupRef, className: classes, style: style, onMouseDown: onMouseDown, onMouseUp: onMouseUp,
275
275
  // mouse handlers are used to track clicking on inner elements
package/package.json CHANGED
@@ -1,8 +1,10 @@
1
1
  {
2
2
  "name": "@jetbrains/ring-ui",
3
- "version": "7.0.16",
3
+ "version": "7.0.17",
4
4
  "description": "JetBrains UI library",
5
- "author": "JetBrains",
5
+ "author": {
6
+ "name": "JetBrains"
7
+ },
6
8
  "license": "Apache-2.0",
7
9
  "packageManager": "npm@8.11.0",
8
10
  "files": [
@@ -46,6 +48,8 @@
46
48
  "screenshots-test-ci": "npm --prefix packages/screenshots run test-ci",
47
49
  "screenshots-gather": "npm --prefix packages/screenshots run gather",
48
50
  "build-stories": "storybook build --quiet -c .storybook -o storybook-dist",
51
+ "chromatic": "npx chromatic --build-script-name build-stories --exit-once-uploaded",
52
+ "chromatic-local": "dotenv -- npm run publish-stories",
49
53
  "prebuild": "rimraf components && tsc --project tsconfig-build.json && cpy './**/*' '!**/*.ts' '!**/*.tsx' '!**/__mocks__/**' ../components --parents --cwd=src/",
50
54
  "build": "./node_modules/.bin/rollup -c --bundleConfigAsCjs",
51
55
  "postbuild": "cpy './**/*.d.ts' ../dist --parents --cwd=components/",
@@ -73,7 +77,7 @@
73
77
  },
74
78
  "repository": {
75
79
  "type": "git",
76
- "url": "ssh://github.com/JetBrains/ring-ui.git"
80
+ "url": "git+ssh://git@github.com/JetBrains/ring-ui.git"
77
81
  },
78
82
  "readmeFilename": "README.md",
79
83
  "devDependencies": {
@@ -87,8 +91,8 @@
87
91
  "@eslint/js": "^9.17.0",
88
92
  "@jetbrains/eslint-config": "^6.0.4",
89
93
  "@jetbrains/logos": "3.0.0-canary.734b213.0",
90
- "@jetbrains/stylelint-config": "^4.0.2",
91
94
  "@jetbrains/rollup-css-plugin": "./packages/rollup-css-plugin",
95
+ "@jetbrains/stylelint-config": "^4.0.2",
92
96
  "@primer/octicons": "^19.14.0",
93
97
  "@rollup/plugin-babel": "^6.0.4",
94
98
  "@rollup/plugin-json": "^6.1.0",
@@ -104,7 +108,7 @@
104
108
  "@storybook/preview-api": "8.4.7",
105
109
  "@storybook/react": "8.4.7",
106
110
  "@storybook/react-webpack5": "8.4.7",
107
- "@storybook/test-runner": "^0.20.1",
111
+ "@storybook/test-runner": "^0.21.0",
108
112
  "@storybook/theming": "8.4.7",
109
113
  "@testing-library/dom": "^10.4.0",
110
114
  "@testing-library/react": "^16.1.0",
@@ -122,7 +126,7 @@
122
126
  "@types/sinon-chai": "^4.0.0",
123
127
  "@types/webpack-env": "^1.18.5",
124
128
  "@vitejs/plugin-react": "^4.3.4",
125
- "@vitest/eslint-plugin": "^1.1.18",
129
+ "@vitest/eslint-plugin": "^1.1.20",
126
130
  "@wojtekmaj/enzyme-adapter-react-17": "^0.8.0",
127
131
  "acorn": "^8.14.0",
128
132
  "axe-playwright": "^2.0.3",
@@ -133,8 +137,10 @@
133
137
  "chai-dom": "^1.10.0",
134
138
  "chai-enzyme": "1.0.0-beta.1",
135
139
  "cheerio": "^1.0.0-rc.12",
140
+ "chromatic": "^11.20.2",
136
141
  "core-js": "^3.39.0",
137
142
  "cpy-cli": "^5.0.0",
143
+ "dotenv-cli": "^7.4.4",
138
144
  "enzyme": "^3.11.0",
139
145
  "eslint": "^9.17.0",
140
146
  "eslint-config-prettier": "^9.1.0",
@@ -183,7 +189,7 @@
183
189
  "vitest-teamcity-reporter": "^0.3.1",
184
190
  "wallaby-webpack": "^3.9.16",
185
191
  "webpack": "^5.97.1",
186
- "webpack-cli": "^5.1.4",
192
+ "webpack-cli": "^6.0.0",
187
193
  "xmlappend": "^1.0.4"
188
194
  },
189
195
  "peerDependencies": {
@@ -254,5 +260,9 @@
254
260
  "engines": {
255
261
  "node": ">=14.0",
256
262
  "npm": ">=6.0.0"
257
- }
263
+ },
264
+ "bugs": {
265
+ "url": "https://github.com/JetBrains/ring-ui/issues"
266
+ },
267
+ "homepage": "https://github.com/JetBrains/ring-ui#readme"
258
268
  }