@neo4j-ndl/react 1.5.11 → 1.6.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
@@ -1,5 +1,16 @@
1
1
  # Change Log
2
2
 
3
+ ## 1.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - ee7d01f: added new toggletip component
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [ee7d01f]
12
+ - @neo4j-ndl/base@1.6.0
13
+
3
14
  ## 1.5.11
4
15
 
5
16
  ### Patch Changes
package/lib/LICENSES.txt CHANGED
@@ -109,7 +109,7 @@ SOFTWARE.
109
109
 
110
110
  -----
111
111
 
112
- The following software may be included in this product: @floating-ui/react-dom-interactions. A copy of the source code may be downloaded from https://github.com/floating-ui/floating-ui.git. This software contains the following license and notice below:
112
+ The following software may be included in this product: @floating-ui/react. A copy of the source code may be downloaded from https://github.com/floating-ui/floating-ui.git. This software contains the following license and notice below:
113
113
 
114
114
  MIT License
115
115
 
@@ -12062,6 +12062,212 @@ SOFTWARE.
12062
12062
 
12063
12063
  -----
12064
12064
 
12065
+ The following software may be included in this product: react-aria. A copy of the source code may be downloaded from https://github.com/adobe/react-spectrum. This software contains the following license and notice below:
12066
+
12067
+ Apache License
12068
+ Version 2.0, January 2004
12069
+ http://www.apache.org/licenses/
12070
+
12071
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
12072
+
12073
+ 1. Definitions.
12074
+
12075
+ "License" shall mean the terms and conditions for use, reproduction,
12076
+ and distribution as defined by Sections 1 through 9 of this document.
12077
+
12078
+ "Licensor" shall mean the copyright owner or entity authorized by
12079
+ the copyright owner that is granting the License.
12080
+
12081
+ "Legal Entity" shall mean the union of the acting entity and all
12082
+ other entities that control, are controlled by, or are under common
12083
+ control with that entity. For the purposes of this definition,
12084
+ "control" means (i) the power, direct or indirect, to cause the
12085
+ direction or management of such entity, whether by contract or
12086
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
12087
+ outstanding shares, or (iii) beneficial ownership of such entity.
12088
+
12089
+ "You" (or "Your") shall mean an individual or Legal Entity
12090
+ exercising permissions granted by this License.
12091
+
12092
+ "Source" form shall mean the preferred form for making modifications,
12093
+ including but not limited to software source code, documentation
12094
+ source, and configuration files.
12095
+
12096
+ "Object" form shall mean any form resulting from mechanical
12097
+ transformation or translation of a Source form, including but
12098
+ not limited to compiled object code, generated documentation,
12099
+ and conversions to other media types.
12100
+
12101
+ "Work" shall mean the work of authorship, whether in Source or
12102
+ Object form, made available under the License, as indicated by a
12103
+ copyright notice that is included in or attached to the work
12104
+ (an example is provided in the Appendix below).
12105
+
12106
+ "Derivative Works" shall mean any work, whether in Source or Object
12107
+ form, that is based on (or derived from) the Work and for which the
12108
+ editorial revisions, annotations, elaborations, or other modifications
12109
+ represent, as a whole, an original work of authorship. For the purposes
12110
+ of this License, Derivative Works shall not include works that remain
12111
+ separable from, or merely link (or bind by name) to the interfaces of,
12112
+ the Work and Derivative Works thereof.
12113
+
12114
+ "Contribution" shall mean any work of authorship, including
12115
+ the original version of the Work and any modifications or additions
12116
+ to that Work or Derivative Works thereof, that is intentionally
12117
+ submitted to Licensor for inclusion in the Work by the copyright owner
12118
+ or by an individual or Legal Entity authorized to submit on behalf of
12119
+ the copyright owner. For the purposes of this definition, "submitted"
12120
+ means any form of electronic, verbal, or written communication sent
12121
+ to the Licensor or its representatives, including but not limited to
12122
+ communication on electronic mailing lists, source code control systems,
12123
+ and issue tracking systems that are managed by, or on behalf of, the
12124
+ Licensor for the purpose of discussing and improving the Work, but
12125
+ excluding communication that is conspicuously marked or otherwise
12126
+ designated in writing by the copyright owner as "Not a Contribution."
12127
+
12128
+ "Contributor" shall mean Licensor and any individual or Legal Entity
12129
+ on behalf of whom a Contribution has been received by Licensor and
12130
+ subsequently incorporated within the Work.
12131
+
12132
+ 2. Grant of Copyright License. Subject to the terms and conditions of
12133
+ this License, each Contributor hereby grants to You a perpetual,
12134
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
12135
+ copyright license to reproduce, prepare Derivative Works of,
12136
+ publicly display, publicly perform, sublicense, and distribute the
12137
+ Work and such Derivative Works in Source or Object form.
12138
+
12139
+ 3. Grant of Patent License. Subject to the terms and conditions of
12140
+ this License, each Contributor hereby grants to You a perpetual,
12141
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
12142
+ (except as stated in this section) patent license to make, have made,
12143
+ use, offer to sell, sell, import, and otherwise transfer the Work,
12144
+ where such license applies only to those patent claims licensable
12145
+ by such Contributor that are necessarily infringed by their
12146
+ Contribution(s) alone or by combination of their Contribution(s)
12147
+ with the Work to which such Contribution(s) was submitted. If You
12148
+ institute patent litigation against any entity (including a
12149
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
12150
+ or a Contribution incorporated within the Work constitutes direct
12151
+ or contributory patent infringement, then any patent licenses
12152
+ granted to You under this License for that Work shall terminate
12153
+ as of the date such litigation is filed.
12154
+
12155
+ 4. Redistribution. You may reproduce and distribute copies of the
12156
+ Work or Derivative Works thereof in any medium, with or without
12157
+ modifications, and in Source or Object form, provided that You
12158
+ meet the following conditions:
12159
+
12160
+ (a) You must give any other recipients of the Work or
12161
+ Derivative Works a copy of this License; and
12162
+
12163
+ (b) You must cause any modified files to carry prominent notices
12164
+ stating that You changed the files; and
12165
+
12166
+ (c) You must retain, in the Source form of any Derivative Works
12167
+ that You distribute, all copyright, patent, trademark, and
12168
+ attribution notices from the Source form of the Work,
12169
+ excluding those notices that do not pertain to any part of
12170
+ the Derivative Works; and
12171
+
12172
+ (d) If the Work includes a "NOTICE" text file as part of its
12173
+ distribution, then any Derivative Works that You distribute must
12174
+ include a readable copy of the attribution notices contained
12175
+ within such NOTICE file, excluding those notices that do not
12176
+ pertain to any part of the Derivative Works, in at least one
12177
+ of the following places: within a NOTICE text file distributed
12178
+ as part of the Derivative Works; within the Source form or
12179
+ documentation, if provided along with the Derivative Works; or,
12180
+ within a display generated by the Derivative Works, if and
12181
+ wherever such third-party notices normally appear. The contents
12182
+ of the NOTICE file are for informational purposes only and
12183
+ do not modify the License. You may add Your own attribution
12184
+ notices within Derivative Works that You distribute, alongside
12185
+ or as an addendum to the NOTICE text from the Work, provided
12186
+ that such additional attribution notices cannot be construed
12187
+ as modifying the License.
12188
+
12189
+ You may add Your own copyright statement to Your modifications and
12190
+ may provide additional or different license terms and conditions
12191
+ for use, reproduction, or distribution of Your modifications, or
12192
+ for any such Derivative Works as a whole, provided Your use,
12193
+ reproduction, and distribution of the Work otherwise complies with
12194
+ the conditions stated in this License.
12195
+
12196
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
12197
+ any Contribution intentionally submitted for inclusion in the Work
12198
+ by You to the Licensor shall be under the terms and conditions of
12199
+ this License, without any additional terms or conditions.
12200
+ Notwithstanding the above, nothing herein shall supersede or modify
12201
+ the terms of any separate license agreement you may have executed
12202
+ with Licensor regarding such Contributions.
12203
+
12204
+ 6. Trademarks. This License does not grant permission to use the trade
12205
+ names, trademarks, service marks, or product names of the Licensor,
12206
+ except as required for reasonable and customary use in describing the
12207
+ origin of the Work and reproducing the content of the NOTICE file.
12208
+
12209
+ 7. Disclaimer of Warranty. Unless required by applicable law or
12210
+ agreed to in writing, Licensor provides the Work (and each
12211
+ Contributor provides its Contributions) on an "AS IS" BASIS,
12212
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
12213
+ implied, including, without limitation, any warranties or conditions
12214
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
12215
+ PARTICULAR PURPOSE. You are solely responsible for determining the
12216
+ appropriateness of using or redistributing the Work and assume any
12217
+ risks associated with Your exercise of permissions under this License.
12218
+
12219
+ 8. Limitation of Liability. In no event and under no legal theory,
12220
+ whether in tort (including negligence), contract, or otherwise,
12221
+ unless required by applicable law (such as deliberate and grossly
12222
+ negligent acts) or agreed to in writing, shall any Contributor be
12223
+ liable to You for damages, including any direct, indirect, special,
12224
+ incidental, or consequential damages of any character arising as a
12225
+ result of this License or out of the use or inability to use the
12226
+ Work (including but not limited to damages for loss of goodwill,
12227
+ work stoppage, computer failure or malfunction, or any and all
12228
+ other commercial damages or losses), even if such Contributor
12229
+ has been advised of the possibility of such damages.
12230
+
12231
+ 9. Accepting Warranty or Additional Liability. While redistributing
12232
+ the Work or Derivative Works thereof, You may choose to offer,
12233
+ and charge a fee for, acceptance of support, warranty, indemnity,
12234
+ or other liability obligations and/or rights consistent with this
12235
+ License. However, in accepting such obligations, You may act only
12236
+ on Your own behalf and on Your sole responsibility, not on behalf
12237
+ of any other Contributor, and only if You agree to indemnify,
12238
+ defend, and hold each Contributor harmless for any liability
12239
+ incurred by, or claims asserted against, such Contributor by reason
12240
+ of your accepting any such warranty or additional liability.
12241
+
12242
+ END OF TERMS AND CONDITIONS
12243
+
12244
+ APPENDIX: How to apply the Apache License to your work.
12245
+
12246
+ To apply the Apache License to your work, attach the following
12247
+ boilerplate notice, with the fields enclosed by brackets "[]"
12248
+ replaced with your own identifying information. (Don't include
12249
+ the brackets!) The text should be enclosed in the appropriate
12250
+ comment syntax for the file format. We also recommend that a
12251
+ file or class name and description of purpose be included on the
12252
+ same "printed page" as the copyright notice for easier
12253
+ identification within third-party archives.
12254
+
12255
+ Copyright 2019 Adobe
12256
+
12257
+ Licensed under the Apache License, Version 2.0 (the "License");
12258
+ you may not use this file except in compliance with the License.
12259
+ You may obtain a copy of the License at
12260
+
12261
+ http://www.apache.org/licenses/LICENSE-2.0
12262
+
12263
+ Unless required by applicable law or agreed to in writing, software
12264
+ distributed under the License is distributed on an "AS IS" BASIS,
12265
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12266
+ See the License for the specific language governing permissions and
12267
+ limitations under the License.
12268
+
12269
+ -----
12270
+
12065
12271
  The following software may be included in this product: react-dropzone. A copy of the source code may be downloaded from https://github.com/react-dropzone/react-dropzone.git. This software contains the following license and notice below:
12066
12272
 
12067
12273
  The MIT License (MIT)
package/lib/NOTICE.txt CHANGED
@@ -50,10 +50,10 @@ Third-party licenses
50
50
  │ │ ├─ URL: https://github.com/conventional-changelog/commitlint.git
51
51
  │ │ ├─ VendorName: Mario Nebl
52
52
  │ │ └─ VendorUrl: https://commitlint.js.org/
53
- │ ├─ @floating-ui/react-dom-interactions@npm:0.12.0 [a2e03] (via npm:^0.12.0 [a2e03])
53
+ │ ├─ @floating-ui/react@npm:0.24.2 [a2e03] (via npm:^0.24.2 [a2e03])
54
54
  │ │ ├─ URL: https://github.com/floating-ui/floating-ui.git
55
55
  │ │ ├─ VendorName: atomiks
56
- │ │ └─ VendorUrl: https://floating-ui.com/docs/react-dom-interactions
56
+ │ │ └─ VendorUrl: https://floating-ui.com/docs/react
57
57
  │ ├─ @heroicons/react@npm:2.0.13 [a2e03] (via npm:2.0.13 [a2e03])
58
58
  │ │ ├─ URL: https://github.com/tailwindlabs/heroicons.git
59
59
  │ │ └─ VendorUrl: https://github.com/tailwindlabs/heroicons#readme
@@ -298,6 +298,8 @@ Third-party licenses
298
298
  │ │ ├─ URL: https://github.com/krisk/Fuse.git
299
299
  │ │ ├─ VendorName: Kiro Risk
300
300
  │ │ └─ VendorUrl: http://fusejs.io
301
+ │ ├─ react-aria@npm:3.25.0 [a2e03] (via npm:^3.25.0 [a2e03])
302
+ │ │ └─ URL: https://github.com/adobe/react-spectrum
301
303
  │ ├─ style-dictionary@npm:3.8.0 (via npm:^3.0.3)
302
304
  │ │ ├─ URL: git://github.com/amzn/style-dictionary.git
303
305
  │ │ ├─ VendorName: Amazon
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/_common/utils.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAEH,iCAAuD;AAEhD,MAAM,cAAc,GAAG,CAAC,KAAa,EAAE,EAAE,CAC9C,KAAK,CAAC,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;AADzB,QAAA,cAAc,kBACW;AAEtC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AAE;YACV,QAAQ,CAAC,mBAAmB,CAAC,WAAW,EAAE,QAAe,CAAC,CAAC;YAC3D,QAAQ,CAAC,mBAAmB,CAAC,YAAY,EAAE,QAAe,CAAC,CAAC;QAC9D,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,wCAAwC;AAC9D,CAAC,CAAC;AAtBW,QAAA,iBAAiB,qBAsB5B;AAEF;;GAEG;AACI,MAAM,QAAQ,GAAG,CAAC,MAAc,EAAE,EAAE,CACzC,IAAI,CAAC,MAAM,EAAE;KACV,QAAQ,CAAC,EAAE,CAAC;KACZ,KAAK,CAAC,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,CAAC;AAHb,QAAA,QAAQ,YAGK"}
@@ -1,38 +1,4 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __rest = (this && this.__rest) || function (s, e) {
26
- var t = {};
27
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
28
- t[p] = s[p];
29
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
30
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
31
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
32
- t[p[i]] = s[p[i]];
33
- }
34
- return t;
35
- };
36
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
37
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
38
4
  };
@@ -58,59 +24,10 @@ const jsx_runtime_1 = require("react/jsx-runtime");
58
24
  * You should have received a copy of the GNU General Public License
59
25
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
60
26
  */
61
- const react_1 = __importStar(require("react"));
62
- const react_dom_interactions_1 = require("@floating-ui/react-dom-interactions");
63
- const Tooltip_1 = __importDefault(require("./Tooltip"));
64
- const base_1 = require("@neo4j-ndl/base");
65
- const portal_1 = require("../portal");
66
- const ConditionalWrap_1 = __importDefault(require("../_common/ConditionalWrap"));
67
- const PLACEMENTS = ['top', 'bottom', 'left', 'right'];
68
- const calculateArrow = (placement) => {
69
- switch (placement) {
70
- case 'bottom':
71
- return 'top';
72
- case 'left':
73
- return 'right';
74
- case 'right':
75
- return 'left';
76
- case 'top':
77
- default:
78
- return 'bottom';
79
- }
80
- };
81
- const SmartTooltip = react_1.default.forwardRef(function SmartTooltip(_a, ref) {
82
- var { open: openProp, allowedPlacements = PLACEMENTS, portal = true } = _a, props = __rest(_a, ["open", "allowedPlacements", "portal"]);
83
- const [open, setOpen] = (0, react_1.useState)(false);
84
- const { context, x, y, reference, floating, strategy, placement } = (0, react_dom_interactions_1.useFloating)({
85
- open,
86
- onOpenChange: setOpen,
87
- whileElementsMounted: react_dom_interactions_1.autoUpdate,
88
- middleware: [
89
- (0, react_dom_interactions_1.offset)(10),
90
- (0, react_dom_interactions_1.autoPlacement)({
91
- allowedPlacements,
92
- }),
93
- ],
94
- });
95
- const hover = (0, react_dom_interactions_1.useHover)(context, {
96
- move: false,
97
- delay: {
98
- // Strip the 'ms' from the duration token, need to provide pure ms durations
99
- close: parseInt(base_1.tokens.transitions.values.duration.default.replace('ms', '')),
100
- },
101
- });
102
- const { getFloatingProps } = (0, react_dom_interactions_1.useInteractions)([hover]);
103
- (0, react_1.useEffect)(() => {
104
- /**
105
- * Assign passed ref to the reference callback
106
- * of the useFloating hook
107
- */
108
- const { current = null } = ref || {};
109
- if (current) {
110
- reference(current);
111
- }
112
- }, [ref]);
113
- return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: open || openProp ? ((0, jsx_runtime_1.jsx)(ConditionalWrap_1.default, Object.assign({ condition: portal, wrap: (children) => (0, jsx_runtime_1.jsx)(portal_1.Portal, { children: children }) }, { children: (0, jsx_runtime_1.jsx)(Tooltip_1.default, Object.assign({}, props, getFloatingProps(), { ref: floating, arrowPosition: calculateArrow(placement), style: Object.assign({ position: strategy, top: y !== null && y !== void 0 ? y : 0, left: x !== null && x !== void 0 ? x : 0, width: 'max-content', zIndex: base_1.tokens.zIndex.alias.tooltip }, props.style) })) }))) : null }));
27
+ const react_1 = __importDefault(require("react"));
28
+ const Tip_1 = __importDefault(require("./Tip"));
29
+ const SmartTooltip = react_1.default.forwardRef(function SmartTooltip(props, ref) {
30
+ return (0, jsx_runtime_1.jsx)(Tip_1.default, Object.assign({}, props, { type: "tooltip", ref: ref }));
114
31
  });
115
32
  exports.default = SmartTooltip;
116
33
  //# sourceMappingURL=SmartTooltip.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SmartTooltip.js","sourceRoot":"","sources":["../../../src/tooltip/SmartTooltip.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,+CAKe;AACf,gFAO6C;AAE7C,wDAAkD;AAClD,0CAAyC;AACzC,sCAAmC;AACnC,iFAAyD;AAczD,MAAM,UAAU,GAAW,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,E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AK,IAAE,IAAI,EAAC,SAAS,EAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AACrD,CAAC,CAAC,CAAC;AAEH,kBAAe,YAAY,CAAC"}
@@ -0,0 +1,169 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __rest = (this && this.__rest) || function (s, e) {
26
+ var t = {};
27
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
28
+ t[p] = s[p];
29
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
30
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
31
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
32
+ t[p[i]] = s[p[i]];
33
+ }
34
+ return t;
35
+ };
36
+ var __importDefault = (this && this.__importDefault) || function (mod) {
37
+ return (mod && mod.__esModule) ? mod : { "default": mod };
38
+ };
39
+ Object.defineProperty(exports, "__esModule", { value: true });
40
+ const react_1 = require("react");
41
+ const jsx_runtime_1 = require("react/jsx-runtime");
42
+ /**
43
+ *
44
+ * Copyright (c) "Neo4j"
45
+ * Neo4j Sweden AB [http://neo4j.com]
46
+ *
47
+ * This file is part of Neo4j.
48
+ *
49
+ * Neo4j is free software: you can redistribute it and/or modify
50
+ * it under the terms of the GNU General Public License as published by
51
+ * the Free Software Foundation, either version 3 of the License, or
52
+ * (at your option) any later version.
53
+ *
54
+ * This program is distributed in the hope that it will be useful,
55
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
56
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
57
+ * GNU General Public License for more details.
58
+ *
59
+ * You should have received a copy of the GNU General Public License
60
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
61
+ */
62
+ const react_2 = __importStar(require("react"));
63
+ const react_3 = require("@floating-ui/react");
64
+ const Tooltip_1 = __importDefault(require("./Tooltip"));
65
+ const base_1 = require("@neo4j-ndl/base");
66
+ const portal_1 = require("../portal");
67
+ const ConditionalWrap_1 = __importDefault(require("../_common/ConditionalWrap"));
68
+ const icons_1 = require("../icons");
69
+ const typography_1 = require("../typography");
70
+ const react_aria_1 = require("react-aria");
71
+ const classnames_1 = __importDefault(require("classnames"));
72
+ const PLACEMENTS = ['top', 'bottom', 'left', 'right'];
73
+ const calculateArrow = (placement) => {
74
+ switch (placement) {
75
+ case 'bottom':
76
+ return 'top';
77
+ case 'left':
78
+ return 'right';
79
+ case 'right':
80
+ return 'left';
81
+ case 'top':
82
+ default:
83
+ return 'bottom';
84
+ }
85
+ };
86
+ const ToggletipAction = (_a) => {
87
+ var { label, onClick } = _a, props = __rest(_a, ["label", "onClick"]);
88
+ const { pressProps } = (0, react_aria_1.usePress)({
89
+ onPress: (e) => {
90
+ onClick && onClick(e);
91
+ },
92
+ });
93
+ return ((0, jsx_runtime_1.jsx)(typography_1.Typography, Object.assign({}, props, { className: (0, classnames_1.default)('ndl-toggletip-action', props.className) }, pressProps, { tabIndex: 0, variant: "label", as: onClick === undefined ? 'a' : 'button' }, { children: label })));
94
+ };
95
+ const Tip = react_2.default.forwardRef(function Tip(_a, ref) {
96
+ var { open: openProp, allowedPlacements = PLACEMENTS, portal = true } = _a, props = __rest(_a, ["open", "allowedPlacements", "portal"]);
97
+ const [open, setOpen] = (0, react_2.useState)(false);
98
+ const { type = 'tooltip' } = props;
99
+ const { context, x, y, strategy, placement, refs } = (0, react_3.useFloating)({
100
+ open: openProp !== null && openProp !== void 0 ? openProp : open,
101
+ onOpenChange: (e) => {
102
+ setOpen(e);
103
+ /**
104
+ * We do not receive an `event` here from the onOpenChange callback
105
+ * Need to investigate if we can propagate the underlying event for closing to `onClose`
106
+ */
107
+ if (!open) {
108
+ props.type === 'toggletip' && props.onClose && props.onClose(undefined);
109
+ }
110
+ },
111
+ whileElementsMounted: react_3.autoUpdate,
112
+ middleware: [
113
+ (0, react_3.offset)(10),
114
+ (0, react_3.autoPlacement)({
115
+ allowedPlacements,
116
+ }),
117
+ ],
118
+ });
119
+ const hover = (0, react_3.useHover)(context, {
120
+ move: false,
121
+ enabled: type === 'tooltip',
122
+ delay: {
123
+ // TODO: add a slower animation token to avoid this being hardcoded
124
+ open: 200,
125
+ // Strip the 'ms' from the duration token, need to provide pure ms durations
126
+ close: parseInt(base_1.tokens.transitions.values.duration.default.replace('ms', '')),
127
+ },
128
+ });
129
+ const dismiss = (0, react_3.useDismiss)(context, {
130
+ enabled: type === 'toggletip',
131
+ outsidePress: (e) => {
132
+ /** Avoid calling onClose, if we click the reference element */
133
+ if (
134
+ /** Case that the target is a child of the referenced element **/
135
+ typeof ref !== 'function' &&
136
+ (ref === null || ref === void 0 ? void 0 : ref.current) instanceof Element &&
137
+ e.target instanceof Element &&
138
+ (ref === null || ref === void 0 ? void 0 : ref.current.contains(e.target))) {
139
+ return false;
140
+ }
141
+ return true;
142
+ },
143
+ });
144
+ const { getFloatingProps } = (0, react_3.useInteractions)([hover, dismiss]);
145
+ (0, react_2.useEffect)(() => {
146
+ /**
147
+ * Assign passed ref to the reference callback
148
+ * of the useFloating hook
149
+ */
150
+ const { current = null } = ref || {};
151
+ if (current) {
152
+ refs.setReference(current);
153
+ }
154
+ }, [ref]);
155
+ return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: open || openProp ? ((0, jsx_runtime_1.jsx)(ConditionalWrap_1.default, Object.assign({ condition: portal, wrap: (children) => (0, jsx_runtime_1.jsx)(portal_1.Portal, { children: children }) }, { children: (0, jsx_runtime_1.jsxs)(Tooltip_1.default, Object.assign({}, props, { ref: refs.setFloating }, getFloatingProps(), { arrowPosition: calculateArrow(placement), className: (0, classnames_1.default)(props.className, {
156
+ 'ndl-toggletip': type === 'toggletip',
157
+ }), style: Object.assign({ position: strategy, top: y !== null && y !== void 0 ? y : 0, left: x !== null && x !== void 0 ? x : 0, width: 'max-content', zIndex: base_1.tokens.zIndex.alias.tooltip }, props.style) }, { children: [props.type === 'tooltip' && props.children, props.type === 'toggletip' && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "ndl-toggletip-header" }, { children: [props.title && ((0, jsx_runtime_1.jsx)(typography_1.Typography, Object.assign({ variant: "h6" }, { children: props.title }))), !props.title && ((0, jsx_runtime_1.jsx)(typography_1.Typography, Object.assign({ variant: "body-medium", as: "div" }, { children: props.children }))), (0, jsx_runtime_1.jsx)("div", Object.assign({ tabIndex: 0, role: "button", className: "ndl-toggletip-close-icon", onKeyDown: (event) => {
158
+ var _a;
159
+ if (event.key === 'Enter' || event.key === 'Space') {
160
+ setOpen(false);
161
+ (_a = props === null || props === void 0 ? void 0 : props.onClose) === null || _a === void 0 ? void 0 : _a.call(props, event);
162
+ }
163
+ }, onClick: (event) => {
164
+ setOpen(false);
165
+ (props === null || props === void 0 ? void 0 : props.onClose) && (props === null || props === void 0 ? void 0 : props.onClose(event));
166
+ }, "aria-label": "close-toggletip", "data-testid": "close-toggletip" }, { children: (0, jsx_runtime_1.jsx)(icons_1.XMarkIconOutline, {}) }))] })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "ndl-toggletip-content", "data-testid": "toggletip-content" }, { children: [props.title && ((0, jsx_runtime_1.jsx)(typography_1.Typography, Object.assign({ variant: "body-medium" }, { children: props.children }))), props.actions && ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "ndl-toggletip-actions" }, { children: props.actions.map((action, index) => ((0, react_1.createElement)(ToggletipAction, Object.assign({}, action, { key: index })))) })))] }))] }))] })) }))) : null }));
167
+ });
168
+ exports.default = Tip;
169
+ //# sourceMappingURL=Tip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tip.js","sourceRoot":"","sources":["../../../src/tooltip/Tip.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,+CAMe;AACf,8CAQ4B;AAE5B,wDAAkD;AAClD,0CAAyC;AACzC,sCAAmC;AACnC,iFAAyD;AACzD,oCAA4C;AAC5C,8CAA2C;AAE3C,2CAAsC;AACtC,4DAAmC;AAiDnC,MAAM,UAAU,GAAW,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AAE9D,MAAM,cAAc,GAAG,CACrB,SAAe,EACkC,EAAE;IACnD,QAAQ,SAAS,EAAE;QACjB,KAAK,QAAQ;YACX,OAAO,KAAK,CAAC;QACf,KAAK,MAAM;YACT,OAAO,OAAO,CAAC;QACjB,KAAK,OAAO;YACV,OAAO,MAAM,CAAC;QAChB,KAAK,KAAK,CAAC;QACX;YACE,OAAO,QAAQ,CAAC;KACnB;AACH,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,EAIF,EAAE,EAAE;QAJF,EACvB,KAAK,EACL,OAAO,OAEc,EADlB,KAAK,cAHe,oBAIxB,CADS;IAER,MAAM,EAAE,UAAU,EAAE,GAAG,IAAA,qBAAQ,E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QAAQ,EACb,SAAS,EAAC,0BAA0B,EACpC,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE;;4CACnB,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO,EAAE;gDAClD,OAAO,CAAC,KAAK,CAAC,CAAC;gDACf,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,sDAAG,KAAK,CAAC,CAAC;6CACzB;wCACH,CAAC,EACD,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;4CACjB,OAAO,CAAC,KAAK,CAAC,CAAC;4CACf,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,MAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,CAAC,KAAK,CAAC,CAAA,CAAC;wCAC1C,CAAC,gBACU,iBAAiB,iBAChB,iBAAiB,gBAE7B,uBAAC,wBAAgB,KAAG,IAChB,KACF,EACN,+CACE,SAAS,EAAC,uBAAuB,iBACrB,mBAAmB,iBAE9B,KAAK,CAAC,KAAK,IAAI,CACd,uBAAC,uBAAU,kBAAC,OAAO,EAAC,aAAa,gBAC9B,KAAK,CAAC,QAAQ,IACJ,CACd,EACA,KAAK,CAAC,OAAO,IAAI,CAChB,8CAAK,SAAS,EAAC,uBAAuB,gBACnC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CACpC,2BAAC,eAAe,oBAAK,MAAM,IAAE,GAAG,EAAE,KAAK,IAAI,CAC5C,CAAC,IACE,CACP,KACG,IACL,CACJ,KACO,IACM,CACnB,CAAC,CAAC,CAAC,IAAI,GACP,CACJ,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,kBAAe,GAAG,CAAC"}
@@ -23,9 +23,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
23
23
  return (mod && mod.__esModule) ? mod : { "default": mod };
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.SmartTooltip = exports.Tooltip = void 0;
26
+ exports.Tip = exports.SmartTooltip = exports.Tooltip = void 0;
27
27
  var Tooltip_1 = require("./Tooltip");
28
28
  Object.defineProperty(exports, "Tooltip", { enumerable: true, get: function () { return __importDefault(Tooltip_1).default; } });
29
29
  var SmartTooltip_1 = require("./SmartTooltip");
30
30
  Object.defineProperty(exports, "SmartTooltip", { enumerable: true, get: function () { return __importDefault(SmartTooltip_1).default; } });
31
+ var Tip_1 = require("./Tip");
32
+ Object.defineProperty(exports, "Tip", { enumerable: true, get: function () { return __importDefault(Tip_1).default; } });
31
33
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tooltip/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;AAEH,qCAA+C;AAAtC,mHAAA,OAAO,OAAW;AAC3B,+CAAyD;AAAhD,6HAAA,OAAO,OAAgB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tooltip/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;AAEH,qCAA+C;AAAtC,mHAAA,OAAO,OAAW;AAC3B,+CAAyD;AAAhD,6HAAA,OAAO,OAAgB;AAChC,6BAAuC;AAA9B,2GAAA,OAAO,OAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/_common/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEvD,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAa,EAAE,EAAE,CAC9C,KAAK,CAAC,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;AAEtC,qCAAqC;AACrC,MAAM,CAAC,MAAM,YAAY,GAAG,CAA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J,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,wCAAwC;AAC9D,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,MAAc,EAAE,EAAE,CACzC,IAAI,CAAC,MAAM,EAAE;KACV,QAAQ,CAAC,EAAE,CAAC;KACZ,KAAK,CAAC,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,CAAC"}
@@ -1,15 +1,4 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
- import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { jsx as _jsx } from "react/jsx-runtime";
13
2
  /**
14
3
  *
15
4
  * Copyright (c) "Neo4j"
@@ -30,59 +19,10 @@ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
30
19
  * You should have received a copy of the GNU General Public License
31
20
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
32
21
  */
33
- import React, { useEffect, useState, } from 'react';
34
- import { useFloating, offset, autoPlacement, autoUpdate, useHover, useInteractions, } from '@floating-ui/react-dom-interactions';
35
- import Tooltip from './Tooltip';
36
- import { tokens } from '@neo4j-ndl/base';
37
- import { Portal } from '../portal';
38
- import ConditionalWrap from '../_common/ConditionalWrap';
39
- const PLACEMENTS = ['top', 'bottom', 'left', 'right'];
40
- const calculateArrow = (placement) => {
41
- switch (placement) {
42
- case 'bottom':
43
- return 'top';
44
- case 'left':
45
- return 'right';
46
- case 'right':
47
- return 'left';
48
- case 'top':
49
- default:
50
- return 'bottom';
51
- }
52
- };
53
- const SmartTooltip = React.forwardRef(function SmartTooltip(_a, ref) {
54
- var { open: openProp, allowedPlacements = PLACEMENTS, portal = true } = _a, props = __rest(_a, ["open", "allowedPlacements", "portal"]);
55
- const [open, setOpen] = useState(false);
56
- const { context, x, y, reference, floating, strategy, placement } = useFloating({
57
- open,
58
- onOpenChange: setOpen,
59
- whileElementsMounted: autoUpdate,
60
- middleware: [
61
- offset(10),
62
- autoPlacement({
63
- allowedPlacements,
64
- }),
65
- ],
66
- });
67
- const hover = useHover(context, {
68
- move: false,
69
- delay: {
70
- // Strip the 'ms' from the duration token, need to provide pure ms durations
71
- close: parseInt(tokens.transitions.values.duration.default.replace('ms', '')),
72
- },
73
- });
74
- const { getFloatingProps } = useInteractions([hover]);
75
- useEffect(() => {
76
- /**
77
- * Assign passed ref to the reference callback
78
- * of the useFloating hook
79
- */
80
- const { current = null } = ref || {};
81
- if (current) {
82
- reference(current);
83
- }
84
- }, [ref]);
85
- return (_jsx(_Fragment, { children: open || openProp ? (_jsx(ConditionalWrap, Object.assign({ condition: portal, wrap: (children) => _jsx(Portal, { children: children }) }, { children: _jsx(Tooltip, Object.assign({}, props, getFloatingProps(), { ref: floating, arrowPosition: calculateArrow(placement), style: Object.assign({ position: strategy, top: y !== null && y !== void 0 ? y : 0, left: x !== null && x !== void 0 ? x : 0, width: 'max-content', zIndex: tokens.zIndex.alias.tooltip }, props.style) })) }))) : null }));
22
+ import React from 'react';
23
+ import Tip from './Tip';
24
+ const SmartTooltip = React.forwardRef(function SmartTooltip(props, ref) {
25
+ return _jsx(Tip, Object.assign({}, props, { type: "tooltip", ref: ref }));
86
26
  });
87
27
  export default SmartTooltip;
88
28
  //# sourceMappingURL=SmartTooltip.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SmartTooltip.js","sourceRoot":"","sources":["../../../src/tooltip/SmartTooltip.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG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C,IAAI,GACP,CACJ,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"SmartTooltip.js","sourceRoot":"","sources":["../../../src/tooltip/SmartTooltip.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,GAAG,MAAM,OAAO,CAAC;AAcxB,MAAM,YAAY,GAAG,KAAK,CAAC,UAAU,CAAC,SAAS,YAAY,CACzD,KAAwB,EACxB,GAAgC;IAEhC,OAAO,KAAC,GAAG,oBAAK,KAAK,IAAE,IAAI,EAAC,SAAS,EAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AACrD,CAAC,CAAC,CAAC;AAEH,eAAe,YAAY,CAAC"}
@@ -0,0 +1,141 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { createElement as _createElement } from "react";
13
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
14
+ /**
15
+ *
16
+ * Copyright (c) "Neo4j"
17
+ * Neo4j Sweden AB [http://neo4j.com]
18
+ *
19
+ * This file is part of Neo4j.
20
+ *
21
+ * Neo4j is free software: you can redistribute it and/or modify
22
+ * it under the terms of the GNU General Public License as published by
23
+ * the Free Software Foundation, either version 3 of the License, or
24
+ * (at your option) any later version.
25
+ *
26
+ * This program is distributed in the hope that it will be useful,
27
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
28
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29
+ * GNU General Public License for more details.
30
+ *
31
+ * You should have received a copy of the GNU General Public License
32
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
33
+ */
34
+ import React, { useEffect, useState, } from 'react';
35
+ import { useFloating, useDismiss, offset, autoPlacement, autoUpdate, useHover, useInteractions, } from '@floating-ui/react';
36
+ import Tooltip from './Tooltip';
37
+ import { tokens } from '@neo4j-ndl/base';
38
+ import { Portal } from '../portal';
39
+ import ConditionalWrap from '../_common/ConditionalWrap';
40
+ import { XMarkIconOutline } from '../icons';
41
+ import { Typography } from '../typography';
42
+ import { usePress } from 'react-aria';
43
+ import classname from 'classnames';
44
+ const PLACEMENTS = ['top', 'bottom', 'left', 'right'];
45
+ const calculateArrow = (placement) => {
46
+ switch (placement) {
47
+ case 'bottom':
48
+ return 'top';
49
+ case 'left':
50
+ return 'right';
51
+ case 'right':
52
+ return 'left';
53
+ case 'top':
54
+ default:
55
+ return 'bottom';
56
+ }
57
+ };
58
+ const ToggletipAction = (_a) => {
59
+ var { label, onClick } = _a, props = __rest(_a, ["label", "onClick"]);
60
+ const { pressProps } = usePress({
61
+ onPress: (e) => {
62
+ onClick && onClick(e);
63
+ },
64
+ });
65
+ return (_jsx(Typography, Object.assign({}, props, { className: classname('ndl-toggletip-action', props.className) }, pressProps, { tabIndex: 0, variant: "label", as: onClick === undefined ? 'a' : 'button' }, { children: label })));
66
+ };
67
+ const Tip = React.forwardRef(function Tip(_a, ref) {
68
+ var { open: openProp, allowedPlacements = PLACEMENTS, portal = true } = _a, props = __rest(_a, ["open", "allowedPlacements", "portal"]);
69
+ const [open, setOpen] = useState(false);
70
+ const { type = 'tooltip' } = props;
71
+ const { context, x, y, strategy, placement, refs } = useFloating({
72
+ open: openProp !== null && openProp !== void 0 ? openProp : open,
73
+ onOpenChange: (e) => {
74
+ setOpen(e);
75
+ /**
76
+ * We do not receive an `event` here from the onOpenChange callback
77
+ * Need to investigate if we can propagate the underlying event for closing to `onClose`
78
+ */
79
+ if (!open) {
80
+ props.type === 'toggletip' && props.onClose && props.onClose(undefined);
81
+ }
82
+ },
83
+ whileElementsMounted: autoUpdate,
84
+ middleware: [
85
+ offset(10),
86
+ autoPlacement({
87
+ allowedPlacements,
88
+ }),
89
+ ],
90
+ });
91
+ const hover = useHover(context, {
92
+ move: false,
93
+ enabled: type === 'tooltip',
94
+ delay: {
95
+ // TODO: add a slower animation token to avoid this being hardcoded
96
+ open: 200,
97
+ // Strip the 'ms' from the duration token, need to provide pure ms durations
98
+ close: parseInt(tokens.transitions.values.duration.default.replace('ms', '')),
99
+ },
100
+ });
101
+ const dismiss = useDismiss(context, {
102
+ enabled: type === 'toggletip',
103
+ outsidePress: (e) => {
104
+ /** Avoid calling onClose, if we click the reference element */
105
+ if (
106
+ /** Case that the target is a child of the referenced element **/
107
+ typeof ref !== 'function' &&
108
+ (ref === null || ref === void 0 ? void 0 : ref.current) instanceof Element &&
109
+ e.target instanceof Element &&
110
+ (ref === null || ref === void 0 ? void 0 : ref.current.contains(e.target))) {
111
+ return false;
112
+ }
113
+ return true;
114
+ },
115
+ });
116
+ const { getFloatingProps } = useInteractions([hover, dismiss]);
117
+ useEffect(() => {
118
+ /**
119
+ * Assign passed ref to the reference callback
120
+ * of the useFloating hook
121
+ */
122
+ const { current = null } = ref || {};
123
+ if (current) {
124
+ refs.setReference(current);
125
+ }
126
+ }, [ref]);
127
+ return (_jsx(_Fragment, { children: open || openProp ? (_jsx(ConditionalWrap, Object.assign({ condition: portal, wrap: (children) => _jsx(Portal, { children: children }) }, { children: _jsxs(Tooltip, Object.assign({}, props, { ref: refs.setFloating }, getFloatingProps(), { arrowPosition: calculateArrow(placement), className: classname(props.className, {
128
+ 'ndl-toggletip': type === 'toggletip',
129
+ }), style: Object.assign({ position: strategy, top: y !== null && y !== void 0 ? y : 0, left: x !== null && x !== void 0 ? x : 0, width: 'max-content', zIndex: tokens.zIndex.alias.tooltip }, props.style) }, { children: [props.type === 'tooltip' && props.children, props.type === 'toggletip' && (_jsxs(_Fragment, { children: [_jsxs("div", Object.assign({ className: "ndl-toggletip-header" }, { children: [props.title && (_jsx(Typography, Object.assign({ variant: "h6" }, { children: props.title }))), !props.title && (_jsx(Typography, Object.assign({ variant: "body-medium", as: "div" }, { children: props.children }))), _jsx("div", Object.assign({ tabIndex: 0, role: "button", className: "ndl-toggletip-close-icon", onKeyDown: (event) => {
130
+ var _a;
131
+ if (event.key === 'Enter' || event.key === 'Space') {
132
+ setOpen(false);
133
+ (_a = props === null || props === void 0 ? void 0 : props.onClose) === null || _a === void 0 ? void 0 : _a.call(props, event);
134
+ }
135
+ }, onClick: (event) => {
136
+ setOpen(false);
137
+ (props === null || props === void 0 ? void 0 : props.onClose) && (props === null || props === void 0 ? void 0 : props.onClose(event));
138
+ }, "aria-label": "close-toggletip", "data-testid": "close-toggletip" }, { children: _jsx(XMarkIconOutline, {}) }))] })), _jsxs("div", Object.assign({ className: "ndl-toggletip-content", "data-testid": "toggletip-content" }, { children: [props.title && (_jsx(Typography, Object.assign({ variant: "body-medium" }, { children: props.children }))), props.actions && (_jsx("div", Object.assign({ className: "ndl-toggletip-actions" }, { children: props.actions.map((action, index) => (_createElement(ToggletipAction, Object.assign({}, action, { key: index })))) })))] }))] }))] })) }))) : null }));
139
+ });
140
+ export default Tip;
141
+ //# sourceMappingURL=Tip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tip.js","sourceRoot":"","sources":["../../../src/tooltip/Tip.tsx"],"names":[],"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,EAIZ,SAAS,EACT,QAAQ,GACT,MAAM,OAAO,CAAC;AACf,OAAO,EACL,WAAW,EACX,UAAU,EACV,MAAM,EACN,aAAa,EACb,UAAU,EACV,QAAQ,EACR,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,OAAyB,MAAM,WAAW,CAAC;AAClD,OAAO,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KAAK,CAAC,CAAA,CAAC;wCAC1C,CAAC,gBACU,iBAAiB,iBAChB,iBAAiB,gBAE7B,KAAC,gBAAgB,KAAG,IAChB,KACF,EACN,6BACE,SAAS,EAAC,uBAAuB,iBACrB,mBAAmB,iBAE9B,KAAK,CAAC,KAAK,IAAI,CACd,KAAC,UAAU,kBAAC,OAAO,EAAC,aAAa,gBAC9B,KAAK,CAAC,QAAQ,IACJ,CACd,EACA,KAAK,CAAC,OAAO,IAAI,CAChB,4BAAK,SAAS,EAAC,uBAAuB,gBACnC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CACpC,eAAC,eAAe,oBAAK,MAAM,IAAE,GAAG,EAAE,KAAK,IAAI,CAC5C,CAAC,IACE,CACP,KACG,IACL,CACJ,KACO,IACM,CACnB,CAAC,CAAC,CAAC,IAAI,GACP,CACJ,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,GAAG,CAAC"}
@@ -20,4 +20,5 @@
20
20
  */
21
21
  export { default as Tooltip } from './Tooltip';
22
22
  export { default as SmartTooltip } from './SmartTooltip';
23
+ export { default as Tip } from './Tip';
23
24
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tooltip/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tooltip/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,OAAO,CAAC"}
@@ -18,8 +18,7 @@
18
18
  * You should have received a copy of the GNU General Public License
19
19
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
20
  */
21
- /// <reference types="react" />
22
- /// <reference types="react" />
21
+ import { MouseEvent, TouchEvent } from 'react';
23
22
  export declare const removeNewlines: (input: string) => string;
24
23
  /** Remove extra spaces from sting */
25
24
  export declare const removeSpaces: (input: string) => string;
@@ -40,7 +40,7 @@ export interface TextInputProperties extends Omit<CommonInputProps, 'label'> {
40
40
  isOptional?: boolean;
41
41
  /** Information to be displayed in the information tooltip */
42
42
  informationIconText?: string;
43
- /** Pass props to the underlaying SmartTooltip component */
43
+ /** Pass props to the underlying SmartTooltip component */
44
44
  smartTooltipProps?: SmartTooltipProps;
45
45
  }
46
46
  /**
@@ -32,5 +32,5 @@ export interface SmartTooltipProps extends Omit<TooltipProps, 'arrowPosition'> {
32
32
  */
33
33
  portal?: boolean;
34
34
  }
35
- declare const SmartTooltip: React.ForwardRefExoticComponent<Omit<SmartTooltipProps, "ref"> & React.RefAttributes<HTMLElement>>;
35
+ declare const SmartTooltip: React.ForwardRefExoticComponent<Omit<SmartTooltipProps, "ref"> & React.RefAttributes<unknown>>;
36
36
  export default SmartTooltip;
@@ -0,0 +1,62 @@
1
+ /**
2
+ *
3
+ * Copyright (c) "Neo4j"
4
+ * Neo4j Sweden AB [http://neo4j.com]
5
+ *
6
+ * This file is part of Neo4j.
7
+ *
8
+ * Neo4j is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+ import React, { ReactNode } from 'react';
22
+ import type { Side } from '@floating-ui/core/src/types';
23
+ import { TooltipProps } from './Tooltip';
24
+ import type { PressEvent } from '@react-types/shared';
25
+ export interface ToggletipActionProps extends Omit<React.HTMLProps<HTMLAnchorElement>, 'onClick'> {
26
+ /** Label of the action item */
27
+ label: string;
28
+ /** Event handler when the action button is clicked. If set, the element is rendered as `button` */
29
+ onClick?: (event: PressEvent) => void;
30
+ /** Experimental: this can be surfaced from every tap-able component in Needle v2 */
31
+ onPress?: (event: PressEvent) => void;
32
+ /** Link to redirect to when the action button is clicked. If set, the element is rendered as `a`. Ignored if `onClick` prop is passed */
33
+ href?: string;
34
+ /** Sets how to open the link. Only applicable when `href` is passed */
35
+ target?: '_blank' | '_self' | '_parent' | '_top';
36
+ }
37
+ declare type SmartTooltipProps = {
38
+ type: 'tooltip';
39
+ };
40
+ declare type ToggleTipCustomProps = {
41
+ type: 'toggletip';
42
+ /** Title of the Toggletip **/
43
+ title?: string | ReactNode;
44
+ /** Shows Action buttons in the footer */
45
+ actions?: ToggletipActionProps[];
46
+ /** Callback function on toggletip close. */
47
+ onClose?: (event: React.MouseEvent | React.TouchEvent | React.KeyboardEvent | undefined) => void;
48
+ };
49
+ export interface TipProps extends Omit<TooltipProps, 'arrowPosition'> {
50
+ /** Allowed places of the tooltip */
51
+ allowedPlacements?: Side[];
52
+ /** If you want controlled open/close behavior pass an open prop */
53
+ open?: boolean;
54
+ /**
55
+ * If the tooltip is being cut-off by a parent element,
56
+ * it will render in a Portal targeting body
57
+ */
58
+ portal?: boolean;
59
+ }
60
+ export declare type ToogleTipProps = TipProps & ToggleTipCustomProps;
61
+ declare const Tip: React.ForwardRefExoticComponent<(Omit<ToogleTipProps, "ref"> | Omit<TipProps & SmartTooltipProps, "ref">) & React.RefAttributes<unknown>>;
62
+ export default Tip;
@@ -20,3 +20,4 @@
20
20
  */
21
21
  export { default as Tooltip } from './Tooltip';
22
22
  export { default as SmartTooltip } from './SmartTooltip';
23
+ export { default as Tip } from './Tip';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neo4j-ndl/react",
3
- "version": "1.5.11",
3
+ "version": "1.6.0",
4
4
  "sideEffects": false,
5
5
  "description": "React implementation of Neo4j Design System",
6
6
  "keywords": [
@@ -89,14 +89,15 @@
89
89
  "react": ">=16.8.0"
90
90
  },
91
91
  "dependencies": {
92
- "@floating-ui/react-dom-interactions": "^0.12.0",
92
+ "@floating-ui/react": "^0.24.2",
93
93
  "@heroicons/react": "2.0.13",
94
94
  "@neo4j-cypher/react-codemirror": "^1.0.1",
95
- "@neo4j-ndl/base": "^1.5.7",
95
+ "@neo4j-ndl/base": "^1.6.0",
96
96
  "@tanstack/react-table": "^8.5.22",
97
97
  "classnames": "^2.3.1",
98
98
  "detect-browser": "^5.3.0",
99
99
  "re-resizable": "^6.9.9",
100
+ "react-aria": "^3.25.0",
100
101
  "react-dropzone": "^14.0.0",
101
102
  "react-focus-lock": "^2.9.4",
102
103
  "react-select": "5.7.0",