@synerise/ds-menu 0.14.0 → 0.15.0

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/CHANGELOG.md CHANGED
@@ -3,6 +3,18 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [0.15.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-menu@0.14.0...@synerise/ds-menu@0.15.0) (2022-06-29)
7
+
8
+
9
+ ### Features
10
+
11
+ * **menu:** adds data-name attribute for the UI tests ([7722c84](https://github.com/Synerise/synerise-design/commit/7722c8461f4852ad44602f92269f3c54704c59bf))
12
+ * **menu:** enables hover tooltip on disabled menu-item ([1d36a08](https://github.com/Synerise/synerise-design/commit/1d36a08950b5f08ad9cfd1ea54bb7823a2e47ad2))
13
+
14
+
15
+
16
+
17
+
6
18
  # [0.14.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-menu@0.13.2...@synerise/ds-menu@0.14.0) (2022-06-15)
7
19
 
8
20
 
@@ -4,6 +4,7 @@ import { BasicItemProps } from './Text.types';
4
4
  export declare type HoverTooltipProps = React.PropsWithChildren<{
5
5
  hoverTooltipProps?: BasicItemProps['hoverTooltipProps'];
6
6
  renderHoverTooltip?: () => JSX.Element;
7
+ style?: React.CSSProperties;
7
8
  }>;
8
9
  declare const Text: React.FC<BasicItemProps>;
9
10
  export default Text;
@@ -34,7 +34,8 @@ function WithHoverTooltip(_ref) {
34
34
 
35
35
  var hoverTooltipProps = _ref.hoverTooltipProps,
36
36
  renderHoverTooltip = _ref.renderHoverTooltip,
37
- children = _ref.children;
37
+ children = _ref.children,
38
+ style = _ref.style;
38
39
  var dsTheme = useTheme();
39
40
  var zIndex = parseInt(dsTheme.variables['zindex-tooltip'], 10);
40
41
  var cancelBubblingEvent = React.useCallback(function () {
@@ -63,7 +64,9 @@ function WithHoverTooltip(_ref) {
63
64
  zIndex: zIndex
64
65
  },
65
66
  zIndex: zIndex
66
- }, hoverTooltipProps), children))
67
+ }, hoverTooltipProps), /*#__PURE__*/React.createElement("div", {
68
+ style: style
69
+ }, children)))
67
70
  );
68
71
  }
69
72
 
@@ -176,13 +179,14 @@ var Text = function Text(_ref2) {
176
179
  disabled: disabled,
177
180
  tabIndex: disabled ? -1 : 0,
178
181
  description: description,
179
- style: style,
182
+ style: renderHoverTooltip ? undefined : style,
180
183
  indentLevel: Number(indentLevel),
181
184
  ordered: ordered,
182
185
  size: size,
183
186
  onClick: onClick,
184
187
  onItemHover: onItemHover
185
188
  }, rest, {
189
+ "data-name": typeof children === 'string' ? children : undefined,
186
190
  className: className
187
191
  }), /*#__PURE__*/React.createElement(Tooltip, _extends({
188
192
  type: "default",
@@ -214,7 +218,8 @@ var Text = function Text(_ref2) {
214
218
  if (renderHoverTooltip) {
215
219
  return /*#__PURE__*/React.createElement(WithHoverTooltip, {
216
220
  hoverTooltipProps: hoverTooltipProps,
217
- renderHoverTooltip: renderHoverTooltip
221
+ renderHoverTooltip: renderHoverTooltip,
222
+ style: style
218
223
  }, element);
219
224
  }
220
225
 
@@ -1,7 +1,7 @@
1
1
  import styled, { css } from 'styled-components';
2
2
  import MenuItem from 'antd/lib/menu/MenuItem';
3
3
  import { IconContainer } from '@synerise/ds-icon';
4
- import { ItemSize } from "../MenuItem.types";
4
+ import { ItemSize } from '../MenuItem.types';
5
5
  var INDENT_LEVEL_STEP = 16;
6
6
  var TRANSITION_FN = '0.2s ease-out';
7
7
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-menu",
3
- "version": "0.14.0",
3
+ "version": "0.15.0",
4
4
  "description": "Menu UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -41,5 +41,5 @@
41
41
  "@synerise/ds-core": "*",
42
42
  "react": ">=16.9.0 < 17.0.0"
43
43
  },
44
- "gitHead": "d787395998e479858cb58f6d56555e4c51fe45d5"
44
+ "gitHead": "3df224bc0e56a55beaa9df7e0dcfbda4c04631ad"
45
45
  }