@jetbrains/ring-ui 7.0.0-beta.1 → 7.0.0-beta.3

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 (31) hide show
  1. package/components/alert-service/alert-service.js +2 -2
  2. package/components/auth/auth__core.d.ts +1 -1
  3. package/components/breadcrumbs/breadcrumbs.css +1 -0
  4. package/components/dialog/dialog.js +6 -1
  5. package/components/global/composeRefs.d.ts +0 -3
  6. package/components/global/composeRefs.js +0 -3
  7. package/components/global/theme.d.ts +3 -0
  8. package/components/global/theme.js +16 -10
  9. package/components/header/header.css +1 -14
  10. package/components/header/header.d.ts +0 -1
  11. package/components/header/header.js +0 -1
  12. package/components/header/links.d.ts +2 -0
  13. package/components/header/links.js +7 -0
  14. package/components/icon/icon__svg.js +6 -1
  15. package/components/input/input.js +1 -1
  16. package/components/list/list.js +1 -1
  17. package/components/scrollable-section/scrollable-section.css +31 -0
  18. package/components/{header → scrollable-section}/scrollable-section.js +11 -6
  19. package/components/select/select.js +15 -7
  20. package/components/select/select__filter.js +6 -1
  21. package/components/table/table.js +1 -2
  22. package/components/tag/tag.css +3 -48
  23. package/components/tag/tag.d.ts +0 -2
  24. package/components/tag/tag.js +0 -7
  25. package/package.json +28 -28
  26. package/components/global/react-render-adapter.d.ts +0 -1
  27. package/components/global/react-render-adapter.js +0 -3
  28. package/components/header/tray-icon.d.ts +0 -1
  29. package/components/header/tray-icon.js +0 -2
  30. package/components/palette/palette.css +0 -220
  31. /package/components/{header → scrollable-section}/scrollable-section.d.ts +0 -0
@@ -71,11 +71,11 @@ class AlertService {
71
71
  timeout,
72
72
  isClosing: false,
73
73
  onCloseRequest: () => {
74
- onCloseRequest && onCloseRequest();
74
+ onCloseRequest?.();
75
75
  this.startAlertClosing(alert);
76
76
  },
77
77
  onClose: () => {
78
- onClose && onClose();
78
+ onClose?.();
79
79
  this.removeWithoutAnimation(alert.key);
80
80
  },
81
81
  ...restOptions
@@ -1,6 +1,6 @@
1
1
  import Listeners, { Handler } from '../global/listeners';
2
2
  import HTTP, { HTTPAuth, RequestParams } from '../http/http';
3
- import AuthDialogService from '../auth-dialog-service/auth-dialog-service';
3
+ import type AuthDialogService from '../auth-dialog-service/auth-dialog-service';
4
4
  import AuthStorage, { AuthState } from './storage';
5
5
  import { AuthError, AuthResponse } from './response-parser';
6
6
  import AuthRequestBuilder from './request-builder';
@@ -4,4 +4,5 @@
4
4
  color: var(--ring-borders-color);
5
5
 
6
6
  font-size: 16px;
7
+ line-height: 16px;
7
8
  }
@@ -85,7 +85,12 @@ export default class Dialog extends PureComponent {
85
85
  if (this.nativeDialog.current != null) {
86
86
  if (show) {
87
87
  this.nativeDialog.current.removeAttribute('open');
88
- modal ? this.nativeDialog.current.showModal() : this.nativeDialog.current.show();
88
+ if (modal) {
89
+ this.nativeDialog.current.showModal();
90
+ }
91
+ else {
92
+ this.nativeDialog.current.show();
93
+ }
89
94
  }
90
95
  else {
91
96
  this.nativeDialog.current.close();
@@ -1,5 +1,2 @@
1
1
  import { Ref } from 'react';
2
- declare function composeRefs<T>(...refs: (Ref<T> | undefined)[]): (value: T | null) => void;
3
- declare const _default: typeof composeRefs;
4
- export default _default;
5
2
  export declare function createComposedRef<T>(): import("memoize-one").MemoizedFn<(...refs: (Ref<T> | undefined)[]) => (value: T | null) => void>;
@@ -1,5 +1,4 @@
1
1
  import memoizeOne from 'memoize-one';
2
- import deprecate from 'util-deprecate';
3
2
  function composeRefs(...refs) {
4
3
  return (value) => refs.forEach(ref => {
5
4
  if (typeof ref === 'function') {
@@ -10,8 +9,6 @@ function composeRefs(...refs) {
10
9
  }
11
10
  });
12
11
  }
13
- // TODO remove export in 7.0, composeRefs should be used only in createComposedRef and in useComposedRefs in the future
14
- export default deprecate(composeRefs, 'composeRefs is deprecated and will be removed in 7.0. Use createComposedRef instead.');
15
12
  export function createComposedRef() {
16
13
  return memoizeOne((composeRefs));
17
14
  }
@@ -4,6 +4,9 @@ declare enum Theme {
4
4
  LIGHT = "light",
5
5
  DARK = "dark"
6
6
  }
7
+ export declare const ThemeContext: import("react").Context<{
8
+ theme: Theme.LIGHT | Theme.DARK;
9
+ }>;
7
10
  export declare function useTheme(): Theme.LIGHT | Theme.DARK;
8
11
  export declare function useThemeClasses(theme: Theme): string;
9
12
  export interface WithThemeClassesProps {
@@ -1,4 +1,4 @@
1
- import { useMemo, useState, useEffect, forwardRef, useContext } from 'react';
1
+ import { useMemo, useState, useEffect, forwardRef, useContext, createContext } from 'react';
2
2
  import classNames from 'classnames';
3
3
  import { createPortal } from 'react-dom';
4
4
  import { PopupTarget, PopupTargetContext } from '../popup/popup.target';
@@ -12,6 +12,8 @@ var Theme;
12
12
  Theme["LIGHT"] = "light";
13
13
  Theme["DARK"] = "dark";
14
14
  })(Theme || (Theme = {}));
15
+ export const ThemeContext = createContext({ theme: Theme.LIGHT });
16
+ const GLOBAL_DARK_CLASS_NAME = 'ring-ui-theme-dark';
15
17
  const darkMatcher = window.matchMedia('(prefers-color-scheme: dark)');
16
18
  export function useTheme() {
17
19
  const [dark, setDark] = useState(darkMatcher.matches);
@@ -27,6 +29,7 @@ export function useThemeClasses(theme) {
27
29
  const resolvedTheme = theme === Theme.AUTO ? systemTheme : theme;
28
30
  return classNames({
29
31
  [styles.dark]: resolvedTheme === Theme.DARK,
32
+ [GLOBAL_DARK_CLASS_NAME]: resolvedTheme === Theme.DARK,
30
33
  [defaultStyles.light]: resolvedTheme === Theme.LIGHT
31
34
  });
32
35
  }
@@ -38,11 +41,11 @@ export function applyTheme(theme, container) {
38
41
  if (theme === Theme.DARK) {
39
42
  container.classList.remove(defaultStyles.light);
40
43
  container.classList.add(styles.dark);
41
- container.classList.add('ring-ui-theme-dark');
44
+ container.classList.add(GLOBAL_DARK_CLASS_NAME);
42
45
  }
43
46
  else {
44
47
  container.classList.remove(styles.dark);
45
- container.classList.remove('ring-ui-theme-dark');
48
+ container.classList.remove(GLOBAL_DARK_CLASS_NAME);
46
49
  container.classList.add(defaultStyles.light);
47
50
  }
48
51
  }
@@ -50,6 +53,7 @@ export const ThemeProvider = forwardRef(function ThemeProvider({ theme = Theme.A
50
53
  const systemTheme = useTheme();
51
54
  const resolvedTheme = theme === Theme.AUTO ? systemTheme : theme;
52
55
  const id = useMemo(() => getUID('popups-with-theme-'), []);
56
+ const themeValue = useMemo(() => ({ theme: resolvedTheme }), [resolvedTheme]);
53
57
  useEffect(() => {
54
58
  if (target != null) {
55
59
  applyTheme(resolvedTheme, target);
@@ -57,14 +61,16 @@ export const ThemeProvider = forwardRef(function ThemeProvider({ theme = Theme.A
57
61
  }, [resolvedTheme, target]);
58
62
  const themeClasses = useThemeClasses(theme);
59
63
  const parentTarget = useContext(PopupTargetContext);
60
- return (<div ref={ref} className={target != null ? undefined : classNames(className, themeClasses)} {...restProps}>{passToPopups
64
+ return (<ThemeContext.Provider value={themeValue}>
65
+ <div ref={ref} className={target != null ? undefined : classNames(className, themeClasses)} {...restProps}>{passToPopups
61
66
  ? (<PopupTarget id={id}>
62
- {popupTarget => (<>
63
- {children}
64
- {createPortal(<div className={themeClasses}>{popupTarget}</div>, parentTarget && getPopupContainer(parentTarget) || document.body)}
65
- </>)}
66
- </PopupTarget>)
67
+ {popupTarget => (<>
68
+ {children}
69
+ {createPortal(<div className={themeClasses}>{popupTarget}</div>, parentTarget && getPopupContainer(parentTarget) || document.body)}
70
+ </>)}
71
+ </PopupTarget>)
67
72
  : children}
68
- </div>);
73
+ </div>
74
+ </ThemeContext.Provider>);
69
75
  });
70
76
  export default Theme;
@@ -97,26 +97,13 @@
97
97
  padding: calc(var(--ring-unit) * 2) calc(var(--ring-unit) * 1.5);
98
98
  }
99
99
 
100
- .scrollableSection {
100
+ .links {
101
101
  display: flex;
102
- overflow: auto;
103
102
  flex-direction: column;
104
103
 
105
104
  min-height: calc(var(--ring-unit) * 5);
106
105
  }
107
106
 
108
- .withTopBorder {
109
- box-shadow: inset 0 1px 0 var(--ring-line-color);
110
- }
111
-
112
- .withBottomBorder {
113
- box-shadow: inset 0 -1px 0 var(--ring-line-color);
114
- }
115
-
116
- .withTopBorder.withBottomBorder {
117
- box-shadow: inset 0 -1px 0 var(--ring-line-color), inset 0 1px 0 var(--ring-line-color);
118
- }
119
-
120
107
  .tray {
121
108
  align-items: flex-end;
122
109
 
@@ -30,7 +30,6 @@ export default Header;
30
30
  export { default as Logo } from './logo';
31
31
  export { default as Tray } from './tray';
32
32
  export { default as HeaderIcon } from './header-icon';
33
- export { default as TrayIcon } from './tray-icon';
34
33
  export { default as Profile } from './profile';
35
34
  export { default as SmartProfile } from './smart-profile';
36
35
  export { default as Services } from './services';
@@ -41,7 +41,6 @@ export default Header;
41
41
  export { default as Logo } from './logo';
42
42
  export { default as Tray } from './tray';
43
43
  export { default as HeaderIcon } from './header-icon';
44
- export { default as TrayIcon } from './tray-icon';
45
44
  export { default as Profile } from './profile';
46
45
  export { default as SmartProfile } from './smart-profile';
47
46
  export { default as Services } from './services';
@@ -0,0 +1,2 @@
1
+ import { HTMLAttributes } from 'react';
2
+ export default function Links({ className, ...restProps }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import classNames from 'classnames';
2
+ import ScrollableSection from '../scrollable-section/scrollable-section';
3
+ import styles from './header.css';
4
+ // currently only supports vertical header
5
+ export default function Links({ className, ...restProps }) {
6
+ return (<ScrollableSection {...restProps} className={classNames(styles.links, className)}/>);
7
+ }
@@ -30,7 +30,12 @@ const getSVGFromSource = memoize((src) => {
30
30
  const svgContainer = document.createElement('div');
31
31
  svgContainer.innerHTML = src;
32
32
  const svg = svgContainer.firstElementChild;
33
- svg.remove ? svg.remove() : svgContainer.removeChild(svg);
33
+ if (svg.remove) {
34
+ svg.remove();
35
+ }
36
+ else {
37
+ svgContainer.removeChild(svg);
38
+ }
34
39
  return {
35
40
  props: extractSVGProps(svg),
36
41
  html: svg.innerHTML
@@ -77,7 +77,7 @@ export class Input extends PureComponent {
77
77
  };
78
78
  composedInputRef = createComposedRef();
79
79
  clear = (e) => {
80
- this.props.onClear && this.props.onClear(e);
80
+ this.props.onClear?.(e);
81
81
  };
82
82
  handleInputChange = (e) => {
83
83
  if (!this.props.multiline) {
@@ -407,7 +407,7 @@ export default class List extends Component {
407
407
  const isString = typeof identificator === 'string' || identificator instanceof String;
408
408
  if (identificator && !isString) {
409
409
  warnEmptyKey();
410
- `${itemProps.rgItemType}_${JSON.stringify(identificator)}`;
410
+ return `${itemProps.rgItemType}_${JSON.stringify(identificator)}`;
411
411
  }
412
412
  return `${itemProps.rgItemType}_${identificator}`;
413
413
  }
@@ -0,0 +1,31 @@
1
+
2
+
3
+ .scrollableSection {
4
+ --ring-scrollable-section-top-shadow: transparent;
5
+ --ring-scrollable-section-right-shadow: transparent;
6
+ --ring-scrollable-section-bottom-shadow: transparent;
7
+ --ring-scrollable-section-left-shadow: transparent;
8
+
9
+ overflow: auto;
10
+
11
+ box-shadow: inset 0 1px 0 var(--ring-scrollable-section-top-shadow),
12
+ inset -1px 0 0 var(--ring-scrollable-section-right-shadow),
13
+ inset 0 -1px 0 var(--ring-scrollable-section-bottom-shadow),
14
+ inset 1px 0 0 var(--ring-scrollable-section-left-shadow);
15
+ }
16
+
17
+ .withTopBorder {
18
+ --ring-scrollable-section-top-shadow: var(--ring-line-color);
19
+ }
20
+
21
+ .withRightBorder {
22
+ --ring-scrollable-section-right-shadow: var(--ring-line-color);
23
+ }
24
+
25
+ .withBottomBorder {
26
+ --ring-scrollable-section-bottom-shadow: var(--ring-line-color);
27
+ }
28
+
29
+ .withLeftBorder {
30
+ --ring-scrollable-section-left-shadow: var(--ring-line-color);
31
+ }
@@ -1,16 +1,19 @@
1
1
  import { useCallback, useEffect, useRef, useState } from 'react';
2
2
  import classNames from 'classnames';
3
- import styles from './header.css';
4
- // currently only supports vertical header
3
+ import styles from './scrollable-section.css';
5
4
  export default function ScrollableSection({ className, ...restProps }) {
6
- const [scrolledToTop, setScrolledToTop] = useState(true);
7
- const [scrolledToBottom, setScrolledToBottom] = useState(true);
5
+ const [scrolledToTop, setScrolledToTop] = useState(false);
6
+ const [scrolledToRight, setScrolledToRight] = useState(false);
7
+ const [scrolledToBottom, setScrolledToBottom] = useState(false);
8
+ const [scrolledToLeft, setScrolledToLeft] = useState(false);
8
9
  const ref = useRef(null);
9
10
  const calculateScrollPosition = useCallback(() => {
10
11
  if (ref.current != null) {
11
- const { scrollTop, scrollHeight, offsetHeight } = ref.current;
12
+ const { scrollTop, scrollLeft, scrollHeight, scrollWidth, offsetHeight, offsetWidth } = ref.current;
12
13
  setScrolledToTop(scrollTop === 0);
14
+ setScrolledToRight(offsetWidth + scrollLeft >= scrollWidth);
13
15
  setScrolledToBottom(offsetHeight + scrollTop >= scrollHeight);
16
+ setScrolledToLeft(scrollLeft === 0);
14
17
  }
15
18
  }, []);
16
19
  useEffect(() => {
@@ -20,6 +23,8 @@ export default function ScrollableSection({ className, ...restProps }) {
20
23
  }, [calculateScrollPosition]);
21
24
  return (<div {...restProps} className={classNames(styles.scrollableSection, className, {
22
25
  [styles.withTopBorder]: !scrolledToTop,
23
- [styles.withBottomBorder]: !scrolledToBottom
26
+ [styles.withRightBorder]: !scrolledToRight,
27
+ [styles.withBottomBorder]: !scrolledToBottom,
28
+ [styles.withLeftBorder]: !scrolledToLeft
24
29
  })} ref={ref} onScroll={calculateScrollPosition}/>);
25
30
  }
@@ -560,7 +560,9 @@ export default class Select extends Component {
560
560
  this.props.onChange(fakeSelected, event);
561
561
  });
562
562
  }
563
- !this._popup?.isVisible() && this.props.onBeforeOpen();
563
+ if (!this._popup?.isVisible()) {
564
+ this.props.onBeforeOpen();
565
+ }
564
566
  this.setState({ filterValue }, () => {
565
567
  this._showPopup();
566
568
  });
@@ -573,7 +575,9 @@ export default class Select extends Component {
573
575
  _redrawPopup = () => {
574
576
  if (this.props.multiple) {
575
577
  setTimeout(() => {
576
- this.isInputMode() && this.clearFilter();
578
+ if (this.isInputMode()) {
579
+ this.clearFilter();
580
+ }
577
581
  this._showPopup();
578
582
  }, 0);
579
583
  }
@@ -620,13 +624,10 @@ export default class Select extends Component {
620
624
  let nextSelection;
621
625
  if (!prevState.multipleMap[selected.key]) {
622
626
  nextSelection = currentSelection.concat(selected);
623
- this.props.onSelect && this.props.onSelect(selected, event);
624
627
  }
625
628
  else {
626
629
  nextSelection = currentSelection.filter(item => item.key !== selected.key);
627
- this.props.onDeselect && this.props.onDeselect(selected);
628
630
  }
629
- this.props.onChange(nextSelection, event);
630
631
  const nextState = {
631
632
  filterValue: '',
632
633
  selected: nextSelection,
@@ -648,6 +649,13 @@ export default class Select extends Component {
648
649
  }
649
650
  return { ...prevState, ...nextState };
650
651
  }, () => {
652
+ if (this.state.multipleMap[selected.key]) {
653
+ this.props.onSelect?.(selected, event);
654
+ }
655
+ else {
656
+ this.props.onDeselect?.(selected);
657
+ }
658
+ this.props.onChange(this.state.selected, event);
651
659
  if (tryKeepOpen) {
652
660
  this._redrawPopup();
653
661
  }
@@ -667,14 +675,14 @@ export default class Select extends Component {
667
675
  filter(item => !this.props.selected.
668
676
  find(selectedItem => item.key === selectedItem.key)).
669
677
  forEach(item => {
670
- this.props.onSelect && this.props.onSelect(item);
678
+ this.props.onSelect?.(item);
671
679
  });
672
680
  }
673
681
  else {
674
682
  nextSelection = [];
675
683
  currentSelection.
676
684
  forEach(item => {
677
- this.props.onDeselect && this.props.onDeselect(item);
685
+ this.props.onDeselect?.(item);
678
686
  });
679
687
  }
680
688
  this.props.onChange(nextSelection, event);
@@ -17,7 +17,12 @@ export default class SelectFilter extends Component {
17
17
  focus() {
18
18
  const { input } = this;
19
19
  if (input && input !== document.activeElement) {
20
- sniffr.browser.name === 'firefox' ? input.select() : input.focus();
20
+ if (sniffr.browser.name === 'firefox') {
21
+ input.select();
22
+ }
23
+ else {
24
+ input.focus();
25
+ }
21
26
  }
22
27
  }
23
28
  blur() {
@@ -46,8 +46,7 @@ export class Table extends PureComponent {
46
46
  isDisabledSelectionVisible: () => false,
47
47
  getCheckboxTooltip: () => undefined,
48
48
  RowComponent: Row,
49
- //TODO: change to false in 7.0
50
- wideFirstColumn: true
49
+ wideFirstColumn: false
51
50
  };
52
51
  state = {
53
52
  shortcutsScope: getUID('ring-table-'),
@@ -29,8 +29,7 @@
29
29
  line-height: var(--ring-line-height);
30
30
  }
31
31
 
32
- .tag,
33
- .tagAngled::before {
32
+ .tag {
34
33
  transition: background-color var(--ring-ease);
35
34
 
36
35
  background-color: var(--ring-tag-background-color);
@@ -61,62 +60,18 @@
61
60
  }
62
61
 
63
62
  .focused,
64
- .focused.tagAngled::before,
65
63
  .tag:focus-visible,
66
- .tagAngled:focus-visible::before,
67
- .tag:hover,
68
- .tagAngled:hover::before {
64
+ .tag:hover {
69
65
  transition: none;
70
66
 
71
67
  background-color: var(--ring-tag-hover-background-color);
72
68
  }
73
69
 
74
- .tagAngled {
75
- /* it needs to fix vertical alignment broken by "overflow: hidden". Remove this class, when IE11 will be deprecated */
76
-
77
- margin-bottom: -5px !important;
78
-
79
- margin-left: var(--ring-unit);
80
- padding-left: calc(var(--ring-unit) / 2);
81
-
82
- border-top-left-radius: 0;
83
- border-bottom-left-radius: 0;
84
-
85
- &::before {
86
- position: absolute;
87
- z-index: -1;
88
- top: 0;
89
- left: 0;
90
-
91
- box-sizing: border-box;
92
- width: 12px;
93
- height: 12px;
94
-
95
- content: "";
96
- transform: scaleY(1.177) rotate(45deg);
97
- transform-origin: 0 0;
98
-
99
- border: none;
100
- }
101
-
102
- &.focused,
103
- &:focus {
104
- box-shadow: 0 0 0 1px var(--ring-border-hover-color) inset, 0 0 0 1px var(--ring-border-hover-color);
105
- }
106
-
107
- &:focus::before {
108
- box-shadow:
109
- 1px -1px var(--ring-border-hover-color) inset,
110
- -0.8px 0.8px 0 0.5px var(--ring-border-hover-color);
111
- }
112
- }
113
-
114
70
  .content {
115
71
  composes: ellipsis from "../global/global.css";
116
72
  }
117
73
 
118
- .disabled.tag,
119
- .disabled.tagAngled::before {
74
+ .disabled.tag {
120
75
  pointer-events: none;
121
76
 
122
77
  color: var(--ring-disabled-color);
@@ -20,7 +20,6 @@ export interface TagProps {
20
20
  icon?: string | undefined;
21
21
  avatar?: string | null | undefined;
22
22
  rgTagTitle?: string | undefined;
23
- angled?: boolean | null | undefined;
24
23
  textColor?: string | undefined;
25
24
  backgroundColor?: string | undefined;
26
25
  }
@@ -38,7 +37,6 @@ export default class Tag extends PureComponent<TagProps> {
38
37
  readOnly: PropTypes.Requireable<boolean>;
39
38
  disabled: PropTypes.Requireable<boolean>;
40
39
  focused: PropTypes.Requireable<boolean>;
41
- angled: PropTypes.Requireable<boolean>;
42
40
  backgroundColor: PropTypes.Requireable<string>;
43
41
  textColor: PropTypes.Requireable<string>;
44
42
  children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
@@ -3,12 +3,10 @@ import * as React from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import classNames from 'classnames';
5
5
  import closeIcon from '@jetbrains/icons/close-12px';
6
- import deprecate from 'util-deprecate';
7
6
  import Icon from '../icon/icon';
8
7
  import Button from '../button/button';
9
8
  import { ControlsHeight } from '../global/controls-height';
10
9
  import styles from './tag.css';
11
- const warnAngled = deprecate(() => { }, 'Tag angled prop is deprecated and will be removed in Ring UI 7.0');
12
10
  /**
13
11
  * @name Tag
14
12
  */
@@ -23,7 +21,6 @@ export default class Tag extends PureComponent {
23
21
  readOnly: PropTypes.bool,
24
22
  disabled: PropTypes.bool,
25
23
  focused: PropTypes.bool,
26
- angled: PropTypes.bool,
27
24
  backgroundColor: PropTypes.string,
28
25
  textColor: PropTypes.string,
29
26
  children: PropTypes.node,
@@ -105,13 +102,9 @@ export default class Tag extends PureComponent {
105
102
  return null;
106
103
  }
107
104
  render() {
108
- if (this.props.angled) {
109
- warnAngled();
110
- }
111
105
  const classes = classNames('ring-js-shortcuts', styles.tag, {
112
106
  [styles.focused]: this.state.focused,
113
107
  [styles.disabled]: this.props.disabled,
114
- [styles.tagAngled]: this.props.angled,
115
108
  [styles.withRemove]: !this.props.readOnly
116
109
  }, this.props.className);
117
110
  const { backgroundColor, textColor, render } = this.props;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetbrains/ring-ui",
3
- "version": "7.0.0-beta.1",
3
+ "version": "7.0.0-beta.3",
4
4
  "description": "JetBrains UI library",
5
5
  "author": "JetBrains",
6
6
  "license": "Apache-2.0",
@@ -77,9 +77,9 @@
77
77
  "readmeFilename": "README.md",
78
78
  "devDependencies": {
79
79
  "@babel/cli": "^7.24.8",
80
- "@babel/eslint-parser": "^7.24.8",
81
- "@csstools/css-parser-algorithms": "^2.7.0",
82
- "@csstools/stylelint-no-at-nest-rule": "^2.0.0",
80
+ "@babel/eslint-parser": "^7.25.1",
81
+ "@csstools/css-parser-algorithms": "^3.0.0",
82
+ "@csstools/stylelint-no-at-nest-rule": "^3.0.0",
83
83
  "@jetbrains/eslint-config": "^5.4.2",
84
84
  "@jetbrains/logos": "3.0.0-canary.734b213.0",
85
85
  "@jetbrains/stylelint-config": "^4.0.2",
@@ -88,20 +88,20 @@
88
88
  "@rollup/plugin-json": "^6.1.0",
89
89
  "@rollup/plugin-node-resolve": "^15.2.3",
90
90
  "@rollup/plugin-replace": "^5.0.7",
91
- "@storybook/addon-a11y": "8.2.6",
92
- "@storybook/addon-docs": "8.2.6",
93
- "@storybook/addon-essentials": "8.2.6",
94
- "@storybook/components": "8.2.6",
95
- "@storybook/manager-api": "8.2.6",
96
- "@storybook/preview-api": "8.2.6",
97
- "@storybook/react": "8.2.6",
98
- "@storybook/react-webpack5": "8.2.6",
91
+ "@storybook/addon-a11y": "8.2.7",
92
+ "@storybook/addon-docs": "8.2.7",
93
+ "@storybook/addon-essentials": "8.2.7",
94
+ "@storybook/components": "8.2.7",
95
+ "@storybook/manager-api": "8.2.7",
96
+ "@storybook/preview-api": "8.2.7",
97
+ "@storybook/react": "8.2.7",
98
+ "@storybook/react-webpack5": "8.2.7",
99
99
  "@storybook/test-runner": "^0.19.1",
100
- "@storybook/theming": "8.2.6",
100
+ "@storybook/theming": "8.2.7",
101
101
  "@testing-library/dom": "^10.4.0",
102
102
  "@testing-library/react": "^16.0.0",
103
103
  "@testing-library/user-event": "^14.5.2",
104
- "@types/chai": "^4.3.16",
104
+ "@types/chai": "^4.3.17",
105
105
  "@types/chai-as-promised": "^7.1.8",
106
106
  "@types/chai-dom": "0.0.10",
107
107
  "@types/chai-enzyme": "^0.6.13",
@@ -112,20 +112,20 @@
112
112
  "@types/sinon": "^17.0.3",
113
113
  "@types/sinon-chai": "^3.2.12",
114
114
  "@types/webpack-env": "^1.18.5",
115
- "@typescript-eslint/eslint-plugin": "^7.17.0",
116
- "@typescript-eslint/parser": "^7.17.0",
115
+ "@typescript-eslint/eslint-plugin": "^8.0.0",
116
+ "@typescript-eslint/parser": "^8.0.0",
117
117
  "@vitejs/plugin-react": "^4.3.1",
118
118
  "@wojtekmaj/enzyme-adapter-react-17": "^0.8.0",
119
119
  "acorn": "^8.12.1",
120
120
  "axe-playwright": "^2.0.1",
121
121
  "babel-plugin-require-context-hook": "^1.0.0",
122
- "caniuse-lite": "^1.0.30001643",
122
+ "caniuse-lite": "^1.0.30001649",
123
123
  "chai": "^5.1.1",
124
124
  "chai-as-promised": "^8.0.0",
125
125
  "chai-dom": "^1.10.0",
126
126
  "chai-enzyme": "1.0.0-beta.1",
127
127
  "cheerio": "^1.0.0-rc.12",
128
- "core-js": "^3.37.1",
128
+ "core-js": "^3.38.0",
129
129
  "cpy-cli": "^5.0.0",
130
130
  "enzyme": "^3.11.0",
131
131
  "eslint": "^8.57.0",
@@ -140,12 +140,12 @@
140
140
  "glob": "^11.0.0",
141
141
  "html-webpack-plugin": "^5.6.0",
142
142
  "http-server": "^14.1.1",
143
- "husky": "^9.1.1",
143
+ "husky": "^9.1.4",
144
144
  "identity-obj-proxy": "^3.0.0",
145
145
  "jest": "~29.7.0",
146
146
  "jest-environment-jsdom": "^29.7.0",
147
147
  "jest-teamcity": "^1.12.0",
148
- "lint-staged": "^15.2.7",
148
+ "lint-staged": "^15.2.8",
149
149
  "markdown-it": "^14.1.0",
150
150
  "merge-options": "^3.0.4",
151
151
  "pinst": "^3.0.0",
@@ -156,21 +156,21 @@
156
156
  "react-test-renderer": "^18.3.1",
157
157
  "regenerator-runtime": "^0.14.1",
158
158
  "rimraf": "^6.0.1",
159
- "rollup": "^4.19.0",
159
+ "rollup": "^4.20.0",
160
160
  "rollup-plugin-clear": "^2.0.7",
161
161
  "rollup-plugin-styles": "^4.0.0",
162
162
  "sinon": "^18.0.0",
163
- "sinon-chai": "^3.7.0",
163
+ "sinon-chai": "^4.0.0",
164
164
  "storage-mock": "^2.1.0",
165
- "storybook": "8.2.6",
165
+ "storybook": "8.2.7",
166
166
  "storybook-addon-themes": "^6.1.0",
167
- "stylelint": "^16.7.0",
167
+ "stylelint": "^16.8.1",
168
168
  "svg-inline-loader": "^0.8.2",
169
169
  "teamcity-service-messages": "^0.1.14",
170
170
  "terser-webpack-plugin": "^5.3.10",
171
171
  "typescript": "~5.5.4",
172
- "vitest": "^2.0.4",
173
- "vitest-teamcity-reporter": "^0.3.0",
172
+ "vitest": "^2.0.5",
173
+ "vitest-teamcity-reporter": "^0.3.1",
174
174
  "wallaby-webpack": "^3.9.16",
175
175
  "webpack": "^5.93.0",
176
176
  "webpack-cli": "^5.1.4",
@@ -196,7 +196,7 @@
196
196
  }
197
197
  },
198
198
  "dependencies": {
199
- "@babel/core": "^7.24.9",
199
+ "@babel/core": "^7.25.2",
200
200
  "@babel/preset-typescript": "^7.24.7",
201
201
  "@jetbrains/babel-preset-jetbrains": "^2.4.0",
202
202
  "@jetbrains/icons": "^4.4.0",
@@ -210,7 +210,7 @@
210
210
  "@ungap/url-search-params": "^0.2.2",
211
211
  "babel-loader": "9.1.3",
212
212
  "babel-plugin-transform-define": "^2.1.4",
213
- "browserslist": "^4.23.2",
213
+ "browserslist": "^4.23.3",
214
214
  "change-case": "^4.1.1",
215
215
  "classnames": "^2.5.1",
216
216
  "combokeys": "^3.0.1",
@@ -1 +0,0 @@
1
- export declare const setClient: () => void;
@@ -1,3 +0,0 @@
1
- import deprecate from 'util-deprecate';
2
- // TODO remove in 7.0
3
- export const setClient = deprecate(() => { }, 'setClient does nothing in Ring UI 6.0 and will be removed in 7.0');
@@ -1 +0,0 @@
1
- export { type HeaderIconSpecificProps as TrayIconSpecificProps, default } from './header-icon';
@@ -1,2 +0,0 @@
1
- // TODO remove this file in 7.0
2
- export { default } from './header-icon';
@@ -1,220 +0,0 @@
1
- /* stylelint-disable color-no-hex */
2
-
3
- /**
4
- TODO: Drop in Ring UI 7.0
5
- */
6
-
7
- :global(.ring-palette_color-0) {
8
- color: #444;
9
- background-color: transparent;
10
- }
11
-
12
- :global(.ring-palette_color-1),
13
- :global(.ring-palette_tone-0-0) {
14
- color: #888;
15
- background-color: #e6e6e6;
16
- }
17
-
18
- :global(.ring-palette_color-2),
19
- :global(.ring-palette_tone-1-0) {
20
- color: #4da400;
21
- background-color: #e6f6cf;
22
- }
23
-
24
- :global(.ring-palette_color-3),
25
- :global(.ring-palette_tone-2-0) {
26
- color: #45818e;
27
- background-color: #d8f7f3;
28
- }
29
-
30
- :global(.ring-palette_color-4),
31
- :global(.ring-palette_tone-3-0) {
32
- color: #3d85c6;
33
- background-color: #e0f1fb;
34
- }
35
-
36
- :global(.ring-palette_color-5),
37
- :global(.ring-palette_tone-4-0) {
38
- color: #dc5766;
39
- background-color: #fce5f1;
40
- }
41
-
42
- :global(.ring-palette_color-6),
43
- :global(.ring-palette_tone-5-0) {
44
- color: #b45f06;
45
- background-color: #ffee9c;
46
- }
47
-
48
- :global(.ring-palette_color-7),
49
- :global(.ring-palette_tone-6-0) {
50
- color: #b45f06;
51
- background-color: #f7e9c1;
52
- }
53
-
54
- :global(.ring-palette_color-8),
55
- :global(.ring-palette_tone-0-1) {
56
- color: #444;
57
- background-color: #bababa;
58
- }
59
-
60
- :global(.ring-palette_color-9),
61
- :global(.ring-palette_tone-1-1) {
62
- color: #444;
63
- background-color: #b7e281;
64
- }
65
-
66
- :global(.ring-palette_color-10),
67
- :global(.ring-palette_tone-2-1) {
68
- color: #444;
69
- background-color: #92e1d5;
70
- }
71
-
72
- :global(.ring-palette_color-11),
73
- :global(.ring-palette_tone-3-1) {
74
- color: #444;
75
- background-color: #a6e0fc;
76
- }
77
-
78
- :global(.ring-palette_color-12),
79
- :global(.ring-palette_tone-4-1) {
80
- color: #444;
81
- background-color: #ffc8ea;
82
- }
83
-
84
- :global(.ring-palette_color-13),
85
- :global(.ring-palette_tone-5-1) {
86
- color: #444;
87
- background-color: #fed74a;
88
- }
89
-
90
- :global(.ring-palette_color-14),
91
- :global(.ring-palette_tone-6-1) {
92
- color: #444;
93
- background-color: #e0c378;
94
- }
95
-
96
- :global(.ring-palette_color-15),
97
- :global(.ring-palette_tone-0-2) {
98
- color: #fff;
99
- background-color: #878787;
100
- }
101
-
102
- :global(.ring-palette_color-16),
103
- :global(.ring-palette_tone-1-2) {
104
- color: #fff;
105
- background-color: #7dbd36;
106
- }
107
-
108
- :global(.ring-palette_color-17),
109
- :global(.ring-palette_tone-2-2) {
110
- color: #fff;
111
- background-color: #25beb2;
112
- }
113
-
114
- :global(.ring-palette_color-18),
115
- :global(.ring-palette_tone-3-2) {
116
- color: #fff;
117
- background-color: #42a3df;
118
- }
119
-
120
- :global(.ring-palette_color-19),
121
- :global(.ring-palette_tone-4-2) {
122
- color: #fff;
123
- background-color: #ff7bc3;
124
- }
125
-
126
- :global(.ring-palette_color-20),
127
- :global(.ring-palette_tone-5-2) {
128
- color: #fff;
129
- background-color: #ff7123;
130
- }
131
-
132
- :global(.ring-palette_color-21),
133
- :global(.ring-palette_tone-6-2) {
134
- color: #fff;
135
- background-color: #ce6700;
136
- }
137
-
138
- :global(.ring-palette_color-22),
139
- :global(.ring-palette_tone-0-3) {
140
- color: #fff;
141
- background-color: #4d4d4d;
142
- }
143
-
144
- :global(.ring-palette_color-23),
145
- :global(.ring-palette_tone-1-3) {
146
- color: #fff;
147
- background-color: #409600;
148
- }
149
-
150
- :global(.ring-palette_color-24),
151
- :global(.ring-palette_tone-2-3) {
152
- color: #fff;
153
- background-color: #2f9890;
154
- }
155
-
156
- :global(.ring-palette_color-25),
157
- :global(.ring-palette_tone-3-3) {
158
- color: #fff;
159
- background-color: #0070e4;
160
- }
161
-
162
- :global(.ring-palette_color-26),
163
- :global(.ring-palette_tone-4-3) {
164
- color: #fff;
165
- background-color: #dc0083;
166
- }
167
-
168
- :global(.ring-palette_color-27),
169
- :global(.ring-palette_tone-5-3) {
170
- color: #fff;
171
- background-color: #e30000;
172
- }
173
-
174
- :global(.ring-palette_color-28),
175
- :global(.ring-palette_tone-6-3) {
176
- color: #fff;
177
- background-color: #8d5100;
178
- }
179
-
180
- :global(.ring-palette_color-29),
181
- :global(.ring-palette_tone-0-4) {
182
- color: #fff;
183
- background-color: #1a1a1a;
184
- }
185
-
186
- :global(.ring-palette_color-30),
187
- :global(.ring-palette_tone-1-4) {
188
- color: #fff;
189
- background-color: #246512;
190
- }
191
-
192
- :global(.ring-palette_color-31),
193
- :global(.ring-palette_tone-2-4) {
194
- color: #fff;
195
- background-color: #00665e;
196
- }
197
-
198
- :global(.ring-palette_color-32),
199
- :global(.ring-palette_tone-3-4) {
200
- color: #fff;
201
- background-color: #0050a1;
202
- }
203
-
204
- :global(.ring-palette_color-33),
205
- :global(.ring-palette_tone-4-4) {
206
- color: #fff;
207
- background-color: #900052;
208
- }
209
-
210
- :global(.ring-palette_color-34),
211
- :global(.ring-palette_tone-5-4) {
212
- color: #fff;
213
- background-color: #8e1600;
214
- }
215
-
216
- :global(.ring-palette_color-35),
217
- :global(.ring-palette_tone-6-4) {
218
- color: #fff;
219
- background-color: #553000;
220
- }