@jetbrains/ring-ui 8.0.0-beta.6 → 8.0.0-beta.8
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 +0 -8
- package/components/avatar/avatar-info.js +0 -2
- package/components/avatar/avatar-size.d.ts +0 -4
- package/components/avatar/avatar-size.js +0 -4
- package/components/avatar/avatar.js +0 -6
- package/components/avatar/fallback-avatar.js +0 -28
- package/components/avatar-stack/avatar-stack.js +1 -1
- package/components/button/button.css +4 -4
- package/components/button/button.d.ts +0 -4
- package/components/button/button.js +2 -7
- package/components/global/variables.css +0 -10
- package/components/global/variables.interface.d.ts +0 -4
- package/components/global/variables_dark.css +0 -7
- package/components/icon/icon.css +0 -27
- package/components/icon/icon.d.ts +0 -1
- package/components/icon/icon.js +2 -4
- package/components/list/consts.d.ts +0 -1
- package/components/list/consts.js +0 -1
- package/components/list/list.d.ts +0 -4
- package/components/select/select-popup.d.ts +2 -1
- package/components/select/select-popup.js +3 -3
- package/components/select/select.d.ts +2 -0
- package/components/select/select.js +2 -4
- package/package.json +1 -4
- package/components/content-layout/content-layout.css +0 -109
- package/components/content-layout/content-layout.d.ts +0 -20
- package/components/content-layout/content-layout.js +0 -40
- package/components/content-layout/sidebar.d.ts +0 -26
- package/components/content-layout/sidebar.js +0 -71
- package/components/expand/collapsible-group.css +0 -76
- package/components/expand/collapsible-group.d.ts +0 -8
- package/components/expand/collapsible-group.js +0 -14
- package/components/grid/col.d.ts +0 -16
- package/components/grid/col.js +0 -35
- package/components/grid/grid.css +0 -920
- package/components/grid/grid.d.ts +0 -13
- package/components/grid/grid.js +0 -19
- package/components/grid/row.d.ts +0 -21
- package/components/grid/row.js +0 -41
- package/components/old-browsers-message/__mocks__/old-browsers-message.js +0 -1
- package/components/old-browsers-message/old-browsers-message-stop.d.ts +0 -1
- package/components/old-browsers-message/old-browsers-message-stop.js +0 -2
- package/components/old-browsers-message/old-browsers-message.css +0 -26
- package/components/old-browsers-message/old-browsers-message.d.ts +0 -5
- package/components/old-browsers-message/old-browsers-message.js +0 -86
- package/components/old-browsers-message/white-list.d.ts +0 -2
- package/components/old-browsers-message/white-list.js +0 -24
package/babel.config.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
const browserslist = require('browserslist');
|
|
2
|
-
|
|
3
1
|
module.exports = function config(api) {
|
|
4
2
|
api.cache(true);
|
|
5
3
|
|
|
@@ -12,12 +10,6 @@ module.exports = function config(api) {
|
|
|
12
10
|
panicThreshold: 'all_errors',
|
|
13
11
|
},
|
|
14
12
|
],
|
|
15
|
-
[
|
|
16
|
-
'babel-plugin-transform-define',
|
|
17
|
-
{
|
|
18
|
-
SUPPORTED_BROWSERS: browserslist(),
|
|
19
|
-
},
|
|
20
|
-
],
|
|
21
13
|
],
|
|
22
14
|
presets: [
|
|
23
15
|
[
|
|
@@ -3,13 +3,11 @@ import { Size } from './avatar-size';
|
|
|
3
3
|
import styles from './avatar.css';
|
|
4
4
|
export const fontSizes = {
|
|
5
5
|
[Size.Size16]: 9,
|
|
6
|
-
[Size.Size18]: 9,
|
|
7
6
|
[Size.Size20]: 9,
|
|
8
7
|
[Size.Size24]: 11,
|
|
9
8
|
[Size.Size28]: 12,
|
|
10
9
|
[Size.Size32]: 14,
|
|
11
10
|
[Size.Size40]: 16,
|
|
12
|
-
[Size.Size48]: 16,
|
|
13
11
|
[Size.Size56]: 22,
|
|
14
12
|
};
|
|
15
13
|
export default function AvatarInfo({ size, children }) {
|
|
@@ -4,14 +4,10 @@
|
|
|
4
4
|
export var Size;
|
|
5
5
|
(function (Size) {
|
|
6
6
|
Size[Size["Size16"] = 16] = "Size16";
|
|
7
|
-
/** @deprecated */
|
|
8
|
-
Size[Size["Size18"] = 18] = "Size18";
|
|
9
7
|
Size[Size["Size20"] = 20] = "Size20";
|
|
10
8
|
Size[Size["Size24"] = 24] = "Size24";
|
|
11
9
|
Size[Size["Size28"] = 28] = "Size28";
|
|
12
10
|
Size[Size["Size32"] = 32] = "Size32";
|
|
13
11
|
Size[Size["Size40"] = 40] = "Size40";
|
|
14
|
-
/** @deprecated */
|
|
15
|
-
Size[Size["Size48"] = 48] = "Size48";
|
|
16
12
|
Size[Size["Size56"] = 56] = "Size56";
|
|
17
13
|
})(Size || (Size = {}));
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import { PureComponent } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
|
-
import deprecate from 'util-deprecate';
|
|
4
3
|
import { encodeURL, isDataURI, parseQueryString } from '../global/url';
|
|
5
4
|
import { getPixelRatio } from '../global/dom';
|
|
6
|
-
import memoize from '../global/memoize';
|
|
7
5
|
import FallbackAvatar from './fallback-avatar';
|
|
8
6
|
import { Size } from './avatar-size';
|
|
9
7
|
import AvatarInfo from './avatar-info';
|
|
10
8
|
import styles from './avatar.css';
|
|
11
9
|
export { Size };
|
|
12
|
-
const warnSize = memoize((size) => deprecate(() => { }, `Avatar: Size${size} is deprecated and will be removed in 8.0. The supported sizes are: Size20, Size24, Size28, Size32, Size40.`));
|
|
13
10
|
export default class Avatar extends PureComponent {
|
|
14
11
|
static defaultProps = {
|
|
15
12
|
dpr: getPixelRatio(),
|
|
@@ -28,9 +25,6 @@ export default class Avatar extends PureComponent {
|
|
|
28
25
|
};
|
|
29
26
|
render() {
|
|
30
27
|
const { size, url, dpr, style, round, subavatar, subavatarSize, username, info, skipParams, ...restProps } = this.props;
|
|
31
|
-
if ([Size.Size18, Size.Size48].includes(size)) {
|
|
32
|
-
warnSize(size)();
|
|
33
|
-
}
|
|
34
28
|
const sizeString = `${size}px`;
|
|
35
29
|
const subavatarSizeString = `${subavatarSize}px`;
|
|
36
30
|
const styleObj = {
|
|
@@ -31,12 +31,6 @@ const SizesSquare = {
|
|
|
31
31
|
fontSize: '8px',
|
|
32
32
|
textAnchor: 'middle',
|
|
33
33
|
},
|
|
34
|
-
[Size.Size18]: {
|
|
35
|
-
radius: 4,
|
|
36
|
-
text: { x: 9, y: 13 },
|
|
37
|
-
fontSize: '11px',
|
|
38
|
-
textAnchor: 'middle',
|
|
39
|
-
},
|
|
40
34
|
[Size.Size20]: {
|
|
41
35
|
radius: 4,
|
|
42
36
|
text: { x: 2, y: 10 },
|
|
@@ -69,13 +63,6 @@ const SizesSquare = {
|
|
|
69
63
|
letterSpacing: 1,
|
|
70
64
|
underscore: { x: 5, y: 32, width: 15, height: 2.5 },
|
|
71
65
|
},
|
|
72
|
-
[Size.Size48]: {
|
|
73
|
-
radius: 4,
|
|
74
|
-
text: { x: 3, y: 21 },
|
|
75
|
-
fontSize: '19px',
|
|
76
|
-
letterSpacing: 1,
|
|
77
|
-
underscore: { x: 5, y: 32, width: 15, height: 2.5 },
|
|
78
|
-
},
|
|
79
66
|
[Size.Size56]: {
|
|
80
67
|
radius: 4,
|
|
81
68
|
text: { x: 4, y: 28 },
|
|
@@ -92,13 +79,6 @@ const SizesRound = {
|
|
|
92
79
|
textAnchor: 'middle',
|
|
93
80
|
dominantBaseline: 'middle',
|
|
94
81
|
},
|
|
95
|
-
[Size.Size18]: {
|
|
96
|
-
radius: 4,
|
|
97
|
-
fontSize: '11px',
|
|
98
|
-
text: { x: '50%', y: '54%' },
|
|
99
|
-
textAnchor: 'middle',
|
|
100
|
-
dominantBaseline: 'middle',
|
|
101
|
-
},
|
|
102
82
|
[Size.Size20]: {
|
|
103
83
|
radius: 4,
|
|
104
84
|
fontSize: '9px',
|
|
@@ -136,14 +116,6 @@ const SizesRound = {
|
|
|
136
116
|
textAnchor: 'middle',
|
|
137
117
|
dominantBaseline: 'middle',
|
|
138
118
|
},
|
|
139
|
-
[Size.Size48]: {
|
|
140
|
-
radius: 4,
|
|
141
|
-
fontSize: '19px',
|
|
142
|
-
letterSpacing: 1,
|
|
143
|
-
text: { x: '50%', y: '54%' },
|
|
144
|
-
textAnchor: 'middle',
|
|
145
|
-
dominantBaseline: 'middle',
|
|
146
|
-
},
|
|
147
119
|
[Size.Size56]: {
|
|
148
120
|
radius: 4,
|
|
149
121
|
fontSize: '26px',
|
|
@@ -6,7 +6,7 @@ import { fontSizes } from '../avatar/avatar-info';
|
|
|
6
6
|
import styles from './avatar-stack.css';
|
|
7
7
|
export default function AvatarStack({ children, className, size = Size.Size20, extraItems, dropdownMenuProps, ...restProps }) {
|
|
8
8
|
const [dropdownOpen, setDropdownOpen] = useState(false);
|
|
9
|
-
const sizeClass = size !== Size.Size16
|
|
9
|
+
const sizeClass = size !== Size.Size16 ? styles[`size${size}`] : undefined;
|
|
10
10
|
return (<div className={classNames(styles.avatarStack, className, sizeClass, {
|
|
11
11
|
[styles.hovered]: dropdownOpen,
|
|
12
12
|
})} {...restProps} style={{ height: size, ...restProps.style }}>
|
|
@@ -235,12 +235,12 @@
|
|
|
235
235
|
}
|
|
236
236
|
|
|
237
237
|
.primaryBlock {
|
|
238
|
-
--ring-button-default-background-color: var(--ring-
|
|
238
|
+
--ring-button-default-background-color: var(--ring-main-color);
|
|
239
239
|
--ring-button-hover-background-color: var(--ring-main-hover-color);
|
|
240
|
-
--ring-button-pressed-background-color: var(--ring-
|
|
241
|
-
--ring-button-active-background-color: var(--ring-
|
|
240
|
+
--ring-button-pressed-background-color: var(--ring-main-color);
|
|
241
|
+
--ring-button-active-background-color: var(--ring-main-color);
|
|
242
242
|
--ring-button-active-hover-background-color: var(--ring-main-hover-color);
|
|
243
|
-
--ring-button-active-pressed-background-color: var(--ring-
|
|
243
|
+
--ring-button-active-pressed-background-color: var(--ring-main-color);
|
|
244
244
|
--ring-button-disabled-background-color: var(--ring-border-hover-color);
|
|
245
245
|
--ring-button-pressed-border-color: var(--ring-button-primary-border-color);
|
|
246
246
|
--ring-button-active-border-color: var(--ring-button-primary-border-color);
|
|
@@ -15,10 +15,6 @@ export interface ButtonBaseProps {
|
|
|
15
15
|
secondary?: boolean | null | undefined;
|
|
16
16
|
ghost?: boolean | null | undefined;
|
|
17
17
|
short?: boolean | null | undefined;
|
|
18
|
-
/**
|
|
19
|
-
* @deprecated Use inline instead
|
|
20
|
-
*/
|
|
21
|
-
text?: boolean | null | undefined;
|
|
22
18
|
inline?: boolean | null | undefined;
|
|
23
19
|
dropdown?: boolean | null | undefined;
|
|
24
20
|
disabled?: boolean | undefined;
|
|
@@ -3,13 +3,11 @@ import * as React from 'react';
|
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import chevronDown from '@jetbrains/icons/chevron-down';
|
|
5
5
|
import chevron12pxDown from '@jetbrains/icons/chevron-12px-down';
|
|
6
|
-
import deprecate from 'util-deprecate';
|
|
7
6
|
import Icon, { Size } from '../icon/icon';
|
|
8
7
|
import ClickableLink from '../link/clickable-link';
|
|
9
8
|
import { ControlsHeightContext } from '../global/controls-height';
|
|
10
9
|
import { getButtonClasses } from './button.classes';
|
|
11
10
|
import styles from './button.css';
|
|
12
|
-
const warnText = deprecate(() => { }, 'Button: "text" prop is deprecated and will be removed in 8.0. Use inline instead.');
|
|
13
11
|
function removeLinkProps(props) {
|
|
14
12
|
const { download, href, hrefLang, media, ping, target, type, referrerPolicy, onConditionalClick, onPlainLeftClick, activeClassName, ...restProps } = props;
|
|
15
13
|
return restProps;
|
|
@@ -30,13 +28,10 @@ export class Button extends PureComponent {
|
|
|
30
28
|
render() {
|
|
31
29
|
const {
|
|
32
30
|
// Modifiers
|
|
33
|
-
active, danger, delayed, loader, primary, success, error, secondary, ghost, short,
|
|
31
|
+
active, danger, delayed, loader, primary, success, error, secondary, ghost, short, dropdown, height,
|
|
34
32
|
// Props
|
|
35
33
|
icon, iconRight, iconSize, iconClassName, iconRightClassName, iconSuppressSizeWarning, className, children, inline, disabled, ...props } = this.props;
|
|
36
|
-
const isInline = inline ??
|
|
37
|
-
if (text) {
|
|
38
|
-
warnText();
|
|
39
|
-
}
|
|
34
|
+
const isInline = inline ?? !!icon;
|
|
40
35
|
const classes = getButtonClasses({
|
|
41
36
|
...this.props,
|
|
42
37
|
inline: isInline,
|
|
@@ -20,8 +20,6 @@
|
|
|
20
20
|
--ring-border-disabled-color: rgb(var(--ring-border-disabled-components)); /* #ebecf0 */
|
|
21
21
|
--ring-border-selected-disabled-components: 201, 204, 214;
|
|
22
22
|
--ring-border-selected-disabled-color: rgb(var(--ring-border-selected-disabled-components)); /* #c9ccd6 */
|
|
23
|
-
--ring-border-disabled-active-components: var(--ring-border-hover-components);
|
|
24
|
-
--ring-border-disabled-active-color: var(--ring-border-hover-color); /* TODO: remove in 8.0 in favor of --ring-border-hover-color */
|
|
25
23
|
--ring-icon-disabled-components: 168, 173, 189;
|
|
26
24
|
--ring-icon-disabled-color: rgb(var(--ring-icon-disabled-components)); /* #A8ADBD */
|
|
27
25
|
--ring-border-hover-components: 160, 189, 248;
|
|
@@ -36,8 +34,6 @@
|
|
|
36
34
|
--ring-icon-hover-color: rgb(var(--ring-icon-hover-components)); /* #5a5d6b */
|
|
37
35
|
--ring-main-components: 51, 105, 214;
|
|
38
36
|
--ring-main-color: rgb(var(--ring-main-components)); /* #3369D6 */
|
|
39
|
-
--ring-action-link-components: var(--ring-link-components);
|
|
40
|
-
--ring-action-link-color: var(--ring-link-color); /* #315FBD */ /* TODO: remove in 8.0 in favor of --ring-link-color */
|
|
41
37
|
--ring-main-hover-components: 49, 95, 189;
|
|
42
38
|
--ring-main-hover-color: rgb(var(--ring-main-hover-components)); /* #315FBD */
|
|
43
39
|
--ring-main-success-components: 31, 128, 57;
|
|
@@ -94,8 +90,6 @@
|
|
|
94
90
|
--ring-popup-shadow-color: rgba(var(--ring-popup-border-components), 0.1);
|
|
95
91
|
--ring-popup-secondary-shadow-color: rgba(var(--ring-popup-border-components), 0.04);
|
|
96
92
|
--ring-message-shadow-color: rgba(var(--ring-popup-border-components), 0.3);
|
|
97
|
-
--ring-pinned-shadow-components: 108, 112, 126;
|
|
98
|
-
--ring-pinned-shadow-color: rgb(var(--ring-pinned-shadow-components)); /* #6C707E */ /* TODO remove in 8.0 */
|
|
99
93
|
--ring-button-danger-hover-components: 219, 59, 75;
|
|
100
94
|
--ring-button-danger-hover-color: rgb(var(--ring-button-danger-hover-components)); /* #DB3B4B */
|
|
101
95
|
--ring-button-primary-border-components: 46, 85, 163;
|
|
@@ -108,8 +102,6 @@
|
|
|
108
102
|
/* Text */
|
|
109
103
|
--ring-search-components: 112, 156, 245;
|
|
110
104
|
--ring-search-color: rgb(var(--ring-search-components)); /* #709CF5 */
|
|
111
|
-
--ring-hint-components: 46, 85, 163;
|
|
112
|
-
--ring-hint-color: rgb(var(--ring-hint-components)); /* #2E55A3 */ /* TODO: remove in 8.0 */
|
|
113
105
|
--ring-link-components: 49, 95, 189;
|
|
114
106
|
--ring-link-color: rgb(var(--ring-link-components)); /* #315FBD */
|
|
115
107
|
--ring-link-hover-components: 46, 85, 163;
|
|
@@ -167,8 +159,6 @@
|
|
|
167
159
|
--ring-disabled-selected-background-components: 235, 236, 240;
|
|
168
160
|
--ring-disabled-selected-background-color: rgb(var(--ring-disabled-selected-background-components)); /* #EBECF0 */
|
|
169
161
|
--ring-button-danger-active-color: var(--ring-error-container-light-color); /* #FAD4D8 */
|
|
170
|
-
--ring-button-loader-background: rgba(var(--ring-white-text-components), 0.4); /* TODO remove in 8.0 */
|
|
171
|
-
--ring-button-primary-background-color: var(--ring-main-color); /* TODO remove in 8.0 */
|
|
172
162
|
--ring-table-loader-background-color: rgba(var(--ring-content-background-components), 0.5); /* #FFFFFF50 */
|
|
173
163
|
--ring-removed-subtle-background-components: 255, 235, 236;
|
|
174
164
|
--ring-removed-subtle-background-color: rgb(var(--ring-removed-subtle-background-components)); /* #FFEBEC */
|
|
@@ -19,11 +19,9 @@ export interface RingCSSProperties {
|
|
|
19
19
|
'--ring-popup-border-color'?: Property.BorderColor;
|
|
20
20
|
'--ring-popup-shadow-color'?: Property.Color;
|
|
21
21
|
'--ring-message-shadow-color'?: Property.Color;
|
|
22
|
-
'--ring-pinned-shadow-color'?: Property.Color;
|
|
23
22
|
'--ring-button-danger-hover-color'?: Property.Color;
|
|
24
23
|
'--ring-button-primary-border-color'?: Property.Color;
|
|
25
24
|
'--ring-search-color'?: Property.Color;
|
|
26
|
-
'--ring-hint-color'?: Property.Color;
|
|
27
25
|
'--ring-link-color'?: Property.Color;
|
|
28
26
|
'--ring-link-hover-color'?: Property.Color;
|
|
29
27
|
'--ring-error-color'?: Property.Color;
|
|
@@ -49,8 +47,6 @@ export interface RingCSSProperties {
|
|
|
49
47
|
'--ring-disabled-background-color'?: Property.BackgroundColor;
|
|
50
48
|
'--ring-disabled-selected-background-color'?: Property.BackgroundColor;
|
|
51
49
|
'--ring-button-danger-active-color'?: Property.BackgroundColor;
|
|
52
|
-
'--ring-button-loader-background'?: Property.BackgroundColor;
|
|
53
|
-
'--ring-button-primary-background-color'?: Property.BackgroundColor;
|
|
54
50
|
'--ring-code-background-color'?: Property.BackgroundColor;
|
|
55
51
|
'--ring-code-color'?: Property.Color;
|
|
56
52
|
'--ring-code-comment-color'?: Property.Color;
|
|
@@ -15,8 +15,6 @@
|
|
|
15
15
|
--ring-border-disabled-color: rgb(var(--ring-border-disabled-components)); /* #4E5157 */
|
|
16
16
|
--ring-border-selected-disabled-components: 90, 93, 99;
|
|
17
17
|
--ring-border-selected-disabled-color: rgb(var(--ring-border-selected-disabled-components)); /* #5A5D63 */
|
|
18
|
-
--ring-border-disabled-active-components: var(--ring-border-hover-components);
|
|
19
|
-
--ring-border-disabled-active-color: var(--ring-border-hover-color); /* TODO: remove in 8.0 in favor of --ring-border-hover-color */
|
|
20
18
|
--ring-icon-disabled-components: 111, 115, 122;
|
|
21
19
|
--ring-icon-disabled-color: rgb(var(--ring-icon-disabled-components)); /* #6F737A */
|
|
22
20
|
--ring-border-hover-components: 55, 95, 173;
|
|
@@ -82,8 +80,6 @@
|
|
|
82
80
|
--ring-popup-shadow-color: rgba(0, 0, 0, 0.31);
|
|
83
81
|
--ring-popup-secondary-shadow-color: rgba(0, 0, 0, 0.37);
|
|
84
82
|
--ring-message-shadow-color: rgba(var(--ring-popup-border-components), 0.3);
|
|
85
|
-
--ring-pinned-shadow-components: 0, 0, 0;
|
|
86
|
-
--ring-pinned-shadow-color: rgb(var(--ring-pinned-shadow-components)); /* #000 */ /* TODO remove in 8.0 */
|
|
87
83
|
--ring-button-danger-hover-color: var(--ring-error-color);
|
|
88
84
|
--ring-button-primary-border-components: 153, 187, 255;
|
|
89
85
|
--ring-button-primary-border-color: rgb(var(--ring-button-primary-border-components)); /* #99BBFF */
|
|
@@ -93,8 +89,6 @@
|
|
|
93
89
|
--ring-dialog-shadow: 0 4px 16px var(--ring-popup-shadow-color), 0 2px 6px var(--ring-popup-secondary-shadow-color);
|
|
94
90
|
|
|
95
91
|
/* Text */
|
|
96
|
-
--ring-hint-components: 134, 138, 145;
|
|
97
|
-
--ring-hint-color: rgb(var(--ring-hint-components)); /* #868A91 */ /* TODO: remove in 8.0 */
|
|
98
92
|
--ring-link-components: 153, 187, 255;
|
|
99
93
|
--ring-link-color: rgb(var(--ring-link-components)); /* #99BBFF */
|
|
100
94
|
--ring-link-hover-components: 107, 155, 250;
|
|
@@ -153,7 +147,6 @@
|
|
|
153
147
|
--ring-disabled-selected-background-components: 67, 69, 74;
|
|
154
148
|
--ring-disabled-selected-background-color: rgb(var(--ring-disabled-selected-background-components)); /* #43454A */
|
|
155
149
|
--ring-button-danger-active-color: var(--ring-error-container-light-color); /* #5E3838 */
|
|
156
|
-
--ring-button-primary-background-color: var(--ring-main-color); /* TODO remove in 8.0 */
|
|
157
150
|
--ring-table-loader-background-color: rgba(var(--ring-content-background-components), 0.5); /* #2B2D3050 */
|
|
158
151
|
--ring-removed-subtle-background-components: 64, 41, 41;
|
|
159
152
|
--ring-removed-subtle-background-color: rgb(var(--ring-removed-subtle-background-components)); /* #402929 */
|
package/components/icon/icon.css
CHANGED
|
@@ -11,11 +11,6 @@
|
|
|
11
11
|
|
|
12
12
|
pointer-events: none;
|
|
13
13
|
|
|
14
|
-
/* TODO remove in 8.0 */
|
|
15
|
-
&[width='10'] {
|
|
16
|
-
vertical-align: -1px;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
14
|
&[width='12'] {
|
|
20
15
|
vertical-align: -1px;
|
|
21
16
|
}
|
|
@@ -71,25 +66,3 @@
|
|
|
71
66
|
.white {
|
|
72
67
|
color: var(--ring-white-text-color);
|
|
73
68
|
}
|
|
74
|
-
|
|
75
|
-
.loading {
|
|
76
|
-
animation-name: icon-loading;
|
|
77
|
-
animation-duration: 1200ms;
|
|
78
|
-
animation-iteration-count: infinite;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
@keyframes icon-loading {
|
|
82
|
-
0% {
|
|
83
|
-
transform: scale(1);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
50% {
|
|
87
|
-
transform: scale(0.9);
|
|
88
|
-
|
|
89
|
-
opacity: 0.5;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
100% {
|
|
93
|
-
transform: scale(1);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
@@ -19,7 +19,6 @@ export interface IconProps extends HTMLAttributes<HTMLElement> {
|
|
|
19
19
|
* @deprecated Use icons with appropriate intrinsic sizes instead
|
|
20
20
|
*/
|
|
21
21
|
width?: number | undefined;
|
|
22
|
-
loading?: boolean | null | undefined;
|
|
23
22
|
suppressSizeWarning?: boolean | null | undefined;
|
|
24
23
|
}
|
|
25
24
|
export default class Icon extends PureComponent<IconProps> {
|
package/components/icon/icon.js
CHANGED
|
@@ -43,13 +43,11 @@ export default class Icon extends PureComponent {
|
|
|
43
43
|
return undefined;
|
|
44
44
|
}
|
|
45
45
|
render() {
|
|
46
|
-
const { className, size, color,
|
|
46
|
+
const { className, size, color, glyph: Glyph, width, height, suppressSizeWarning, ...restProps } = this.props;
|
|
47
47
|
if (!Glyph) {
|
|
48
48
|
return null;
|
|
49
49
|
}
|
|
50
|
-
const classes = classNames(styles.icon, color && styles[color],
|
|
51
|
-
[styles.loading]: loading,
|
|
52
|
-
}, className);
|
|
50
|
+
const classes = classNames(styles.icon, color && styles[color], className);
|
|
53
51
|
return (<span data-test='ring-icon' {...restProps} className={classes}>
|
|
54
52
|
{typeof Glyph === 'string' ? (<IconSVG src={Glyph} style={this.getStyle()}/>) : (<Glyph className={styles.glyph} style={this.getStyle()}/>)}
|
|
55
53
|
</span>);
|
|
@@ -6,7 +6,6 @@ export var Type;
|
|
|
6
6
|
Type[Type["SEPARATOR"] = 0] = "SEPARATOR";
|
|
7
7
|
Type[Type["LINK"] = 1] = "LINK";
|
|
8
8
|
Type[Type["ITEM"] = 2] = "ITEM";
|
|
9
|
-
Type[Type["HINT"] = 3] = "HINT";
|
|
10
9
|
Type[Type["CUSTOM"] = 4] = "CUSTOM";
|
|
11
10
|
Type[Type["TITLE"] = 5] = "TITLE";
|
|
12
11
|
Type[Type["MARGIN"] = 6] = "MARGIN";
|
|
@@ -43,10 +43,6 @@ export interface ListProps<T = unknown> {
|
|
|
43
43
|
maxHeight?: number | null | undefined;
|
|
44
44
|
activeIndex?: number | null | undefined;
|
|
45
45
|
useMouseUp?: boolean | null | undefined;
|
|
46
|
-
/**
|
|
47
|
-
* @deprecated No longer used. Visibility is detected automatically via IntersectionObserver. Will be removed in Ring UI 8.0.
|
|
48
|
-
*/
|
|
49
|
-
visible?: boolean | null | undefined;
|
|
50
46
|
disableMoveOverflow?: boolean | null | undefined;
|
|
51
47
|
compact?: boolean | null | undefined;
|
|
52
48
|
disableScrollToActive?: boolean | null | undefined;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { type ComponentType, type CSSProperties, PureComponent, type ReactNode, type Ref, type SyntheticEvent } from 'react';
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import { type IconType } from '../icon/icon';
|
|
7
|
-
import Popup from '../popup/popup';
|
|
7
|
+
import Popup, { type PopupAttrs } from '../popup/popup';
|
|
8
8
|
import { type Directions } from '../popup/position';
|
|
9
9
|
import List, { type SelectHandlerParams } from '../list/list';
|
|
10
10
|
import Caret from '../caret/caret';
|
|
@@ -60,6 +60,7 @@ export interface SelectPopupProps<T = unknown> {
|
|
|
60
60
|
ringPopupTarget: string | null;
|
|
61
61
|
onSelectAll: (isSelectAll: boolean) => void;
|
|
62
62
|
onEmptyPopupEnter: (e: KeyboardEvent) => void;
|
|
63
|
+
popupProps?: Partial<PopupAttrs> | undefined;
|
|
63
64
|
className?: string | null | undefined;
|
|
64
65
|
compact?: boolean | null | undefined;
|
|
65
66
|
dir?: 'ltr' | 'rtl' | undefined;
|
|
@@ -323,8 +323,8 @@ export default class SelectPopup extends PureComponent {
|
|
|
323
323
|
right: event => this.handleNavigation(event),
|
|
324
324
|
};
|
|
325
325
|
render() {
|
|
326
|
-
const { toolbar, topbar, className, multiple, hidden, isInputMode, anchorElement, minWidth, onCloseAttempt, onOutsideClick, directions, top, left, offset, style, dir, filter, } = this.props;
|
|
327
|
-
const classes = classNames(styles.popup, className);
|
|
326
|
+
const { toolbar, topbar, className, multiple, hidden, isInputMode, anchorElement, minWidth, onCloseAttempt, onOutsideClick, directions, top, left, offset, style, dir, filter, popupProps, } = this.props;
|
|
327
|
+
const classes = classNames(styles.popup, className, popupProps?.className);
|
|
328
328
|
return (<PopupTargetContext.Consumer>
|
|
329
329
|
{ringPopupTarget => {
|
|
330
330
|
const filterWithTags = this.getFilterWithTags();
|
|
@@ -332,7 +332,7 @@ export default class SelectPopup extends PureComponent {
|
|
|
332
332
|
const list = this.getList(this.props.ringPopupTarget || normalizePopupTarget(ringPopupTarget));
|
|
333
333
|
const bottomLine = this.getBottomLine();
|
|
334
334
|
const hasContent = filterWithTags || selectAll || list || bottomLine || toolbar || topbar;
|
|
335
|
-
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>
|
|
335
|
+
return (<Popup {...popupProps} 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={{ ...popupProps?.style, ...style }} largeBorderRadius>
|
|
336
336
|
<div dir={dir}>
|
|
337
337
|
{!hidden && filter && <Shortcuts map={this.shortcutsMap} scope={this.shortcutsScope}/>}
|
|
338
338
|
{topbar}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type ButtonHTMLAttributes, Component, type ComponentType, type CSSProperties, type HTMLAttributes, type ReactNode, type Ref, type RefCallback, type SyntheticEvent } from 'react';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
+
import { type PopupAttrs } from '../popup/popup';
|
|
3
4
|
import { type SelectHandlerParams } from '../list/list';
|
|
4
5
|
import { Size } from '../input/input';
|
|
5
6
|
import { type LabelType } from '../control-label/control-label';
|
|
@@ -99,6 +100,7 @@ export interface BaseSelectProps<T = unknown> {
|
|
|
99
100
|
getInitial?: (() => string) | null | undefined;
|
|
100
101
|
minWidth?: number | undefined;
|
|
101
102
|
popupClassName?: string | null | undefined;
|
|
103
|
+
popupProps?: Partial<PopupAttrs> | undefined;
|
|
102
104
|
popupStyle?: CSSProperties | undefined;
|
|
103
105
|
top?: number | undefined;
|
|
104
106
|
left?: number | undefined;
|
|
@@ -47,9 +47,7 @@ const getStyle = memoize((iconsLength) => ({
|
|
|
47
47
|
}));
|
|
48
48
|
const isInputMode = (type) => type === Type.INPUT || type === Type.INPUT_WITHOUT_CONTROLS;
|
|
49
49
|
function getLowerCaseLabel(item) {
|
|
50
|
-
if (List.isItemType(List.ListProps.Type.SEPARATOR, item) ||
|
|
51
|
-
List.isItemType(List.ListProps.Type.HINT, item) ||
|
|
52
|
-
typeof item.label !== 'string') {
|
|
50
|
+
if (List.isItemType(List.ListProps.Type.SEPARATOR, item) || typeof item.label !== 'string') {
|
|
53
51
|
return null;
|
|
54
52
|
}
|
|
55
53
|
return item.label.toLowerCase();
|
|
@@ -456,7 +454,7 @@ export default class Select extends Component {
|
|
|
456
454
|
else if (!shownData.length) {
|
|
457
455
|
message = this.props.notFoundMessage ?? translate('noOptionsFound');
|
|
458
456
|
}
|
|
459
|
-
return (<SelectPopup data={_shownData} message={message} toolbar={showPopup && this.getToolbar()} topbar={this.getTopbar()} loading={this.props.loading} activeIndex={activeIndex} hidden={!showPopup} ref={this.popupRef} maxHeight={this.props.maxHeight} minWidth={this.props.minWidth} directions={this.props.directions} className={this.props.popupClassName} style={this.props.popupStyle} top={this.props.top} left={this.props.left} offset={this.props.offset} filter={this.isInputMode() ? false : this.props.filter} // disable popup filter in INPUT mode
|
|
457
|
+
return (<SelectPopup data={_shownData} message={message} toolbar={showPopup && this.getToolbar()} topbar={this.getTopbar()} loading={this.props.loading} activeIndex={activeIndex} hidden={!showPopup} ref={this.popupRef} maxHeight={this.props.maxHeight} minWidth={this.props.minWidth} directions={this.props.directions} popupProps={this.props.popupProps} className={this.props.popupClassName} style={this.props.popupStyle} top={this.props.top} left={this.props.left} offset={this.props.offset} filter={this.isInputMode() ? false : this.props.filter} // disable popup filter in INPUT mode
|
|
460
458
|
filterIcon={this.props.filterIcon} filterRef={this.props.filterRef} multiple={this.props.multiple} filterValue={this.state.filterValue} anchorElement={anchorElement} onCloseAttempt={this._onCloseAttempt} onOutsideClick={this.props.onOutsideClick} onSelect={this._listSelectHandler} onSelectAll={this._listSelectAllHandler} onFilter={this._filterChangeHandler} onClear={this.clearFilter} onLoadMore={this.props.onLoadMore} isInputMode={this.isInputMode()} selected={this.state.selected} tags={this.props.tags} compact={this.props.compact} renderOptimization={this.props.renderOptimization} ringPopupTarget={this.props.ringPopupTarget} disableMoveOverflow={this.props.disableMoveOverflow} disableScrollToActive={this.props.disableScrollToActive} dir={this.props.dir} onEmptyPopupEnter={this.onEmptyPopupEnter} listId={this.listId} preventListOverscroll={this.props.preventListOverscroll}/>);
|
|
461
459
|
}}
|
|
462
460
|
</I18nContext.Consumer>);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jetbrains/ring-ui",
|
|
3
|
-
"version": "8.0.0-beta.
|
|
3
|
+
"version": "8.0.0-beta.8",
|
|
4
4
|
"description": "JetBrains UI library",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "JetBrains"
|
|
@@ -226,8 +226,6 @@
|
|
|
226
226
|
"@types/util-deprecate": "^1.0.4",
|
|
227
227
|
"babel-loader": "10.1.1",
|
|
228
228
|
"babel-plugin-react-compiler": "^1.0.0",
|
|
229
|
-
"babel-plugin-transform-define": "^2.1.4",
|
|
230
|
-
"browserslist": "^4.28.4",
|
|
231
229
|
"change-case": "^4.1.1",
|
|
232
230
|
"classnames": "^2.5.1",
|
|
233
231
|
"combokeys": "^3.0.1",
|
|
@@ -251,7 +249,6 @@
|
|
|
251
249
|
"react-compiler-runtime": "^1.0.0",
|
|
252
250
|
"react-movable": "^3.4.1",
|
|
253
251
|
"react-virtualized": "^9.22.6",
|
|
254
|
-
"react-waypoint": "^10.3.0",
|
|
255
252
|
"scrollbar-width": "^3.1.1",
|
|
256
253
|
"simply-uuid": "^1.0.1",
|
|
257
254
|
"sniffr": "^1.4.0",
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
@import '../global/variables.css';
|
|
2
|
-
|
|
3
|
-
@value extra-small-screen-media, small-screen-media from '../global/global.css';
|
|
4
|
-
|
|
5
|
-
.contentLayout {
|
|
6
|
-
--ring-content-layout-sidebar-width: calc(var(--ring-unit) * 30);
|
|
7
|
-
|
|
8
|
-
position: relative;
|
|
9
|
-
|
|
10
|
-
display: flex;
|
|
11
|
-
flex-flow: row nowrap;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.contentLayoutContent {
|
|
15
|
-
align-self: flex-start;
|
|
16
|
-
flex-grow: 2;
|
|
17
|
-
|
|
18
|
-
width: 100%; /* without this hack IE11 render contentLayoutContent wider than its container */
|
|
19
|
-
margin: 0 calc(var(--ring-unit) * 4);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.sidebarContainer {
|
|
23
|
-
min-width: var(--ring-content-layout-sidebar-width);
|
|
24
|
-
max-width: var(--ring-content-layout-sidebar-width);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.sidebarContainerRight {
|
|
28
|
-
order: 1;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.sidebar {
|
|
32
|
-
overflow: auto;
|
|
33
|
-
|
|
34
|
-
box-sizing: border-box;
|
|
35
|
-
min-width: var(--ring-content-layout-sidebar-width);
|
|
36
|
-
max-width: var(--ring-content-layout-sidebar-width);
|
|
37
|
-
height: 100%;
|
|
38
|
-
padding-right: calc(var(--ring-unit) * 2);
|
|
39
|
-
padding-left: calc(var(--ring-unit) * 4);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.sidebarRight {
|
|
43
|
-
padding-right: calc(var(--ring-unit) * 4);
|
|
44
|
-
padding-left: calc(var(--ring-unit) * 2);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.sidebarFixedTop {
|
|
48
|
-
top: 0;
|
|
49
|
-
bottom: 0;
|
|
50
|
-
|
|
51
|
-
&.sidebarFixedTop {
|
|
52
|
-
position: fixed;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.sidebarFixedBottom.sidebarFixedBottom {
|
|
57
|
-
position: absolute;
|
|
58
|
-
top: auto;
|
|
59
|
-
bottom: 0;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.bottomMarker {
|
|
63
|
-
position: absolute;
|
|
64
|
-
bottom: 0;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.contentLayoutResponsive {
|
|
68
|
-
@media extra-small-screen-media, small-screen-media {
|
|
69
|
-
& .contentLayoutContent {
|
|
70
|
-
margin: 0 16px;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
& .sidebar {
|
|
74
|
-
position: absolute;
|
|
75
|
-
top: 0;
|
|
76
|
-
bottom: 0;
|
|
77
|
-
left: 0;
|
|
78
|
-
|
|
79
|
-
box-sizing: content-box;
|
|
80
|
-
padding: 0 16px;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
& .sidebarFixedTop {
|
|
84
|
-
position: fixed;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
& .sidebarFixedBottom {
|
|
88
|
-
top: auto;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
& .sidebarRight {
|
|
92
|
-
right: 0;
|
|
93
|
-
left: auto;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
& .sidebarContainer {
|
|
97
|
-
min-width: 0;
|
|
98
|
-
max-width: 0;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
@media extra-small-screen-media {
|
|
103
|
-
& .sidebar {
|
|
104
|
-
width: 80%;
|
|
105
|
-
min-width: 0;
|
|
106
|
-
max-width: none;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Component, type HTMLAttributes } from 'react';
|
|
2
|
-
export interface ContentLayoutProps extends HTMLAttributes<HTMLElement> {
|
|
3
|
-
responsive: boolean;
|
|
4
|
-
contentClassName?: string | null | undefined;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* @name Content Layout
|
|
8
|
-
* @deprecated Will be removed in Ring UI 8.0.
|
|
9
|
-
*/
|
|
10
|
-
export default class ContentLayout extends Component<ContentLayoutProps> {
|
|
11
|
-
static defaultProps: {
|
|
12
|
-
responsive: boolean;
|
|
13
|
-
};
|
|
14
|
-
state: {
|
|
15
|
-
contentNode: null;
|
|
16
|
-
};
|
|
17
|
-
saveContentNode: (contentNode: HTMLElement | null) => void;
|
|
18
|
-
render(): import("react").JSX.Element;
|
|
19
|
-
}
|
|
20
|
-
export { default as Sidebar } from './sidebar';
|