@wireapp/react-ui-kit 9.7.3 → 9.7.5
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/lib/Form/Tooltip.d.ts
CHANGED
|
@@ -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;
|
|
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"}
|
package/lib/Form/Tooltip.js
CHANGED
|
@@ -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
|
|
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;
|
|
@@ -3,5 +3,5 @@ export interface ChildrenProps<T extends Element, P extends React.HTMLProps<T>>
|
|
|
3
3
|
children: React.ReactNode;
|
|
4
4
|
defaultProps: P;
|
|
5
5
|
}
|
|
6
|
-
export declare const childrenWithDefaultProps: <E extends Element, P extends unknown>(props: ChildrenProps<E, P>) => (string | number | React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.
|
|
6
|
+
export declare const childrenWithDefaultProps: <E extends Element, P extends unknown>(props: ChildrenProps<E, P>) => (string | number | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal)[];
|
|
7
7
|
//# sourceMappingURL=childrenWithDefaultProps.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"childrenWithDefaultProps.d.ts","sourceRoot":"","sources":["../../src/Misc/childrenWithDefaultProps.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,WAAW,aAAa,CAAC,CAAC,SAAS,OAAO,EAAE,CAAC,SAAS,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;IAC5E,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,YAAY,EAAE,CAAC,CAAC;CACjB;AAED,eAAO,MAAM,wBAAwB,
|
|
1
|
+
{"version":3,"file":"childrenWithDefaultProps.d.ts","sourceRoot":"","sources":["../../src/Misc/childrenWithDefaultProps.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,WAAW,aAAa,CAAC,CAAC,SAAS,OAAO,EAAE,CAAC,SAAS,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;IAC5E,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,YAAY,EAAE,CAAC,CAAC;CACjB;AAED,eAAO,MAAM,wBAAwB,gNAYjC,CAAC"}
|
package/package.json
CHANGED
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
"react-transition-group": "4.4.5"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@babel/cli": "7.
|
|
19
|
-
"@babel/core": "7.22.
|
|
20
|
-
"@babel/preset-env": "7.22.
|
|
21
|
-
"@babel/preset-react": "7.22.
|
|
22
|
-
"@babel/preset-typescript": "7.
|
|
18
|
+
"@babel/cli": "7.22.5",
|
|
19
|
+
"@babel/core": "7.22.5",
|
|
20
|
+
"@babel/preset-env": "7.22.5",
|
|
21
|
+
"@babel/preset-react": "7.22.5",
|
|
22
|
+
"@babel/preset-typescript": "7.22.5",
|
|
23
23
|
"@emotion/babel-preset-css-prop": "^11.10.0",
|
|
24
24
|
"@emotion/jest": "11.11.0",
|
|
25
25
|
"@emotion/react": "^11.10.4",
|
|
@@ -70,6 +70,6 @@
|
|
|
70
70
|
"test:watch": "jest --watch",
|
|
71
71
|
"test:update": "jest --updateSnapshot"
|
|
72
72
|
},
|
|
73
|
-
"version": "9.7.
|
|
74
|
-
"gitHead": "
|
|
73
|
+
"version": "9.7.5",
|
|
74
|
+
"gitHead": "d88c1dd23ab3460dfdb6683c8a66a2ce8cf46fa6"
|
|
75
75
|
}
|