@wireapp/react-ui-kit 9.7.4 → 9.7.6

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.
@@ -2,6 +2,7 @@ import * as React from 'react';
2
2
  interface ToolTipProps<T = HTMLDivElement> extends React.HTMLProps<T> {
3
3
  position?: 'top' | 'right' | 'left' | 'bottom';
4
4
  body: React.ReactNode;
5
+ isOpen?: boolean;
5
6
  }
6
7
  export declare const Tooltip: ({ children, ...props }: ToolTipProps) => import("@emotion/react/jsx-runtime").JSX.Element;
7
8
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../src/Form/Tooltip.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,UAAU,YAAY,CAAC,CAAC,GAAG,cAAc,CAAE,SAAQ,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;IACnE,QAAQ,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;IAC/C,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;CACvB;AAiGD,eAAO,MAAM,OAAO,2BAA0B,YAAY,qDAkBzD,CAAC"}
1
+ {"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../src/Form/Tooltip.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,UAAU,YAAY,CAAC,CAAC,GAAG,cAAc,CAAE,SAAQ,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;IACnE,QAAQ,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;IAC/C,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAoGD,eAAO,MAAM,OAAO,2BAA0B,YAAY,qDAoBzD,CAAC"}
@@ -17,7 +17,10 @@ const util_1 = require("../util");
17
17
  const tooltipStyle = theme => ({
18
18
  position: 'relative',
19
19
  width: 'fit-content',
20
- '&:hover .tooltip-content': { visibility: 'visible', opacity: 1 },
20
+ '&:hover .tooltip-content, &:focus-within .tooltip-content,': {
21
+ visibility: 'visible',
22
+ opacity: 1,
23
+ },
21
24
  '.tooltip-content': {
22
25
  textAlign: 'center',
23
26
  visibility: 'hidden',
@@ -106,11 +109,11 @@ const tooltipStyle = theme => ({
106
109
  },
107
110
  },
108
111
  });
109
- const filterTooltipProps = (props) => (0, util_1.filterProps)(props, ['position', 'body']);
112
+ const filterTooltipProps = (props) => (0, util_1.filterProps)(props, ['position', 'body', 'isOpen']);
110
113
  const Tooltip = (_a) => {
111
114
  var { children } = _a, props = __rest(_a, ["children"]);
112
115
  const filteredProps = filterTooltipProps(props);
113
- const { body, position = 'top' } = props;
114
- return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ css: (theme) => tooltipStyle(theme), "data-position": position }, filteredProps, { "data-testid": "tooltip-wrapper", children: [(0, jsx_runtime_1.jsxs)("div", { className: "tooltip-content", "data-testid": "tooltip-content", children: [body, (0, jsx_runtime_1.jsx)("div", { className: "tooltip-arrow" })] }), children] })));
116
+ const { body, position = 'top', isOpen = true } = props;
117
+ return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ css: (theme) => tooltipStyle(theme), "data-position": position }, filteredProps, { "data-testid": "tooltip-wrapper", children: [isOpen && ((0, jsx_runtime_1.jsxs)("div", { className: "tooltip-content", "data-testid": "tooltip-content", children: [body, (0, jsx_runtime_1.jsx)("div", { className: "tooltip-arrow" })] })), children] })));
115
118
  };
116
119
  exports.Tooltip = Tooltip;
package/package.json CHANGED
@@ -15,9 +15,9 @@
15
15
  "react-transition-group": "4.4.5"
16
16
  },
17
17
  "devDependencies": {
18
- "@babel/cli": "7.22.5",
18
+ "@babel/cli": "7.22.6",
19
19
  "@babel/core": "7.22.5",
20
- "@babel/preset-env": "7.22.5",
20
+ "@babel/preset-env": "7.22.7",
21
21
  "@babel/preset-react": "7.22.5",
22
22
  "@babel/preset-typescript": "7.22.5",
23
23
  "@emotion/babel-preset-css-prop": "^11.10.0",
@@ -35,8 +35,8 @@
35
35
  "@types/react-dom": "^18.0.8",
36
36
  "@types/rimraf": "^3.0.2",
37
37
  "@types/webpack-env": "1.18.1",
38
- "babel-jest": "29.5.0",
39
- "babel-loader": "9.1.2",
38
+ "babel-jest": "29.6.1",
39
+ "babel-loader": "9.1.3",
40
40
  "jest": "^29.2.1",
41
41
  "react": "18.2.0",
42
42
  "react-dom": "18.2.0",
@@ -70,6 +70,6 @@
70
70
  "test:watch": "jest --watch",
71
71
  "test:update": "jest --updateSnapshot"
72
72
  },
73
- "version": "9.7.4",
74
- "gitHead": "1ed405f040d81c74928aa513385b2378fbb37cd3"
73
+ "version": "9.7.6",
74
+ "gitHead": "e4b8fd6a7d0711fc1f7808b3ac572b155c3437d5"
75
75
  }