@neo4j-ndl/react 1.5.11 → 1.7.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.
Files changed (38) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/lib/LICENSES.txt +207 -1
  3. package/lib/NOTICE.txt +4 -2
  4. package/lib/cjs/_common/utils.js.map +1 -1
  5. package/lib/cjs/index.js +1 -0
  6. package/lib/cjs/index.js.map +1 -1
  7. package/lib/cjs/textarea/Textarea.js +85 -0
  8. package/lib/cjs/textarea/Textarea.js.map +1 -0
  9. package/lib/cjs/textarea/index.js +29 -0
  10. package/lib/cjs/textarea/index.js.map +1 -0
  11. package/lib/cjs/tooltip/SmartTooltip.js +4 -87
  12. package/lib/cjs/tooltip/SmartTooltip.js.map +1 -1
  13. package/lib/cjs/tooltip/Tip.js +169 -0
  14. package/lib/cjs/tooltip/Tip.js.map +1 -0
  15. package/lib/cjs/tooltip/index.js +3 -1
  16. package/lib/cjs/tooltip/index.js.map +1 -1
  17. package/lib/esm/_common/utils.js.map +1 -1
  18. package/lib/esm/index.js +1 -0
  19. package/lib/esm/index.js.map +1 -1
  20. package/lib/esm/textarea/Textarea.js +80 -0
  21. package/lib/esm/textarea/Textarea.js.map +1 -0
  22. package/lib/esm/textarea/index.js +22 -0
  23. package/lib/esm/textarea/index.js.map +1 -0
  24. package/lib/esm/tooltip/SmartTooltip.js +5 -65
  25. package/lib/esm/tooltip/SmartTooltip.js.map +1 -1
  26. package/lib/esm/tooltip/Tip.js +141 -0
  27. package/lib/esm/tooltip/Tip.js.map +1 -0
  28. package/lib/esm/tooltip/index.js +1 -0
  29. package/lib/esm/tooltip/index.js.map +1 -1
  30. package/lib/types/_common/utils.d.ts +1 -2
  31. package/lib/types/index.d.ts +1 -0
  32. package/lib/types/text-input/TextInput.d.ts +1 -1
  33. package/lib/types/textarea/Textarea.d.ts +56 -0
  34. package/lib/types/textarea/index.d.ts +21 -0
  35. package/lib/types/tooltip/SmartTooltip.d.ts +1 -1
  36. package/lib/types/tooltip/Tip.d.ts +62 -0
  37. package/lib/types/tooltip/index.d.ts +1 -0
  38. package/package.json +4 -3
@@ -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,EAAC;QAC9B,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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,CAAC,KAAa,EAA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AE,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"}
package/lib/esm/index.js CHANGED
@@ -37,6 +37,7 @@ export * from './table-deprecated';
37
37
  export * from './table';
38
38
  export * from './drag-and-drop';
39
39
  export * from './text-input';
40
+ export * from './textarea';
40
41
  export * from './text-link';
41
42
  export * from './dropdown';
42
43
  export * from './tag';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC"}
@@ -0,0 +1,80 @@
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, jsxs as _jsxs } from "react/jsx-runtime";
13
+ /**
14
+ *
15
+ * Copyright (c) "Neo4j"
16
+ * Neo4j Sweden AB [http://neo4j.com]
17
+ *
18
+ * This file is part of Neo4j.
19
+ *
20
+ * Neo4j is free software: you can redistribute it and/or modify
21
+ * it under the terms of the GNU General Public License as published by
22
+ * the Free Software Foundation, either version 3 of the License, or
23
+ * (at your option) any later version.
24
+ *
25
+ * This program is distributed in the hope that it will be useful,
26
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
27
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28
+ * GNU General Public License for more details.
29
+ *
30
+ * You should have received a copy of the GNU General Public License
31
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
32
+ */
33
+ import { forwardRef, useMemo, useRef, } from 'react';
34
+ import SmartTooltip from '../tooltip/SmartTooltip';
35
+ import classNames from 'classnames';
36
+ import { needleWarningMessage } from '../_common/utils';
37
+ import { customLabelAndNoAriaLabelWarningMessage } from '../_common/messages';
38
+ import { ExclamationCircleIconSolid, InformationCircleIconOutline, } from '../icons';
39
+ /**
40
+ *
41
+ *
42
+ * Textarea Component
43
+ *
44
+ *
45
+ */
46
+ const Textarea = forwardRef(function Textarea(props, ref) {
47
+ const { label, fluid, errorText, helpText, isOptional = false, informationIconText, size = 'small', 'aria-label': ariaLabel, smartTooltipProps } = props, customProps = __rest(props, ["label", "fluid", "errorText", "helpText", "isOptional", "informationIconText", "size", 'aria-label', "smartTooltipProps"]);
48
+ const containerWrappingClass = classNames(`ndl-textarea ndl-type-text`, customProps.className, {
49
+ 'ndl-disabled': customProps.disabled,
50
+ 'ndl-small': size === 'small',
51
+ 'ndl-large': size === 'large',
52
+ 'ndl-has-error': errorText,
53
+ 'ndl-has-right-icon': errorText,
54
+ 'ndl-has-icon': errorText,
55
+ });
56
+ const hasEmptyLabelValue = !label || label === '';
57
+ const labelWrappingClass = classNames('ndl-textarea-label', {
58
+ 'ndl-fluid': fluid,
59
+ 'ndl-textarea-no-label': hasEmptyLabelValue,
60
+ });
61
+ const isCustomLabel = label && typeof label !== 'string';
62
+ const hasCustomLabelAndNoAriaLabel = isCustomLabel && !ariaLabel;
63
+ useMemo(() => {
64
+ if (!label && !ariaLabel) {
65
+ needleWarningMessage('A Textarea without a label does not have an aria label, be sure to include an aria label for screen readers link: https://dequeuniversity.com/rules/axe/4.2/label?application=axeAPI');
66
+ }
67
+ if (hasCustomLabelAndNoAriaLabel) {
68
+ needleWarningMessage(customLabelAndNoAriaLabelWarningMessage);
69
+ }
70
+ }, [label, ariaLabel, hasCustomLabelAndNoAriaLabel]);
71
+ const customPropsClassNameStripped = Object.assign(Object.assign({}, customProps), { className: undefined });
72
+ const informationIconClass = classNames({
73
+ 'ndl-information-icon-small': size === 'small',
74
+ 'ndl-information-icon-large': size === 'large',
75
+ });
76
+ const informationRef = useRef(null);
77
+ return (_jsxs("div", Object.assign({ className: containerWrappingClass }, { children: [_jsxs("label", Object.assign({ className: labelWrappingClass }, { children: [_jsx("div", Object.assign({ className: "ndl-textarea-wrapper" }, { children: _jsx("textarea", Object.assign({}, customPropsClassNameStripped, { ref: ref, "aria-label": ariaLabel })) })), !hasEmptyLabelValue && (_jsxs("div", Object.assign({ className: "ndl-textarea-wrapper" }, { children: [_jsx("span", Object.assign({ className: "ndl-textarea-label-text" }, { children: label })), informationIconText && (_jsxs("div", Object.assign({ className: informationIconClass, "data-testid": "information-icon", ref: informationRef }, { children: [_jsx(InformationCircleIconOutline, {}), _jsx(SmartTooltip, Object.assign({}, smartTooltipProps, { ref: informationRef }, { children: informationIconText }))] }))), isOptional && (_jsx("span", Object.assign({ className: "ndl-textarea-optional" }, { children: "Optional" })))] })))] })), helpText && !errorText && (_jsx("div", Object.assign({ className: "ndl-textarea-msg" }, { children: helpText }))), errorText && (_jsxs("div", Object.assign({ className: "ndl-textarea-msg" }, { children: [_jsx("div", Object.assign({ className: "ndl-error-icon" }, { children: _jsx(ExclamationCircleIconSolid, {}) })), _jsx("div", Object.assign({ className: "ndl-error-text" }, { children: errorText }))] })))] })));
78
+ });
79
+ export default Textarea;
80
+ //# sourceMappingURL=Textarea.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Textarea.js","sourceRoot":"","sources":["../../../src/textarea/Textarea.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAIL,UAAU,EACV,OAAO,EACP,MAAM,GACP,MAAM,OAAO,CAAC;AACf,OAAO,YAAmC,MAAM,yBAAyB,CAAC;AAC1E,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,uCAAuC,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EACL,0BAA0B,EAC1B,4BAA4B,GAC7B,MAAM,UAAU,CAAC;AAwClB;;;;;;GAMG;AAEH,MAAM,QAAQ,GAAG,UAAU,CAAC,SAAS,QAAQ,CAC3C,KAAoB,EACpB,GAAsC;IAEtC,MAAM,EACJ,KAAK,EACL,KAAK,EACL,SAAS,EACT,QAAQ,EACR,UAAU,GAAG,KAAK,EAClB,mBAAmB,EACnB,IAAI,GAAG,OAAO,EACd,YAAY,EAAE,SAAS,EACvB,iBAAiB,KAEf,KAAK,EADJ,WAAW,UACZ,KAAK,EAXH,2HAWL,CAAQ,CAAC;IAEV,MAAM,sBAAsB,GAAG,UAAU,CACvC,4BAA4B,EAC5B,WAAW,CAAC,SAAS,EACrB;QACE,cAAc,EAAE,WAAW,CAAC,QAAQ;QACpC,WAAW,EAAE,IAAI,KAAK,OAAO;QAC7B,WAAW,EAAE,IAAI,KAAK,OAAO;QAC7B,eAAe,EAAE,SAAS;QAC1B,oBAAoB,EAAE,SAAS;QAC/B,cAAc,EAAE,SAA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,kBAAkB,EAC9B,GAAG,EAAE,cAAc,iBAEnB,KAAC,4BAA4B,KAAG,EAChC,KAAC,YAAY,oBAAK,iBAAiB,IAAE,GAAG,EAAE,cAAc,gBACrD,mBAAmB,IACP,KACX,CACP,EACA,UAAU,IAAI,CACb,6BAAM,SAAS,EAAC,uBAAuB,8BAAgB,CACxD,KACG,CACP,KACK,EACP,QAAQ,IAAI,CAAC,SAAS,IAAI,CACzB,4BAAK,SAAS,EAAC,kBAAkB,gBAAE,QAAQ,IAAO,CACnD,EACA,SAAS,IAAI,CACZ,6BAAK,SAAS,EAAC,kBAAkB,iBAC/B,4BAAK,SAAS,EAAC,gBAAgB,gBAC7B,KAAC,0BAA0B,KAAG,IAC1B,EACN,4BAAK,SAAS,EAAC,gBAAgB,gBAAE,SAAS,IAAO,KAC7C,CACP,KACG,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,22 @@
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
+ export { default as Textarea } from './Textarea';
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/textarea/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,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;AAEH,OAAO,KAAK,EAAE,EAGZ,SAAS,EACT,QAAQ,GACT,MAAM,OAAO,CAAC;AACf,OAAO,EACL,WAAW,EACX,MAAM,EACN,aAAa,EACb,UAAU,EACV,QAAQ,EACR,eAAe,GAChB,MAAM,qCAAqC,CAAC;AAE7C,OAAO,OAAyB,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,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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,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,eAAe,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,Q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AAC,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;
@@ -37,6 +37,7 @@ export * from './table-deprecated';
37
37
  export * from './table';
38
38
  export * from './drag-and-drop';
39
39
  export * from './text-input';
40
+ export * from './textarea';
40
41
  export * from './text-link';
41
42
  export * from './dropdown';
42
43
  export * from './tag';