@prom-ui/core 0.0.22 → 0.0.23

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 (47) hide show
  1. package/Body/package.json +1 -1
  2. package/Box/package.json +1 -1
  3. package/Button/package.json +1 -1
  4. package/ButtonPageUp/package.json +1 -1
  5. package/Checkbox/package.json +1 -1
  6. package/Flex/package.json +1 -1
  7. package/Grid/package.json +1 -1
  8. package/Icon/package.json +1 -1
  9. package/Image/package.json +1 -1
  10. package/ImageEmoji/package.json +1 -1
  11. package/Input/package.json +1 -1
  12. package/KeyPress/package.json +1 -1
  13. package/Line/package.json +1 -1
  14. package/Link/package.json +1 -1
  15. package/List/package.json +1 -1
  16. package/OutsideClick/package.json +1 -1
  17. package/Picture/package.json +1 -1
  18. package/PortableOverlay/package.json +1 -1
  19. package/Portal/package.json +1 -1
  20. package/Rating/package.json +1 -1
  21. package/SafeQuery/components/Error.d.ts +7 -0
  22. package/SafeQuery/index.d.ts +7 -0
  23. package/SafeQuery/index.js +176 -0
  24. package/{Tooltip → SafeQuery}/package.json +3 -3
  25. package/SafeQuery/style.css +4 -0
  26. package/Scroll/package.json +1 -1
  27. package/ScrollControls/package.json +1 -1
  28. package/SideOverlay/package.json +1 -1
  29. package/SimpleSlider/package.json +1 -1
  30. package/Skeleton/package.json +1 -1
  31. package/Spinner/package.json +1 -1
  32. package/Text/package.json +1 -1
  33. package/TextEmoji/package.json +1 -1
  34. package/Tumbler/package.json +1 -1
  35. package/package.json +10 -2
  36. package/Tooltip/Popper/index.d.ts +0 -12
  37. package/Tooltip/Popper/index.js +0 -88
  38. package/Tooltip/Popper/package.json +0 -9
  39. package/Tooltip/Popper/style.css +0 -133
  40. package/Tooltip/Trigger/index.d.ts +0 -5
  41. package/Tooltip/Trigger/index.js +0 -76
  42. package/Tooltip/Trigger/package.json +0 -9
  43. package/Tooltip/Trigger/style.css +0 -36
  44. package/Tooltip/index.d.ts +0 -24
  45. package/Tooltip/index.js +0 -284
  46. package/Tooltip/style.css +0 -170
  47. package/Tooltip/utils.d.ts +0 -1
package/Body/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Body",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
package/Box/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Box",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Button",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/ButtonPageUp",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Checkbox",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
package/Flex/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Flex",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
package/Grid/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Grid",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
package/Icon/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Icon",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Image",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/ImageEmoji",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Input",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/KeyPress",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
package/Line/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Line",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
package/Link/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Link",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
package/List/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/List",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/OutsideClick",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Picture",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/PortableOverlay",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Portal",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Rating",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ declare type tSafeQueryErrorProps = {
3
+ componentErrorName: string;
4
+ onReload: () => void;
5
+ };
6
+ export declare const SafeQueryError: React.FC<tSafeQueryErrorProps>;
7
+ export {};
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ export declare type tSafeQueryProps = {
3
+ componentErrorName?: string;
4
+ onReload?: () => void;
5
+ children: (arg: any) => JSX.Element;
6
+ };
7
+ export declare const SafeQuery: React.FC<tSafeQueryProps>;
@@ -0,0 +1,176 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var React = require('react');
6
+ var PropTypes = require('prop-types');
7
+ var components = require('@apollo/client/react/components');
8
+ var errcatch = require('@evo/errcatch');
9
+ var Box = require('@prom-ui/core/Box');
10
+ var Button = require('@prom-ui/core/Button');
11
+ var Text = require('@prom-ui/core/Text');
12
+
13
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
14
+
15
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
16
+ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
17
+
18
+ /******************************************************************************
19
+ Copyright (c) Microsoft Corporation.
20
+
21
+ Permission to use, copy, modify, and/or distribute this software for any
22
+ purpose with or without fee is hereby granted.
23
+
24
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
25
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
26
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
27
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
28
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
29
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
30
+ PERFORMANCE OF THIS SOFTWARE.
31
+ ***************************************************************************** */
32
+
33
+ var __assign = function() {
34
+ __assign = Object.assign || function __assign(t) {
35
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
36
+ s = arguments[i];
37
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
38
+ }
39
+ return t;
40
+ };
41
+ return __assign.apply(this, arguments);
42
+ };
43
+
44
+ function __rest(s, e) {
45
+ var t = {};
46
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
47
+ t[p] = s[p];
48
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
49
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
50
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
51
+ t[p[i]] = s[p[i]];
52
+ }
53
+ return t;
54
+ }
55
+
56
+ var css = {"root":"SafeQuery__root___RWb3q"};
57
+
58
+ var SafeQueryError = function (_a) {
59
+ var componentErrorName = _a.componentErrorName,
60
+ onReload = _a.onReload;
61
+
62
+ var _b = React.useState(false),
63
+ isHidden = _b[0],
64
+ setHidden = _b[1];
65
+
66
+ if (isHidden) {
67
+ return null;
68
+ }
69
+
70
+ if (process.env.NODE_ENV !== 'production') {
71
+ if (typeof window === 'undefined') return null;
72
+ return React__default["default"].createElement(Box.Box, {
73
+ className: css.root,
74
+ "box-background": 'red-500',
75
+ "box-padding": ['s m', 'm@large l@large'],
76
+ "box-position": 'relative',
77
+ "box-round": 'm',
78
+ "data-qaid": 'err_catch_trace'
79
+ }, React__default["default"].createElement(Box.Box, {
80
+ "box-margin-right": '5xl'
81
+ }, React__default["default"].createElement(Text.Text, {
82
+ "text-color": 'white'
83
+ }, "\u0412\u043E\u0437\u043D\u0438\u043A\u043B\u0430 \u043E\u0448\u0438\u0431\u043A\u0430:", ' ', React__default["default"].createElement(Text.Text, {
84
+ "text-weight": 'bold',
85
+ style: {
86
+ fontFamily: 'Consolas, "Liberation Mono", Menlo, monospace',
87
+ userSelect: 'all'
88
+ }
89
+ }, componentErrorName))), React__default["default"].createElement(Box.Box, {
90
+ "box-position": 'absolute center-right',
91
+ "box-margin-right": 's'
92
+ }, React__default["default"].createElement(Button.Button, {
93
+ "button-padding": 'xxs',
94
+ "button-theme": 'white-inherit',
95
+ onClick: onReload,
96
+ title: '\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C'
97
+ }, React__default["default"].createElement("svg", {
98
+ xmlns: 'http://www.w3.org/2000/svg',
99
+ viewBox: '0 0 18 18',
100
+ width: 18,
101
+ height: 18
102
+ }, React__default["default"].createElement("path", {
103
+ fill: '#fff',
104
+ d: 'M9 13.5c-2.49 0-4.5-2.01-4.5-4.5S6.51 4.5 9 4.5c1.24\n 0 2.36.52 3.17 1.33L10 8h5V3l-1.76 1.76C12.15 3.68 10.66\n 3 9 3 5.69 3 3.01 5.69 3.01 9S5.69 15 9 15c2.97 0\n 5.43-2.16 5.9-5h-1.52c-.46 2-2.24 3.5-4.38 3.5z'
105
+ }))), React__default["default"].createElement(Button.Button, {
106
+ "button-padding": 'xxs',
107
+ "button-theme": 'white-inherit',
108
+ onClick: function () {
109
+ return setHidden(true);
110
+ },
111
+ title: '\u0421\u043A\u0440\u044B\u0442\u044C'
112
+ }, React__default["default"].createElement("svg", {
113
+ xmlns: 'http://www.w3.org/2000/svg',
114
+ viewBox: '0 0 24 24',
115
+ width: 18,
116
+ height: 18
117
+ }, React__default["default"].createElement("path", {
118
+ fill: '#fff',
119
+ d: 'M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5\n 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'
120
+ })))));
121
+ }
122
+
123
+ return null;
124
+ };
125
+ SafeQueryError.propTypes = {
126
+ componentErrorName: PropTypes__default["default"].string.isRequired,
127
+ onReload: PropTypes__default["default"].func.isRequired
128
+ };
129
+
130
+ var SafeQuery = function (_a) {
131
+ var _b = _a.componentErrorName,
132
+ componentErrorName = _b === void 0 ? 'SafeQuery' : _b,
133
+ children = _a.children,
134
+ props = __rest(_a, ["componentErrorName", "children"]);
135
+
136
+ var _c = React.useState(false),
137
+ isReload = _c[0],
138
+ setReload = _c[1];
139
+
140
+ React.useEffect(function () {
141
+ if (isReload) {
142
+ setReload(false);
143
+ }
144
+ }, [isReload]);
145
+
146
+ if (isReload) {
147
+ return null;
148
+ }
149
+
150
+ var errorComponent = React__default["default"].createElement(SafeQueryError, {
151
+ componentErrorName: componentErrorName,
152
+ onReload: function () {
153
+ return setReload(true);
154
+ }
155
+ });
156
+ return React__default["default"].createElement(errcatch.ErrCatch, {
157
+ name: componentErrorName,
158
+ errorComponent: errorComponent
159
+ }, React__default["default"].createElement(components.Query, __assign({}, props), function (queryResult) {
160
+ var error = queryResult.error;
161
+ if (error) throw error;
162
+ return children(queryResult);
163
+ }));
164
+ }; // SafeQuery.defaultProps = {
165
+ // componentErrorName: 'SafeQuery',
166
+ // };
167
+
168
+ SafeQuery.propTypes = {
169
+ /** Название компонента в тексте с ошибкой */
170
+ componentErrorName: PropTypes__default["default"].string // children: PropTypes.func.isRequired,
171
+
172
+ };
173
+
174
+ exports.SafeQuery = SafeQuery;
175
+
176
+ require('./style.css');
@@ -1,12 +1,12 @@
1
1
  {
2
- "name": "@prom-ui/core/Tooltip",
3
- "version": "0.0.22",
2
+ "name": "@prom-ui/core/SafeQuery",
3
+ "version": "0.0.23",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
7
7
  "*.css"
8
8
  ],
9
9
  "dependencies": {
10
- "react-popper-tooltip": "2.10.1"
10
+ "@evo/errcatch": "^1.0.2"
11
11
  }
12
12
  }
@@ -0,0 +1,4 @@
1
+
2
+ .SafeQuery__root___RWb3q + .SafeQuery__root___RWb3q {
3
+ margin-top: 10px;
4
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Scroll",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/ScrollControls",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/SideOverlay",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/SimpleSlider",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Skeleton",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Spinner",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
package/Text/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Text",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/TextEmoji",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Tumbler",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@prom-ui/core",
3
3
  "author": "e.marchenko",
4
- "version": "0.0.22",
4
+ "version": "0.0.23",
5
5
  "description": "core ui blocks",
6
6
  "scripts": {
7
7
  "prebuild": "node ./preBuild.js",
@@ -20,6 +20,7 @@
20
20
  "directory": "dist"
21
21
  },
22
22
  "devDependencies": {
23
+ "@apollo/client": "^3.6.5",
23
24
  "@prom-ui/core": "file:../core/src",
24
25
  "@prom-ui/hooks": "file:../hooks/src",
25
26
  "@prom-ui/icons": "file:../icons/src"
@@ -27,6 +28,7 @@
27
28
  "dependencies": {
28
29
  "@evo/emoji": "^0.2.0",
29
30
  "@evo/emoji-text": "^0.1.1",
31
+ "@evo/errcatch": "^1.0.2",
30
32
  "@prom-ui/hooks": "^0.0.3",
31
33
  "@prom-ui/icons": "^0.0.5",
32
34
  "classnames": "^2.3.1",
@@ -51,9 +53,15 @@
51
53
  "ttag": "^1.7.24"
52
54
  },
53
55
  "peerDependencies": {
56
+ "@apollo/client": "*",
54
57
  "prop-types": "*",
55
58
  "react": "*",
56
59
  "react-dom": "*"
57
60
  },
58
- "gitHead": "9f1fe6e1762c7557b5dc3d1a43996e59eaa3adc3"
61
+ "peerDependenciesMeta": {
62
+ "@apollo/client": {
63
+ "optional": true
64
+ }
65
+ },
66
+ "gitHead": "0f474f29fb44db937145e449d9f75292721e938b"
59
67
  }
@@ -1,12 +0,0 @@
1
- import React from 'react';
2
- export declare type tPlacement = 'auto' | 'top' | 'right' | 'bottom' | 'left' | 'top-start' | 'right-start' | 'bottom-start' | 'left-start' | 'top-end' | 'right-end' | 'bottom-end' | 'left-end';
3
- export declare type tPopperProps = {
4
- hideArrow?: boolean;
5
- withPadding?: boolean;
6
- theme: 'white' | 'black';
7
- placement: tPlacement;
8
- children?: React.ReactNode;
9
- arrowProps?: any;
10
- tooltipProps?: any;
11
- };
12
- export declare const Popper: React.FC<tPopperProps>;
@@ -1,88 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var React = require('react');
6
- var PropTypes = require('prop-types');
7
-
8
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
9
-
10
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
11
- var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
12
-
13
- /******************************************************************************
14
- Copyright (c) Microsoft Corporation.
15
-
16
- Permission to use, copy, modify, and/or distribute this software for any
17
- purpose with or without fee is hereby granted.
18
-
19
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
20
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
21
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
22
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
23
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
24
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
25
- PERFORMANCE OF THIS SOFTWARE.
26
- ***************************************************************************** */
27
-
28
- var __assign = function() {
29
- __assign = Object.assign || function __assign(t) {
30
- for (var s, i = 1, n = arguments.length; i < n; i++) {
31
- s = arguments[i];
32
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
33
- }
34
- return t;
35
- };
36
- return __assign.apply(this, arguments);
37
- };
38
-
39
- var themeWhite = {"popper":"Tooltip-Popper__popper___QfuZ2","body":"Tooltip-Popper__body___ccixN","withPadding":"Tooltip-Popper__withPadding___NcotR Tooltip-Popper__body___ccixN","arrow":"Tooltip-Popper__arrow___EH4RM"};
40
-
41
- var themeBlack = {"popper":"Tooltip-Popper__popper___jz7P8","body":"Tooltip-Popper__body___ac26T","withPadding":"Tooltip-Popper__withPadding___mBCQj Tooltip-Popper__body___ac26T","arrow":"Tooltip-Popper__arrow___6fLZr"};
42
-
43
- var THEMES = {
44
- white: themeWhite,
45
- black: themeBlack
46
- };
47
-
48
- var getTheme = function (name) {
49
- if (THEMES.hasOwnProperty(name)) {
50
- return THEMES[name];
51
- }
52
-
53
- return THEMES.white;
54
- };
55
-
56
- var Popper = function (_a) {
57
- var tooltipProps = _a.tooltipProps,
58
- arrowProps = _a.arrowProps,
59
- children = _a.children,
60
- _b = _a.hideArrow,
61
- hideArrow = _b === void 0 ? false : _b,
62
- placement = _a.placement,
63
- theme = _a.theme,
64
- withPadding = _a.withPadding;
65
- var css = getTheme(theme);
66
- return React__default["default"].createElement("div", __assign({}, tooltipProps, {
67
- className: css.popper,
68
- "data-placement": placement
69
- }), !hideArrow && React__default["default"].createElement("div", __assign({}, arrowProps, {
70
- className: css.arrow
71
- })), React__default["default"].createElement("div", {
72
- className: withPadding ? css.withPadding : css.body
73
- }, children));
74
- }; // Popper.defaultProps = {
75
- // children: null,
76
- // hideArrow: false,
77
- // };
78
-
79
- Popper.propTypes = {
80
- // children: PropTypes.node,
81
- hideArrow: PropTypes__default["default"].bool // onShow: PropTypes.func,
82
- // theme: PropTypes.string.isRequired,
83
-
84
- };
85
-
86
- exports.Popper = Popper;
87
-
88
- require('./style.css');
@@ -1,9 +0,0 @@
1
- {
2
- "name": "@prom-ui/core/Tooltip/Popper",
3
- "version": "0.0.22",
4
- "main": "index.js",
5
- "types": "index.d.ts",
6
- "sideEffects": [
7
- "*.css"
8
- ]
9
- }