@jetbrains/ring-ui 7.0.60-beta.0 → 7.0.60

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.
Files changed (36) hide show
  1. package/components/banner/banner.css +102 -0
  2. package/components/banner/banner.d.ts +19 -0
  3. package/components/banner/banner.js +38 -0
  4. package/components/button/button.css +2 -1
  5. package/components/button-group/button-group.css +2 -1
  6. package/components/checkbox/checkbox.css +2 -1
  7. package/components/date-picker/date-picker.css +2 -2
  8. package/components/date-picker/date-picker.js +2 -2
  9. package/components/error-bubble/error-bubble.css +2 -1
  10. package/components/error-bubble/error-bubble.js +1 -1
  11. package/components/global/variables.css +3 -1
  12. package/components/header/header.css +2 -1
  13. package/components/header/services.js +1 -1
  14. package/components/input-size/input-size.css +2 -1
  15. package/components/loader/__mocks__/loader__core.js +5 -0
  16. package/components/loader-inline/loader-inline.css +2 -1
  17. package/components/message/message.js +1 -1
  18. package/components/old-browsers-message/__mocks__/old-browsers-message.js +1 -0
  19. package/components/popup/popup.css +3 -80
  20. package/components/popup/popup.d.ts +0 -2
  21. package/components/popup/popup.js +21 -46
  22. package/components/popup/position.d.ts +0 -1
  23. package/components/popup/position.js +5 -12
  24. package/components/popup-menu/popup-menu.d.ts +0 -1
  25. package/components/progress-bar/progress-bar.css +2 -1
  26. package/components/query-assist/query-assist.js +1 -1
  27. package/components/select/select__popup.js +1 -1
  28. package/components/tabs/collapsible-more.js +1 -1
  29. package/components/tabs/tabs.css +2 -1
  30. package/components/tooltip/tooltip.css +2 -1
  31. package/components/tooltip/tooltip.js +7 -0
  32. package/components/user-card/tooltip.js +1 -1
  33. package/package.json +61 -65
  34. package/components/popup/position-css.d.ts +0 -14
  35. package/components/popup/position-css.js +0 -77
  36. 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);
@@ -2,7 +2,8 @@
2
2
 
3
3
  @value glyph from "../icon/icon.css";
4
4
 
5
- :root {
5
+ :root,
6
+ :host {
6
7
  --ring-button-focus-border-color: var(--ring-border-hover-color);
7
8
  --ring-button-shadow: inset 0 0 0 1px;
8
9
  --ring-button-loader-width: calc(var(--ring-unit) * 8);
@@ -2,7 +2,8 @@
2
2
 
3
3
  @value button, active, flat from "../button/button.css";
4
4
 
5
- :root {
5
+ :root,
6
+ :host {
6
7
  --ring-button-group-default-z-index: 1;
7
8
  --ring-button-group-disabled-z-index: 0;
8
9
  --ring-button-group-active-z-index: 2;
@@ -1,6 +1,7 @@
1
1
  @import "../global/variables.css";
2
2
 
3
- :root {
3
+ :root,
4
+ :host {
4
5
  --ring-checkbox-disabled-check-color: var(--ring-white-text-color);
5
6
  }
6
7
 
@@ -4,8 +4,8 @@
4
4
  /* ensure styles order */
5
5
  @import "../input/input.css";
6
6
 
7
- :root {
8
- /* stylelint-disable-next-line color-no-hex */
7
+ :root,
8
+ :host {
9
9
  --ring-date-picker-hover-color: var(--ring-border-hover-color);
10
10
  }
11
11
 
@@ -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, { cssPositioning: true, hidden: hidden, className: className, ref: popupRef, directions: [
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, cssPositioning: true, popupRef: this.popupRef, onClear: clear ? this.clear : null, datePopupProps: {
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,
@@ -1,6 +1,7 @@
1
1
  @import "../global/variables.css";
2
2
 
3
- :root {
3
+ :root,
4
+ :host {
4
5
  --ring-error-bubble-background-color: var(--ring-popup-background-color);
5
6
  }
6
7
 
@@ -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, { cssPositioning: true, 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
+ 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
  }
@@ -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
 
@@ -2,7 +2,8 @@
2
2
 
3
3
  @value link, active from "../link/link.css";
4
4
 
5
- :root {
5
+ :root,
6
+ :host {
6
7
  --ring-header-link-color: var(--ring-link-color);
7
8
  }
8
9
 
@@ -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, { cssPositioning: true, className: classNames(styles.services, { [darkStyles.dark]: theme === Theme.DARK }), top: -3, children: [servicesWithIcons.map(service => {
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,7 @@
1
1
  @import "../global/variables.css";
2
2
 
3
- :root {
3
+ :root,
4
+ :host {
4
5
  --ring-input-xs: calc(var(--ring-unit) * 12);
5
6
  --ring-input-s: calc(var(--ring-unit) * 12);
6
7
  --ring-input-m: calc(var(--ring-unit) * 30);
@@ -0,0 +1,5 @@
1
+ export default class LoaderCore {
2
+ startAnimation() {}
3
+ stopAnimation() {}
4
+ destroy() {}
5
+ }
@@ -1,6 +1,7 @@
1
1
  @import "../global/variables.css";
2
2
 
3
- :root {
3
+ :root,
4
+ :host {
4
5
  /* stylelint-disable-next-line color-no-hex */
5
6
  --ring-loader-inline-stops: #ff00eb, #bd3bff, #008eff, #58ba00, #f48700, #ff00eb;
6
7
  }
@@ -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, cssPositioning: true, 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') }))] }) })) })) }));
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() {}
@@ -3,7 +3,10 @@
3
3
  .popup {
4
4
  composes: font from "../global/global.css";
5
5
 
6
+ position: fixed;
6
7
  z-index: var(--ring-overlay-z-index);
8
+ top: -100vh;
9
+ left: -100vw;
7
10
 
8
11
  overflow-y: auto;
9
12
 
@@ -16,86 +19,6 @@
16
19
  box-shadow: var(--ring-popup-shadow);
17
20
  }
18
21
 
19
- .jsAnchoredPopup {
20
- position: fixed;
21
-
22
- top: -100vh;
23
- left: -100vw;
24
- }
25
-
26
- :root {
27
- --ring-popup-offset: 8px;
28
- }
29
-
30
- .cssAnchoredPopup {
31
- --ring-popup-offset: 0;
32
-
33
- position: absolute;
34
-
35
- margin: 0
36
- }
37
-
38
- @position-try --bottom-right {
39
- position-area: block-end span-inline-end;
40
- margin-block-start: var(--ring-popup-offset);
41
- }
42
-
43
- @position-try --bottom-left {
44
- position-area: block-end span-inline-start;
45
- margin-block-start: var(--ring-popup-offset);
46
- }
47
-
48
- @position-try --bottom-center {
49
- position-area: block-end center;
50
- margin-block-start: var(--ring-popup-offset);
51
- }
52
-
53
- @position-try --top-center {
54
- position-area: block-start center;
55
- margin-block-end: var(--ring-popup-offset);
56
- }
57
-
58
- @position-try --top-right {
59
- position-area: block-start span-inline-end;
60
- margin-block-end: var(--ring-popup-offset);
61
- }
62
-
63
- @position-try --top-left {
64
- position-area: block-start span-inline-start;
65
- margin-block-end: var(--ring-popup-offset);
66
- }
67
-
68
- @position-try --right-center {
69
- position-area: center inline-end;
70
- margin-inline-start: var(--ring-popup-offset);
71
- }
72
-
73
- @position-try --right-top {
74
- position-area: span-block-start inline-end;
75
- margin-inline-start: var(--ring-popup-offset);
76
- }
77
-
78
- @position-try --right-bottom {
79
- position-area: span-block-end inline-end;
80
- margin-inline-start: var(--ring-popup-offset);
81
- }
82
-
83
- @position-try --left-center {
84
- position-area: center inline-start;
85
- margin-inline-end: var(--ring-popup-offset);
86
- }
87
-
88
- @position-try --left-top {
89
- position-area: span-block-start inline-start;
90
- margin-inline-end: var(--ring-popup-offset);
91
- }
92
-
93
- @position-try --left-bottom {
94
- position-area: span-block-end inline-start;
95
- margin-inline-end: var(--ring-popup-offset);
96
- }
97
-
98
-
99
22
  .largeBorderRadius {
100
23
  border-radius: var(--ring-border-radius-large);
101
24
  }
@@ -32,7 +32,6 @@ export interface BasePopupProps {
32
32
  withTail?: boolean;
33
33
  tailOffset?: number;
34
34
  largeBorderRadius?: boolean;
35
- cssPositioning?: boolean;
36
35
  anchorElement?: HTMLElement | null | undefined;
37
36
  target?: string | Element | null | undefined;
38
37
  className?: string | null | undefined;
@@ -84,7 +83,6 @@ export default class Popup<P extends BasePopupProps = PopupProps> extends PureCo
84
83
  trapFocus: boolean;
85
84
  autoFocusFirst: boolean;
86
85
  legacy: boolean;
87
- cssPositioning: boolean;
88
86
  };
89
87
  state: PopupState;
90
88
  componentDidMount(): void;
@@ -15,7 +15,6 @@ import position from './position';
15
15
  import styles from './popup.css';
16
16
  import { DEFAULT_DIRECTIONS, Dimension, Directions, Display, MaxHeight, MinWidth } from './popup.consts';
17
17
  import { PopupTargetContext, PopupTarget } from './popup.target';
18
- import { setCSSAnchorPositioning, supportsCSSAnchorPositioning } from './position-css';
19
18
  export { PopupTargetContext, PopupTarget };
20
19
  const isPossibleClientSideNavigation = (event) => {
21
20
  const target = event.target;
@@ -66,7 +65,6 @@ export default class Popup extends PureComponent {
66
65
  trapFocus: false,
67
66
  autoFocusFirst: false,
68
67
  legacy: false,
69
- cssPositioning: false,
70
68
  };
71
69
  state = {
72
70
  display: Display.SHOWING,
@@ -162,37 +160,21 @@ export default class Popup extends PureComponent {
162
160
  };
163
161
  _updatePosition = () => {
164
162
  const popup = this.popup;
165
- const anchor = this._getAnchor();
166
163
  if (popup) {
167
- if (this.props.cssPositioning && supportsCSSAnchorPositioning() && anchor) {
168
- // Use CSS Anchor positioning
169
- setCSSAnchorPositioning({
170
- popup,
171
- anchor,
172
- uid: this.uid,
173
- minWidth: this.props.minWidth,
174
- top: this.props.top,
175
- left: this.props.left,
176
- directions: this.props.directions,
177
- offset: this.props.offset,
178
- });
179
- }
180
- else {
181
- popup.style.position = 'absolute';
182
- if (this.isVisible()) {
183
- const { styles: style, direction } = this.position();
184
- Object.entries(style).forEach(([key, value]) => {
185
- const propKey = key;
186
- if (typeof value === 'number') {
187
- popup.style[propKey] = `${value}px`;
188
- }
189
- else {
190
- popup.style[propKey] = value.toString();
191
- }
192
- });
193
- if (direction != null) {
194
- this._updateDirection(direction);
164
+ popup.style.position = 'absolute';
165
+ if (this.isVisible()) {
166
+ const { styles: style, direction } = this.position();
167
+ Object.entries(style).forEach(([key, value]) => {
168
+ const propKey = key;
169
+ if (typeof value === 'number') {
170
+ popup.style[propKey] = `${value}px`;
195
171
  }
172
+ else {
173
+ popup.style[propKey] = value.toString();
174
+ }
175
+ });
176
+ if (direction != null) {
177
+ this._updateDirection(direction);
196
178
  }
197
179
  }
198
180
  this.setState(this.calculateDisplay);
@@ -217,20 +199,16 @@ export default class Popup extends PureComponent {
217
199
  clearTimeout(this._prevTimeout);
218
200
  this._prevTimeout = window.setTimeout(() => {
219
201
  this._listenersEnabled = true;
220
- // CSS positioning doesn't need resize/scroll listeners as it's handled by CSS
221
- // But we need them if CSS positioning isn't supported
222
- if (!this.props.cssPositioning || !supportsCSSAnchorPositioning()) {
223
- this.listeners.add(window, 'resize', this._redraw);
224
- if (this.props.autoPositioningOnScroll) {
225
- this.listeners.add(window, 'scroll', this._redraw);
226
- }
227
- let el = this._getAnchor();
228
- while (el) {
229
- this.listeners.add(el, 'scroll', this._redraw);
230
- el = el.parentElement;
231
- }
202
+ this.listeners.add(window, 'resize', this._redraw);
203
+ if (this.props.autoPositioningOnScroll) {
204
+ this.listeners.add(window, 'scroll', this._redraw);
232
205
  }
233
206
  this.listeners.add(document, 'pointerdown', this._onDocumentClick, true);
207
+ let el = this._getAnchor();
208
+ while (el) {
209
+ this.listeners.add(el, 'scroll', this._redraw);
210
+ el = el.parentElement;
211
+ }
234
212
  }, 0);
235
213
  return;
236
214
  }
@@ -279,11 +257,8 @@ export default class Popup extends PureComponent {
279
257
  };
280
258
  render() {
281
259
  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
260
  const showing = this.state.display === Display.SHOWING;
284
261
  const classes = classNames(className, styles.popup, {
285
- [styles.jsAnchoredPopup]: !useCssPositioning,
286
- [styles.cssAnchoredPopup]: useCssPositioning,
287
262
  [styles.attached]: attached,
288
263
  [styles.hidden]: hidden,
289
264
  [styles.showing]: showing,
@@ -24,7 +24,6 @@ export interface PositionAttrs {
24
24
  }
25
25
  export declare const positionPropKeys: readonly ["directions", "autoPositioning", "autoCorrectTopOverflow", "sidePadding", "top", "left", "offset", "maxHeight", "minWidth"];
26
26
  export declare function maxHeightForDirection(direction: Directions, anchorNode: Element, containerNode?: Element | null): number | null;
27
- export declare function calculateMinWidth(anchorWidth: number, minWidth: PositionAttrs['minWidth']): number | null;
28
27
  export default function position(attrs: PositionAttrs): {
29
28
  styles: PositionStyles;
30
29
  direction: Directions | null;
@@ -126,15 +126,6 @@ export function maxHeightForDirection(direction, anchorNode, containerNode) {
126
126
  return null;
127
127
  }
128
128
  }
129
- export function calculateMinWidth(anchorWidth, minWidth) {
130
- if (minWidth === MinWidth.TARGET || minWidth === 'target') {
131
- return anchorWidth;
132
- }
133
- else if (minWidth) {
134
- return anchorWidth < minWidth ? minWidth : anchorWidth;
135
- }
136
- return null;
137
- }
138
129
  export default function position(attrs) {
139
130
  const { popup, anchor, container, directions, autoPositioning, sidePadding, top, left, offset, maxHeight, minWidth, autoCorrectTopOverflow = true, } = attrs;
140
131
  let styles = {
@@ -194,9 +185,11 @@ export default function position(attrs) {
194
185
  scroll,
195
186
  });
196
187
  }
197
- const newMinWidth = calculateMinWidth(anchorRect.width, minWidth);
198
- if (newMinWidth !== null) {
199
- styles.minWidth = newMinWidth;
188
+ if (minWidth === MinWidth.TARGET || minWidth === 'target') {
189
+ styles.minWidth = anchorRect.width;
190
+ }
191
+ else if (minWidth) {
192
+ styles.minWidth = anchorRect.width < minWidth ? minWidth : anchorRect.width;
200
193
  }
201
194
  return { styles, direction: chosenDirection };
202
195
  }
@@ -47,7 +47,6 @@ export default class PopupMenu<T = unknown> extends Popup<PopupMenuProps<T>> {
47
47
  trapFocus: boolean;
48
48
  autoFocusFirst: boolean;
49
49
  legacy: boolean;
50
- cssPositioning: boolean;
51
50
  data: never[];
52
51
  restoreActiveIndex: boolean;
53
52
  activateSingleItem: boolean;
@@ -1,6 +1,7 @@
1
1
  @import "../global/variables.css";
2
2
 
3
- :root {
3
+ :root,
4
+ :host {
4
5
  --ring-progress-bar-background-color: rgba(0, 0, 0, 0.2);
5
6
  --ring-progress-bar-line-background-color: rgba(255, 255, 255, 0.6);
6
7
  }
@@ -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, { cssPositioning: true, 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" }) }))] })) }) }));
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);
@@ -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, cssPositioning: true, 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] }) }));
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, { cssPositioning: true, directions: morePopupDirections, className: morePopupClassName, onSelect: onSelectHandler, data: data })), [data, morePopupClassName, onSelectHandler]);
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
  }
@@ -3,7 +3,8 @@
3
3
  /* ensure styles order */
4
4
  @import "../link/link.css";
5
5
 
6
- :root {
6
+ :root,
7
+ :host {
7
8
  --ring-selected-tab-color: var(--ring-text-color);
8
9
  }
9
10
 
@@ -1,6 +1,7 @@
1
1
  @import "../global/variables.css";
2
2
 
3
- :root {
3
+ :root,
4
+ :host {
4
5
  --ring-tooltip-background-color: var(--ring-content-background-color);
5
6
  --ring-tooltip-text-color: var(--ring-text-color);
6
7
  }
@@ -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, cssPositioning: true, children: user
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.60-beta.0",
3
+ "version": "7.0.60",
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
- "console-errors": "jest console-errors.test.js --watchAll",
56
- "console-errors-ci": "jest console-errors.test.js --reporters=jest-teamcity",
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
- "chromatic": "npx chromatic --build-script-name build-stories --exit-once-uploaded",
64
- "chromatic-local": "dotenv -- npm run publish-stories",
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
- "prebuild": "rimraf components && tsc --project tsconfig-build.json && cpy './**/*' '!**/*.stories.*' '!**/*.ts' '!**/*.tsx' '!**/__mocks__/**' ../components --parents --cwd=src/",
70
- "build": "BROWSERSLIST_ENV=dist ./node_modules/.bin/rollup -c --bundleConfigAsCjs",
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 && git status",
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
- "validate-tc-config": "mvn --file .teamcity/pom.xml org.jetbrains.teamcity:teamcity-configs-maven-plugin:generate -e",
82
- "pretest-ci": "npm run lint-ci",
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-ci": "node tsc-teamcity",
86
- "prerelease-ci": "git pull",
87
- "release-ci": "npm version $NPM_VERSION_PARAMS && npm publish --access=public $NPM_PUBLISH_PARAMS",
88
- "postrelease-ci": "git push --follow-tags",
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,28 +95,28 @@
98
95
  },
99
96
  "readmeFilename": "README.md",
100
97
  "devDependencies": {
101
- "@babel/cli": "^7.28.0",
98
+ "@babel/cli": "^7.28.3",
102
99
  "@babel/eslint-parser": "^7.28.0",
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.33.0",
104
+ "@eslint/js": "^9.34.0",
108
105
  "@figma/code-connect": "^1.3.4",
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.15.5",
110
+ "@primer/octicons": "^19.16.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.2",
119
- "@storybook/addon-docs": "^9.1.2",
120
- "@storybook/addon-themes": "^9.1.2",
115
+ "@storybook/addon-a11y": "9.1.4",
116
+ "@storybook/addon-docs": "^9.1.4",
117
+ "@storybook/addon-themes": "^9.1.4",
121
118
  "@storybook/csf": "^0.1.13",
122
- "@storybook/react-webpack5": "9.1.2",
119
+ "@storybook/react-webpack5": "9.1.4",
123
120
  "@storybook/test-runner": "^0.23.0",
124
121
  "@testing-library/dom": "^10.4.1",
125
122
  "@testing-library/react": "^16.3.0",
@@ -129,23 +126,22 @@
129
126
  "@types/chai-dom": "1.11.3",
130
127
  "@types/eslint__js": "^9.14.0",
131
128
  "@types/markdown-it": "^14.1.2",
132
- "@types/react": "^19.1.10",
133
- "@types/react-dom": "^19.1.7",
129
+ "@types/react": "^19.1.12",
130
+ "@types/react-dom": "^19.1.8",
134
131
  "@types/webpack-env": "^1.18.8",
135
- "@vitejs/plugin-react": "^5.0.0",
136
- "@vitest/eslint-plugin": "^1.3.4",
132
+ "@vitejs/plugin-react": "^5.0.2",
133
+ "@vitest/eslint-plugin": "^1.3.6",
137
134
  "acorn": "^8.15.0",
138
135
  "babel-plugin-require-context-hook": "^1.0.0",
139
- "caniuse-lite": "^1.0.30001731",
140
- "chai": "^5.2.1",
141
- "chai-as-promised": "^8.0.1",
136
+ "caniuse-lite": "^1.0.30001739",
137
+ "chai": "^5.3.1",
138
+ "chai-as-promised": "^8.0.2",
142
139
  "chai-dom": "^1.12.1",
143
140
  "cheerio": "^1.1.2",
144
- "chromatic": "^13.1.3",
145
- "core-js": "^3.45.0",
141
+ "core-js": "^3.45.1",
146
142
  "cpy-cli": "^6.0.0",
147
143
  "dotenv-cli": "^10.0.0",
148
- "eslint": "^9.33.0",
144
+ "eslint": "^9.34.0",
149
145
  "eslint-config-prettier": "^10.1.8",
150
146
  "eslint-formatter-jslint-xml": "^8.40.0",
151
147
  "eslint-import-resolver-exports": "^1.0.0-beta.5",
@@ -155,18 +151,18 @@
155
151
  "eslint-plugin-prettier": "^5.5.4",
156
152
  "eslint-plugin-react": "^7.37.5",
157
153
  "eslint-plugin-react-hooks": "^5.2.0",
158
- "eslint-plugin-storybook": "^9.1.2",
154
+ "eslint-plugin-storybook": "^9.1.4",
159
155
  "events": "^3.3.0",
160
156
  "glob": "^11.0.3",
161
157
  "globals": "^16.3.0",
162
- "html-webpack-plugin": "^5.6.3",
158
+ "html-webpack-plugin": "^5.6.4",
163
159
  "http-server": "^14.1.1",
164
160
  "husky": "^9.1.7",
165
161
  "identity-obj-proxy": "^3.0.0",
166
- "jest": "~30.0.5",
167
- "jest-environment-jsdom": "^30.0.5",
162
+ "jest": "~30.1.1",
163
+ "jest-environment-jsdom": "^30.1.1",
168
164
  "jest-teamcity": "^1.12.0",
169
- "lint-staged": "^16.1.5",
165
+ "lint-staged": "^16.1.6",
170
166
  "markdown-it": "^14.1.0",
171
167
  "merge-options": "^3.0.4",
172
168
  "pinst": "^3.0.0",
@@ -176,20 +172,20 @@
176
172
  "react-dom": "^19.1.1",
177
173
  "regenerator-runtime": "^0.14.1",
178
174
  "rimraf": "^6.0.1",
179
- "rollup": "^4.46.2",
175
+ "rollup": "^4.50.0",
180
176
  "rollup-plugin-clear": "^2.0.7",
181
177
  "storage-mock": "^2.1.0",
182
- "storybook": "9.1.2",
178
+ "storybook": "9.1.4",
183
179
  "stylelint": "^16.23.1",
184
180
  "svg-inline-loader": "^0.8.2",
185
181
  "teamcity-service-messages": "^0.1.14",
186
182
  "terser-webpack-plugin": "^5.3.14",
187
183
  "typescript": "~5.9.2",
188
- "typescript-eslint": "^8.39.1",
184
+ "typescript-eslint": "^8.41.0",
189
185
  "vitest": "^3.2.4",
190
186
  "vitest-teamcity-reporter": "^0.3.1",
191
187
  "wallaby-webpack": "^3.9.16",
192
- "webpack": "^5.101.1",
188
+ "webpack": "^5.101.3",
193
189
  "webpack-cli": "^6.0.1",
194
190
  "xmlappend": "^1.0.4"
195
191
  },
@@ -213,7 +209,7 @@
213
209
  }
214
210
  },
215
211
  "dependencies": {
216
- "@babel/core": "^7.28.0",
212
+ "@babel/core": "^7.28.3",
217
213
  "@babel/preset-typescript": "^7.27.1",
218
214
  "@jetbrains/babel-preset-jetbrains": "^2.4.0",
219
215
  "@jetbrains/icons": "^5.12.0",
@@ -243,9 +239,9 @@
243
239
  "postcss-calc": "^10.1.1",
244
240
  "postcss-flexbugs-fixes": "^5.0.2",
245
241
  "postcss-font-family-system-ui": "^5.0.0",
246
- "postcss-loader": "^8.1.1",
242
+ "postcss-loader": "^8.2.0",
247
243
  "postcss-modules-values-replace": "^4.2.2",
248
- "postcss-preset-env": "^10.2.4",
244
+ "postcss-preset-env": "^10.3.1",
249
245
  "react-movable": "^3.4.1",
250
246
  "react-virtualized": "^9.22.6",
251
247
  "react-waypoint": "^10.3.0",
@@ -1,14 +0,0 @@
1
- import { Directions } from './popup.consts';
2
- export declare const supportsCSSAnchorPositioning: () => boolean;
3
- interface SetCSSAnchorPositioningParams {
4
- popup: HTMLElement;
5
- anchor: HTMLElement;
6
- uid: string;
7
- minWidth?: number | 'target' | null;
8
- top?: number;
9
- left?: number;
10
- directions: readonly Directions[];
11
- offset?: number;
12
- }
13
- export declare const setCSSAnchorPositioning: ({ popup, anchor, uid, minWidth, top, left, directions, offset, }: SetCSSAnchorPositioningParams) => void;
14
- export {};
@@ -1,77 +0,0 @@
1
- import { getRect } from '../global/dom';
2
- import { calculateMinWidth } from './position';
3
- import { Directions } from './popup.consts';
4
- export const supportsCSSAnchorPositioning = () => {
5
- return CSS?.supports?.('anchor-name', 'none');
6
- };
7
- const getPositionArea = (direction) => {
8
- switch (direction) {
9
- case Directions.BOTTOM_RIGHT:
10
- return ['block-end span-inline-end', '--bottom-right'];
11
- case Directions.BOTTOM_LEFT:
12
- return ['block-end span-inline-start', '--bottom-left'];
13
- case Directions.BOTTOM_CENTER:
14
- return ['block-end center', '--bottom-center'];
15
- case Directions.TOP_CENTER:
16
- return ['block-start center', '--top-center'];
17
- case Directions.TOP_RIGHT:
18
- return ['block-start span-inline-end', '--top-right'];
19
- case Directions.TOP_LEFT:
20
- return ['block-start span-inline-start', '--top-left'];
21
- case Directions.RIGHT_CENTER:
22
- return ['center inline-end', '--right-center'];
23
- case Directions.RIGHT_TOP:
24
- return ['span-block-start inline-end', '--right-top'];
25
- case Directions.RIGHT_BOTTOM:
26
- return ['span-block-end inline-end', '--right-bottom'];
27
- case Directions.LEFT_CENTER:
28
- return ['center inline-start', '--left-center'];
29
- case Directions.LEFT_TOP:
30
- return ['span-block-start inline-start', '--left-top'];
31
- case Directions.LEFT_BOTTOM:
32
- return ['span-block-end inline-start', '--left-bottom'];
33
- default:
34
- return ['block-end span-inline-end', '--bottom-right'];
35
- }
36
- };
37
- const getPositionFallbacks = (directions) => {
38
- return directions
39
- .slice(1)
40
- .map(direction => getPositionArea(direction)[1])
41
- .join(', ');
42
- };
43
- export const setCSSAnchorPositioning = ({ popup, anchor, uid, minWidth, top, left, directions, offset, }) => {
44
- const anchorName = anchor.style.getPropertyValue('anchor-name') || `--anchor-${uid}`;
45
- if (!anchor.style.getPropertyValue('anchor-name')) {
46
- anchor.style.setProperty('anchor-name', anchorName);
47
- }
48
- // Set positioning properties on the popup using setProperty
49
- popup.style.position = 'absolute';
50
- popup.style.setProperty('position-anchor', anchorName);
51
- const calculatedMinWidth = calculateMinWidth(getRect(anchor).width, minWidth);
52
- if (calculatedMinWidth !== null) {
53
- popup.style.minWidth = `${calculatedMinWidth}px`;
54
- }
55
- if (top) {
56
- popup.style.top = `${top}px`;
57
- }
58
- if (left) {
59
- popup.style.left = `${left}px`;
60
- }
61
- const [initialPositionStyle, initialPositionName] = getPositionArea(directions[0]);
62
- popup.style.setProperty('position-area', initialPositionStyle);
63
- if (offset) {
64
- popup.style.setProperty('--ring-popup-offset', `${offset}px`);
65
- if (initialPositionName.startsWith('--bottom') || initialPositionName.startsWith('--top')) {
66
- popup.style.margin = `${offset}px 0`;
67
- }
68
- else {
69
- popup.style.margin = `0 ${offset}px`;
70
- }
71
- }
72
- // Add fallbacks for better positioning if there are multiple directions
73
- const fallbacks = getPositionFallbacks(directions);
74
- if (fallbacks) {
75
- popup.style.setProperty('position-try-fallbacks', fallbacks);
76
- }
77
- };
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 '&lt;';
7
- case '>':
8
- return '&gt;';
9
- case '&':
10
- return '&amp;';
11
- case '"':
12
- return '&quot;';
13
- case "'":
14
- return '&apos;';
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
- };