@jetbrains/ring-ui-built 7.0.96 → 7.0.98

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.
@@ -74,11 +74,11 @@ const DEFAULT_DEBOUNCE_INTERVAL = 100;
74
74
  const MEASURE_TOLERANCE = 0.5;
75
75
  const CollapsibleTabs = t0 => {
76
76
  const $ = c(92);
77
- if ($[0] !== "70efbf9102ae6e4ef4eaf532e2761386fcd6421dbdab25489e6ec60adf5616c6") {
77
+ if ($[0] !== "82f2dc93de65dc30001587c39f2444b114e674174f0aa9346f45d08c4898b52b") {
78
78
  for (let $i = 0; $i < 92; $i += 1) {
79
79
  $[$i] = Symbol.for("react.memo_cache_sentinel");
80
80
  }
81
- $[0] = "70efbf9102ae6e4ef4eaf532e2761386fcd6421dbdab25489e6ec60adf5616c6";
81
+ $[0] = "82f2dc93de65dc30001587c39f2444b114e674174f0aa9346f45d08c4898b52b";
82
82
  }
83
83
  const {
84
84
  children,
@@ -13,6 +13,7 @@ export interface TooltipProps extends Omit<AllHTMLAttributes<HTMLSpanElement>, '
13
13
  selfOverflowOnly?: boolean | null | undefined;
14
14
  popupProps?: Partial<PopupAttrs> | null | undefined;
15
15
  title?: ReactNode | null | undefined;
16
+ hide?: boolean | null | undefined;
16
17
  theme?: Theme | 'inherit';
17
18
  'data-test'?: string | null | undefined;
18
19
  long?: boolean | null | undefined;
@@ -21,6 +22,7 @@ export interface TooltipProps extends Omit<AllHTMLAttributes<HTMLSpanElement>, '
21
22
  * @name Tooltip
22
23
  */
23
24
  export default class Tooltip extends Component<TooltipProps> {
25
+ private static isShow;
24
26
  static defaultProps: {
25
27
  title: string;
26
28
  selfOverflowOnly: boolean;
@@ -29,6 +29,12 @@ const TooltipContext = /*#__PURE__*/createContext(undefined);
29
29
  * @name Tooltip
30
30
  */
31
31
  class Tooltip extends Component {
32
+ static isShow({
33
+ title,
34
+ hide
35
+ }) {
36
+ return !!title && !hide;
37
+ }
32
38
  static defaultProps = {
33
39
  title: '',
34
40
  selfOverflowOnly: false,
@@ -40,14 +46,16 @@ class Tooltip extends Component {
40
46
  showNestedPopup: false
41
47
  };
42
48
  componentDidMount() {
43
- if (this.props.title) {
49
+ if (Tooltip.isShow(this.props)) {
44
50
  this.addListeners();
45
51
  }
46
52
  }
47
53
  componentDidUpdate(prevProps) {
48
- if (!prevProps.title && this.props.title) {
54
+ const prevShow = Tooltip.isShow(prevProps);
55
+ const currShow = Tooltip.isShow(this.props);
56
+ if (!prevShow && currShow) {
49
57
  this.addListeners();
50
- } else if (prevProps.title && !this.props.title) {
58
+ } else if (prevShow && !currShow) {
51
59
  this.hidePopup();
52
60
  this.listeners.removeAll();
53
61
  }
@@ -65,13 +73,10 @@ class Tooltip extends Component {
65
73
  this.containerNode = el;
66
74
  };
67
75
  tryToShowPopup = () => {
76
+ if (!Tooltip.isShow(this.props)) return;
68
77
  const {
69
- delay,
70
- title
78
+ delay
71
79
  } = this.props;
72
- if (!title) {
73
- return;
74
- }
75
80
  if (delay) {
76
81
  clearTimeout(this.timeout);
77
82
  this.timeout = window.setTimeout(this.showPopup, delay);
@@ -162,9 +167,13 @@ class Tooltip extends Component {
162
167
  selfOverflowOnly,
163
168
  popupProps,
164
169
  long,
170
+ hide,
165
171
  ...restProps
166
172
  } = this.props;
167
- const ariaProps = typeof title === 'string' && !!title ? {
173
+ const ariaProps = typeof title === 'string' && Tooltip.isShow({
174
+ title,
175
+ hide
176
+ }) ? {
168
177
  'aria-label': title,
169
178
  role: 'tooltip'
170
179
  } : {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetbrains/ring-ui-built",
3
- "version": "7.0.96",
3
+ "version": "7.0.98",
4
4
  "description": "JetBrains UI library",
5
5
  "author": {
6
6
  "name": "JetBrains"
@@ -53,6 +53,8 @@
53
53
  "figma-connect-unpublish": "npx figma connect unpublish --token=$FIGMA_CODE_CONNECT_TOKEN",
54
54
  "figma-connect-unpublish-local": "dotenv -- npm run figma-connect-unpublish",
55
55
  "lint": "npm run lint:js && npm run stylelint",
56
+ "prelint-ci": "echo \"##teamcity[importData type='jslint' path='eslint-report.xml']\"",
57
+ "lint-ci": "eslint --format jslint-xml . > eslint-report.xml && npm run stylelint-ci",
56
58
  "lint:js": "eslint",
57
59
  "postbuild": "cpy './**/*.d.ts' ../dist --parents --cwd=components/",
58
60
  "_postinstall": "husky && npm run postinstall:gitconfig",
@@ -76,12 +78,15 @@
76
78
  "start": "storybook dev -p 9999",
77
79
  "storybook-debug": "node --inspect-brk node_modules/@storybook/react/bin -p 9999",
78
80
  "stylelint": "stylelint --ignore-path .stylelintignore '**/*.css'",
81
+ "stylelint-ci": "stylelint --ignore-path .stylelintignore --custom-formatter 'scripts/jslint-xml.js' '**/*.css' | xmlappend eslint-report.xml",
79
82
  "test": "vitest src",
80
83
  "type-check": "(npm run type-check:create-d-ts && npm run type-check:main && npm run type-check:build) ; npm run type-check:cleanup-d-ts",
81
84
  "type-check:create-d-ts": "npx tcm src && npx tcm .storybook",
82
85
  "type-check:main": "tsc --noEmit -p tsconfig.json",
83
86
  "type-check:build": "tsc --noEmit -p tsconfig-build.json",
84
87
  "type-check:cleanup-d-ts": "rimraf src/**/*.css.d.ts .storybook/*.css.d.ts .storybook/**/*.css.d.ts",
88
+ "pretype-check-ci": "npm run type-check:create-d-ts",
89
+ "type-check-ci": "node scripts/tsc-teamcity",
85
90
  "update-styles": "node scripts/update-styles.mjs",
86
91
  "validate-tc-config": "mvn --file .teamcity/pom.xml org.jetbrains.teamcity:teamcity-configs-maven-plugin:generate -e"
87
92
  },