@jetbrains/ring-ui 7.0.60-beta.2 → 7.0.61
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/banner/banner.css +102 -0
- package/components/banner/banner.d.ts +19 -0
- package/components/banner/banner.js +38 -0
- package/components/button/button.css +2 -1
- package/components/button/button.d.ts +1 -1
- package/components/button/button.js +1 -1
- package/components/button-group/button-group.css +2 -1
- package/components/checkbox/checkbox.css +2 -1
- package/components/date-picker/date-picker.css +2 -2
- package/components/date-picker/date-picker.js +2 -2
- package/components/error-bubble/error-bubble.css +2 -1
- package/components/error-bubble/error-bubble.js +1 -1
- package/components/global/configuration.d.ts +11 -0
- package/components/global/configuration.js +21 -0
- package/components/global/controls-height.d.ts +4 -7
- package/components/global/controls-height.js +8 -12
- package/components/global/variables.css +3 -1
- package/components/header/header.css +2 -1
- package/components/header/services.js +1 -1
- package/components/input/input.d.ts +3 -2
- package/components/input/input.js +1 -1
- package/components/input-size/input-size.css +2 -1
- package/components/loader/__mocks__/loader__core.js +5 -0
- package/components/loader-inline/loader-inline.css +2 -1
- package/components/message/message.js +1 -1
- package/components/old-browsers-message/__mocks__/old-browsers-message.js +1 -0
- package/components/popup/popup.d.ts +1 -1
- package/components/popup/popup.js +12 -5
- package/components/popup-menu/popup-menu.d.ts +0 -1
- package/components/progress-bar/progress-bar.css +2 -1
- package/components/query-assist/query-assist.js +1 -1
- package/components/select/select.d.ts +3 -2
- package/components/select/select.js +1 -1
- package/components/select/select__popup.js +1 -1
- package/components/tabs/collapsible-more.js +1 -1
- package/components/tabs/tabs.css +2 -1
- package/components/tags-input/tags-input.d.ts +3 -2
- package/components/tags-input/tags-input.js +1 -1
- package/components/tooltip/tooltip.css +2 -1
- package/components/tooltip/tooltip.js +7 -0
- package/components/user-card/tooltip.js +1 -1
- package/package.json +63 -69
- package/jslint-xml.js +0 -39
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
.banner {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: flex-start;
|
|
4
|
+
|
|
5
|
+
padding: calc(var(--ring-unit) * 1.5);
|
|
6
|
+
|
|
7
|
+
color: var(--ring-text-color);
|
|
8
|
+
border: 1px solid var(--ring-borders-color);
|
|
9
|
+
|
|
10
|
+
border-radius: var(--ring-unit);
|
|
11
|
+
|
|
12
|
+
line-height: var(--ring-line-height);
|
|
13
|
+
gap: var(--ring-unit);
|
|
14
|
+
|
|
15
|
+
&.inline {
|
|
16
|
+
border-right: none;
|
|
17
|
+
border-left: none;
|
|
18
|
+
border-radius: 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&.info {
|
|
22
|
+
border-color: var(--ring-border-hover-color);
|
|
23
|
+
background-color: var(--ring-main-container-light-color);
|
|
24
|
+
|
|
25
|
+
.icon {
|
|
26
|
+
color: var(--ring-main-color);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&.error {
|
|
31
|
+
border-color: var(--ring-error-border-color);
|
|
32
|
+
background-color: var(--ring-error-container-light-color);
|
|
33
|
+
|
|
34
|
+
.icon {
|
|
35
|
+
color: var(--ring-main-error-color);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&.success {
|
|
40
|
+
border-color: var(--ring-success-border-color);
|
|
41
|
+
background-color: var(--ring-success-container-light-color);
|
|
42
|
+
|
|
43
|
+
.icon {
|
|
44
|
+
color: var(--ring-main-success-color);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&.warning {
|
|
49
|
+
border-color: var(--ring-warning-border-color);
|
|
50
|
+
background-color: var(--ring-warning-container-light-color);
|
|
51
|
+
|
|
52
|
+
.icon {
|
|
53
|
+
color: var(--ring-main-warning-color);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&.purple {
|
|
58
|
+
border-color: var(--ring-purple-border-color);
|
|
59
|
+
background-color: var(--ring-purple-container-light-color);
|
|
60
|
+
|
|
61
|
+
.icon {
|
|
62
|
+
color: var(--ring-main-purple-color);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&.grey {
|
|
67
|
+
border-color: var(--ring-borders-color);
|
|
68
|
+
background-color: var(--ring-grey-container-light-color);
|
|
69
|
+
|
|
70
|
+
.icon {
|
|
71
|
+
color: var(--ring-secondary-color);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.title {
|
|
77
|
+
margin-bottom: calc(var(--ring-unit) / 2);
|
|
78
|
+
|
|
79
|
+
font-weight: var(--ring-font-weight-bold);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.description {
|
|
83
|
+
p {
|
|
84
|
+
margin: var(--ring-unit) 0;
|
|
85
|
+
|
|
86
|
+
&:first-child {
|
|
87
|
+
margin-top: 0;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&:last-child {
|
|
91
|
+
margin-bottom: 0;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.closeButtonWrapper {
|
|
97
|
+
margin-left: auto;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.closeButton {
|
|
101
|
+
color: var(--ring-text-color);
|
|
102
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface BannerTranslations {
|
|
3
|
+
close: string;
|
|
4
|
+
}
|
|
5
|
+
export interface BannerProps {
|
|
6
|
+
title?: React.ReactNode;
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
mode?: 'info' | 'error' | 'success' | 'warning' | 'purple' | 'grey';
|
|
9
|
+
withIcon?: boolean;
|
|
10
|
+
inline?: boolean;
|
|
11
|
+
onClose?: () => void;
|
|
12
|
+
closeButtonTitle?: string;
|
|
13
|
+
className?: string;
|
|
14
|
+
['data-test']?: string;
|
|
15
|
+
translations?: BannerTranslations;
|
|
16
|
+
}
|
|
17
|
+
export declare function Banner(props: BannerProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
declare const _default: React.MemoExoticComponent<typeof Banner>;
|
|
19
|
+
export default _default;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import classnames from 'classnames';
|
|
4
|
+
import infoIcon from '@jetbrains/icons/info-filled';
|
|
5
|
+
import exceptionIcon from '@jetbrains/icons/exception';
|
|
6
|
+
import successIcon from '@jetbrains/icons/success';
|
|
7
|
+
import warningIcon from '@jetbrains/icons/warning';
|
|
8
|
+
import closeIcon from '@jetbrains/icons/close';
|
|
9
|
+
import Icon from '../icon/icon';
|
|
10
|
+
import Link from '../link/link';
|
|
11
|
+
import Tooltip from '../tooltip/tooltip';
|
|
12
|
+
import styles from './banner.css';
|
|
13
|
+
export function Banner(props) {
|
|
14
|
+
const { title, children, mode = 'info', withIcon = false, inline = false, onClose, closeButtonTitle, className, ['data-test']: dataTest, translations = {
|
|
15
|
+
close: 'Close',
|
|
16
|
+
}, } = props;
|
|
17
|
+
let icon = infoIcon;
|
|
18
|
+
if (mode === 'error') {
|
|
19
|
+
icon = exceptionIcon;
|
|
20
|
+
}
|
|
21
|
+
else if (mode === 'success') {
|
|
22
|
+
icon = successIcon;
|
|
23
|
+
}
|
|
24
|
+
else if (mode === 'warning') {
|
|
25
|
+
icon = warningIcon;
|
|
26
|
+
}
|
|
27
|
+
return (_jsxs("div", { className: classnames({
|
|
28
|
+
[styles.banner]: true,
|
|
29
|
+
[styles.inline]: inline,
|
|
30
|
+
[styles.info]: mode === 'info',
|
|
31
|
+
[styles.error]: mode === 'error',
|
|
32
|
+
[styles.success]: mode === 'success',
|
|
33
|
+
[styles.warning]: mode === 'warning',
|
|
34
|
+
[styles.purple]: mode === 'purple',
|
|
35
|
+
[styles.grey]: mode === 'grey',
|
|
36
|
+
}, className), "data-test": dataTest, children: [withIcon && _jsx(Icon, { glyph: icon, className: styles.icon }), _jsxs("div", { children: [title && _jsx("div", { className: styles.title, children: title }), _jsx("div", { className: styles.description, children: children })] }), onClose && (_jsx(Tooltip, { title: closeButtonTitle ?? translations.close, className: styles.closeButtonWrapper, children: _jsx(Link, { className: styles.closeButton, pseudo: true, onClick: onClose, "aria-label": "Close", children: _jsx(Icon, { glyph: closeIcon }) }) }))] }));
|
|
37
|
+
}
|
|
38
|
+
export default React.memo(Banner);
|
|
@@ -51,7 +51,7 @@ export declare class Button extends PureComponent<ButtonProps> {
|
|
|
51
51
|
* @deprecated Use icons with appropriate intrinsic sizes instead
|
|
52
52
|
*/
|
|
53
53
|
static IconSize: typeof Size;
|
|
54
|
-
static contextType: React.Context<ControlsHeight>;
|
|
54
|
+
static contextType: React.Context<ControlsHeight | (() => ControlsHeight)>;
|
|
55
55
|
context: React.ContextType<typeof ControlsHeightContext>;
|
|
56
56
|
buttonRef: React.RefObject<HTMLButtonElement | null>;
|
|
57
57
|
render(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -40,7 +40,7 @@ export class Button extends PureComponent {
|
|
|
40
40
|
const classes = getButtonClasses({
|
|
41
41
|
...this.props,
|
|
42
42
|
inline: isInline,
|
|
43
|
-
height: height ?? this.context,
|
|
43
|
+
height: height ?? (typeof this.context === 'function' ? this.context() : this.context),
|
|
44
44
|
});
|
|
45
45
|
const content = (_jsxs(_Fragment, { children: [icon && (_jsx(Icon, { className: classNames(styles.icon, iconClassName), glyph: icon, size: iconSize, suppressSizeWarning: iconSuppressSizeWarning })), children, iconRight && _jsx(Icon, { className: classNames(styles.iconRight, iconRightClassName), glyph: iconRight }), dropdown && _jsx(Icon, { glyph: isInline ? chevron12pxDown : chevronDown, className: styles.dropdownIcon })] }));
|
|
46
46
|
const isDisabled = disabled || loader || undefined;
|
|
@@ -21,7 +21,7 @@ import { I18nContext } from '../i18n/i18n-context';
|
|
|
21
21
|
import DatePopup from './date-popup';
|
|
22
22
|
import styles from './date-picker.css';
|
|
23
23
|
import formats from './formats';
|
|
24
|
-
const PopupComponent = ({ hidden = false, className, popupRef, onClear, datePopupProps, onComplete, ...restProps }) => (_jsx(Popup, {
|
|
24
|
+
const PopupComponent = ({ hidden = false, className, popupRef, onClear, datePopupProps, onComplete, ...restProps }) => (_jsx(Popup, { hidden: hidden, className: className, ref: popupRef, directions: [
|
|
25
25
|
Popup.PopupProps.Directions.BOTTOM_RIGHT,
|
|
26
26
|
Popup.PopupProps.Directions.BOTTOM_LEFT,
|
|
27
27
|
Popup.PopupProps.Directions.TOP_LEFT,
|
|
@@ -152,7 +152,7 @@ export default class DatePicker extends PureComponent {
|
|
|
152
152
|
const classes = classNames(styles.datePicker, className, styles[`size${this.props.size}`], {
|
|
153
153
|
[styles.inline]: inline,
|
|
154
154
|
});
|
|
155
|
-
return (_jsx(Dropdown, { className: classes, disabled: this.props.disabled, "data-test": "ring-date-picker", anchor: inline ? (_jsx(Link, { "data-test-ring-dropdown-anchor": true, className: styles.anchor, disabled: this.props.disabled ?? false, pseudo: true, children: this.getAnchorText() })) : (_jsx(Button, { "data-test-ring-dropdown-anchor": true, className: styles.anchor, inline: false, disabled: this.props.disabled ?? false, ...this.props.buttonAttributes, children: anchorContent })), ...dropdownProps, children: _jsx(PopupComponent, { className: popupClassName,
|
|
155
|
+
return (_jsx(Dropdown, { className: classes, disabled: this.props.disabled, "data-test": "ring-date-picker", anchor: inline ? (_jsx(Link, { "data-test-ring-dropdown-anchor": true, className: styles.anchor, disabled: this.props.disabled ?? false, pseudo: true, children: this.getAnchorText() })) : (_jsx(Button, { "data-test-ring-dropdown-anchor": true, className: styles.anchor, inline: false, disabled: this.props.disabled ?? false, ...this.props.buttonAttributes, children: anchorContent })), ...dropdownProps, children: _jsx(PopupComponent, { className: popupClassName, popupRef: this.popupRef, onClear: clear ? this.clear : null, datePopupProps: {
|
|
156
156
|
...datePopupProps,
|
|
157
157
|
translations,
|
|
158
158
|
onChange: this.handleChange,
|
|
@@ -12,6 +12,6 @@ export default class ErrorBubble extends PureComponent {
|
|
|
12
12
|
const { children, className, ...restProps } = this.props;
|
|
13
13
|
const errorBubbleClasses = classNames(styles.errorBubble, className);
|
|
14
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, {
|
|
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 }) }))] }));
|
|
16
16
|
}
|
|
17
17
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare enum ControlsHeight {
|
|
2
|
+
S = "S",
|
|
3
|
+
M = "M",
|
|
4
|
+
L = "L"
|
|
5
|
+
}
|
|
6
|
+
export interface RingUIConfiguration {
|
|
7
|
+
controlsHeight?: ControlsHeight;
|
|
8
|
+
popupsCssPositioning?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function configure(config: RingUIConfiguration): void;
|
|
11
|
+
export declare function getConfiguration(): Required<RingUIConfiguration>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export var ControlsHeight;
|
|
2
|
+
(function (ControlsHeight) {
|
|
3
|
+
ControlsHeight["S"] = "S";
|
|
4
|
+
ControlsHeight["M"] = "M";
|
|
5
|
+
ControlsHeight["L"] = "L";
|
|
6
|
+
})(ControlsHeight || (ControlsHeight = {}));
|
|
7
|
+
const globalConfiguration = {
|
|
8
|
+
controlsHeight: ControlsHeight.M,
|
|
9
|
+
popupsCssPositioning: true,
|
|
10
|
+
};
|
|
11
|
+
export function configure(config) {
|
|
12
|
+
if (config.controlsHeight !== undefined) {
|
|
13
|
+
globalConfiguration.controlsHeight = config.controlsHeight;
|
|
14
|
+
}
|
|
15
|
+
if (config.popupsCssPositioning !== undefined) {
|
|
16
|
+
globalConfiguration.popupsCssPositioning = config.popupsCssPositioning;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export function getConfiguration() {
|
|
20
|
+
return { ...globalConfiguration };
|
|
21
|
+
}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
L = "L"
|
|
5
|
-
}
|
|
6
|
-
export declare const ControlsHeightContext: import("react").Context<ControlsHeight>;
|
|
7
|
-
export declare function configureGlobalControlsHeight(value: ControlsHeight): void;
|
|
1
|
+
import { ControlsHeight } from './configuration';
|
|
2
|
+
export { ControlsHeight } from './configuration';
|
|
3
|
+
export declare const configureGlobalControlsHeight: (value: ControlsHeight) => void;
|
|
8
4
|
export declare function getGlobalControlsHeight(): ControlsHeight;
|
|
5
|
+
export declare const ControlsHeightContext: import("react").Context<ControlsHeight | (() => ControlsHeight)>;
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import { createContext } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
ControlsHeight["M"] = "M";
|
|
6
|
-
ControlsHeight["L"] = "L";
|
|
7
|
-
})(ControlsHeight || (ControlsHeight = {}));
|
|
8
|
-
export const ControlsHeightContext = createContext(ControlsHeight.M);
|
|
9
|
-
let globalControlsHeight = ControlsHeight.M;
|
|
2
|
+
import deprecate from 'util-deprecate';
|
|
3
|
+
import { configure, ControlsHeight, getConfiguration } from './configuration';
|
|
4
|
+
export { ControlsHeight } from './configuration';
|
|
10
5
|
// This can be used if React Context is not applicable, for example for alertService or Auth dialog
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
}
|
|
6
|
+
export const configureGlobalControlsHeight = deprecate((value) => {
|
|
7
|
+
configure({ controlsHeight: value });
|
|
8
|
+
}, 'Ring UI: configureGlobalControlsHeight() is deprecated, use configure() instead');
|
|
14
9
|
export function getGlobalControlsHeight() {
|
|
15
|
-
return
|
|
10
|
+
return getConfiguration().controlsHeight ?? ControlsHeight.M;
|
|
16
11
|
}
|
|
12
|
+
export const ControlsHeightContext = createContext(getGlobalControlsHeight);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/* stylelint-disable color-no-hex */
|
|
2
2
|
|
|
3
3
|
.light,
|
|
4
|
-
:root
|
|
4
|
+
:root,
|
|
5
|
+
:host {
|
|
5
6
|
--ring-unit: 8px;
|
|
6
7
|
|
|
7
8
|
/* Element */
|
|
@@ -239,6 +240,7 @@
|
|
|
239
240
|
--ring-font-family: system-ui, Arial, sans-serif;
|
|
240
241
|
--ring-font-family-monospace: Menlo, "Bitstream Vera Sans Mono", "Ubuntu Mono", Consolas, "Courier New", Courier,
|
|
241
242
|
monospace;
|
|
243
|
+
--ring-font-weight-medium: 500;
|
|
242
244
|
--ring-font-weight-bold: 600;
|
|
243
245
|
--ring-font-variant-numeric: lining-nums tabular-nums slashed-zero;
|
|
244
246
|
|
|
@@ -33,7 +33,7 @@ export default class Services extends PureComponent {
|
|
|
33
33
|
const servicesWithIcons = sortedServices.filter(service => service.iconUrl && service.homeUrl);
|
|
34
34
|
const servicesWithOutIcons = sortedServices.filter(service => !service.iconUrl && service.homeUrl);
|
|
35
35
|
const separatorIsRequired = servicesWithIcons.length !== 0 && servicesWithOutIcons.length !== 0;
|
|
36
|
-
return (_jsx(Dropdown, { ...props, anchor: makeAnchor(loading), initShown: initShown, children: _jsxs(Popup, {
|
|
36
|
+
return (_jsx(Dropdown, { ...props, anchor: makeAnchor(loading), initShown: initShown, children: _jsxs(Popup, { className: classNames(styles.services, { [darkStyles.dark]: theme === Theme.DARK }), top: -3, children: [servicesWithIcons.map(service => {
|
|
37
37
|
const isActive = this.serviceIsActive(service);
|
|
38
38
|
return (_jsx(Services.Link, { active: isActive, className: isActive ? styles.activeItem : styles.item, service: service }, service.id));
|
|
39
39
|
}), separatorIsRequired && _jsx("div", { className: styles.line }, "separator"), servicesWithOutIcons.map(service => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PureComponent, Ref, ComponentType, InputHTMLAttributes, TextareaHTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { ControlsHeight } from '../global/controls-height';
|
|
3
|
+
import { ControlsHeight, ControlsHeightContext } from '../global/controls-height';
|
|
4
4
|
import { LabelType } from '../control-label/control-label';
|
|
5
5
|
declare function noop(): void;
|
|
6
6
|
/**
|
|
@@ -58,7 +58,8 @@ export declare class Input extends PureComponent<InputProps> {
|
|
|
58
58
|
componentDidMount(): void;
|
|
59
59
|
componentDidUpdate(): void;
|
|
60
60
|
componentWillUnmount(): void;
|
|
61
|
-
static contextType: React.Context<ControlsHeight>;
|
|
61
|
+
static contextType: React.Context<ControlsHeight | (() => ControlsHeight)>;
|
|
62
|
+
context: React.ContextType<typeof ControlsHeightContext>;
|
|
62
63
|
frame?: number;
|
|
63
64
|
input?: HTMLInputElement | HTMLTextAreaElement | null;
|
|
64
65
|
id: string;
|
|
@@ -97,7 +97,7 @@ export class Input extends PureComponent {
|
|
|
97
97
|
// Modifiers
|
|
98
98
|
size, multiline, borderless,
|
|
99
99
|
// Props
|
|
100
|
-
label, labelType, error, help, className, inputClassName, children, value, onClear, disabled, inputRef, onChange, enableShortcuts, id, placeholder, icon, translations, height = this.context, beforeInput, afterInput, autogrow, ...restProps } = this.props;
|
|
100
|
+
label, labelType, error, help, className, inputClassName, children, value, onClear, disabled, inputRef, onChange, enableShortcuts, id, placeholder, icon, translations, height = typeof this.context === 'function' ? this.context() : this.context, beforeInput, afterInput, autogrow, ...restProps } = this.props;
|
|
101
101
|
const { empty } = this.state;
|
|
102
102
|
const clearable = !!onClear;
|
|
103
103
|
const classes = classNames(className, styles.outerContainer, [styles[`size${size}`]], [styles[`height${height}`]], {
|
|
@@ -98,6 +98,6 @@ export default class Message extends Component {
|
|
|
98
98
|
const tailClasses = classNames(styles.tail, tailClassName);
|
|
99
99
|
const popupDirections = this.props.direction ? [this.props.direction] : this.props.directions;
|
|
100
100
|
const { direction } = this.state;
|
|
101
|
-
return (_jsx(I18nContext.Consumer, { children: ({ translate }) => (_jsx(WithThemeClasses, { theme: theme, children: themeClasses => (_jsx(Popup, { ref: this.popupRef,
|
|
101
|
+
return (_jsx(I18nContext.Consumer, { children: ({ translate }) => (_jsx(WithThemeClasses, { theme: theme, children: themeClasses => (_jsx(Popup, { ref: this.popupRef, hidden: false, directions: popupDirections, className: classNames(classes, themeClasses), offset: UNIT * 2, onDirectionChange: this._onDirectionChange, ...popupProps, children: _jsxs(ThemeProvider, { theme: theme, passToPopups: true, children: [direction && _jsx("div", { className: tailClasses, style: getTailOffsets(this.getTailOffset())[direction] }), icon && _jsx(Icon, { className: styles.icon, glyph: icon }), title && (_jsx("h1", { "data-test": "rgMessageTitle", className: styles.title, children: title })), children && _jsx("div", { className: styles.description, children: children }), (onClose || buttonProps) && (_jsx(Button, { className: styles.gotIt, onClick: onClose, primary: true, ...buttonProps, children: translations?.gotIt ?? translate('gotIt') })), onDismiss && (_jsx(Button, { onClick: onDismiss, inline: true, children: translations?.dismiss ?? translate('dismiss') }))] }) })) })) }));
|
|
102
102
|
}
|
|
103
103
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function stop() {}
|
|
@@ -84,7 +84,6 @@ export default class Popup<P extends BasePopupProps = PopupProps> extends PureCo
|
|
|
84
84
|
trapFocus: boolean;
|
|
85
85
|
autoFocusFirst: boolean;
|
|
86
86
|
legacy: boolean;
|
|
87
|
-
cssPositioning: boolean;
|
|
88
87
|
};
|
|
89
88
|
state: PopupState;
|
|
90
89
|
componentDidMount(): void;
|
|
@@ -119,6 +118,7 @@ export default class Popup<P extends BasePopupProps = PopupProps> extends PureCo
|
|
|
119
118
|
direction: Directions | null;
|
|
120
119
|
};
|
|
121
120
|
private _updateDirection;
|
|
121
|
+
private shouldUseCssPositioning;
|
|
122
122
|
private _updatePosition;
|
|
123
123
|
private _redraw;
|
|
124
124
|
private _getAnchor;
|
|
@@ -11,6 +11,7 @@ import { Listeners, getStyles } from '../global/dom';
|
|
|
11
11
|
import Shortcuts from '../shortcuts/shortcuts';
|
|
12
12
|
import dataTests from '../global/data-tests';
|
|
13
13
|
import TabTrap from '../tab-trap/tab-trap';
|
|
14
|
+
import { getConfiguration } from '../global/configuration';
|
|
14
15
|
import position from './position';
|
|
15
16
|
import styles from './popup.css';
|
|
16
17
|
import { DEFAULT_DIRECTIONS, Dimension, Directions, Display, MaxHeight, MinWidth } from './popup.consts';
|
|
@@ -66,7 +67,6 @@ export default class Popup extends PureComponent {
|
|
|
66
67
|
trapFocus: false,
|
|
67
68
|
autoFocusFirst: false,
|
|
68
69
|
legacy: false,
|
|
69
|
-
cssPositioning: false,
|
|
70
70
|
};
|
|
71
71
|
state = {
|
|
72
72
|
display: Display.SHOWING,
|
|
@@ -160,11 +160,19 @@ export default class Popup extends PureComponent {
|
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
162
|
};
|
|
163
|
+
shouldUseCssPositioning() {
|
|
164
|
+
if (!supportsCSSAnchorPositioning()) {
|
|
165
|
+
return false;
|
|
166
|
+
}
|
|
167
|
+
return this.props.cssPositioning !== undefined
|
|
168
|
+
? this.props.cssPositioning
|
|
169
|
+
: getConfiguration().popupsCssPositioning;
|
|
170
|
+
}
|
|
163
171
|
_updatePosition = () => {
|
|
164
172
|
const popup = this.popup;
|
|
165
173
|
const anchor = this._getAnchor();
|
|
166
174
|
if (popup) {
|
|
167
|
-
if (this.
|
|
175
|
+
if (this.shouldUseCssPositioning() && anchor) {
|
|
168
176
|
// Use CSS Anchor positioning
|
|
169
177
|
setCSSAnchorPositioning({
|
|
170
178
|
popup,
|
|
@@ -219,7 +227,7 @@ export default class Popup extends PureComponent {
|
|
|
219
227
|
this._listenersEnabled = true;
|
|
220
228
|
// CSS positioning doesn't need resize/scroll listeners as it's handled by CSS
|
|
221
229
|
// But we need them if CSS positioning isn't supported
|
|
222
|
-
if (!this.
|
|
230
|
+
if (!this.shouldUseCssPositioning()) {
|
|
223
231
|
this.listeners.add(window, 'resize', this._redraw);
|
|
224
232
|
if (this.props.autoPositioningOnScroll) {
|
|
225
233
|
this.listeners.add(window, 'scroll', this._redraw);
|
|
@@ -279,10 +287,9 @@ export default class Popup extends PureComponent {
|
|
|
279
287
|
};
|
|
280
288
|
render() {
|
|
281
289
|
const { className, style, hidden, attached, keepMounted, client, onMouseDown, onMouseUp, onMouseOver, onMouseOut, onContextMenu, 'data-test': dataTest, largeBorderRadius, } = this.props;
|
|
282
|
-
const useCssPositioning = this.props.cssPositioning && supportsCSSAnchorPositioning();
|
|
283
290
|
const showing = this.state.display === Display.SHOWING;
|
|
284
291
|
const classes = classNames(className, styles.popup, {
|
|
285
|
-
[styles.cssAnchoredPopup]:
|
|
292
|
+
[styles.cssAnchoredPopup]: this.shouldUseCssPositioning(),
|
|
286
293
|
[styles.attached]: attached,
|
|
287
294
|
[styles.hidden]: hidden,
|
|
288
295
|
[styles.showing]: showing,
|
|
@@ -704,7 +704,7 @@ export default class QueryAssist extends Component {
|
|
|
704
704
|
return (_jsx(ControlsHeightContext.Provider, { value: ControlsHeight.M, children: _jsx(I18nContext.Consumer, { children: ({ translate }) => (_jsxs("div", { "data-test": dataTests('ring-query-assist', dataTest), className: containerClasses, role: "presentation", ref: this.nodeRef, children: [this.state.shortcuts && _jsx(Shortcuts, { map: this.shortcutsMap, scope: this.shortcutsScope }), renderGlass && !huge && (_jsx(Icon, { glyph: searchIcon, className: styles.icon, title: translations?.searchTitle ?? translate('searchTitle'), ref: this.glassRef, "data-test": "query-assist-search-icon" })), renderLoader && (_jsx("div", { className: classNames(styles.icon, styles.loader, {
|
|
705
705
|
[styles.loaderOnTheRight]: !glass && !huge,
|
|
706
706
|
[styles.loaderActive]: renderLoader,
|
|
707
|
-
}), ref: this.loaderRef, children: _jsx(LoaderInline, {}) })), _jsx(ContentEditable, { "aria-label": translations?.searchTitle ?? translate('searchTitle'), className: inputClasses, "data-test": "ring-query-assist-input", inputRef: this.inputRef, disabled: this.props.disabled, onComponentUpdate: () => this.setCaretPosition({ fromContentEditable: true }), onBlur: this.handleFocusChange, onClick: this.handleCaretMove, onCompositionStart: this.trackCompositionState, onCompositionEnd: this.trackCompositionState, onFocus: this.handleFocusChange, onInput: this.handleInput, onKeyUp: this.handleInput, onKeyDown: this.handleEnter, onPaste: this.handlePaste, spellCheck: "false", children: this.state.query && _jsx("span", { children: this.renderQuery() }) }), renderPlaceholder && (_jsx("button", { type: "button", className: placeholderStyles, ref: this.placeholderRef, onClick: this.handleCaretMove, "data-test": "query-assist-placeholder", disabled: this.props.disabled, tabIndex: -1, children: this.props.placeholder })), actions.length ? (_jsx("div", { "data-test": "ring-query-assist-actions", className: styles.actions, children: actions })) : null, _jsx(PopupMenu, {
|
|
707
|
+
}), ref: this.loaderRef, children: _jsx(LoaderInline, {}) })), _jsx(ContentEditable, { "aria-label": translations?.searchTitle ?? translate('searchTitle'), className: inputClasses, "data-test": "ring-query-assist-input", inputRef: this.inputRef, disabled: this.props.disabled, onComponentUpdate: () => this.setCaretPosition({ fromContentEditable: true }), onBlur: this.handleFocusChange, onClick: this.handleCaretMove, onCompositionStart: this.trackCompositionState, onCompositionEnd: this.trackCompositionState, onFocus: this.handleFocusChange, onInput: this.handleInput, onKeyUp: this.handleInput, onKeyDown: this.handleEnter, onPaste: this.handlePaste, spellCheck: "false", children: this.state.query && _jsx("span", { children: this.renderQuery() }) }), renderPlaceholder && (_jsx("button", { type: "button", className: placeholderStyles, ref: this.placeholderRef, onClick: this.handleCaretMove, "data-test": "query-assist-placeholder", disabled: this.props.disabled, tabIndex: -1, children: this.props.placeholder })), actions.length ? (_jsx("div", { "data-test": "ring-query-assist-actions", className: styles.actions, children: actions })) : null, _jsx(PopupMenu, { hidden: !this.state.showPopup, onCloseAttempt: this.closePopup, ref: this.popupRef, anchorElement: this.node, keepMounted: true, attached: true, className: this.props.popupClassName, directions: [PopupMenu.PopupProps.Directions.BOTTOM_RIGHT], data: useCustomItemRender ? this.state.suggestions : this.renderSuggestions(), "data-test": "ring-query-assist-popup", hint: this.props.hint, shortcutsMap: this.listShortcutsMap, hintOnSelection: this.props.hintOnSelection, left: this.getPopupOffset(this.state.suggestions), maxHeight: PopupMenu.PopupProps.MaxHeight.SCREEN, onMouseDown: this.trackPopupMouseState, onMouseUp: this.trackPopupMouseState, onSelect: item => this.handleComplete(item) }), glass && huge && (_jsx("div", { className: styles.rightSearchButton, "data-test": "query-assist-search-button", children: _jsx(Icon, { glyph: searchIcon, className: styles.rightSearchIcon, title: translations?.searchTitle ?? translate('searchTitle'), onClick: this.handleApply, ref: this.glassRef, "data-test": "query-assist-search-icon" }) }))] })) }) }));
|
|
708
708
|
}
|
|
709
709
|
}
|
|
710
710
|
export const RerenderableQueryAssist = rerenderHOC(QueryAssist);
|
|
@@ -5,7 +5,7 @@ import { Size } from '../input/input';
|
|
|
5
5
|
import { LabelType } from '../control-label/control-label';
|
|
6
6
|
import { ListDataItem } from '../list/consts';
|
|
7
7
|
import { Directions } from '../popup/popup.consts';
|
|
8
|
-
import { ControlsHeight } from '../global/controls-height';
|
|
8
|
+
import { ControlsHeight, ControlsHeightContext } from '../global/controls-height';
|
|
9
9
|
import SelectPopup, { Filter, FilterFn, Multiple, Tags } from './select__popup';
|
|
10
10
|
/**
|
|
11
11
|
* @name Select
|
|
@@ -206,7 +206,8 @@ export default class Select<T = unknown> extends Component<SelectProps<T>, Selec
|
|
|
206
206
|
static getDerivedStateFromProps<T = unknown>(nextProps: SelectProps<T>, prevState: SelectState<T>): Partial<SelectState<T>>;
|
|
207
207
|
state: SelectState<T>;
|
|
208
208
|
componentDidUpdate(prevProps: SelectProps<T>, prevState: SelectState<T>): void;
|
|
209
|
-
static contextType: React.Context<ControlsHeight>;
|
|
209
|
+
static contextType: React.Context<ControlsHeight | (() => ControlsHeight)>;
|
|
210
|
+
context: React.ContextType<typeof ControlsHeightContext>;
|
|
210
211
|
static Type: typeof Type;
|
|
211
212
|
static Size: typeof Size;
|
|
212
213
|
id: string;
|
|
@@ -737,7 +737,7 @@ export default class Select extends Component {
|
|
|
737
737
|
const { selected } = this.state;
|
|
738
738
|
const { disabled, clear, hideArrow } = this.props;
|
|
739
739
|
const icons = [];
|
|
740
|
-
const height = this.props.height || this.context;
|
|
740
|
+
const height = this.props.height || (typeof this.context === 'function' ? this.context() : this.context);
|
|
741
741
|
if (!Array.isArray(selected) && selected?.icon) {
|
|
742
742
|
icons.push(_jsx("button", { title: "Toggle options popup", type: "button", className: styles.selectedIcon, disabled: this.props.disabled, onClick: this._clickHandler, style: { backgroundImage: `url(${selected.icon})` } }, "selected"));
|
|
743
743
|
}
|
|
@@ -310,7 +310,7 @@ export default class SelectPopup extends PureComponent {
|
|
|
310
310
|
const list = this.getList(this.props.ringPopupTarget || ringPopupTarget);
|
|
311
311
|
const bottomLine = this.getBottomLine();
|
|
312
312
|
const hasContent = filterWithTags || selectAll || list || bottomLine || toolbar || topbar;
|
|
313
|
-
return (_jsx(Popup, { trapFocus: false,
|
|
313
|
+
return (_jsx(Popup, { trapFocus: false, ref: this.popupRef, hidden: hidden || !hasContent, attached: isInputMode, className: classes, dontCloseOnAnchorClick: true, 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: true, children: _jsxs("div", { dir: dir, children: [!hidden && filter && _jsx(Shortcuts, { map: this.shortcutsMap, scope: this.shortcutsScope }), topbar, hidden ? _jsx("div", {}) : filterWithTags, selectAll, list, bottomLine, toolbar] }) }));
|
|
314
314
|
} }));
|
|
315
315
|
}
|
|
316
316
|
}
|
|
@@ -52,7 +52,7 @@ export const MoreButton = memo(({ items, selected, onSelect, moreClassName, more
|
|
|
52
52
|
return popupItems;
|
|
53
53
|
}, [items, morePopupBeforeEnd, morePopupItemClassName, selected]);
|
|
54
54
|
const popupAnchor = useMemo(() => (_jsx(AnchorLink, { moreClassName: moreClassName, moreActiveClassName: moreActiveClassName, hasActiveChildren: hasActiveChild })), [hasActiveChild, moreActiveClassName, moreClassName]);
|
|
55
|
-
const popup = useMemo(() => (_jsx(PopupMenu, {
|
|
55
|
+
const popup = useMemo(() => (_jsx(PopupMenu, { directions: morePopupDirections, className: morePopupClassName, onSelect: onSelectHandler, data: data })), [data, morePopupClassName, onSelectHandler]);
|
|
56
56
|
if (items.length === 0) {
|
|
57
57
|
return null;
|
|
58
58
|
}
|
package/components/tabs/tabs.css
CHANGED
|
@@ -4,7 +4,7 @@ import Select, { SelectItem } from '../select/select';
|
|
|
4
4
|
import { TagType } from '../tags-list/tags-list';
|
|
5
5
|
import Caret from '../caret/caret';
|
|
6
6
|
import { Size } from '../input/input';
|
|
7
|
-
import { ControlsHeight } from '../global/controls-height';
|
|
7
|
+
import { ControlsHeight, ControlsHeightContext } from '../global/controls-height';
|
|
8
8
|
import { Filter } from '../select/select__popup';
|
|
9
9
|
import { TagAttrs } from '../tag/tag';
|
|
10
10
|
import { LabelType } from '../control-label/control-label';
|
|
@@ -82,7 +82,8 @@ export default class TagsInput extends PureComponent<TagsInputProps, TagsInputSt
|
|
|
82
82
|
componentDidMount(): void;
|
|
83
83
|
static ngModelStateField: string;
|
|
84
84
|
ngModelStateField: string;
|
|
85
|
-
static contextType: React.Context<ControlsHeight>;
|
|
85
|
+
static contextType: React.Context<ControlsHeight | (() => ControlsHeight)>;
|
|
86
|
+
context: React.ContextType<typeof ControlsHeightContext>;
|
|
86
87
|
id: string;
|
|
87
88
|
node?: HTMLElement | null;
|
|
88
89
|
nodeRef: (node: HTMLElement | null) => void;
|
|
@@ -221,7 +221,7 @@ export default class TagsInput extends PureComponent {
|
|
|
221
221
|
};
|
|
222
222
|
render() {
|
|
223
223
|
const { focused, tags, activeIndex } = this.state;
|
|
224
|
-
const { disabled, canNotBeEmpty, allowAddNewTags, filter, size, labelType, height = this.context, label, } = this.props;
|
|
224
|
+
const { disabled, canNotBeEmpty, allowAddNewTags, filter, size, labelType, height = typeof this.context === 'function' ? this.context() : this.context, label, } = this.props;
|
|
225
225
|
const classes = classNames(styles.tagsInput, [inputStyles[`size${size}`]], [inputStyles[`height${height}`]], {
|
|
226
226
|
[styles.tagsInputDisabled]: disabled,
|
|
227
227
|
[styles.tagsInputFocused]: focused,
|
|
@@ -97,6 +97,13 @@ export default class Tooltip extends Component {
|
|
|
97
97
|
}
|
|
98
98
|
this.hidePopup();
|
|
99
99
|
});
|
|
100
|
+
this.listeners.add(this.containerNode, 'focusin', this.tryToShowPopup);
|
|
101
|
+
this.listeners.add(this.containerNode, 'focusout', ev => {
|
|
102
|
+
if (ev.relatedTarget && this.popup?.container?.contains(ev.relatedTarget)) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
this.hidePopup();
|
|
106
|
+
});
|
|
100
107
|
}
|
|
101
108
|
this.listeners.add(document, 'scroll', () => scheduleScroll(this.hidePopup), { passive: true });
|
|
102
109
|
}
|
|
@@ -20,7 +20,7 @@ export default class UserCardTooltip extends Component {
|
|
|
20
20
|
};
|
|
21
21
|
render() {
|
|
22
22
|
const { children, renderUserCard, renderNoUser, dropdownProps, user, ...restProps } = this.props;
|
|
23
|
-
return (_jsx(Dropdown, { anchor: children, hoverMode: true, clickMode: false, ...dropdownProps, children: _jsx(Popup, { attached: false,
|
|
23
|
+
return (_jsx(Dropdown, { anchor: children, hoverMode: true, clickMode: false, ...dropdownProps, children: _jsx(Popup, { attached: false, children: user
|
|
24
24
|
? renderUserCard({
|
|
25
25
|
...restProps,
|
|
26
26
|
user,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jetbrains/ring-ui",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.61",
|
|
4
4
|
"description": "JetBrains UI library",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "JetBrains"
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
"components",
|
|
13
13
|
"postcss.config.js",
|
|
14
14
|
"webpack.config.js",
|
|
15
|
-
"jslint-xml.js",
|
|
16
15
|
"typings.d.ts"
|
|
17
16
|
],
|
|
18
17
|
"exports": {
|
|
@@ -45,52 +44,50 @@
|
|
|
45
44
|
"components": "./components/"
|
|
46
45
|
},
|
|
47
46
|
"scripts": {
|
|
48
|
-
"apply-resolutions": "npx npm-force-resolutions@0.0.10",
|
|
49
|
-
"_postinstall": "husky && npm run postinstall:gitconfig",
|
|
50
|
-
"postinstall:gitconfig": "git config blame.ignoreRevsFile .git-blame-ignore-revs",
|
|
51
|
-
"prepare": "webpack -c .storybook/custom-header/webpack.config.js",
|
|
52
|
-
"prea11y-audit": "playwright install",
|
|
53
47
|
"a11y-audit": "test-storybook --url http://localhost:9999 && DARK=true test-storybook --url http://localhost:9999",
|
|
54
|
-
"a11y-audit-ci": "node a11y-audit-ci.mjs",
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"test": "vitest src",
|
|
58
|
-
"screenshots-gui": "npm --prefix packages/screenshots run gui",
|
|
59
|
-
"screenshots-test": "npm --prefix packages/screenshots run test",
|
|
60
|
-
"screenshots-test-ci": "npm --prefix packages/screenshots run test-ci",
|
|
61
|
-
"screenshots-gather": "npm --prefix packages/screenshots run gather",
|
|
48
|
+
"a11y-audit-ci": "node scripts/a11y-audit-ci.mjs",
|
|
49
|
+
"apply-resolutions": "npx npm-force-resolutions@0.0.10",
|
|
50
|
+
"build": "BROWSERSLIST_ENV=dist ./node_modules/.bin/rollup -c --bundleConfigAsCjs",
|
|
62
51
|
"build-stories": "storybook build --quiet -c .storybook -o storybook-dist",
|
|
63
|
-
"
|
|
64
|
-
"
|
|
52
|
+
"console-errors": "jest scripts/console-errors.test.js --watchAll",
|
|
53
|
+
"console-errors-ci": "jest scripts/console-errors.test.js --reporters=jest-teamcity",
|
|
65
54
|
"figma-connect-publish": "npx figma connect publish --token=$FIGMA_CODE_CONNECT_TOKEN",
|
|
66
55
|
"figma-connect-publish-local": "dotenv -- npm run figma-connect-publish",
|
|
67
56
|
"figma-connect-unpublish": "npx figma connect unpublish --token=$FIGMA_CODE_CONNECT_TOKEN",
|
|
68
57
|
"figma-connect-unpublish-local": "dotenv -- npm run figma-connect-unpublish",
|
|
69
|
-
"
|
|
70
|
-
"
|
|
58
|
+
"lint": "npm run lint:js . && npm run stylelint",
|
|
59
|
+
"lint-ci": "eslint --format jslint-xml . > eslint-report.xml && npm run stylelint-ci",
|
|
60
|
+
"lint:js": "eslint",
|
|
71
61
|
"postbuild": "cpy './**/*.d.ts' ../dist --parents --cwd=components/",
|
|
62
|
+
"_postinstall": "husky && npm run postinstall:gitconfig",
|
|
63
|
+
"postinstall:gitconfig": "git config blame.ignoreRevsFile .git-blame-ignore-revs",
|
|
64
|
+
"postpublish": "pinst --enable",
|
|
65
|
+
"postrelease-ci": "git push --follow-tags",
|
|
66
|
+
"prea11y-audit": "playwright install",
|
|
67
|
+
"prebuild": "rimraf components && tsc --project tsconfig-build.json && cpy './**/*' '!**/*.stories.*' '!**/*.ts' '!**/*.tsx' '!**/test-helpers/mocks/**' ../components --parents --cwd=src/",
|
|
68
|
+
"prelint-ci": "echo \"##teamcity[importData type='jslint' path='eslint-report.xml']\"",
|
|
69
|
+
"prepare": "webpack -c .storybook/custom-header/webpack.config.js",
|
|
70
|
+
"prepublishOnly": "pinst --disable",
|
|
71
|
+
"prerelease-built-ci": "node scripts/prepare-built-package.js",
|
|
72
|
+
"prerelease-ci": "git pull",
|
|
73
|
+
"pretest-ci": "npm run lint-ci",
|
|
74
|
+
"release-built-ci": "npm publish --access=public $NPM_PUBLISH_PARAMS",
|
|
75
|
+
"release-ci": "npm version $NPM_VERSION_PARAMS && npm publish --access=public $NPM_PUBLISH_PARAMS",
|
|
76
|
+
"screenshots-gather": "npm --prefix packages/screenshots run gather",
|
|
77
|
+
"screenshots-gui": "npm --prefix packages/screenshots run gui",
|
|
78
|
+
"screenshots-test": "npm --prefix packages/screenshots run test",
|
|
79
|
+
"screenshots-test-ci": "npm --prefix packages/screenshots run test-ci",
|
|
72
80
|
"serve": "http-server storybook-dist/ -p 9999",
|
|
73
81
|
"start": "storybook dev -p 9999",
|
|
74
82
|
"storybook-debug": "node --inspect-brk node_modules/@storybook/react/bin -p 9999",
|
|
75
|
-
"lint:js": "eslint",
|
|
76
|
-
"lint": "npm run lint:js . && npm run stylelint",
|
|
77
|
-
"prelint-ci": "echo \"##teamcity[importData type='jslint' path='eslint-report.xml']\"",
|
|
78
|
-
"lint-ci": "eslint --format jslint-xml . > eslint-report.xml && npm run stylelint-ci",
|
|
79
|
-
"stylelint-ci": "stylelint --ignore-path .stylelintignore --custom-formatter './jslint-xml.js' '**/*.css' | xmlappend eslint-report.xml",
|
|
80
83
|
"stylelint": "stylelint --ignore-path .stylelintignore '**/*.css'",
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"typecheck": "tsc",
|
|
84
|
+
"stylelint-ci": "stylelint --ignore-path .stylelintignore --custom-formatter 'scripts/jslint-xml.js' '**/*.css' | xmlappend eslint-report.xml",
|
|
85
|
+
"test": "vitest src",
|
|
84
86
|
"test-ci": "npm run test",
|
|
85
|
-
"typecheck
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
"prerelease-built-ci": "node prepare-built-package.js",
|
|
90
|
-
"release-built-ci": "npm publish --access=public $NPM_PUBLISH_PARAMS",
|
|
91
|
-
"prepublishOnly": "pinst --disable",
|
|
92
|
-
"postpublish": "pinst --enable",
|
|
93
|
-
"update-styles": "node design-tokens/update-styles.mjs"
|
|
87
|
+
"typecheck": "tsc",
|
|
88
|
+
"typecheck-ci": "node scripts/tsc-teamcity",
|
|
89
|
+
"update-styles": "node scripts/update-styles.mjs",
|
|
90
|
+
"validate-tc-config": "mvn --file .teamcity/pom.xml org.jetbrains.teamcity:teamcity-configs-maven-plugin:generate -e"
|
|
94
91
|
},
|
|
95
92
|
"repository": {
|
|
96
93
|
"type": "git",
|
|
@@ -98,54 +95,51 @@
|
|
|
98
95
|
},
|
|
99
96
|
"readmeFilename": "README.md",
|
|
100
97
|
"devDependencies": {
|
|
101
|
-
"@babel/cli": "^7.28.
|
|
102
|
-
"@babel/eslint-parser": "^7.28.
|
|
98
|
+
"@babel/cli": "^7.28.3",
|
|
99
|
+
"@babel/eslint-parser": "^7.28.4",
|
|
103
100
|
"@csstools/css-parser-algorithms": "^3.0.4",
|
|
104
101
|
"@csstools/stylelint-no-at-nest-rule": "^4.0.0",
|
|
105
102
|
"@eslint/compat": "^1.3.2",
|
|
106
103
|
"@eslint/eslintrc": "^3.2.0",
|
|
107
|
-
"@eslint/js": "^9.
|
|
108
|
-
"@figma/code-connect": "^1.3.
|
|
104
|
+
"@eslint/js": "^9.35.0",
|
|
105
|
+
"@figma/code-connect": "^1.3.5",
|
|
109
106
|
"@jetbrains/eslint-config": "^6.0.5",
|
|
110
107
|
"@jetbrains/logos": "3.0.0-canary.734b213.0",
|
|
111
108
|
"@jetbrains/rollup-css-plugin": "./packages/rollup-css-plugin",
|
|
112
109
|
"@jetbrains/stylelint-config": "^4.0.2",
|
|
113
|
-
"@primer/octicons": "^19.
|
|
110
|
+
"@primer/octicons": "^19.17.0",
|
|
114
111
|
"@rollup/plugin-babel": "^6.0.4",
|
|
115
112
|
"@rollup/plugin-json": "^6.1.0",
|
|
116
113
|
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
117
114
|
"@rollup/plugin-replace": "^6.0.2",
|
|
118
|
-
"@storybook/addon-a11y": "9.1.
|
|
119
|
-
"@storybook/addon-docs": "^9.1.
|
|
120
|
-
"@storybook/addon-themes": "^9.1.
|
|
115
|
+
"@storybook/addon-a11y": "9.1.5",
|
|
116
|
+
"@storybook/addon-docs": "^9.1.5",
|
|
117
|
+
"@storybook/addon-themes": "^9.1.5",
|
|
121
118
|
"@storybook/csf": "^0.1.13",
|
|
122
|
-
"@storybook/react-webpack5": "9.1.
|
|
119
|
+
"@storybook/react-webpack5": "9.1.5",
|
|
123
120
|
"@storybook/test-runner": "^0.23.0",
|
|
124
121
|
"@testing-library/dom": "^10.4.1",
|
|
125
122
|
"@testing-library/react": "^16.3.0",
|
|
126
123
|
"@testing-library/user-event": "^14.6.1",
|
|
127
|
-
"@types/chai": "^5.2.2",
|
|
128
124
|
"@types/chai-as-promised": "^8.0.2",
|
|
129
125
|
"@types/chai-dom": "1.11.3",
|
|
130
126
|
"@types/eslint__js": "^9.14.0",
|
|
131
127
|
"@types/markdown-it": "^14.1.2",
|
|
132
|
-
"@types/react": "^19.1.
|
|
133
|
-
"@types/react-dom": "^19.1.
|
|
128
|
+
"@types/react": "^19.1.12",
|
|
129
|
+
"@types/react-dom": "^19.1.9",
|
|
134
130
|
"@types/webpack-env": "^1.18.8",
|
|
135
|
-
"@vitejs/plugin-react": "^5.0.
|
|
136
|
-
"@vitest/eslint-plugin": "^1.3.
|
|
131
|
+
"@vitejs/plugin-react": "^5.0.2",
|
|
132
|
+
"@vitest/eslint-plugin": "^1.3.9",
|
|
137
133
|
"acorn": "^8.15.0",
|
|
138
134
|
"babel-plugin-require-context-hook": "^1.0.0",
|
|
139
|
-
"caniuse-lite": "^1.0.
|
|
140
|
-
"chai": "^
|
|
141
|
-
"chai-as-promised": "^8.0.1",
|
|
135
|
+
"caniuse-lite": "^1.0.30001741",
|
|
136
|
+
"chai-as-promised": "^8.0.2",
|
|
142
137
|
"chai-dom": "^1.12.1",
|
|
143
138
|
"cheerio": "^1.1.2",
|
|
144
|
-
"
|
|
145
|
-
"core-js": "^3.45.0",
|
|
139
|
+
"core-js": "^3.45.1",
|
|
146
140
|
"cpy-cli": "^6.0.0",
|
|
147
141
|
"dotenv-cli": "^10.0.0",
|
|
148
|
-
"eslint": "^9.
|
|
142
|
+
"eslint": "^9.35.0",
|
|
149
143
|
"eslint-config-prettier": "^10.1.8",
|
|
150
144
|
"eslint-formatter-jslint-xml": "^8.40.0",
|
|
151
145
|
"eslint-import-resolver-exports": "^1.0.0-beta.5",
|
|
@@ -155,18 +149,18 @@
|
|
|
155
149
|
"eslint-plugin-prettier": "^5.5.4",
|
|
156
150
|
"eslint-plugin-react": "^7.37.5",
|
|
157
151
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
158
|
-
"eslint-plugin-storybook": "^9.1.
|
|
152
|
+
"eslint-plugin-storybook": "^9.1.5",
|
|
159
153
|
"events": "^3.3.0",
|
|
160
154
|
"glob": "^11.0.3",
|
|
161
155
|
"globals": "^16.3.0",
|
|
162
|
-
"html-webpack-plugin": "^5.6.
|
|
156
|
+
"html-webpack-plugin": "^5.6.4",
|
|
163
157
|
"http-server": "^14.1.1",
|
|
164
158
|
"husky": "^9.1.7",
|
|
165
159
|
"identity-obj-proxy": "^3.0.0",
|
|
166
|
-
"jest": "~30.
|
|
167
|
-
"jest-environment-jsdom": "^30.
|
|
160
|
+
"jest": "~30.1.3",
|
|
161
|
+
"jest-environment-jsdom": "^30.1.2",
|
|
168
162
|
"jest-teamcity": "^1.12.0",
|
|
169
|
-
"lint-staged": "^16.1.
|
|
163
|
+
"lint-staged": "^16.1.6",
|
|
170
164
|
"markdown-it": "^14.1.0",
|
|
171
165
|
"merge-options": "^3.0.4",
|
|
172
166
|
"pinst": "^3.0.0",
|
|
@@ -176,20 +170,20 @@
|
|
|
176
170
|
"react-dom": "^19.1.1",
|
|
177
171
|
"regenerator-runtime": "^0.14.1",
|
|
178
172
|
"rimraf": "^6.0.1",
|
|
179
|
-
"rollup": "^4.
|
|
173
|
+
"rollup": "^4.50.0",
|
|
180
174
|
"rollup-plugin-clear": "^2.0.7",
|
|
181
175
|
"storage-mock": "^2.1.0",
|
|
182
|
-
"storybook": "9.1.
|
|
176
|
+
"storybook": "9.1.5",
|
|
183
177
|
"stylelint": "^16.23.1",
|
|
184
178
|
"svg-inline-loader": "^0.8.2",
|
|
185
179
|
"teamcity-service-messages": "^0.1.14",
|
|
186
180
|
"terser-webpack-plugin": "^5.3.14",
|
|
187
181
|
"typescript": "~5.9.2",
|
|
188
|
-
"typescript-eslint": "^8.
|
|
182
|
+
"typescript-eslint": "^8.42.0",
|
|
189
183
|
"vitest": "^3.2.4",
|
|
190
184
|
"vitest-teamcity-reporter": "^0.3.1",
|
|
191
185
|
"wallaby-webpack": "^3.9.16",
|
|
192
|
-
"webpack": "^5.101.
|
|
186
|
+
"webpack": "^5.101.3",
|
|
193
187
|
"webpack-cli": "^6.0.1",
|
|
194
188
|
"xmlappend": "^1.0.4"
|
|
195
189
|
},
|
|
@@ -213,7 +207,7 @@
|
|
|
213
207
|
}
|
|
214
208
|
},
|
|
215
209
|
"dependencies": {
|
|
216
|
-
"@babel/core": "^7.28.
|
|
210
|
+
"@babel/core": "^7.28.4",
|
|
217
211
|
"@babel/preset-typescript": "^7.27.1",
|
|
218
212
|
"@jetbrains/babel-preset-jetbrains": "^2.4.0",
|
|
219
213
|
"@jetbrains/icons": "^5.12.0",
|
|
@@ -224,7 +218,7 @@
|
|
|
224
218
|
"@types/util-deprecate": "^1.0.4",
|
|
225
219
|
"babel-loader": "10.0.0",
|
|
226
220
|
"babel-plugin-transform-define": "^2.1.4",
|
|
227
|
-
"browserslist": "^4.25.
|
|
221
|
+
"browserslist": "^4.25.4",
|
|
228
222
|
"change-case": "^4.1.1",
|
|
229
223
|
"classnames": "^2.5.1",
|
|
230
224
|
"combokeys": "^3.0.1",
|
|
@@ -243,9 +237,9 @@
|
|
|
243
237
|
"postcss-calc": "^10.1.1",
|
|
244
238
|
"postcss-flexbugs-fixes": "^5.0.2",
|
|
245
239
|
"postcss-font-family-system-ui": "^5.0.0",
|
|
246
|
-
"postcss-loader": "^8.
|
|
240
|
+
"postcss-loader": "^8.2.0",
|
|
247
241
|
"postcss-modules-values-replace": "^4.2.2",
|
|
248
|
-
"postcss-preset-env": "^10.
|
|
242
|
+
"postcss-preset-env": "^10.3.1",
|
|
249
243
|
"react-movable": "^3.4.1",
|
|
250
244
|
"react-virtualized": "^9.22.6",
|
|
251
245
|
"react-waypoint": "^10.3.0",
|
package/jslint-xml.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
const xmlEscape = s =>
|
|
2
|
-
// eslint-disable-next-line no-control-regex
|
|
3
|
-
`${s}`.replace(/[<>&"'\x00-\x1F\x7F\u0080-\uFFFF]/g, c => {
|
|
4
|
-
switch (c) {
|
|
5
|
-
case '<':
|
|
6
|
-
return '<';
|
|
7
|
-
case '>':
|
|
8
|
-
return '>';
|
|
9
|
-
case '&':
|
|
10
|
-
return '&';
|
|
11
|
-
case '"':
|
|
12
|
-
return '"';
|
|
13
|
-
case "'":
|
|
14
|
-
return ''';
|
|
15
|
-
default:
|
|
16
|
-
return `&#${c.charCodeAt(0)};`;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
module.exports = results => {
|
|
21
|
-
const files = results.map(file => {
|
|
22
|
-
const warnings = file.warnings.map(({column, line, text}) => {
|
|
23
|
-
const css = file._postcssResult && file._postcssResult.css;
|
|
24
|
-
const lines = (css && css.split('\n')) || [];
|
|
25
|
-
const evidence = lines[line - 1];
|
|
26
|
-
|
|
27
|
-
return [
|
|
28
|
-
`<issue line="${line}"`,
|
|
29
|
-
` char="${column}"`,
|
|
30
|
-
` evidence="${evidence ? xmlEscape(evidence) : ''}"`,
|
|
31
|
-
` reason="${xmlEscape(text)}" />`,
|
|
32
|
-
].join('');
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
return `<file name="${file.source}">${warnings.join('')}</file>`;
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
return `<?xml version="1.0" encoding="utf-8"?><jslint>${files.join('')}</jslint>`;
|
|
39
|
-
};
|