@jetbrains/ring-ui 7.0.32 → 7.0.33

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.
@@ -5,11 +5,13 @@
5
5
  object-fit: cover;
6
6
  object-position: center;
7
7
 
8
- /* This is a "graceful degradation" fallback, while the real value is controlled by JS */
9
-
10
8
  border-radius: var(--ring-border-radius);
11
9
  }
12
10
 
11
+ .round {
12
+ border-radius: 50%;
13
+ }
14
+
13
15
  .avatarShadow {
14
16
  /* See https://stackoverflow.com/questions/21414925/why-doesnt-inset-box-shadow-work-over-images */
15
17
 
@@ -34,9 +34,7 @@ export default class Avatar extends PureComponent {
34
34
  }
35
35
  const sizeString = `${size}px`;
36
36
  const subavatarSizeString = `${subavatarSize}px`;
37
- const borderRadius = size <= Size.Size18 ? 'var(--ring-border-radius-small)' : 'var(--ring-border-radius)';
38
37
  const styleObj = {
39
- borderRadius: round ? '50%' : borderRadius,
40
38
  height: sizeString,
41
39
  width: sizeString,
42
40
  ...style,
@@ -47,8 +45,11 @@ export default class Avatar extends PureComponent {
47
45
  width: subavatarSizeString,
48
46
  ...style,
49
47
  };
48
+ const classes = classNames(styles.avatar, this.props.className, {
49
+ [styles.round]: round,
50
+ });
50
51
  if (!url || this.state.errorUrl === url) {
51
- return (_jsxs("span", { ...restProps, "data-test": "avatar", className: classNames(styles.avatar, this.props.className, {
52
+ return (_jsxs("span", { ...restProps, "data-test": "avatar", className: classNames(classes, {
52
53
  [styles.empty]: username == null && info == null,
53
54
  }), style: styleObj, children: [username != null && _jsx(FallbackAvatar, { size: size, round: round, username: username }), info != null && _jsx(AvatarInfo, { size: size, children: info })] }));
54
55
  }
@@ -71,10 +72,10 @@ export default class Avatar extends PureComponent {
71
72
  subavatarSizeString,
72
73
  };
73
74
  subavatarSrc = skipParams ? subavatar : encodeURL(urlStart, queryParams);
74
- return (_jsxs("div", { children: [_jsx("img", { ...restProps, onError: this.handleError, onLoad: this.handleSuccess, className: classNames(styles.avatar, styles.avatarShadow, this.props.className), style: styleObj, src: src, alt: "User avatar" }), _jsx("img", { ...restProps, "data-test": "avatar", onError: this.handleError, onLoad: this.handleSuccess, className: classNames(styles.subavatar), style: styleObjGroup, src: subavatarSrc, alt: "Subavatar" })] }));
75
+ return (_jsxs("div", { children: [_jsx("img", { ...restProps, onError: this.handleError, onLoad: this.handleSuccess, className: classNames(classes, styles.avatarShadow), style: styleObj, src: src, alt: "User avatar" }), _jsx("img", { ...restProps, "data-test": "avatar", onError: this.handleError, onLoad: this.handleSuccess, className: classNames(styles.subavatar), style: styleObjGroup, src: subavatarSrc, alt: "Subavatar" })] }));
75
76
  }
76
77
  else {
77
- return (_jsx("img", { ...restProps, "data-test": "avatar", onError: this.handleError, onLoad: this.handleSuccess, className: classNames(styles.avatar, styles.avatarShadow, this.props.className), style: styleObj, src: src, alt: "User avatar" }));
78
+ return (_jsx("img", { ...restProps, "data-test": "avatar", onError: this.handleError, onLoad: this.handleSuccess, className: classNames(classes, styles.avatarShadow), style: styleObj, src: src, alt: "User avatar" }));
78
79
  }
79
80
  }
80
81
  }
@@ -37,29 +37,23 @@
37
37
  .item {
38
38
  position: relative;
39
39
 
40
- margin-left: calc(var(--ring-avatar-stack-offset) * -1);
40
+ margin: -1px;
41
+ margin-left: calc(var(--ring-avatar-stack-offset) * -1 - 1px);
42
+ padding: 1px;
41
43
 
42
44
  transition: transform var(--ring-fast-ease);
43
45
  mask-image: var(--ring-avatar-stack-mask-image);
44
- mask-position: calc(var(--ring-avatar-stack-offset) - 4px) -1px;
46
+ mask-position: calc(var(--ring-avatar-stack-offset) - 3px) 0;
45
47
  mask-repeat: no-repeat;
46
48
 
49
+ border-radius: calc(var(--ring-border-radius) + 1px);
47
50
 
48
- /* make the gaps hoverable */
49
- &::before {
50
- position: absolute;
51
- top: 0;
52
- right: -1px;
53
- bottom: 0;
54
- left: -1px;
55
-
56
- content: '';
57
- }
51
+ background-color: var(--ring-content-background-color);
58
52
  }
59
53
 
60
54
  .item:nth-child(1) {
61
55
  --ring-avatar-stack-index: 0;
62
- --ring-avatar-stack-offset: 0;
56
+ --ring-avatar-stack-offset: 0px;
63
57
 
64
58
  mask: none;
65
59
  }
@@ -9,7 +9,7 @@ export default function AvatarStack({ children, className, size = Size.Size20, e
9
9
  const [dropdownOpen, setDropdownOpen] = useState(false);
10
10
  return (_jsxs("div", { className: classNames(styles.avatarStack, className, styles[`size${size}`], {
11
11
  [styles.hovered]: dropdownOpen,
12
- }), ...restProps, children: [Children.map(children, (child, index) => (_jsx("div", { className: styles.item, style: { '--ring-avatar-stack-index': index }, children: child }))), extraItems?.length ? (_jsx(DropdownMenu, { hoverMode: true, hoverShowTimeOut: 10, onShow: () => setDropdownOpen(true), onHide: () => setDropdownOpen(false), className: styles.extra, style: {
12
+ }), ...restProps, style: { height: size, ...restProps.style }, children: [Children.map(children, (child, index) => (_jsx("div", { className: styles.item, style: { '--ring-avatar-stack-index': index }, children: child }))), extraItems?.length ? (_jsx(DropdownMenu, { hoverMode: true, hoverShowTimeOut: 10, onShow: () => setDropdownOpen(true), onHide: () => setDropdownOpen(false), className: styles.extra, style: {
13
13
  width: size,
14
14
  height: size,
15
15
  '--ring-avatar-stack-index': Children.count(children),
@@ -1,3 +1,3 @@
1
- <svg width="56px" height="56px" xmlns="http://www.w3.org/2000/svg">
2
- <path fill="black" d="M 0 0 a 5 5 0 0 1 5 5 V 51 a 5 5 0 0 1 -5 5 H 56 V 0"/>
1
+ <svg width="58px" height="58px" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill="black" d="M 0 0 a 5 5 0 0 1 5 5 V 53 a 5 5 0 0 1 -5 5 H 58 V 0"/>
3
3
  </svg>
@@ -29,6 +29,7 @@ export interface InputBaseProps {
29
29
  onClear?: ((e: React.MouseEvent<HTMLButtonElement>) => void) | null | undefined;
30
30
  icon?: string | ComponentType | null | undefined;
31
31
  height?: ControlsHeight | undefined;
32
+ beforeInput?: ReactNode;
32
33
  afterInput?: ReactNode;
33
34
  translations?: InputTranslations | null | undefined;
34
35
  }
@@ -93,7 +93,7 @@ export class Input extends PureComponent {
93
93
  // Modifiers
94
94
  size, multiline, borderless,
95
95
  // Props
96
- label, labelType, error, help, className, inputClassName, children, value, onClear, disabled, inputRef, onChange, enableShortcuts, id, placeholder, icon, translations, height = this.context, afterInput, ...restProps } = this.props;
96
+ label, labelType, error, help, className, inputClassName, children, value, onClear, disabled, inputRef, onChange, enableShortcuts, id, placeholder, icon, translations, height = this.context, beforeInput, afterInput, ...restProps } = this.props;
97
97
  const { empty } = this.state;
98
98
  const clearable = !!onClear;
99
99
  const classes = classNames(className, styles.outerContainer, [styles[`size${size}`]], [styles[`height${height}`]], {
@@ -116,7 +116,7 @@ export class Input extends PureComponent {
116
116
  'aria-label': typeof label === 'string' && label ? label : placeholder,
117
117
  'data-enabled-shortcuts': Array.isArray(enableShortcuts) ? enableShortcuts.join(',') : null,
118
118
  };
119
- return (_jsx(I18nContext.Consumer, { children: ({ translate }) => (_jsxs("div", { className: classes, "data-test": "ring-input", children: [label && (_jsx(ControlLabel, { htmlFor: this.getId(), disabled: disabled, type: labelType, children: label })), _jsxs("div", { className: styles.container, children: [icon && _jsx(Icon, { glyph: icon, className: styles.icon }), multiline ? (_jsx("textarea", { onChange: this.handleTextareaChange, rows: 1, ...commonProps, ...restProps })) : (_jsx("input", { onChange: this.handleInputChange, ...commonProps, ...restProps })), clearable && !disabled && (_jsx(Button, { title: translations?.clear ?? translate('clear'), "data-test": "ring-input-clear", className: styles.clear, icon: closeIcon, onClick: this.clear })), afterInput] }), error ? (_jsx("div", { className: styles.errorText, children: error })) : (help && _jsx(ControlHelp, { className: styles.helpText, children: help }))] })) }));
119
+ return (_jsx(I18nContext.Consumer, { children: ({ translate }) => (_jsxs("div", { className: classes, "data-test": "ring-input", children: [label && (_jsx(ControlLabel, { htmlFor: this.getId(), disabled: disabled, type: labelType, children: label })), _jsxs("div", { className: styles.container, children: [icon && _jsx(Icon, { glyph: icon, className: styles.icon }), beforeInput, multiline ? (_jsx("textarea", { onChange: this.handleTextareaChange, rows: 1, ...commonProps, ...restProps })) : (_jsx("input", { onChange: this.handleInputChange, ...commonProps, ...restProps })), clearable && !disabled && (_jsx(Button, { title: translations?.clear ?? translate('clear'), "data-test": "ring-input-clear", className: styles.clear, icon: closeIcon, onClick: this.clear })), afterInput] }), error ? (_jsx("div", { className: styles.errorText, children: error })) : (help && _jsx(ControlHelp, { className: styles.helpText, children: help }))] })) }));
120
120
  }
121
121
  }
122
122
  export default Input;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetbrains/ring-ui",
3
- "version": "7.0.32",
3
+ "version": "7.0.33",
4
4
  "description": "JetBrains UI library",
5
5
  "author": {
6
6
  "name": "JetBrains"
@@ -90,7 +90,7 @@
90
90
  "@babel/plugin-syntax-import-assertions": "^7.26.0",
91
91
  "@csstools/css-parser-algorithms": "^3.0.4",
92
92
  "@csstools/stylelint-no-at-nest-rule": "^4.0.0",
93
- "@eslint/compat": "^1.2.6",
93
+ "@eslint/compat": "^1.2.7",
94
94
  "@eslint/eslintrc": "^3.2.0",
95
95
  "@eslint/js": "^9.20.0",
96
96
  "@figma/code-connect": "^1.3.1",
@@ -103,18 +103,18 @@
103
103
  "@rollup/plugin-json": "^6.1.0",
104
104
  "@rollup/plugin-node-resolve": "^16.0.0",
105
105
  "@rollup/plugin-replace": "^6.0.2",
106
- "@storybook/addon-a11y": "8.5.6",
107
- "@storybook/addon-docs": "8.5.6",
108
- "@storybook/addon-essentials": "8.5.6",
109
- "@storybook/addon-themes": "^8.5.6",
110
- "@storybook/components": "8.5.6",
106
+ "@storybook/addon-a11y": "8.5.8",
107
+ "@storybook/addon-docs": "8.5.8",
108
+ "@storybook/addon-essentials": "8.5.8",
109
+ "@storybook/addon-themes": "^8.5.8",
110
+ "@storybook/components": "8.5.8",
111
111
  "@storybook/csf": "^0.1.13",
112
- "@storybook/manager-api": "8.5.6",
113
- "@storybook/preview-api": "8.5.6",
114
- "@storybook/react": "8.5.6",
115
- "@storybook/react-webpack5": "8.5.6",
116
- "@storybook/test-runner": "^0.21.1",
117
- "@storybook/theming": "8.5.6",
112
+ "@storybook/manager-api": "8.5.8",
113
+ "@storybook/preview-api": "8.5.8",
114
+ "@storybook/react": "8.5.8",
115
+ "@storybook/react-webpack5": "8.5.8",
116
+ "@storybook/test-runner": "^0.21.3",
117
+ "@storybook/theming": "8.5.8",
118
118
  "@testing-library/dom": "^10.4.0",
119
119
  "@testing-library/react": "^16.2.0",
120
120
  "@testing-library/user-event": "^14.6.1",
@@ -127,7 +127,7 @@
127
127
  "@types/markdown-it": "^14.1.2",
128
128
  "@types/react": "^18.3.12",
129
129
  "@types/react-dom": "^18.3.1",
130
- "@types/sinon": "^17.0.3",
130
+ "@types/sinon": "^17.0.4",
131
131
  "@types/sinon-chai": "^4.0.0",
132
132
  "@types/webpack-env": "^1.18.8",
133
133
  "@vitejs/plugin-react": "^4.3.4",
@@ -147,7 +147,7 @@
147
147
  "cpy-cli": "^5.0.0",
148
148
  "dotenv-cli": "^8.0.0",
149
149
  "enzyme": "^3.11.0",
150
- "eslint": "^9.20.1",
150
+ "eslint": "^9.21.0",
151
151
  "eslint-config-prettier": "^10.0.1",
152
152
  "eslint-formatter-jslint-xml": "^8.40.0",
153
153
  "eslint-import-resolver-webpack": "^0.13.10",
@@ -159,7 +159,7 @@
159
159
  "eslint-plugin-storybook": "^0.11.3",
160
160
  "events": "^3.3.0",
161
161
  "glob": "^11.0.1",
162
- "globals": "^15.15.0",
162
+ "globals": "^16.0.0",
163
163
  "html-webpack-plugin": "^5.6.3",
164
164
  "http-server": "^14.1.1",
165
165
  "husky": "^9.1.7",
@@ -171,7 +171,7 @@
171
171
  "markdown-it": "^14.1.0",
172
172
  "merge-options": "^3.0.4",
173
173
  "pinst": "^3.0.0",
174
- "prettier": "^3.5.1",
174
+ "prettier": "^3.5.2",
175
175
  "raw-loader": "^4.0.2",
176
176
  "react": "^18.3.1",
177
177
  "react-dom": "^18.3.1",
@@ -183,14 +183,14 @@
183
183
  "sinon": "^19.0.2",
184
184
  "sinon-chai": "^4.0.0",
185
185
  "storage-mock": "^2.1.0",
186
- "storybook": "8.5.6",
186
+ "storybook": "8.5.8",
187
187
  "stylelint": "^16.14.1",
188
188
  "svg-inline-loader": "^0.8.2",
189
189
  "teamcity-service-messages": "^0.1.14",
190
190
  "terser-webpack-plugin": "^5.3.11",
191
191
  "typescript": "~5.7.3",
192
- "typescript-eslint": "^8.24.1",
193
- "vitest": "^3.0.5",
192
+ "typescript-eslint": "^8.25.0",
193
+ "vitest": "^3.0.7",
194
194
  "vitest-teamcity-reporter": "^0.3.1",
195
195
  "wallaby-webpack": "^3.9.16",
196
196
  "webpack": "^5.98.0",
@@ -220,11 +220,11 @@
220
220
  "@babel/core": "^7.26.9",
221
221
  "@babel/preset-typescript": "^7.26.0",
222
222
  "@jetbrains/babel-preset-jetbrains": "^2.4.0",
223
- "@jetbrains/icons": "^5.6.0",
223
+ "@jetbrains/icons": "^5.7.0",
224
224
  "@jetbrains/postcss-require-hover": "^0.1.3",
225
225
  "@types/combokeys": "^2.4.9",
226
226
  "@types/element-resize-detector": "^1.1.6",
227
- "@types/react-virtualized": "9.22.0",
227
+ "@types/react-virtualized": "9.22.2",
228
228
  "@types/util-deprecate": "^1.0.4",
229
229
  "babel-loader": "9.2.1",
230
230
  "babel-plugin-transform-define": "^2.1.4",
@@ -244,13 +244,13 @@
244
244
  "highlight.js": "^10.7.2",
245
245
  "just-debounce-it": "^3.2.0",
246
246
  "memoize-one": "^6.0.0",
247
- "postcss": "^8.5.2",
247
+ "postcss": "^8.5.3",
248
248
  "postcss-calc": "^10.1.1",
249
249
  "postcss-flexbugs-fixes": "^5.0.2",
250
250
  "postcss-font-family-system-ui": "^5.0.0",
251
251
  "postcss-loader": "^8.1.1",
252
252
  "postcss-modules-values-replace": "^4.2.0",
253
- "postcss-preset-env": "^10.1.4",
253
+ "postcss-preset-env": "^10.1.5",
254
254
  "react-movable": "^3.4.0",
255
255
  "react-virtualized": "^9.22.6",
256
256
  "react-waypoint": "^10.3.0",