@wireapp/react-ui-kit 9.15.3 → 9.16.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/lib/Form/Tooltip.d.ts.map +1 -1
- package/lib/Form/Tooltip.js +26 -19
- package/lib/Icon/StarIcon.d.ts +3 -0
- package/lib/Icon/StarIcon.d.ts.map +1 -0
- package/lib/Icon/StarIcon.js +25 -0
- package/lib/Icon/index.d.ts +1 -0
- package/lib/Icon/index.d.ts.map +1 -1
- package/lib/Icon/index.js +1 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../src/Form/Tooltip.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAC,SAAS,EAA0B,SAAS,EAAmB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../src/Form/Tooltip.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAC,SAAS,EAA0B,SAAS,EAAmB,MAAM,OAAO,CAAC;AAsHrF,UAAU,YAAY,CAAC,CAAC,GAAG,cAAc,CAAE,SAAQ,SAAS,CAAC,CAAC,CAAC;IAC7D,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAID,eAAO,MAAM,OAAO,2BAA0B,YAAY,qDAiCzD,CAAC"}
|
package/lib/Form/Tooltip.js
CHANGED
|
@@ -34,36 +34,43 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
|
34
34
|
const react_1 = require("react");
|
|
35
35
|
const react_dom_1 = require("react-dom");
|
|
36
36
|
const util_1 = require("../util");
|
|
37
|
-
const
|
|
37
|
+
const paddingDistance = 8;
|
|
38
38
|
const tooltipStyle = theme => ({
|
|
39
|
-
position: '
|
|
39
|
+
position: 'fixed',
|
|
40
40
|
zIndex: '99999',
|
|
41
41
|
maxWidth: '300px',
|
|
42
42
|
filter: 'drop-shadow(1px 2px 6px rgba(0, 0, 0, 0.3))',
|
|
43
43
|
borderRadius: '4px',
|
|
44
|
+
"&[data-position='top']": {
|
|
45
|
+
paddingBottom: `${paddingDistance}px`,
|
|
46
|
+
'.tooltip-arrow': {
|
|
47
|
+
borderTop: `10px solid ${theme.Tooltip.backgroundColor}`,
|
|
48
|
+
bottom: 0,
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
"&[data-position='bottom']": {
|
|
52
|
+
paddingTop: `${paddingDistance}px`,
|
|
53
|
+
'.tooltip-arrow': {
|
|
54
|
+
borderBottom: `10px solid ${theme.Tooltip.backgroundColor}`,
|
|
55
|
+
top: 0,
|
|
56
|
+
},
|
|
57
|
+
},
|
|
44
58
|
'.tooltip-content': {
|
|
45
59
|
color: theme.Tooltip.color,
|
|
46
60
|
backgroundColor: theme.Tooltip.backgroundColor,
|
|
61
|
+
borderRadius: '4px',
|
|
47
62
|
fontSize: '12px',
|
|
48
63
|
lineHeight: '14px',
|
|
49
64
|
fontWeight: 400,
|
|
50
|
-
padding: `${
|
|
65
|
+
padding: `${paddingDistance}px 8px`,
|
|
51
66
|
textAlign: 'center',
|
|
52
67
|
},
|
|
53
68
|
'.tooltip-arrow': {
|
|
54
69
|
width: 0,
|
|
55
70
|
height: 0,
|
|
56
|
-
borderLeft: '
|
|
57
|
-
borderRight: '
|
|
71
|
+
borderLeft: '8px solid transparent',
|
|
72
|
+
borderRight: '8px solid transparent',
|
|
58
73
|
position: 'absolute',
|
|
59
|
-
"&[data-position='top']": {
|
|
60
|
-
borderTop: `10px solid ${theme.Tooltip.backgroundColor}`,
|
|
61
|
-
bottom: '-6px',
|
|
62
|
-
},
|
|
63
|
-
"&[data-position='bottom']": {
|
|
64
|
-
borderBottom: `10px solid ${theme.Tooltip.backgroundColor}`,
|
|
65
|
-
top: '-6px',
|
|
66
|
-
},
|
|
67
74
|
},
|
|
68
75
|
});
|
|
69
76
|
const PortalComponent = ({ children, bounding, selector = '#wire-app' }) => {
|
|
@@ -76,15 +83,15 @@ const PortalComponent = ({ children, bounding, selector = '#wire-app' }) => {
|
|
|
76
83
|
if (!bounding || !element) {
|
|
77
84
|
return;
|
|
78
85
|
}
|
|
79
|
-
const isTouchingTopEdge = bounding.y <= element.clientHeight +
|
|
86
|
+
const isTouchingTopEdge = bounding.y <= element.clientHeight + paddingDistance * 2;
|
|
80
87
|
setIsTouchingTop(isTouchingTopEdge);
|
|
81
88
|
const elementWidth = (element.scrollWidth - bounding.width) / 2;
|
|
82
89
|
element.style.left = `${bounding.x - elementWidth}px`;
|
|
83
90
|
if (isTouchingTopEdge) {
|
|
84
|
-
element.style.top = `${bounding.y + bounding.height
|
|
91
|
+
element.style.top = `${bounding.y + bounding.height}px`;
|
|
85
92
|
}
|
|
86
93
|
else {
|
|
87
|
-
element.style.top = `${bounding.y - element.clientHeight
|
|
94
|
+
element.style.top = `${bounding.y - element.clientHeight}px`;
|
|
88
95
|
}
|
|
89
96
|
};
|
|
90
97
|
const tooltipArrowRef = (element) => {
|
|
@@ -96,9 +103,9 @@ const PortalComponent = ({ children, bounding, selector = '#wire-app' }) => {
|
|
|
96
103
|
return;
|
|
97
104
|
}
|
|
98
105
|
const parentElementRect = parentElement.getBoundingClientRect();
|
|
99
|
-
element.style.left = `${parentElementRect.width / 2 -
|
|
106
|
+
element.style.left = `${parentElementRect.width / 2 - paddingDistance}px`;
|
|
100
107
|
};
|
|
101
|
-
return (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsxs)("div", { ref: tooltipRef, className: "tooltip", css: (theme) => tooltipStyle(theme), children: [(0, jsx_runtime_1.jsx)("div", { ref: tooltipArrowRef, className: "tooltip-arrow"
|
|
108
|
+
return (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsxs)("div", { ref: tooltipRef, className: "tooltip", css: (theme) => tooltipStyle(theme), "data-position": isTouchingTop ? 'bottom' : 'top', children: [(0, jsx_runtime_1.jsx)("div", { ref: tooltipArrowRef, className: "tooltip-arrow" }), (0, jsx_runtime_1.jsx)("div", { className: "tooltip-content", "data-testid": "tooltip-content", children: children })] }), targetElement);
|
|
102
109
|
};
|
|
103
110
|
const filterTooltipProps = (props) => (0, util_1.filterProps)(props, ['body']);
|
|
104
111
|
const Tooltip = (_a) => {
|
|
@@ -108,7 +115,7 @@ const Tooltip = (_a) => {
|
|
|
108
115
|
const filteredProps = filterTooltipProps(props);
|
|
109
116
|
const { body, selector = '#wire-app' } = props;
|
|
110
117
|
const onElementEnter = (event) => {
|
|
111
|
-
const boundingRect = event.
|
|
118
|
+
const boundingRect = event.currentTarget.getBoundingClientRect();
|
|
112
119
|
setIsHovered(true);
|
|
113
120
|
boundingRectRef.current = boundingRect;
|
|
114
121
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StarIcon.d.ts","sourceRoot":"","sources":["../../src/Icon/StarIcon.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAU,YAAY,EAAC,MAAM,WAAW,CAAC;AAEhD,eAAO,MAAM,QAAQ,UAAW,YAAY,qDAI3C,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StarIcon = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
|
+
/*
|
|
6
|
+
* Wire
|
|
7
|
+
* Copyright (C) 2024 Wire Swiss GmbH
|
|
8
|
+
*
|
|
9
|
+
* This program is free software: you can redistribute it and/or modify
|
|
10
|
+
* it under the terms of the GNU General Public License as published by
|
|
11
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
12
|
+
* (at your option) any later version.
|
|
13
|
+
*
|
|
14
|
+
* This program is distributed in the hope that it will be useful,
|
|
15
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
16
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
17
|
+
* GNU General Public License for more details.
|
|
18
|
+
*
|
|
19
|
+
* You should have received a copy of the GNU General Public License
|
|
20
|
+
* along with this program. If not, see http://www.gnu.org/licenses/.
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
const SVGIcon_1 = require("./SVGIcon");
|
|
24
|
+
const StarIcon = (props) => ((0, jsx_runtime_1.jsx)(SVGIcon_1.SVGIcon, Object.assign({ realWidth: 12, realHeight: 12 }, props, { children: (0, jsx_runtime_1.jsx)("path", { d: "M5.19036 0.612427C5.44371 -0.204142 6.55629 -0.204143 6.80964 0.612426L7.82903 3.89792H11.1477C11.97 3.89792 12.3138 4.98908 11.6505 5.49374L8.95944 7.54121L9.98352 10.8418C10.2364 11.6569 9.33636 12.3313 8.67113 11.8252L6 9.79289L3.32887 11.8252C2.66364 12.3313 1.76358 11.6569 2.01648 10.8418L3.04056 7.54121L0.349516 5.49374C-0.313779 4.98908 0.0299803 3.89792 0.852265 3.89792H4.17097L5.19036 0.612427Z" }) })));
|
|
25
|
+
exports.StarIcon = StarIcon;
|
package/lib/Icon/index.d.ts
CHANGED
package/lib/Icon/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Icon/index.ts"],"names":[],"mappings":"AAmBA,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,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;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC"}
|
package/lib/Icon/index.js
CHANGED
|
@@ -90,6 +90,7 @@ __exportStar(require("./SettingsIcon"), exports);
|
|
|
90
90
|
__exportStar(require("./ShowIcon"), exports);
|
|
91
91
|
__exportStar(require("./SignIcon"), exports);
|
|
92
92
|
__exportStar(require("./SpeakerIcon"), exports);
|
|
93
|
+
__exportStar(require("./StarIcon"), exports);
|
|
93
94
|
__exportStar(require("./TeamIcon"), exports);
|
|
94
95
|
__exportStar(require("./TimedIcon"), exports);
|
|
95
96
|
__exportStar(require("./TrashIcon"), exports);
|
package/package.json
CHANGED