@jetbrains/ring-ui 7.0.33 → 7.0.35
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/components/avatar/avatar.figma.js +1 -1
- package/components/avatar-stack/avatar-stack.figma.js +33 -0
- package/components/breadcrumbs/breadcrumbs.figma.js +31 -0
- package/components/button/button.d.ts +3 -0
- package/components/button/button.figma.js +2 -2
- package/components/checkbox/checkbox-group.figma.js +31 -0
- package/components/checkbox/checkbox.d.ts +1 -1
- package/components/checkbox/checkbox.figma.js +38 -0
- package/components/code/highlight.css +0 -7
- package/components/dialog/dialog.js +2 -2
- package/components/dialog/dialog__body-scroll-preventer.js +3 -1
- package/components/error-bubble/error-bubble.css +1 -1
- package/components/error-bubble/error-bubble.d.ts +1 -1
- package/components/error-bubble/error-bubble.figma.js +15 -0
- package/components/error-bubble/error-bubble.js +2 -1
- package/components/global/variables.css +32 -21
- package/components/global/variables_dark.css +31 -20
- package/components/icon/icon.d.ts +9 -0
- package/components/input/input.d.ts +1 -1
- package/components/input/input.figma.js +74 -0
- package/components/list/consts.d.ts +4 -1
- package/components/list/list.js +7 -2
- package/components/list/list__custom.js +1 -1
- package/components/query-assist/query-assist.css +1 -1
- package/components/select/select.d.ts +1 -1
- package/components/select/select__popup.d.ts +1 -1
- package/components/table/row.d.ts +1 -1
- package/components/table/table.d.ts +1 -1
- package/components/table/table.js +2 -2
- package/components/user-agreement/service.js +6 -1
- package/package.json +44 -44
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/HY6d4uE1xxaQXCMG9fe6Y2/RingUI?node-id=5990-752
|
|
2
|
+
const figma = require('figma');
|
|
3
|
+
|
|
4
|
+
const instance = figma.selectedInstance;
|
|
5
|
+
const sizeString = instance.getString('Size');
|
|
6
|
+
const [sizeSubstring] = sizeString.match(/\d+/) ?? [];
|
|
7
|
+
const size = parseInt(sizeSubstring, 10);
|
|
8
|
+
const children = instance.findConnectedInstances(() => true);
|
|
9
|
+
|
|
10
|
+
const imports = ["import AvatarStack from '@jetbrains/ring-ui/components/avatar-stack/avatar-stack'"];
|
|
11
|
+
const props = [];
|
|
12
|
+
|
|
13
|
+
const DEFAULT_SIZE = 20;
|
|
14
|
+
const isDefaultSize = size === DEFAULT_SIZE;
|
|
15
|
+
if (!isDefaultSize) {
|
|
16
|
+
props.push(`size={Size.Size${size}}`);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const renderedChildren = children.map(child => {
|
|
20
|
+
const {example} = child.executeTemplate();
|
|
21
|
+
const [childImports, code] = example[0].code.split('\n\n');
|
|
22
|
+
return {imports: childImports, code};
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export default {
|
|
26
|
+
id: 'avatar-stack',
|
|
27
|
+
example: figma.code`${imports.join('\n')}
|
|
28
|
+
${renderedChildren[0].imports}
|
|
29
|
+
|
|
30
|
+
<AvatarStack ${props.map(prop => `${prop} `).join('')}>
|
|
31
|
+
${renderedChildren.map(({code}) => code).join('\n ')}
|
|
32
|
+
</AvatarStack>`,
|
|
33
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/HY6d4uE1xxaQXCMG9fe6Y2/RingUI?node-id=460%3A2730
|
|
2
|
+
const figma = require('figma');
|
|
3
|
+
|
|
4
|
+
const instance = figma.selectedInstance;
|
|
5
|
+
|
|
6
|
+
const imports = [
|
|
7
|
+
"import Breadcrumbs from '@jetbrains/ring-ui/components/breadcrumbs/breadcrumbs'",
|
|
8
|
+
"import Link from '@jetbrains/ring-ui/components/link/link'",
|
|
9
|
+
];
|
|
10
|
+
|
|
11
|
+
const children = instance
|
|
12
|
+
.findLayers(() => true)
|
|
13
|
+
.map(layer => layer.textContent)
|
|
14
|
+
.filter(text => text !== '/');
|
|
15
|
+
|
|
16
|
+
export default {
|
|
17
|
+
id: 'breadcrumbs',
|
|
18
|
+
example: figma.code`${imports.join('\n')}
|
|
19
|
+
|
|
20
|
+
<Breadcrumbs>
|
|
21
|
+
${children
|
|
22
|
+
.map((text, index) => {
|
|
23
|
+
const props = [`href="/page${index + 1}"`];
|
|
24
|
+
if (index === children.length - 1) {
|
|
25
|
+
props.push('active');
|
|
26
|
+
}
|
|
27
|
+
return `<Link ${props.map(prop => `${prop} `).join('')}>${text}</Link>`;
|
|
28
|
+
})
|
|
29
|
+
.join('\n ')}
|
|
30
|
+
</Breadcrumbs>`,
|
|
31
|
+
};
|
|
@@ -23,6 +23,9 @@ export interface ButtonBaseProps {
|
|
|
23
23
|
dropdown?: boolean | null | undefined;
|
|
24
24
|
disabled?: boolean | undefined;
|
|
25
25
|
icon?: string | IconType | null | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* @deprecated Use icons with appropriate intrinsic sizes instead
|
|
28
|
+
*/
|
|
26
29
|
iconSize?: IconProps['size'];
|
|
27
30
|
iconClassName?: string | null | undefined;
|
|
28
31
|
iconSuppressSizeWarning?: boolean | null | undefined;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/HY6d4uE1xxaQXCMG9fe6Y2/RingUI?node-id=9954-528
|
|
1
2
|
const figma = require('figma');
|
|
2
3
|
|
|
3
4
|
const instance = figma.selectedInstance;
|
|
@@ -42,7 +43,7 @@ switch (variant) {
|
|
|
42
43
|
default:
|
|
43
44
|
}
|
|
44
45
|
|
|
45
|
-
|
|
46
|
+
const children = instance.findLayers(() => true)[0].findText('Button').textContent;
|
|
46
47
|
const use12pxIcon = size === 'S' && variant !== 'Text';
|
|
47
48
|
let useButtonGroup = false;
|
|
48
49
|
switch (type) {
|
|
@@ -54,7 +55,6 @@ switch (type) {
|
|
|
54
55
|
props.push('icon={downloadIcon}');
|
|
55
56
|
break;
|
|
56
57
|
case 'Icon':
|
|
57
|
-
children = null;
|
|
58
58
|
imports.push(`import addIcon from '@jetbrains/icons/add${use12pxIcon ? '-12px' : ''}'`);
|
|
59
59
|
props.push('icon={addIcon}');
|
|
60
60
|
break;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/HY6d4uE1xxaQXCMG9fe6Y2/RingUI-(Internal)?node-id=226-2666
|
|
2
|
+
const figma = require('figma');
|
|
3
|
+
|
|
4
|
+
const instance = figma.selectedInstance;
|
|
5
|
+
const labelType = instance.getString('Label');
|
|
6
|
+
const children = instance.findConnectedInstances(() => true);
|
|
7
|
+
const label = instance.findText('Group description').textContent;
|
|
8
|
+
|
|
9
|
+
const isFormLabel = labelType === 'form';
|
|
10
|
+
const imports = [
|
|
11
|
+
`import ControlLabel${isFormLabel ? ', {LabelType}' : ''} from '@jetbrains/ring-ui/components/control-label/control-label'`,
|
|
12
|
+
];
|
|
13
|
+
const labelProps = [];
|
|
14
|
+
if (isFormLabel) {
|
|
15
|
+
labelProps.push('type={LabelType.FORM}');
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const renderedChildren = children.map(child => {
|
|
19
|
+
const {example} = child.executeTemplate();
|
|
20
|
+
const [childImports, code] = example[0].code.split('\n\n');
|
|
21
|
+
return {imports: childImports, code};
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export default {
|
|
25
|
+
id: 'checkbox-group',
|
|
26
|
+
example: figma.code`${imports.join('\n')}
|
|
27
|
+
${renderedChildren[0].imports}
|
|
28
|
+
|
|
29
|
+
<ControlLabel ${labelProps.map(prop => `${prop} `).join('')}>${label}</ControlLabel>
|
|
30
|
+
${renderedChildren.map(({code}) => code).join('\n<br />\n')}`,
|
|
31
|
+
};
|
|
@@ -23,6 +23,6 @@ export default class Checkbox extends PureComponent<CheckboxProps> {
|
|
|
23
23
|
componentDidUpdate(prevProps: CheckboxProps): void;
|
|
24
24
|
input?: HTMLInputElement | null;
|
|
25
25
|
inputRef: (el: HTMLInputElement | null) => void;
|
|
26
|
-
composedInputRef: import("memoize-one").MemoizedFn<(...refs: (Ref<HTMLInputElement> | undefined)[]) => (value:
|
|
26
|
+
composedInputRef: import("memoize-one").MemoizedFn<(...refs: (Ref<HTMLInputElement> | undefined)[]) => (value: T | null) => void>;
|
|
27
27
|
render(): import("react/jsx-runtime").JSX.Element;
|
|
28
28
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/HY6d4uE1xxaQXCMG9fe6Y2/RingUI?node-id=224%3A1943
|
|
2
|
+
const figma = require('figma');
|
|
3
|
+
|
|
4
|
+
const instance = figma.selectedInstance;
|
|
5
|
+
const selected = instance.getString('Selected');
|
|
6
|
+
const hasLabel = instance.getBoolean('Label');
|
|
7
|
+
const label = instance.findText('Label').textContent;
|
|
8
|
+
const hasHelpText = instance.getBoolean('Help Text');
|
|
9
|
+
const helpText = instance.findText('Description').textContent;
|
|
10
|
+
const state = instance.getString('State');
|
|
11
|
+
|
|
12
|
+
const imports = ["import Checkbox from '@jetbrains/ring-ui/components/checkbox/checkbox'"];
|
|
13
|
+
const props = [];
|
|
14
|
+
switch (selected) {
|
|
15
|
+
case 'selected':
|
|
16
|
+
props.push('defaultChecked');
|
|
17
|
+
break;
|
|
18
|
+
case 'intermediate':
|
|
19
|
+
props.push('indeterminate', 'defaultChecked');
|
|
20
|
+
break;
|
|
21
|
+
default:
|
|
22
|
+
}
|
|
23
|
+
if (hasLabel) {
|
|
24
|
+
props.push(`label="${label}"`);
|
|
25
|
+
}
|
|
26
|
+
if (hasHelpText) {
|
|
27
|
+
props.push(`help="${helpText}"`);
|
|
28
|
+
}
|
|
29
|
+
if (state === 'Disabled') {
|
|
30
|
+
props.push('disabled');
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export default {
|
|
34
|
+
id: 'checkbox',
|
|
35
|
+
example: figma.code`${imports.join('\n')}
|
|
36
|
+
|
|
37
|
+
<Checkbox ${props.map(prop => `${prop} `).join('')}/>`,
|
|
38
|
+
};
|
|
@@ -29,13 +29,6 @@
|
|
|
29
29
|
color: var(--ring-code-meta-color);
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
& :global(.hljs-tag) {
|
|
33
|
-
background: var(--ring-code-tag-background-color);
|
|
34
|
-
box-shadow:
|
|
35
|
-
0 1px var(--ring-code-tag-background-color),
|
|
36
|
-
0 -1px var(--ring-code-tag-background-color);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
32
|
& :global(.hljs-section),
|
|
40
33
|
& :global(.hljs-literal),
|
|
41
34
|
& :global(.hljs-keyword),
|
|
@@ -124,7 +124,7 @@ export default class Dialog extends PureComponent {
|
|
|
124
124
|
[styles.closeIconInside]: closeButtonInside,
|
|
125
125
|
}), onClick: this.onCloseClick, title: closeButtonTitle, "aria-label": closeButtonTitle || 'close dialog' }))] }) })] }));
|
|
126
126
|
if (native) {
|
|
127
|
-
return (_jsx("dialog", { className: classNames(styles.nativeDialog, className), ref: this.nativeDialog, children: _jsx(PopupTarget, { id: this.uid, className: styles.popupTarget, children: target => (_jsxs(_Fragment, { children: [content, target] })) }) }));
|
|
127
|
+
return (_jsx("dialog", { className: classNames(styles.nativeDialog, className), ref: this.nativeDialog, "data-rg-modal-dialog-container": modal ? '' : undefined, children: _jsx(PopupTarget, { id: this.uid, className: styles.popupTarget, children: target => (_jsxs(_Fragment, { children: [content, target] })) }) }));
|
|
128
128
|
}
|
|
129
129
|
return (show && (_jsx(PopupTargetContext.Consumer, { children: contextTarget => {
|
|
130
130
|
let targetElement = document.body;
|
|
@@ -137,7 +137,7 @@ export default class Dialog extends PureComponent {
|
|
|
137
137
|
targetElement = container;
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
|
-
return createPortal(_jsx(PopupTarget, { id: this.uid, className: styles.popupTarget, children: target => (_jsxs(TabTrap, { trapDisabled: !trapFocus, "data-test": dataTests('ring-dialog-container', dataTest), ref: this.dialogRef, className: classes, role: "presentation", ...restProps, children: [content, target] })) }), targetElement);
|
|
140
|
+
return createPortal(_jsx(PopupTarget, { id: this.uid, className: styles.popupTarget, children: target => (_jsxs(TabTrap, { trapDisabled: !trapFocus, "data-test": dataTests('ring-dialog-container', dataTest), "data-rg-modal-dialog-container": "", ref: this.dialogRef, className: classes, role: "presentation", ...restProps, children: [content, target] })) }), targetElement);
|
|
141
141
|
} })));
|
|
142
142
|
}
|
|
143
143
|
}
|
|
@@ -14,7 +14,9 @@ const prevent = (key) => {
|
|
|
14
14
|
getComputedStyle(document.documentElement).overflowY === 'scroll';
|
|
15
15
|
document.documentElement.classList.add(styles.documentWithoutScroll);
|
|
16
16
|
const scrollWidth = scrollbarWidth();
|
|
17
|
-
|
|
17
|
+
const { scrollbarGutter } = getComputedStyle(document.documentElement);
|
|
18
|
+
const documentHasScrollbarGutter = scrollbarGutter === 'stable' || scrollbarGutter === 'both-edges';
|
|
19
|
+
if (documentHasScroll && scrollWidth != null && scrollWidth > 0 && !documentHasScrollbarGutter) {
|
|
18
20
|
previousDocumentWidth = document.documentElement.style.width;
|
|
19
21
|
document.documentElement.style.width = `calc(100% - ${scrollWidth}px)`;
|
|
20
22
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PureComponent, ReactElement } from 'react';
|
|
2
2
|
export type ErrorBubbleProps<P> = Partial<P> & {
|
|
3
3
|
className?: string | null | undefined;
|
|
4
|
-
children
|
|
4
|
+
children?: ReactElement<P> | ReactElement<P>[];
|
|
5
5
|
error?: string | null | undefined;
|
|
6
6
|
};
|
|
7
7
|
/**
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/HY6d4uE1xxaQXCMG9fe6Y2/RingUI-(Internal)?node-id=1228-2869
|
|
2
|
+
const figma = require('figma');
|
|
3
|
+
|
|
4
|
+
const instance = figma.selectedInstance;
|
|
5
|
+
const error = instance.findLayers(() => true)[0].textContent;
|
|
6
|
+
|
|
7
|
+
const imports = ["import ErrorBubble from '@jetbrains/ring-ui/components/error-bubble/error-bubble'"];
|
|
8
|
+
const props = [`error={\`${error}\``];
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
id: 'error-bubble',
|
|
12
|
+
example: figma.code`${imports.join('\n')}
|
|
13
|
+
|
|
14
|
+
<ErrorBubble ${props.map(prop => `${prop} `).join('')}/>`,
|
|
15
|
+
};
|
|
@@ -11,6 +11,7 @@ export default class ErrorBubble extends PureComponent {
|
|
|
11
11
|
render() {
|
|
12
12
|
const { children, className, ...restProps } = this.props;
|
|
13
13
|
const errorBubbleClasses = classNames(styles.errorBubble, className);
|
|
14
|
-
return (_jsxs("div", { className: styles.errorBubbleWrapper, "data-test": "ring-error-bubble-wrapper", children: [
|
|
14
|
+
return (_jsxs("div", { className: styles.errorBubbleWrapper, "data-test": "ring-error-bubble-wrapper", children: [children &&
|
|
15
|
+
Children.map(children, (child) => cloneElement(child, { ...child.props, ...restProps })), restProps.error && (_jsx(Popup, { trapFocus: false, className: styles.errorBubblePopup, hidden: false, attached: false, directions: [Directions.RIGHT_CENTER, Directions.RIGHT_BOTTOM, Directions.RIGHT_TOP], children: _jsx("div", { className: errorBubbleClasses, "data-test": "ring-error-bubble", children: restProps.error }) }))] }));
|
|
15
16
|
}
|
|
16
17
|
}
|
|
@@ -39,18 +39,26 @@
|
|
|
39
39
|
--ring-main-hover-color: rgb(var(--ring-main-hover-components)); /* #3369d6 */
|
|
40
40
|
--ring-main-success-components: 32, 138, 60;
|
|
41
41
|
--ring-main-success-color: rgb(var(--ring-main-success-components)); /* #208A3C */
|
|
42
|
-
--ring-main-success-hover-components: 31,
|
|
43
|
-
--ring-main-success-hover-color: rgb(var(--ring-main-success-hover-components)); /* #
|
|
42
|
+
--ring-main-success-hover-components: 31, 117, 54;
|
|
43
|
+
--ring-main-success-hover-color: rgb(var(--ring-main-success-hover-components)); /* #1F7536 */
|
|
44
44
|
--ring-main-error-components: 204, 54, 69;
|
|
45
45
|
--ring-main-error-color: rgb(var(--ring-main-error-components)); /* #CC3645 */
|
|
46
|
-
--ring-main-error-hover-components:
|
|
47
|
-
--ring-main-error-hover-color: rgb(var(--ring-main-error-hover-components)); /* #
|
|
46
|
+
--ring-main-error-hover-components: 173, 43, 56;
|
|
47
|
+
--ring-main-error-hover-color: rgb(var(--ring-main-error-hover-components)); /* #AD2B38 */
|
|
48
|
+
--ring-main-warning-components: 229, 109, 23;
|
|
49
|
+
--ring-main-warning-color: rgb(var(--ring-main-warning-components)); /* #E56D17 */
|
|
50
|
+
--ring-main-warning-hover-components: 206, 97, 23;
|
|
51
|
+
--ring-main-warning-hover-color: rgb(var(--ring-main-warning-hover-components)); /* #CE6117 */
|
|
48
52
|
--ring-icon-error-components: 204, 54, 69;
|
|
49
53
|
--ring-icon-error-color: rgb(var(--ring-icon-error-components)); /* #CC3645 */ /* TODO: remove in 8.0 in favor of --ring-error-color */
|
|
50
|
-
--ring-icon-warning-components:
|
|
51
|
-
--ring-icon-warning-color: rgb(var(--ring-icon-warning-components)); /* #
|
|
52
|
-
--ring-icon-success-components:
|
|
53
|
-
--ring-icon-success-color: rgb(var(--ring-icon-success-components)); /* #
|
|
54
|
+
--ring-icon-warning-components: 229, 109, 23;
|
|
55
|
+
--ring-icon-warning-color: rgb(var(--ring-icon-warning-components)); /* #E56D17 */
|
|
56
|
+
--ring-icon-success-components: 32, 138, 60;
|
|
57
|
+
--ring-icon-success-color: rgb(var(--ring-icon-success-components)); /* #208A3C */
|
|
58
|
+
--ring-icon-highlight-components: 255, 175, 15;
|
|
59
|
+
--ring-icon-highlight-color: rgb(var(--ring-icon-highlight-components)); /* #FFAF0F */
|
|
60
|
+
--ring-icon-highlight-hover-components: 223, 147, 3;
|
|
61
|
+
--ring-icon-highlight-hover-color: rgb(var(--ring-icon-highlight-hover-components)); /* #DF9303 */
|
|
54
62
|
--ring-pale-control-components: 194, 214, 252;
|
|
55
63
|
--ring-pale-control-color: rgb(var(--ring-pale-control-components)); /* #C2D6FC */
|
|
56
64
|
--ring-popup-border-components: 0, 28, 54;
|
|
@@ -81,10 +89,10 @@
|
|
|
81
89
|
--ring-link-hover-color: rgb(var(--ring-link-hover-components)); /* #223C72 */
|
|
82
90
|
--ring-error-components: 204, 54, 69;
|
|
83
91
|
--ring-error-color: rgb(var(--ring-error-components)); /* #CC3645 */
|
|
84
|
-
--ring-warning-components:
|
|
85
|
-
--ring-warning-color: rgb(var(--ring-warning-components)); /* #
|
|
92
|
+
--ring-warning-components: 184, 85, 22;
|
|
93
|
+
--ring-warning-color: rgb(var(--ring-warning-components)); /* #B85516 */ /* Prefer using warning icon + regular text color */
|
|
86
94
|
--ring-success-components: 31, 117, 54;
|
|
87
|
-
--ring-success-color: rgb(var(--ring-success-components)); /* #1F7536 */
|
|
95
|
+
--ring-success-color: rgb(var(--ring-success-components)); /* #1F7536 */ /* Prefer using success icon + regular text color */
|
|
88
96
|
--ring-text-components: 39, 40, 46;
|
|
89
97
|
--ring-text-color: rgb(var(--ring-text-components)); /* #27282E */
|
|
90
98
|
--ring-active-text-color: var(--ring-text-color);
|
|
@@ -117,8 +125,10 @@
|
|
|
117
125
|
--ring-tag-hover-background-color: rgb(var(--ring-tag-hover-background-components)); /* #D3D5DB */
|
|
118
126
|
--ring-removed-background-components: 250, 212, 216;
|
|
119
127
|
--ring-removed-background-color: rgb(var(--ring-removed-background-components)); /* #FAD4D8 */
|
|
120
|
-
--ring-warning-background-components:
|
|
121
|
-
--ring-warning-background-color: rgb(var(--ring-warning-background-components)); /* #
|
|
128
|
+
--ring-warning-background-components: 252, 230, 214;
|
|
129
|
+
--ring-warning-background-color: rgb(var(--ring-warning-background-components)); /* #FCE6D6 */
|
|
130
|
+
--ring-highlight-background-components: 255, 241, 209;
|
|
131
|
+
--ring-highlight-background-color: rgb(var(--ring-highlight-background-components)); /* #FFF1D1 */
|
|
122
132
|
--ring-added-background-components: 197, 229, 204;
|
|
123
133
|
--ring-added-background-color: rgb(var(--ring-added-background-components)); /* #C5E5CC */
|
|
124
134
|
--ring-disabled-background-components: 247, 248, 250;
|
|
@@ -133,19 +143,20 @@
|
|
|
133
143
|
--ring-table-loader-background-color: rgba(var(--ring-content-background-components), 0.5); /* #FFFFFF50 */
|
|
134
144
|
--ring-removed-subtle-background-components: 255, 247, 247;
|
|
135
145
|
--ring-removed-subtle-background-color: rgb(var(--ring-removed-subtle-background-components)); /* #FFF7F7 */
|
|
136
|
-
--ring-warning-subtle-background-components: 255,
|
|
137
|
-
--ring-warning-subtle-background-color: rgb(var(--ring-warning-subtle-background-components)); /* #
|
|
138
|
-
--ring-
|
|
139
|
-
--ring-
|
|
146
|
+
--ring-warning-subtle-background-components: 255, 244, 235;
|
|
147
|
+
--ring-warning-subtle-background-color: rgb(var(--ring-warning-subtle-background-components)); /* #FFF4EB */
|
|
148
|
+
--ring-highlight-subtle-background-components: 255, 246, 222;
|
|
149
|
+
--ring-highlight-subtle-background-color: rgb(var(--ring-highlight-subtle-background-components)); /* #FFF6DE */
|
|
150
|
+
--ring-added-subtle-background-components: 230, 247, 233;
|
|
151
|
+
--ring-added-subtle-background-color: rgb(var(--ring-added-subtle-background-components)); /* #E6F7E9 */
|
|
140
152
|
|
|
141
153
|
/* Code */
|
|
142
154
|
--ring-code-background-color: var(--ring-content-background-color);
|
|
143
155
|
--ring-code-components: 0, 0, 0;
|
|
144
156
|
--ring-code-color: rgb(var(--ring-code-components)); /* #000000 */
|
|
145
|
-
--ring-code-comment-
|
|
146
|
-
--ring-code-
|
|
147
|
-
--ring-code-meta-
|
|
148
|
-
--ring-code-meta-color: rgb(var(--ring-code-meta-components)); /* #9E880D */
|
|
157
|
+
--ring-code-comment-color: var(--ring-secondary-color);
|
|
158
|
+
--ring-code-meta-components: 145, 76, 7;
|
|
159
|
+
--ring-code-meta-color: rgb(var(--ring-code-meta-components)); /* #914C07 */
|
|
149
160
|
--ring-code-keyword-components: 0, 51, 179;
|
|
150
161
|
--ring-code-keyword-color: rgb(var(--ring-code-keyword-components)); /* #0033B3 */
|
|
151
162
|
--ring-code-tag-background-components: 235, 236, 240;
|
|
@@ -35,16 +35,24 @@
|
|
|
35
35
|
--ring-main-success-color: rgb(var(--ring-main-success-components)); /* #57965C */
|
|
36
36
|
--ring-main-success-hover-components: 78, 128, 82;
|
|
37
37
|
--ring-main-success-hover-color: rgb(var(--ring-main-success-hover-components)); /* #4E8052 */
|
|
38
|
-
--ring-main-error-components:
|
|
39
|
-
--ring-main-error-color: rgb(var(--ring-main-error-components)); /* #
|
|
40
|
-
--ring-main-error-hover-components:
|
|
41
|
-
--ring-main-error-hover-color: rgb(var(--ring-main-error-hover-components)); /* #
|
|
38
|
+
--ring-main-error-components: 219, 92, 92;
|
|
39
|
+
--ring-main-error-color: rgb(var(--ring-main-error-components)); /* #DB5C5C */
|
|
40
|
+
--ring-main-error-hover-components: 189, 87, 87;
|
|
41
|
+
--ring-main-error-hover-color: rgb(var(--ring-main-error-hover-components)); /* #BD5757 */
|
|
42
|
+
--ring-main-warning-components: 224, 136, 85;
|
|
43
|
+
--ring-main-warning-color: rgb(var(--ring-main-warning-components)); /* #E08855 */
|
|
44
|
+
--ring-main-warning-hover-components: 199, 125, 85;
|
|
45
|
+
--ring-main-warning-hover-color: rgb(var(--ring-main-warning-hover-components)); /* #C77D55 */
|
|
42
46
|
--ring-icon-error-components: 227, 119, 116;
|
|
43
47
|
--ring-icon-error-color: rgb(var(--ring-icon-error-components)); /* #E37774 */ /* TODO: remove in 8.0 in favor of --ring-error-color */
|
|
44
|
-
--ring-icon-warning-components:
|
|
45
|
-
--ring-icon-warning-color: rgb(var(--ring-icon-warning-components)); /* #
|
|
46
|
-
--ring-icon-success-components:
|
|
47
|
-
--ring-icon-success-color: rgb(var(--ring-icon-success-components)); /* #
|
|
48
|
+
--ring-icon-warning-components: 224, 136, 85;
|
|
49
|
+
--ring-icon-warning-color: rgb(var(--ring-icon-warning-components)); /* #E08855 */
|
|
50
|
+
--ring-icon-success-components: 95, 173, 101;
|
|
51
|
+
--ring-icon-success-color: rgb(var(--ring-icon-success-components)); /* #5FAD65 */
|
|
52
|
+
--ring-icon-highlight-components: 214, 174, 88;
|
|
53
|
+
--ring-icon-highlight-color: rgb(var(--ring-icon-highlight-components)); /* #D6AE58 */
|
|
54
|
+
--ring-icon-highlight-hover-components: 186, 151, 82;
|
|
55
|
+
--ring-icon-highlight-hover-color: rgb(var(--ring-icon-highlight-hover-components)); /* #BA9752 */
|
|
48
56
|
--ring-popup-border-components: 57, 59, 64;
|
|
49
57
|
--ring-popup-border-color: rgb(var(--ring-popup-border-components)); /* #393B40 */
|
|
50
58
|
--ring-popup-shadow-color: rgba(0, 0, 0, 0.31);
|
|
@@ -69,10 +77,10 @@
|
|
|
69
77
|
--ring-link-hover-color: rgb(var(--ring-link-hover-components)); /* #6B9BFA */
|
|
70
78
|
--ring-error-components: 227, 119, 116;
|
|
71
79
|
--ring-error-color: rgb(var(--ring-error-components)); /* #E37774 */
|
|
72
|
-
--ring-warning-components:
|
|
73
|
-
--ring-warning-color: rgb(var(--ring-warning-components)); /* #
|
|
74
|
-
--ring-success-components:
|
|
75
|
-
--ring-success-color: rgb(var(--ring-success-components)); /* #
|
|
80
|
+
--ring-warning-components: 224, 136, 85;
|
|
81
|
+
--ring-warning-color: rgb(var(--ring-warning-components)); /* #E08855 */ /* Prefer using warning icon + regular text color */
|
|
82
|
+
--ring-success-components: 95, 173, 101;
|
|
83
|
+
--ring-success-color: rgb(var(--ring-success-components)); /* #5FAD65 */ /* Prefer using success icon + regular text color */
|
|
76
84
|
--ring-text-components: 223, 225, 229;
|
|
77
85
|
--ring-text-color: rgb(var(--ring-text-components)); /* #DFE1E5 */
|
|
78
86
|
--ring-active-text-components: 255, 255, 255;
|
|
@@ -104,8 +112,10 @@
|
|
|
104
112
|
--ring-tag-hover-background-color: rgb(var(--ring-tag-hover-background-components)); /* #393B40 */
|
|
105
113
|
--ring-removed-background-components: 94, 56, 56;
|
|
106
114
|
--ring-removed-background-color: rgb(var(--ring-removed-background-components)); /* #5E3838 */
|
|
107
|
-
--ring-warning-background-components:
|
|
108
|
-
--ring-warning-background-color: rgb(var(--ring-warning-background-components)); /* #
|
|
115
|
+
--ring-warning-background-components: 97, 68, 56;
|
|
116
|
+
--ring-warning-background-color: rgb(var(--ring-warning-background-components)); /* #614438 */
|
|
117
|
+
--ring-highlight-background-components: 94, 77, 51;
|
|
118
|
+
--ring-highlight-background-color: rgb(var(--ring-highlight-background-components)); /* #5E4D33 */
|
|
109
119
|
--ring-added-background-components: 55, 82, 57;
|
|
110
120
|
--ring-added-background-color: rgb(var(--ring-added-background-components)); /* #375239 */
|
|
111
121
|
--ring-disabled-background-components: 57, 59, 64;
|
|
@@ -119,8 +129,10 @@
|
|
|
119
129
|
--ring-table-loader-background-color: rgba(var(--ring-content-background-components), 0.5); /* #2B2D3050 */
|
|
120
130
|
--ring-removed-subtle-background-components: 64, 41, 41;
|
|
121
131
|
--ring-removed-subtle-background-color: rgb(var(--ring-removed-subtle-background-components)); /* #402929 */
|
|
122
|
-
--ring-warning-subtle-background-components:
|
|
123
|
-
--ring-warning-subtle-background-color: rgb(var(--ring-warning-subtle-background-components)); /* #
|
|
132
|
+
--ring-warning-subtle-background-components: 69, 50, 43;
|
|
133
|
+
--ring-warning-subtle-background-color: rgb(var(--ring-warning-subtle-background-components)); /* #45322B */
|
|
134
|
+
--ring-highlight-subtle-background-components: 61, 50, 35;
|
|
135
|
+
--ring-highlight-subtle-background-color: rgb(var(--ring-highlight-subtle-background-components)); /* #3D3223 */
|
|
124
136
|
--ring-added-subtle-background-components: 37, 54, 39;
|
|
125
137
|
--ring-added-subtle-background-color: rgb(var(--ring-added-subtle-background-components)); /* #253627 */
|
|
126
138
|
|
|
@@ -129,10 +141,9 @@
|
|
|
129
141
|
--ring-code-background-color: rgb(var(--ring-code-background-components)); /* #1E1F22 */
|
|
130
142
|
--ring-code-components: 189, 192, 201;
|
|
131
143
|
--ring-code-color: rgb(var(--ring-code-components)); /* #BDC0C9 */
|
|
132
|
-
--ring-code-comment-
|
|
133
|
-
--ring-code-
|
|
134
|
-
--ring-code-meta-
|
|
135
|
-
--ring-code-meta-color: rgb(var(--ring-code-meta-components)); /* #B8B167 */
|
|
144
|
+
--ring-code-comment-color: var(--ring-secondary-color);
|
|
145
|
+
--ring-code-meta-components: 86, 168, 245;
|
|
146
|
+
--ring-code-meta-color: rgb(var(--ring-code-meta-components)); /* #56A8F5 */
|
|
136
147
|
--ring-code-keyword-components: 214, 154, 107;
|
|
137
148
|
--ring-code-keyword-color: rgb(var(--ring-code-keyword-components)); /* #D69A6B */
|
|
138
149
|
--ring-code-tag-background-components: 67, 69, 74;
|
|
@@ -7,8 +7,17 @@ export type IconType = ComponentType<SVGAttributes<SVGSVGElement>>;
|
|
|
7
7
|
export interface IconProps extends HTMLAttributes<HTMLElement> {
|
|
8
8
|
color: Color;
|
|
9
9
|
glyph: string | IconType | null;
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated Use icons with appropriate intrinsic sizes instead
|
|
12
|
+
*/
|
|
10
13
|
height?: number | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated Use icons with appropriate intrinsic sizes instead
|
|
16
|
+
*/
|
|
11
17
|
size?: Size | number | null | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated Use icons with appropriate intrinsic sizes instead
|
|
20
|
+
*/
|
|
12
21
|
width?: number | undefined;
|
|
13
22
|
loading?: boolean | null | undefined;
|
|
14
23
|
suppressSizeWarning?: boolean | null | undefined;
|
|
@@ -65,7 +65,7 @@ export declare class Input extends PureComponent<InputProps> {
|
|
|
65
65
|
stretch(el: HTMLElement | null | undefined): void;
|
|
66
66
|
adapt(): void;
|
|
67
67
|
inputRef: (el: HTMLInputElement | HTMLTextAreaElement | null) => void;
|
|
68
|
-
composedInputRef: import("memoize-one").MemoizedFn<(...refs: (Ref<HTMLInputElement | HTMLTextAreaElement> | undefined)[]) => (value:
|
|
68
|
+
composedInputRef: import("memoize-one").MemoizedFn<(...refs: (Ref<HTMLInputElement | HTMLTextAreaElement> | undefined)[]) => (value: T | null) => void>;
|
|
69
69
|
clear: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
70
70
|
handleInputChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
71
71
|
handleTextareaChange: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/HY6d4uE1xxaQXCMG9fe6Y2/RingUI-(Internal)?node-id=7538-7763
|
|
2
|
+
const figma = require('figma');
|
|
3
|
+
|
|
4
|
+
const instance = figma.selectedInstance;
|
|
5
|
+
const size = instance.getString('Size');
|
|
6
|
+
const state = instance.getString('State');
|
|
7
|
+
const formVariant = instance.getBoolean('Form variant');
|
|
8
|
+
const icon = instance.getBoolean('Icon');
|
|
9
|
+
const clearable = instance.getBoolean('Clearable');
|
|
10
|
+
const hasLabel = instance.getBoolean('Label');
|
|
11
|
+
const label = instance.findText('Label').textContent;
|
|
12
|
+
const hasHelpText = instance.getBoolean('Help text');
|
|
13
|
+
const helpText = instance.findText('Help text').textContent;
|
|
14
|
+
const hasText = instance.getBoolean('Text');
|
|
15
|
+
const text = instance.findText('Text').textContent;
|
|
16
|
+
const hasPlaceholder = instance.getBoolean('Placeholder');
|
|
17
|
+
const placeholder = instance.findText('Placeholder').textContent;
|
|
18
|
+
|
|
19
|
+
const imports = ["import Input from '@jetbrains/ring-ui/components/input/input'"];
|
|
20
|
+
const props = [];
|
|
21
|
+
const DEFAULT_SIZE = 'M';
|
|
22
|
+
const isDefaultSize = size === DEFAULT_SIZE;
|
|
23
|
+
|
|
24
|
+
if (!isDefaultSize) {
|
|
25
|
+
imports.push("import {ControlsHeight} from '@jetbrains/ring-ui/components/global/controls-height'");
|
|
26
|
+
props.push(`height={ControlsHeight.${size}}`);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
switch (state) {
|
|
30
|
+
case 'disabled':
|
|
31
|
+
props.push('disabled');
|
|
32
|
+
break;
|
|
33
|
+
case 'error':
|
|
34
|
+
props.push('error=""');
|
|
35
|
+
break;
|
|
36
|
+
default:
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (formVariant) {
|
|
40
|
+
imports.push("import {LabelType} from '../control-label/control-label'");
|
|
41
|
+
props.push('labelType={LabelType.FORM}');
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (icon) {
|
|
45
|
+
imports.push("import searchIcon from '@jetbrains/icons/search'");
|
|
46
|
+
props.push('icon={searchIcon}');
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (clearable) {
|
|
50
|
+
props.push('onClear={() => {}}');
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (hasLabel) {
|
|
54
|
+
props.push(`label="${label}"`);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (hasHelpText) {
|
|
58
|
+
props.push(`help="${helpText}"`);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (hasText) {
|
|
62
|
+
props.push(`defaultValue="${text}"`);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (hasPlaceholder) {
|
|
66
|
+
props.push(`placeholder="${placeholder}"`);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export default {
|
|
70
|
+
id: 'input',
|
|
71
|
+
example: figma.code`${imports.join('\n')}
|
|
72
|
+
|
|
73
|
+
<Input ${props.map(prop => `${prop} `).join('')}/>`,
|
|
74
|
+
};
|
|
@@ -10,7 +10,7 @@ export declare enum Type {
|
|
|
10
10
|
SEPARATOR = 0,
|
|
11
11
|
LINK = 1,
|
|
12
12
|
ITEM = 2,
|
|
13
|
-
HINT = 3,
|
|
13
|
+
HINT = 3,// doesn't work, TODO remove in 8.0
|
|
14
14
|
CUSTOM = 4,
|
|
15
15
|
TITLE = 5,
|
|
16
16
|
MARGIN = 6
|
|
@@ -42,6 +42,9 @@ export type ListDataItem<T = unknown> = T & Partial<Omit<LinkProps, 'onClick' |
|
|
|
42
42
|
subavatar?: string | null | undefined;
|
|
43
43
|
glyph?: IconType | string | null | undefined;
|
|
44
44
|
icon?: string | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* @deprecated Use icons with appropriate intrinsic sizes instead
|
|
47
|
+
*/
|
|
45
48
|
iconSize?: Size | null | undefined;
|
|
46
49
|
suppressSizeWarning?: boolean | null | undefined;
|
|
47
50
|
rightGlyph?: IconType | string | null | undefined;
|
package/components/list/list.js
CHANGED
|
@@ -115,16 +115,21 @@ export default class List extends Component {
|
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
shouldComponentUpdate(nextProps, nextState) {
|
|
118
|
-
return (nextProps
|
|
118
|
+
return (Object.keys(nextProps).some(key => !Object.is(nextProps[key], this.props[key])) ||
|
|
119
119
|
Object.keys(nextState).some(key => nextState[key] !== this.state[key]));
|
|
120
120
|
}
|
|
121
121
|
componentDidUpdate(prevProps) {
|
|
122
122
|
if (this.virtualizedList && prevProps.data !== this.props.data) {
|
|
123
123
|
this.virtualizedList.recomputeRowHeights();
|
|
124
124
|
}
|
|
125
|
+
const { activeIndex } = this.state;
|
|
126
|
+
const isActiveItemRetainedPosition = activeIndex
|
|
127
|
+
? prevProps.data[activeIndex]?.key === this.props.data[activeIndex]?.key
|
|
128
|
+
: false;
|
|
125
129
|
if (this.props.activeIndex == null &&
|
|
126
130
|
getDataHash(this.props.data) !== getDataHash(prevProps.data) &&
|
|
127
|
-
shouldActivateFirstItem(this.props)
|
|
131
|
+
shouldActivateFirstItem(this.props) &&
|
|
132
|
+
!isActiveItemRetainedPosition) {
|
|
128
133
|
this.activateFirst();
|
|
129
134
|
}
|
|
130
135
|
this.checkOverflow();
|
|
@@ -18,6 +18,6 @@ export default class ListCustom extends PureComponent {
|
|
|
18
18
|
}, this.props['data-test']);
|
|
19
19
|
const content = typeof template === 'function' ? template(this.props) : template;
|
|
20
20
|
const TagName = tagName || 'span';
|
|
21
|
-
return (_jsx(TagName, { role: role || 'button', tabIndex: tabIndex, onClick: onClick, onKeyPress: this.handleKeyPress, onMouseOver: onMouseOver, onFocus: onMouseOver, onMouseUp: onMouseUp, className: classes, "data-test": dataTest, children: content }));
|
|
21
|
+
return (_jsx(TagName, { role: role || 'button', "aria-disabled": disabled, tabIndex: tabIndex, onClick: onClick, onKeyPress: this.handleKeyPress, onMouseOver: onMouseOver, onFocus: onMouseOver, onMouseUp: onMouseUp, className: classes, "data-test": dataTest, children: content }));
|
|
22
22
|
}
|
|
23
23
|
}
|
|
@@ -262,7 +262,7 @@ export default class Select<T = unknown> extends Component<SelectProps<T>, Selec
|
|
|
262
262
|
private _getAvatar;
|
|
263
263
|
filter?: HTMLInputElement | null;
|
|
264
264
|
filterRef: (el: HTMLInputElement | null) => void;
|
|
265
|
-
composedFilterRef: import("memoize-one").MemoizedFn<(...refs: (Ref<HTMLInputElement> | undefined)[]) => (value:
|
|
265
|
+
composedFilterRef: import("memoize-one").MemoizedFn<(...refs: (Ref<HTMLInputElement> | undefined)[]) => (value: T_1 | null) => void>;
|
|
266
266
|
getShortcutsMap(): {
|
|
267
267
|
enter: () => true | undefined;
|
|
268
268
|
esc: (event: KeyboardEvent) => boolean | undefined;
|
|
@@ -126,7 +126,7 @@ export default class SelectPopup<T = unknown> extends PureComponent<SelectPopupP
|
|
|
126
126
|
list?: List<T> | null;
|
|
127
127
|
listRef: (el: List<T> | null) => void;
|
|
128
128
|
filterRef: (el: HTMLInputElement | null) => void;
|
|
129
|
-
composedFilterRef: import("memoize-one").MemoizedFn<(...refs: (Ref<HTMLInputElement> | undefined)[]) => (value:
|
|
129
|
+
composedFilterRef: import("memoize-one").MemoizedFn<(...refs: (Ref<HTMLInputElement> | undefined)[]) => (value: T_1 | null) => void>;
|
|
130
130
|
shortcutsScope: string;
|
|
131
131
|
shortcutsMap: {
|
|
132
132
|
tab: (event: Event) => void;
|
|
@@ -55,7 +55,7 @@ export default class Row<T extends SelectionItem> extends PureComponent<RowProps
|
|
|
55
55
|
onDoubleClick: () => void;
|
|
56
56
|
row?: HTMLElement | null;
|
|
57
57
|
rowRef: (el: HTMLElement | null) => void;
|
|
58
|
-
composedRowRef: import("memoize-one").MemoizedFn<(...refs: (React.Ref<HTMLElement> | undefined)[]) => (value:
|
|
58
|
+
composedRowRef: import("memoize-one").MemoizedFn<(...refs: (React.Ref<HTMLElement> | undefined)[]) => (value: T_1 | null) => void>;
|
|
59
59
|
render(): import("react/jsx-runtime").JSX.Element;
|
|
60
60
|
}
|
|
61
61
|
export type RowAttrs<T extends SelectionItem> = React.JSX.LibraryManagedAttributes<typeof Row, RowProps<T>>;
|
|
@@ -50,7 +50,7 @@ export interface TableProps<T extends SelectionItem> extends FocusSensorAddProps
|
|
|
50
50
|
stickyHeaderOffset?: string | undefined;
|
|
51
51
|
renderEmpty?: (() => ReactNode) | null | undefined;
|
|
52
52
|
RowComponent: typeof Row;
|
|
53
|
-
|
|
53
|
+
renderLoader?: ((loaderClassName?: string) => ReactNode) | null | undefined;
|
|
54
54
|
}
|
|
55
55
|
/**
|
|
56
56
|
* Interactive table with selection and keyboard navigation support.
|
|
@@ -109,7 +109,7 @@ export class Table extends PureComponent {
|
|
|
109
109
|
window.scrollTo(scrollX, scrollY);
|
|
110
110
|
};
|
|
111
111
|
render() {
|
|
112
|
-
const { data, selection, columns, caption, getItemKey, selectable, focused, isItemSelectable, getItemLevel, getItemClassName, getMetaColumnClassName, getItemDataTest, draggable, alwaysShowDragHandle, dragHandleTitle, loading, onSort, sortKey, sortOrder, loaderClassName, stickyHeader, stickyHeaderOffset, isItemCollapsible, isParentCollapsible, isItemCollapsed, onItemCollapse, onItemExpand, isDisabledSelectionVisible, getCheckboxTooltip, onItemDoubleClick, onItemClick, renderEmpty, RowComponent,
|
|
112
|
+
const { data, selection, columns, caption, getItemKey, selectable, focused, isItemSelectable, getItemLevel, getItemClassName, getMetaColumnClassName, getItemDataTest, draggable, alwaysShowDragHandle, dragHandleTitle, loading, onSort, sortKey, sortOrder, loaderClassName, stickyHeader, stickyHeaderOffset, isItemCollapsible, isParentCollapsible, isItemCollapsed, onItemCollapse, onItemExpand, isDisabledSelectionVisible, getCheckboxTooltip, onItemDoubleClick, onItemClick, renderEmpty, RowComponent, renderLoader, } = this.props;
|
|
113
113
|
// NOTE: Do not construct new object per render because it causes all rows rerendering
|
|
114
114
|
const columnsArray = typeof columns === 'function' ? columns(null) : columns;
|
|
115
115
|
const headerProps = {
|
|
@@ -152,7 +152,7 @@ export class Table extends PureComponent {
|
|
|
152
152
|
const row = (_createElement(RowComponent, { innerRef: ref, level: getItemLevel(value), item: value, showFocus: selection.isFocused(value), autofocus: selection.isFocused(value), focused: focused && selection.isFocused(value), selectable: selectable && isItemSelectable(value), selected: selectable && selection.isSelected(value), onFocus: this.onRowFocus, onSelect: this.onRowSelect, onDoubleClick: onItemDoubleClick, onClick: onItemClick, collapsible: isItemCollapsible(value), parentCollapsible: isParentCollapsible(value), collapsed: isItemCollapsed(value), onCollapse: onItemCollapse, onExpand: onItemExpand, showDisabledSelection: isDisabledSelectionVisible(value), checkboxTooltip: getCheckboxTooltip(value), className: classNames(getItemClassName(value), { [style.draggingRow]: isDragged }), metaColumnClassName: getMetaColumnClassName(value), draggable: draggable, alwaysShowDragHandle: alwaysShowDragHandle, dragHandleTitle: dragHandleTitle, columns: columns, "data-test": getItemDataTest(value), ...restProps, key: restProps.key ?? getItemKey(value) }));
|
|
153
153
|
return isDragged ? (_jsx("table", { style: { ...props.style }, className: style.draggingTable, children: _jsx("tbody", { children: row }) })) : (row);
|
|
154
154
|
};
|
|
155
|
-
return (_jsxs("div", { className: wrapperClasses, "data-test": "ring-table-wrapper", ref: this.props.innerRef, children: [focused && _jsx(Shortcuts, { map: this.props.shortcutsMap, scope: this.state.shortcutsScope }), _jsx("div", { role: "presentation", onMouseDown: this.onMouseDown, children: draggable ? (_jsx(List, { values: data, renderList: renderList, renderItem: renderItem, onChange: this.onSortEnd })) : (renderList({ children: data.map((value, index) => renderItem({ value, index })) })) }), loading && (_jsx("div", { className: style.loadingOverlay, children:
|
|
155
|
+
return (_jsxs("div", { className: wrapperClasses, "data-test": "ring-table-wrapper", ref: this.props.innerRef, children: [focused && _jsx(Shortcuts, { map: this.props.shortcutsMap, scope: this.state.shortcutsScope }), _jsx("div", { role: "presentation", onMouseDown: this.onMouseDown, children: draggable ? (_jsx(List, { values: data, renderList: renderList, renderItem: renderItem, onChange: this.onSortEnd })) : (renderList({ children: data.map((value, index) => renderItem({ value, index })) })) }), loading && (_jsx("div", { className: style.loadingOverlay, children: renderLoader ? renderLoader(loaderClassName) : _jsx(Loader, { className: loaderClassName }) }))] }));
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
158
|
const getContainer = () => disableHoverHOC(selectionShortcutsHOC(focusSensorHOC(Table)));
|
|
@@ -55,7 +55,12 @@ export default class UserAgreementService {
|
|
|
55
55
|
userConsent = DEFAULT_CONSENT;
|
|
56
56
|
intervalId;
|
|
57
57
|
startChecking = () => {
|
|
58
|
-
this.intervalId = window.setInterval(this.checkConsentAndShowDialog
|
|
58
|
+
this.intervalId = window.setInterval(() => this.checkConsentAndShowDialog().catch(reason => {
|
|
59
|
+
if (reason === 'Postponed') {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
throw reason;
|
|
63
|
+
}), this.interval);
|
|
59
64
|
window.addEventListener('storage', this.onStorageEvent);
|
|
60
65
|
this.checkConsentAndShowDialog();
|
|
61
66
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jetbrains/ring-ui",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.35",
|
|
4
4
|
"description": "JetBrains UI library",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "JetBrains"
|
|
@@ -85,8 +85,8 @@
|
|
|
85
85
|
},
|
|
86
86
|
"readmeFilename": "README.md",
|
|
87
87
|
"devDependencies": {
|
|
88
|
-
"@babel/cli": "^7.
|
|
89
|
-
"@babel/eslint-parser": "^7.
|
|
88
|
+
"@babel/cli": "^7.27.0",
|
|
89
|
+
"@babel/eslint-parser": "^7.27.0",
|
|
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",
|
|
@@ -98,28 +98,28 @@
|
|
|
98
98
|
"@jetbrains/logos": "3.0.0-canary.734b213.0",
|
|
99
99
|
"@jetbrains/rollup-css-plugin": "./packages/rollup-css-plugin",
|
|
100
100
|
"@jetbrains/stylelint-config": "^4.0.2",
|
|
101
|
-
"@primer/octicons": "^19.15.
|
|
101
|
+
"@primer/octicons": "^19.15.1",
|
|
102
102
|
"@rollup/plugin-babel": "^6.0.4",
|
|
103
103
|
"@rollup/plugin-json": "^6.1.0",
|
|
104
|
-
"@rollup/plugin-node-resolve": "^16.0.
|
|
104
|
+
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
105
105
|
"@rollup/plugin-replace": "^6.0.2",
|
|
106
|
-
"@storybook/addon-a11y": "8.
|
|
107
|
-
"@storybook/addon-docs": "8.
|
|
108
|
-
"@storybook/addon-essentials": "8.
|
|
109
|
-
"@storybook/addon-themes": "^8.
|
|
110
|
-
"@storybook/components": "8.
|
|
106
|
+
"@storybook/addon-a11y": "8.6.11",
|
|
107
|
+
"@storybook/addon-docs": "8.6.11",
|
|
108
|
+
"@storybook/addon-essentials": "8.6.11",
|
|
109
|
+
"@storybook/addon-themes": "^8.6.11",
|
|
110
|
+
"@storybook/components": "8.6.11",
|
|
111
111
|
"@storybook/csf": "^0.1.13",
|
|
112
|
-
"@storybook/manager-api": "8.
|
|
113
|
-
"@storybook/preview-api": "8.
|
|
114
|
-
"@storybook/react": "8.
|
|
115
|
-
"@storybook/react-webpack5": "8.
|
|
116
|
-
"@storybook/test-runner": "^0.
|
|
117
|
-
"@storybook/theming": "8.
|
|
112
|
+
"@storybook/manager-api": "8.6.11",
|
|
113
|
+
"@storybook/preview-api": "8.6.11",
|
|
114
|
+
"@storybook/react": "8.6.11",
|
|
115
|
+
"@storybook/react-webpack5": "8.6.11",
|
|
116
|
+
"@storybook/test-runner": "^0.22.0",
|
|
117
|
+
"@storybook/theming": "8.6.11",
|
|
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",
|
|
121
|
-
"@types/chai": "^5.
|
|
122
|
-
"@types/chai-as-promised": "^8.0.
|
|
121
|
+
"@types/chai": "^5.2.1",
|
|
122
|
+
"@types/chai-as-promised": "^8.0.2",
|
|
123
123
|
"@types/chai-dom": "0.0.10",
|
|
124
124
|
"@types/chai-enzyme": "^0.6.13",
|
|
125
125
|
"@types/enzyme": "^3.10.18",
|
|
@@ -131,32 +131,32 @@
|
|
|
131
131
|
"@types/sinon-chai": "^4.0.0",
|
|
132
132
|
"@types/webpack-env": "^1.18.8",
|
|
133
133
|
"@vitejs/plugin-react": "^4.3.4",
|
|
134
|
-
"@vitest/eslint-plugin": "^1.1.
|
|
134
|
+
"@vitest/eslint-plugin": "^1.1.38",
|
|
135
135
|
"@wojtekmaj/enzyme-adapter-react-17": "^0.8.0",
|
|
136
|
-
"acorn": "^8.14.
|
|
136
|
+
"acorn": "^8.14.1",
|
|
137
137
|
"axe-playwright": "^2.1.0",
|
|
138
138
|
"babel-plugin-require-context-hook": "^1.0.0",
|
|
139
|
-
"caniuse-lite": "^1.0.
|
|
139
|
+
"caniuse-lite": "^1.0.30001707",
|
|
140
140
|
"chai": "^5.2.0",
|
|
141
141
|
"chai-as-promised": "^8.0.1",
|
|
142
142
|
"chai-dom": "^1.10.0",
|
|
143
143
|
"chai-enzyme": "1.0.0-beta.1",
|
|
144
144
|
"cheerio": "^1.0.0-rc.12",
|
|
145
|
-
"chromatic": "^11.
|
|
146
|
-
"core-js": "^3.
|
|
145
|
+
"chromatic": "^11.27.0",
|
|
146
|
+
"core-js": "^3.41.0",
|
|
147
147
|
"cpy-cli": "^5.0.0",
|
|
148
148
|
"dotenv-cli": "^8.0.0",
|
|
149
149
|
"enzyme": "^3.11.0",
|
|
150
|
-
"eslint": "^9.
|
|
151
|
-
"eslint-config-prettier": "^10.
|
|
150
|
+
"eslint": "^9.23.0",
|
|
151
|
+
"eslint-config-prettier": "^10.1.1",
|
|
152
152
|
"eslint-formatter-jslint-xml": "^8.40.0",
|
|
153
153
|
"eslint-import-resolver-webpack": "^0.13.10",
|
|
154
154
|
"eslint-plugin-import": "^2.31.0",
|
|
155
155
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
156
|
-
"eslint-plugin-prettier": "^5.2.
|
|
156
|
+
"eslint-plugin-prettier": "^5.2.5",
|
|
157
157
|
"eslint-plugin-react": "^7.37.4",
|
|
158
|
-
"eslint-plugin-react-hooks": "^5.
|
|
159
|
-
"eslint-plugin-storybook": "^0.
|
|
158
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
159
|
+
"eslint-plugin-storybook": "^0.12.0",
|
|
160
160
|
"events": "^3.3.0",
|
|
161
161
|
"glob": "^11.0.1",
|
|
162
162
|
"globals": "^16.0.0",
|
|
@@ -167,30 +167,30 @@
|
|
|
167
167
|
"jest": "~29.7.0",
|
|
168
168
|
"jest-environment-jsdom": "^29.7.0",
|
|
169
169
|
"jest-teamcity": "^1.12.0",
|
|
170
|
-
"lint-staged": "^15.
|
|
170
|
+
"lint-staged": "^15.5.0",
|
|
171
171
|
"markdown-it": "^14.1.0",
|
|
172
172
|
"merge-options": "^3.0.4",
|
|
173
173
|
"pinst": "^3.0.0",
|
|
174
|
-
"prettier": "^3.5.
|
|
174
|
+
"prettier": "^3.5.3",
|
|
175
175
|
"raw-loader": "^4.0.2",
|
|
176
176
|
"react": "^18.3.1",
|
|
177
177
|
"react-dom": "^18.3.1",
|
|
178
|
-
"react-test-renderer": "^19.
|
|
178
|
+
"react-test-renderer": "^19.1.0",
|
|
179
179
|
"regenerator-runtime": "^0.14.1",
|
|
180
180
|
"rimraf": "^6.0.1",
|
|
181
|
-
"rollup": "^4.
|
|
181
|
+
"rollup": "^4.38.0",
|
|
182
182
|
"rollup-plugin-clear": "^2.0.7",
|
|
183
|
-
"sinon": "^
|
|
183
|
+
"sinon": "^20.0.0",
|
|
184
184
|
"sinon-chai": "^4.0.0",
|
|
185
185
|
"storage-mock": "^2.1.0",
|
|
186
|
-
"storybook": "8.
|
|
187
|
-
"stylelint": "^16.
|
|
186
|
+
"storybook": "8.6.11",
|
|
187
|
+
"stylelint": "^16.17.0",
|
|
188
188
|
"svg-inline-loader": "^0.8.2",
|
|
189
189
|
"teamcity-service-messages": "^0.1.14",
|
|
190
|
-
"terser-webpack-plugin": "^5.3.
|
|
191
|
-
"typescript": "~5.
|
|
192
|
-
"typescript-eslint": "^8.
|
|
193
|
-
"vitest": "^3.
|
|
190
|
+
"terser-webpack-plugin": "^5.3.14",
|
|
191
|
+
"typescript": "~5.8.2",
|
|
192
|
+
"typescript-eslint": "^8.28.0",
|
|
193
|
+
"vitest": "^3.1.1",
|
|
194
194
|
"vitest-teamcity-reporter": "^0.3.1",
|
|
195
195
|
"wallaby-webpack": "^3.9.16",
|
|
196
196
|
"webpack": "^5.98.0",
|
|
@@ -217,16 +217,16 @@
|
|
|
217
217
|
}
|
|
218
218
|
},
|
|
219
219
|
"dependencies": {
|
|
220
|
-
"@babel/core": "^7.26.
|
|
221
|
-
"@babel/preset-typescript": "^7.
|
|
220
|
+
"@babel/core": "^7.26.10",
|
|
221
|
+
"@babel/preset-typescript": "^7.27.0",
|
|
222
222
|
"@jetbrains/babel-preset-jetbrains": "^2.4.0",
|
|
223
|
-
"@jetbrains/icons": "^5.
|
|
223
|
+
"@jetbrains/icons": "^5.8.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
227
|
"@types/react-virtualized": "9.22.2",
|
|
228
228
|
"@types/util-deprecate": "^1.0.4",
|
|
229
|
-
"babel-loader": "
|
|
229
|
+
"babel-loader": "10.0.0",
|
|
230
230
|
"babel-plugin-transform-define": "^2.1.4",
|
|
231
231
|
"browserslist": "^4.24.4",
|
|
232
232
|
"change-case": "^4.1.1",
|
|
@@ -251,7 +251,7 @@
|
|
|
251
251
|
"postcss-loader": "^8.1.1",
|
|
252
252
|
"postcss-modules-values-replace": "^4.2.0",
|
|
253
253
|
"postcss-preset-env": "^10.1.5",
|
|
254
|
-
"react-movable": "^3.4.
|
|
254
|
+
"react-movable": "^3.4.1",
|
|
255
255
|
"react-virtualized": "^9.22.6",
|
|
256
256
|
"react-waypoint": "^10.3.0",
|
|
257
257
|
"scrollbar-width": "^3.1.1",
|