@prom-ui/core 0.0.24 → 0.0.32

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 (221) hide show
  1. package/Body/cjs/index.development.js +14 -0
  2. package/Body/cjs/index.production.js +1 -0
  3. package/Body/cjs/style.development.css +1 -0
  4. package/Body/cjs/style.production.css +1 -0
  5. package/Body/index.js +5 -12
  6. package/Body/package.json +1 -1
  7. package/Box/cjs/index.development.js +20 -0
  8. package/Box/cjs/index.production.js +1 -0
  9. package/Box/cjs/style.development.css +1 -0
  10. package/Box/cjs/style.production.css +1 -0
  11. package/Box/index.js +5 -18
  12. package/Box/package.json +1 -1
  13. package/Button/cjs/index.development.js +95 -0
  14. package/Button/cjs/index.production.js +1 -0
  15. package/Button/cjs/style.development.css +1 -0
  16. package/Button/cjs/style.production.css +1 -0
  17. package/Button/index.d.ts +5 -4
  18. package/Button/index.js +4 -81
  19. package/Button/package.json +1 -1
  20. package/ButtonPageUp/cjs/index.development.js +170 -0
  21. package/ButtonPageUp/cjs/index.production.js +1 -0
  22. package/ButtonPageUp/index.d.ts +12 -5
  23. package/ButtonPageUp/index.js +4 -169
  24. package/ButtonPageUp/package.json +1 -2
  25. package/Checkbox/cjs/index.development.js +111 -0
  26. package/Checkbox/cjs/index.production.js +1 -0
  27. package/Checkbox/cjs/style.development.css +1 -0
  28. package/Checkbox/cjs/style.production.css +1 -0
  29. package/Checkbox/index.d.ts +4 -4
  30. package/Checkbox/index.js +4 -96
  31. package/Checkbox/package.json +1 -1
  32. package/Flex/cjs/index.development.js +25 -0
  33. package/Flex/cjs/index.production.js +1 -0
  34. package/Flex/cjs/style.development.css +1 -0
  35. package/Flex/cjs/style.production.css +1 -0
  36. package/Flex/index.js +5 -23
  37. package/Flex/package.json +1 -1
  38. package/Grid/cjs/index.development.js +25 -0
  39. package/Grid/cjs/index.production.js +1 -0
  40. package/Grid/cjs/style.development.css +1 -0
  41. package/Grid/cjs/style.production.css +1 -0
  42. package/Grid/index.js +5 -23
  43. package/Grid/package.json +1 -1
  44. package/Icon/cjs/index.development.js +41 -0
  45. package/Icon/cjs/index.production.js +1 -0
  46. package/Icon/cjs/style.development.css +1 -0
  47. package/Icon/cjs/style.production.css +1 -0
  48. package/Icon/index.d.ts +7 -12
  49. package/Icon/index.js +4 -76
  50. package/Icon/package.json +1 -1
  51. package/Image/cjs/index.development.js +20 -0
  52. package/Image/cjs/index.production.js +1 -0
  53. package/Image/cjs/style.development.css +1 -0
  54. package/Image/cjs/style.production.css +1 -0
  55. package/Image/index.js +5 -18
  56. package/Image/package.json +1 -1
  57. package/ImageEmoji/cjs/index.development.js +90 -0
  58. package/ImageEmoji/cjs/index.production.js +1 -0
  59. package/ImageEmoji/index.d.ts +6 -4
  60. package/ImageEmoji/index.js +4 -86
  61. package/ImageEmoji/package.json +1 -1
  62. package/Input/cjs/index.development.js +39 -0
  63. package/Input/cjs/index.production.js +1 -0
  64. package/Input/cjs/style.development.css +1 -0
  65. package/Input/cjs/style.production.css +1 -0
  66. package/Input/index.d.ts +23 -23
  67. package/Input/index.js +4 -81
  68. package/Input/package.json +1 -1
  69. package/KeyPress/cjs/index.development.js +56 -0
  70. package/KeyPress/cjs/index.production.js +1 -0
  71. package/KeyPress/index.d.ts +8 -7
  72. package/KeyPress/index.js +5 -53
  73. package/KeyPress/package.json +2 -5
  74. package/Line/cjs/index.development.js +20 -0
  75. package/Line/cjs/index.production.js +1 -0
  76. package/Line/cjs/style.development.css +1 -0
  77. package/Line/cjs/style.production.css +1 -0
  78. package/Line/index.js +5 -18
  79. package/Line/package.json +1 -1
  80. package/Link/cjs/index.development.js +22 -0
  81. package/Link/cjs/index.production.js +1 -0
  82. package/Link/cjs/style.development.css +1 -0
  83. package/Link/cjs/style.production.css +1 -0
  84. package/Link/index.js +5 -20
  85. package/Link/package.json +1 -1
  86. package/List/cjs/index.development.js +25 -0
  87. package/List/cjs/index.production.js +1 -0
  88. package/List/cjs/style.development.css +1 -0
  89. package/List/cjs/style.production.css +1 -0
  90. package/List/index.js +5 -23
  91. package/List/package.json +1 -1
  92. package/Media/cjs/index.development.js +98 -0
  93. package/Media/cjs/index.production.js +1 -0
  94. package/Media/context.d.ts +2 -2
  95. package/Media/index.d.ts +9 -11
  96. package/Media/index.js +5 -73
  97. package/Media/package.json +1 -1
  98. package/Media/useMedia.d.ts +7 -0
  99. package/OutsideClick/cjs/index.development.js +84 -0
  100. package/OutsideClick/cjs/index.production.js +1 -0
  101. package/OutsideClick/index.d.ts +6 -3
  102. package/OutsideClick/index.js +4 -74
  103. package/OutsideClick/package.json +2 -5
  104. package/Picture/cjs/index.development.js +25 -0
  105. package/Picture/cjs/index.production.js +1 -0
  106. package/Picture/cjs/style.development.css +1 -0
  107. package/Picture/cjs/style.production.css +1 -0
  108. package/Picture/index.js +5 -23
  109. package/Picture/package.json +1 -1
  110. package/PortableOverlay/cjs/index.development.js +111 -0
  111. package/PortableOverlay/cjs/index.production.js +1 -0
  112. package/PortableOverlay/cjs/style.development.css +1 -0
  113. package/PortableOverlay/cjs/style.production.css +1 -0
  114. package/PortableOverlay/index.d.ts +6 -4
  115. package/PortableOverlay/index.js +5 -112
  116. package/PortableOverlay/package.json +1 -2
  117. package/Portal/cjs/index.development.js +57 -0
  118. package/Portal/cjs/index.production.js +1 -0
  119. package/Portal/index.d.ts +6 -4
  120. package/Portal/index.js +5 -52
  121. package/Portal/package.json +2 -5
  122. package/Rating/cjs/index.development.js +105 -0
  123. package/Rating/cjs/index.production.js +1 -0
  124. package/Rating/cjs/style.development.css +1 -0
  125. package/Rating/cjs/style.production.css +1 -0
  126. package/Rating/index.d.ts +6 -5
  127. package/Rating/index.js +4 -98
  128. package/Rating/package.json +1 -1
  129. package/SafeQuery/cjs/index.development.js +181 -0
  130. package/SafeQuery/cjs/index.production.js +1 -0
  131. package/SafeQuery/cjs/style.development.css +1 -0
  132. package/SafeQuery/cjs/style.production.css +1 -0
  133. package/SafeQuery/components/Error.d.ts +2 -2
  134. package/SafeQuery/index.d.ts +7 -4
  135. package/SafeQuery/index.js +4 -173
  136. package/SafeQuery/package.json +1 -1
  137. package/Scroll/cjs/index.development.js +40 -0
  138. package/Scroll/cjs/index.production.js +1 -0
  139. package/Scroll/cjs/style.development.css +1 -0
  140. package/Scroll/cjs/style.production.css +1 -0
  141. package/Scroll/index.d.ts +18 -16
  142. package/Scroll/index.js +4 -76
  143. package/Scroll/package.json +1 -1
  144. package/ScrollControls/cjs/index.development.js +243 -0
  145. package/ScrollControls/cjs/index.production.js +1 -0
  146. package/ScrollControls/cjs/style.development.css +1 -0
  147. package/ScrollControls/cjs/style.production.css +1 -0
  148. package/ScrollControls/index.d.ts +16 -6
  149. package/ScrollControls/index.js +4 -244
  150. package/ScrollControls/package.json +1 -2
  151. package/SideOverlay/cjs/index.development.js +210 -0
  152. package/SideOverlay/cjs/index.production.js +1 -0
  153. package/SideOverlay/cjs/style.development.css +1 -0
  154. package/SideOverlay/cjs/style.production.css +1 -0
  155. package/SideOverlay/index.d.ts +29 -14
  156. package/SideOverlay/index.js +4 -251
  157. package/SideOverlay/package.json +1 -1
  158. package/SimpleSlider/cjs/index.development.js +433 -0
  159. package/SimpleSlider/cjs/index.production.js +1 -0
  160. package/SimpleSlider/cjs/style.development.css +1 -0
  161. package/SimpleSlider/cjs/style.production.css +1 -0
  162. package/SimpleSlider/index.d.ts +17 -3
  163. package/SimpleSlider/index.js +4 -477
  164. package/SimpleSlider/package.json +1 -1
  165. package/Skeleton/cjs/index.development.js +103 -0
  166. package/Skeleton/cjs/index.production.js +1 -0
  167. package/Skeleton/cjs/style.development.css +1 -0
  168. package/Skeleton/cjs/style.production.css +1 -0
  169. package/Skeleton/index.d.ts +9 -5
  170. package/Skeleton/index.js +4 -110
  171. package/Skeleton/package.json +1 -1
  172. package/Spinner/cjs/index.development.js +85 -0
  173. package/Spinner/cjs/index.production.js +1 -0
  174. package/Spinner/cjs/style.development.css +1 -0
  175. package/Spinner/cjs/style.production.css +1 -0
  176. package/Spinner/index.d.ts +7 -6
  177. package/Spinner/index.js +5 -76
  178. package/Spinner/package.json +1 -1
  179. package/Text/cjs/index.development.js +20 -0
  180. package/Text/cjs/index.production.js +1 -0
  181. package/Text/cjs/style.development.css +1 -0
  182. package/Text/cjs/style.production.css +1 -0
  183. package/Text/index.js +5 -18
  184. package/Text/package.json +1 -1
  185. package/TextEmoji/cjs/index.development.js +94 -0
  186. package/TextEmoji/cjs/index.production.js +1 -0
  187. package/TextEmoji/index.d.ts +4 -4
  188. package/TextEmoji/index.js +4 -84
  189. package/TextEmoji/package.json +1 -1
  190. package/Tumbler/cjs/index.development.js +110 -0
  191. package/Tumbler/cjs/index.production.js +1 -0
  192. package/Tumbler/cjs/style.development.css +1 -0
  193. package/Tumbler/cjs/style.production.css +1 -0
  194. package/Tumbler/index.d.ts +4 -4
  195. package/Tumbler/index.js +4 -95
  196. package/Tumbler/package.json +1 -1
  197. package/package.json +7 -10
  198. package/Body/style.css +0 -741
  199. package/Box/style.css +0 -9676
  200. package/Button/style.css +0 -3393
  201. package/Checkbox/style.css +0 -133
  202. package/Flex/style.css +0 -786
  203. package/Grid/style.css +0 -7350
  204. package/Icon/style.css +0 -46
  205. package/Image/style.css +0 -664
  206. package/Input/style.css +0 -345
  207. package/Line/style.css +0 -138
  208. package/Link/style.css +0 -259
  209. package/List/style.css +0 -312
  210. package/Picture/style.css +0 -1426
  211. package/PortableOverlay/style.css +0 -44
  212. package/Rating/style.css +0 -26
  213. package/SafeQuery/style.css +0 -4
  214. package/Scroll/style.css +0 -169
  215. package/ScrollControls/style.css +0 -67
  216. package/SideOverlay/style.css +0 -208
  217. package/SimpleSlider/style.css +0 -134
  218. package/Skeleton/style.css +0 -145
  219. package/Spinner/style.css +0 -80
  220. package/Text/style.css +0 -840
  221. package/Tumbler/style.css +0 -118
@@ -0,0 +1,105 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var React = require('react');
6
+ var evokit = require('evokit');
7
+
8
+ function _interopNamespace(e) {
9
+ if (e && e.__esModule) return e;
10
+ var n = Object.create(null);
11
+ if (e) {
12
+ Object.keys(e).forEach(function (k) {
13
+ if (k !== 'default') {
14
+ var d = Object.getOwnPropertyDescriptor(e, k);
15
+ Object.defineProperty(n, k, d.get ? d : {
16
+ enumerable: true,
17
+ get: function () { return e[k]; }
18
+ });
19
+ }
20
+ });
21
+ }
22
+ n["default"] = e;
23
+ return Object.freeze(n);
24
+ }
25
+
26
+ var React__namespace = /*#__PURE__*/_interopNamespace(React);
27
+
28
+ /******************************************************************************
29
+ Copyright (c) Microsoft Corporation.
30
+
31
+ Permission to use, copy, modify, and/or distribute this software for any
32
+ purpose with or without fee is hereby granted.
33
+
34
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
35
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
36
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
37
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
38
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
39
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
40
+ PERFORMANCE OF THIS SOFTWARE.
41
+ ***************************************************************************** */
42
+
43
+ var __assign = function() {
44
+ __assign = Object.assign || function __assign(t) {
45
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
46
+ s = arguments[i];
47
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
48
+ }
49
+ return t;
50
+ };
51
+ return __assign.apply(this, arguments);
52
+ };
53
+
54
+ function __rest(s, e) {
55
+ var t = {};
56
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
57
+ t[p] = s[p];
58
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
59
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
60
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
61
+ t[p[i]] = s[p[i]];
62
+ }
63
+ return t;
64
+ }
65
+
66
+ var css = {"ek-rating":"Rating__ek-rating___fJb0G","ek-rating_size_small":"Rating__ek-rating_size_small___YZP0u","ek-rating_size_default":"Rating__ek-rating_size_default___X0xeh","ek-rating_size_big":"Rating__ek-rating_size_big___fQ-Lk"};
67
+
68
+ var RatingBlock = evokit.createBlock('svg', 'rating', ['size'], {
69
+ css: css
70
+ });
71
+ var Rating = React__namespace.forwardRef(function (_a, ref) {
72
+ var _b = _a.value,
73
+ value = _b === void 0 ? 0 : _b,
74
+ _c = _a.percent,
75
+ percent = _c === void 0 ? 0 : _c,
76
+ _d = _a.size,
77
+ size = _d === void 0 ? 'default' : _d,
78
+ props = __rest(_a, ["value", "percent", "size"]);
79
+
80
+ var gradientOffset = Math.round(percent > 0 ? percent : value / 5 * 100);
81
+ var gradientId = "pds-rating-gradient-".concat(gradientOffset);
82
+ return React__namespace.createElement(RatingBlock, __assign({}, props, {
83
+ ref: ref,
84
+ "rating-size": size,
85
+ viewBox: '0 0 120 24',
86
+ tabIndex: -1,
87
+ focusable: false
88
+ }), React__namespace.createElement("defs", null, React__namespace.createElement("linearGradient", {
89
+ id: gradientId
90
+ }, React__namespace.createElement("stop", {
91
+ offset: "".concat(gradientOffset, "%"),
92
+ stopColor: 'var(--violet-500)'
93
+ }), React__namespace.createElement("stop", {
94
+ offset: "".concat(gradientOffset, "%"),
95
+ stopColor: 'var(--black-400)'
96
+ }))), React__namespace.createElement("path", {
97
+ fill: "url(#".concat(gradientId, ")"),
98
+ d: 'M 17.138 22 C 16.863 22 16.588 21.931 16.335 21.792 L 12 19.405 L\n 7.665 21.792 C 7.102 22.1 6.428 22.063 5.902 21.692 C 5.359 21.308 5.09\n 20.658 5.199 19.994 L 6.037 14.877 L 2.4939999999999998 11.26 C 2.036\n 10.792 1.883 10.113 2.092 9.488 C 2.2960000000000003 8.878 2.8120000000000003\n 8.438 3.439 8.343 L 8.297 7.604 L 10.479 2.974 C 10.763 2.374 11.345 2 12 2 C\n 12.654 2 13.237 2.374 13.52 2.974 L 15.703 7.604 L 20.561 8.343 C 21.187 8.438\n 21.704 8.878 21.908 9.488 C 22.117 10.113 21.964 10.792 21.508 11.258 L 17.963\n 14.877 L 18.802 19.995 C 18.91 20.658 18.641 21.308 18.098 21.692 C 17.809 21.896\n 17.475 22 17.138 22 Z M 41.138 22 C 40.863 22 40.588 21.931 40.335 21.792 L 36\n 19.405 L 31.665 21.792 C 31.102 22.1 30.428 22.063 29.902 21.692 C 29.359 21.308\n 29.09 20.658 29.199 19.994 L 30.037 14.877 L 26.494 11.26 C 26.036 10.792 25.883\n 10.113 26.092 9.488 C 26.296 8.878 26.812 8.438 27.439 8.343 L 32.297 7.604 L\n 34.479 2.974 C 34.763 2.374 35.345 2 36 2 C 36.654 2 37.237 2.374 37.52 2.974 L\n 39.703 7.604 L 44.561 8.343 C 45.187 8.438 45.704 8.878 45.908 9.488 C 46.117\n 10.113 45.964 10.792 45.508 11.258 L 41.963 14.877 L 42.802 19.995 C 42.91\n 20.658 42.641 21.308 42.098 21.692 C 41.809 21.896 41.475 22 41.138 22 Z M 65.138\n 22 C 64.863 22 64.588 21.931 64.335 21.792 L 60 19.405 L 55.665 21.792 C 55.102\n 22.1 54.428 22.063 53.902 21.692 C 53.359 21.308 53.09 20.658 53.199 19.994 L\n 54.037 14.877 L 50.494 11.26 C 50.036 10.792 49.883 10.113 50.092 9.488 C\n 50.296 8.878 50.812 8.438 51.439 8.343 L 56.297 7.604 L 58.479 2.974 C 58.763\n 2.374 59.345 2 60 2 C 60.654 2 61.237 2.374 61.52 2.974 L 63.703 7.604 L 68.561\n 8.343 C 69.187 8.438 69.704 8.878 69.908 9.488 C 70.117 10.113 69.964 10.792\n 69.508 11.258 L 65.963 14.877 L 66.802 19.995 C 66.91 20.658 66.641 21.308 66.098\n 21.692 C 65.809 21.896 65.475 22 65.138 22 Z M 89.138 22 C 88.863 22 88.588 21.931\n 88.335 21.792 L 84 19.405 L 79.665 21.792 C 79.102 22.1 78.428 22.063 77.902 21.692\n C 77.359 21.308 77.09 20.658 77.199 19.994 L 78.037 14.877 L 74.494 11.26 C\n 74.036 10.792 73.883 10.113 74.092 9.488 C 74.296 8.878 74.812 8.438 75.439\n 8.343 L 80.297 7.604 L 82.479 2.974 C 82.763 2.374 83.345 2 84 2 C 84.654 2\n 85.237 2.374 85.52 2.974 L 87.703 7.604 L 92.561 8.343 C 93.187 8.438 93.704\n 8.878 93.908 9.488 C 94.117 10.113 93.964 10.792 93.508 11.258 L 89.963 14.877 L\n 90.802 19.995 C 90.91 20.658 90.641 21.308 90.098 21.692 C 89.809 21.896 89.475\n 22 89.138 22 Z M 113.138 22 C 112.863 22 112.588 21.931 112.335 21.792 L 108\n 19.405 L 103.665 21.792 C 103.102 22.1 102.428 22.063 101.902 21.692 C 101.359\n 21.308 101.09 20.658 101.199 19.994 L 102.037 14.877 L 98.494 11.26 C 98.036\n 10.792 97.883 10.113 98.092 9.488 C 98.296 8.878 98.812 8.438 99.439 8.343 L\n 104.297 7.604 L 106.479 2.974 C 106.763 2.374 107.345 2 108 2 C 108.654 2 109.237\n 2.374 109.52 2.974 L 111.703 7.604 L 116.561 8.343 C 117.187 8.438 117.704 8.878\n 117.908 9.488 C 118.117 10.113 117.964 10.792 117.508 11.258 L 113.963 14.877 L\n 114.802 19.995 C 114.91 20.658 114.641 21.308 114.098 21.692 C 113.809 21.896\n 113.475 22 113.138 22 Z'
99
+ }));
100
+ });
101
+ Rating.displayName = 'Rating';
102
+
103
+ exports.Rating = Rating;
104
+
105
+ require('./style.development.css');
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),n=require("evokit");function t(e){if(e&&e.__esModule)return e;var n=Object.create(null);return e&&Object.keys(e).forEach((function(t){if("default"!==t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}})),n.default=e,Object.freeze(n)}var r=t(e),a=function(){return a=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var a in n=arguments[t])Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a]);return e},a.apply(this,arguments)};var o=n.createBlock("svg","rating",["size"],{css:{"ek-rating":"fJb0G","ek-rating_size_small":"YZP0u","ek-rating_size_default":"X0xeh","ek-rating_size_big":"fQ-Lk"}}),C=r.forwardRef((function(e,n){var t=e.value,C=void 0===t?0:t,i=e.percent,c=void 0===i?0:i,L=e.size,l=void 0===L?"default":L,s=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)n.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(t[r[a]]=e[r[a]])}return t}(e,["value","percent","size"]),f=Math.round(c>0?c:C/5*100),u="pds-rating-gradient-".concat(f);return r.createElement(o,a({},s,{ref:n,"rating-size":l,viewBox:"0 0 120 24",tabIndex:-1,focusable:!1}),r.createElement("defs",null,r.createElement("linearGradient",{id:u},r.createElement("stop",{offset:"".concat(f,"%"),stopColor:"var(--violet-500)"}),r.createElement("stop",{offset:"".concat(f,"%"),stopColor:"var(--black-400)"}))),r.createElement("path",{fill:"url(#".concat(u,")"),d:"M 17.138 22 C 16.863 22 16.588 21.931 16.335 21.792 L 12 19.405 L\n 7.665 21.792 C 7.102 22.1 6.428 22.063 5.902 21.692 C 5.359 21.308 5.09\n 20.658 5.199 19.994 L 6.037 14.877 L 2.4939999999999998 11.26 C 2.036\n 10.792 1.883 10.113 2.092 9.488 C 2.2960000000000003 8.878 2.8120000000000003\n 8.438 3.439 8.343 L 8.297 7.604 L 10.479 2.974 C 10.763 2.374 11.345 2 12 2 C\n 12.654 2 13.237 2.374 13.52 2.974 L 15.703 7.604 L 20.561 8.343 C 21.187 8.438\n 21.704 8.878 21.908 9.488 C 22.117 10.113 21.964 10.792 21.508 11.258 L 17.963\n 14.877 L 18.802 19.995 C 18.91 20.658 18.641 21.308 18.098 21.692 C 17.809 21.896\n 17.475 22 17.138 22 Z M 41.138 22 C 40.863 22 40.588 21.931 40.335 21.792 L 36\n 19.405 L 31.665 21.792 C 31.102 22.1 30.428 22.063 29.902 21.692 C 29.359 21.308\n 29.09 20.658 29.199 19.994 L 30.037 14.877 L 26.494 11.26 C 26.036 10.792 25.883\n 10.113 26.092 9.488 C 26.296 8.878 26.812 8.438 27.439 8.343 L 32.297 7.604 L\n 34.479 2.974 C 34.763 2.374 35.345 2 36 2 C 36.654 2 37.237 2.374 37.52 2.974 L\n 39.703 7.604 L 44.561 8.343 C 45.187 8.438 45.704 8.878 45.908 9.488 C 46.117\n 10.113 45.964 10.792 45.508 11.258 L 41.963 14.877 L 42.802 19.995 C 42.91\n 20.658 42.641 21.308 42.098 21.692 C 41.809 21.896 41.475 22 41.138 22 Z M 65.138\n 22 C 64.863 22 64.588 21.931 64.335 21.792 L 60 19.405 L 55.665 21.792 C 55.102\n 22.1 54.428 22.063 53.902 21.692 C 53.359 21.308 53.09 20.658 53.199 19.994 L\n 54.037 14.877 L 50.494 11.26 C 50.036 10.792 49.883 10.113 50.092 9.488 C\n 50.296 8.878 50.812 8.438 51.439 8.343 L 56.297 7.604 L 58.479 2.974 C 58.763\n 2.374 59.345 2 60 2 C 60.654 2 61.237 2.374 61.52 2.974 L 63.703 7.604 L 68.561\n 8.343 C 69.187 8.438 69.704 8.878 69.908 9.488 C 70.117 10.113 69.964 10.792\n 69.508 11.258 L 65.963 14.877 L 66.802 19.995 C 66.91 20.658 66.641 21.308 66.098\n 21.692 C 65.809 21.896 65.475 22 65.138 22 Z M 89.138 22 C 88.863 22 88.588 21.931\n 88.335 21.792 L 84 19.405 L 79.665 21.792 C 79.102 22.1 78.428 22.063 77.902 21.692\n C 77.359 21.308 77.09 20.658 77.199 19.994 L 78.037 14.877 L 74.494 11.26 C\n 74.036 10.792 73.883 10.113 74.092 9.488 C 74.296 8.878 74.812 8.438 75.439\n 8.343 L 80.297 7.604 L 82.479 2.974 C 82.763 2.374 83.345 2 84 2 C 84.654 2\n 85.237 2.374 85.52 2.974 L 87.703 7.604 L 92.561 8.343 C 93.187 8.438 93.704\n 8.878 93.908 9.488 C 94.117 10.113 93.964 10.792 93.508 11.258 L 89.963 14.877 L\n 90.802 19.995 C 90.91 20.658 90.641 21.308 90.098 21.692 C 89.809 21.896 89.475\n 22 89.138 22 Z M 113.138 22 C 112.863 22 112.588 21.931 112.335 21.792 L 108\n 19.405 L 103.665 21.792 C 103.102 22.1 102.428 22.063 101.902 21.692 C 101.359\n 21.308 101.09 20.658 101.199 19.994 L 102.037 14.877 L 98.494 11.26 C 98.036\n 10.792 97.883 10.113 98.092 9.488 C 98.296 8.878 98.812 8.438 99.439 8.343 L\n 104.297 7.604 L 106.479 2.974 C 106.763 2.374 107.345 2 108 2 C 108.654 2 109.237\n 2.374 109.52 2.974 L 111.703 7.604 L 116.561 8.343 C 117.187 8.438 117.704 8.878\n 117.908 9.488 C 118.117 10.113 117.964 10.792 117.508 11.258 L 113.963 14.877 L\n 114.802 19.995 C 114.91 20.658 114.641 21.308 114.098 21.692 C 113.809 21.896\n 113.475 22 113.138 22 Z"}))}));C.displayName="Rating",exports.Rating=C,require("./style.production.css");
@@ -0,0 +1 @@
1
+ .Rating__ek-rating___fJb0G{display:block;-webkit-tap-highlight-color:transparent;box-sizing:border-box;height:1em;width:calc(1em*5)}.Rating__ek-rating___fJb0G:focus{outline:0}.Rating__ek-rating_size_small___YZP0u{height:14px;width:calc(14px*5)}.Rating__ek-rating_size_default___X0xeh{height:18px;width:calc(18px*5)}.Rating__ek-rating_size_big___fQ-Lk{height:22px;width:calc(22px*5)}
@@ -0,0 +1 @@
1
+ .fJb0G{display:block;-webkit-tap-highlight-color:transparent;box-sizing:border-box;height:1em;width:calc(1em*5)}.fJb0G:focus{outline:0}.YZP0u{height:14px;width:calc(14px*5)}.X0xeh{height:18px;width:calc(18px*5)}.fQ-Lk{height:22px;width:calc(22px*5)}
package/Rating/index.d.ts CHANGED
@@ -1,9 +1,10 @@
1
- import React from 'react';
2
- declare type Props = {
1
+ import * as React from 'react';
2
+ export declare type RatingProps = React.ComponentPropsWithRef<"svg"> & {
3
+ /** Значение рейтинга, от 0 до 5 */
3
4
  value?: 0 | 1 | 2 | 3 | 4 | 5;
5
+ /** Значение рейтинга в процентах от `0` до `100` */
4
6
  percent?: number;
7
+ /** Размер */
5
8
  size?: 'small' | 'default' | 'big';
6
9
  };
7
- declare type RatingProps = React.HTMLAttributes<HTMLElement & SVGElement> & Props;
8
- export declare const Rating: React.FC<RatingProps>;
9
- export {};
10
+ export declare const Rating: React.ForwardRefExoticComponent<Pick<RatingProps, "string" | "size" | "style" | "clipPath" | "filter" | "mask" | "path" | "className" | "color" | "height" | "id" | "lang" | "max" | "media" | "method" | "min" | "name" | "target" | "type" | "width" | "role" | "tabIndex" | "crossOrigin" | "accentHeight" | "accumulate" | "additive" | "alignmentBaseline" | "allowReorder" | "alphabetic" | "amplitude" | "arabicForm" | "ascent" | "attributeName" | "attributeType" | "autoReverse" | "azimuth" | "baseFrequency" | "baselineShift" | "baseProfile" | "bbox" | "begin" | "bias" | "by" | "calcMode" | "capHeight" | "clip" | "clipPathUnits" | "clipRule" | "colorInterpolation" | "colorInterpolationFilters" | "colorProfile" | "colorRendering" | "contentScriptType" | "contentStyleType" | "cursor" | "cx" | "cy" | "d" | "decelerate" | "descent" | "diffuseConstant" | "direction" | "display" | "divisor" | "dominantBaseline" | "dur" | "dx" | "dy" | "edgeMode" | "elevation" | "enableBackground" | "end" | "exponent" | "externalResourcesRequired" | "fill" | "fillOpacity" | "fillRule" | "filterRes" | "filterUnits" | "floodColor" | "floodOpacity" | "focusable" | "fontFamily" | "fontSize" | "fontSizeAdjust" | "fontStretch" | "fontStyle" | "fontVariant" | "fontWeight" | "format" | "fr" | "from" | "fx" | "fy" | "g1" | "g2" | "glyphName" | "glyphOrientationHorizontal" | "glyphOrientationVertical" | "glyphRef" | "gradientTransform" | "gradientUnits" | "hanging" | "horizAdvX" | "horizOriginX" | "href" | "ideographic" | "imageRendering" | "in2" | "in" | "intercept" | "k1" | "k2" | "k3" | "k4" | "k" | "kernelMatrix" | "kernelUnitLength" | "kerning" | "keyPoints" | "keySplines" | "keyTimes" | "lengthAdjust" | "letterSpacing" | "lightingColor" | "limitingConeAngle" | "local" | "markerEnd" | "markerHeight" | "markerMid" | "markerStart" | "markerUnits" | "markerWidth" | "maskContentUnits" | "maskUnits" | "mathematical" | "mode" | "numOctaves" | "offset" | "opacity" | "operator" | "order" | "orient" | "orientation" | "origin" | "overflow" | "overlinePosition" | "overlineThickness" | "paintOrder" | "panose1" | "pathLength" | "patternContentUnits" | "patternTransform" | "patternUnits" | "pointerEvents" | "points" | "pointsAtX" | "pointsAtY" | "pointsAtZ" | "preserveAlpha" | "preserveAspectRatio" | "primitiveUnits" | "r" | "radius" | "refX" | "refY" | "renderingIntent" | "repeatCount" | "repeatDur" | "requiredExtensions" | "requiredFeatures" | "restart" | "result" | "rotate" | "rx" | "ry" | "scale" | "seed" | "shapeRendering" | "slope" | "spacing" | "specularConstant" | "specularExponent" | "speed" | "spreadMethod" | "startOffset" | "stdDeviation" | "stemh" | "stemv" | "stitchTiles" | "stopColor" | "stopOpacity" | "strikethroughPosition" | "strikethroughThickness" | "stroke" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "surfaceScale" | "systemLanguage" | "tableValues" | "targetX" | "targetY" | "textAnchor" | "textDecoration" | "textLength" | "textRendering" | "to" | "transform" | "u1" | "u2" | "underlinePosition" | "underlineThickness" | "unicode" | "unicodeBidi" | "unicodeRange" | "unitsPerEm" | "vAlphabetic" | "values" | "vectorEffect" | "version" | "vertAdvY" | "vertOriginX" | "vertOriginY" | "vHanging" | "vIdeographic" | "viewBox" | "viewTarget" | "visibility" | "vMathematical" | "widths" | "wordSpacing" | "writingMode" | "x1" | "x2" | "x" | "xChannelSelector" | "xHeight" | "xlinkActuate" | "xlinkArcrole" | "xlinkHref" | "xlinkRole" | "xlinkShow" | "xlinkTitle" | "xlinkType" | "xmlBase" | "xmlLang" | "xmlns" | "xmlnsXlink" | "xmlSpace" | "y1" | "y2" | "y" | "yChannelSelector" | "z" | "zoomAndPan" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "value" | "percent"> & React.RefAttributes<HTMLOrSVGElement>>;
package/Rating/index.js CHANGED
@@ -1,101 +1,7 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var React = require('react');
6
- var PropTypes = require('prop-types');
7
- var evokit = require('evokit');
8
-
9
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
10
-
11
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
12
- var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
13
-
14
- /******************************************************************************
15
- Copyright (c) Microsoft Corporation.
16
-
17
- Permission to use, copy, modify, and/or distribute this software for any
18
- purpose with or without fee is hereby granted.
19
-
20
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
21
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
22
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
23
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
24
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
25
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
26
- PERFORMANCE OF THIS SOFTWARE.
27
- ***************************************************************************** */
28
-
29
- var __assign = function() {
30
- __assign = Object.assign || function __assign(t) {
31
- for (var s, i = 1, n = arguments.length; i < n; i++) {
32
- s = arguments[i];
33
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
34
- }
35
- return t;
36
- };
37
- return __assign.apply(this, arguments);
38
- };
39
-
40
- function __rest(s, e) {
41
- var t = {};
42
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
43
- t[p] = s[p];
44
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
45
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
46
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
47
- t[p[i]] = s[p[i]];
48
- }
49
- return t;
3
+ if (process.env.NODE_ENV === 'production') {
4
+ module.exports = require('./cjs/index.production.js');
5
+ } else {
6
+ module.exports = require('./cjs/index.development.js');
50
7
  }
51
-
52
- var css = {"ek-rating":"Rating__ek-rating___fJb0G","ek-rating_size_small":"Rating__ek-rating_size_small___YZP0u","ek-rating_size_default":"Rating__ek-rating_size_default___X0xeh","ek-rating_size_big":"Rating__ek-rating_size_big___fQ-Lk"};
53
-
54
- var RatingBlock = evokit.createBlock('svg', 'rating', ['size'], {
55
- css: css
56
- });
57
- var Rating = React.memo(React.forwardRef(function (_a, ref) {
58
- var _b = _a.value,
59
- value = _b === void 0 ? 0 : _b,
60
- _c = _a.percent,
61
- percent = _c === void 0 ? 0 : _c,
62
- _d = _a.size,
63
- size = _d === void 0 ? 'default' : _d,
64
- props = __rest(_a, ["value", "percent", "size"]);
65
-
66
- var gradientOffset = Math.round(percent > 0 ? percent : value / 5 * 100);
67
- var gradientId = "pds-rating-gradient-".concat(gradientOffset);
68
- return React__default["default"].createElement(RatingBlock, __assign({}, props, {
69
- ref: ref,
70
- "rating-size": size,
71
- viewBox: '0 0 100 20',
72
- tabIndex: -1,
73
- focusable: false
74
- }), React__default["default"].createElement("defs", null, React__default["default"].createElement("linearGradient", {
75
- id: gradientId
76
- }, React__default["default"].createElement("stop", {
77
- offset: "".concat(gradientOffset, "%"),
78
- stopColor: 'var(--violet-500)'
79
- }), React__default["default"].createElement("stop", {
80
- offset: "".concat(gradientOffset, "%"),
81
- stopColor: 'var(--black-400)'
82
- }))), React__default["default"].createElement("path", {
83
- fill: "url(#".concat(gradientId, ")"),
84
- d: 'M10 1.5l2.781 5.595L19 7.998l-4.5 4.353 1.062 6.149L10\n 15.595 4.438 18.5 5.5 12.35 1 7.999l6.219-.903L10\n 1.5zM30.067 1.5l2.781 5.595 6.22.903-4.5 4.353 1.061\n 6.149-5.562-2.905-5.562 2.905 1.062-6.15-4.5-4.352\n 6.22-.903 2.78-5.595zM50.125 1.5l2.781 5.595\n 6.219.903-4.5 4.353 1.062 6.149-5.562-2.905-5.562\n 2.905 1.062-6.15-4.5-4.352 6.219-.903L50.125 1.5zM70.047\n 1.5l2.781 5.595 6.22.903-4.5 4.353 1.061 6.149-5.562-2.905-5.562\n 2.905 1.062-6.15-4.5-4.352 6.22-.903 2.78-5.595zM89.861\n 1.5l2.781 5.595 6.22.903-4.5 4.353 1.061 6.149-5.562-2.905L84.3\n 18.5l1.062-6.15-4.5-4.352 6.22-.903L89.86 1.5z'
85
- }));
86
- }));
87
- Rating.displayName = 'Rating';
88
- Rating.propTypes = {
89
- /** Значение рейтинга, от 0 до 5 */
90
- value: PropTypes__default["default"].oneOf([0, 1, 2, 3, 4, 5]),
91
-
92
- /** Значение рейтинга в процентах от `0` до `100` */
93
- // percent: PropTypes.number,
94
-
95
- /** Размер */
96
- size: PropTypes__default["default"].oneOf(['small', 'default', 'big'])
97
- };
98
-
99
- exports.Rating = Rating;
100
-
101
- require('./style.css');
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Rating",
3
- "version": "0.0.24",
3
+ "version": "0.0.32",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -0,0 +1,181 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var React = require('react');
6
+ var components = require('@apollo/client/react/components');
7
+ var errcatch = require('@evo/errcatch');
8
+ var Box = require('@prom-ui/core/Box');
9
+ var Button = require('@prom-ui/core/Button');
10
+ var Text = require('@prom-ui/core/Text');
11
+
12
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13
+
14
+ function _interopNamespace(e) {
15
+ if (e && e.__esModule) return e;
16
+ var n = Object.create(null);
17
+ if (e) {
18
+ Object.keys(e).forEach(function (k) {
19
+ if (k !== 'default') {
20
+ var d = Object.getOwnPropertyDescriptor(e, k);
21
+ Object.defineProperty(n, k, d.get ? d : {
22
+ enumerable: true,
23
+ get: function () { return e[k]; }
24
+ });
25
+ }
26
+ });
27
+ }
28
+ n["default"] = e;
29
+ return Object.freeze(n);
30
+ }
31
+
32
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
33
+ var React__namespace = /*#__PURE__*/_interopNamespace(React);
34
+
35
+ /******************************************************************************
36
+ Copyright (c) Microsoft Corporation.
37
+
38
+ Permission to use, copy, modify, and/or distribute this software for any
39
+ purpose with or without fee is hereby granted.
40
+
41
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
42
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
43
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
44
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
45
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
46
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
47
+ PERFORMANCE OF THIS SOFTWARE.
48
+ ***************************************************************************** */
49
+
50
+ var __assign = function() {
51
+ __assign = Object.assign || function __assign(t) {
52
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
53
+ s = arguments[i];
54
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
55
+ }
56
+ return t;
57
+ };
58
+ return __assign.apply(this, arguments);
59
+ };
60
+
61
+ function __rest(s, e) {
62
+ var t = {};
63
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
64
+ t[p] = s[p];
65
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
66
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
67
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
68
+ t[p[i]] = s[p[i]];
69
+ }
70
+ return t;
71
+ }
72
+
73
+ var css = {"root":"SafeQuery__root___RWb3q"};
74
+
75
+ var SafeQueryError = function (_a) {
76
+ var componentErrorName = _a.componentErrorName,
77
+ onReload = _a.onReload;
78
+
79
+ var _b = React.useState(false),
80
+ isHidden = _b[0],
81
+ setHidden = _b[1];
82
+
83
+ if (isHidden) {
84
+ return null;
85
+ }
86
+
87
+ if (process.env.NODE_ENV !== 'production') {
88
+ if (typeof window === 'undefined') return null;
89
+ return React__default["default"].createElement(Box.Box, {
90
+ className: css.root,
91
+ "box-background": 'red-500',
92
+ "box-padding": ['s m', 'm@large l@large'],
93
+ "box-position": 'relative',
94
+ "box-round": 'm',
95
+ "data-qaid": 'err_catch_trace'
96
+ }, React__default["default"].createElement(Box.Box, {
97
+ "box-margin-right": '5xl'
98
+ }, React__default["default"].createElement(Text.Text, {
99
+ "text-color": 'white'
100
+ }, "\u0412\u043E\u0437\u043D\u0438\u043A\u043B\u0430 \u043E\u0448\u0438\u0431\u043A\u0430:", ' ', React__default["default"].createElement(Text.Text, {
101
+ "text-weight": 'bold',
102
+ style: {
103
+ fontFamily: 'Consolas, "Liberation Mono", Menlo, monospace',
104
+ userSelect: 'all'
105
+ }
106
+ }, componentErrorName))), React__default["default"].createElement(Box.Box, {
107
+ "box-position": 'absolute center-right',
108
+ "box-margin-right": 's'
109
+ }, React__default["default"].createElement(Button.Button, {
110
+ "button-padding": 'xxs',
111
+ "button-theme": 'white-inherit',
112
+ onClick: onReload,
113
+ title: '\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C'
114
+ }, React__default["default"].createElement("svg", {
115
+ xmlns: 'http://www.w3.org/2000/svg',
116
+ viewBox: '0 0 18 18',
117
+ width: 18,
118
+ height: 18
119
+ }, React__default["default"].createElement("path", {
120
+ fill: '#fff',
121
+ 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'
122
+ }))), React__default["default"].createElement(Button.Button, {
123
+ "button-padding": 'xxs',
124
+ "button-theme": 'white-inherit',
125
+ onClick: function () {
126
+ return setHidden(true);
127
+ },
128
+ title: '\u0421\u043A\u0440\u044B\u0442\u044C'
129
+ }, React__default["default"].createElement("svg", {
130
+ xmlns: 'http://www.w3.org/2000/svg',
131
+ viewBox: '0 0 24 24',
132
+ width: 18,
133
+ height: 18
134
+ }, React__default["default"].createElement("path", {
135
+ fill: '#fff',
136
+ 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'
137
+ })))));
138
+ }
139
+
140
+ return null;
141
+ };
142
+
143
+ var SafeQuery = function (_a) {
144
+ var _b = _a.componentErrorName,
145
+ componentErrorName = _b === void 0 ? 'SafeQuery' : _b,
146
+ children = _a.children,
147
+ props = __rest(_a, ["componentErrorName", "children"]);
148
+
149
+ var _c = React__namespace.useState(false),
150
+ isReload = _c[0],
151
+ setReload = _c[1];
152
+
153
+ React__namespace.useEffect(function () {
154
+ if (isReload) {
155
+ setReload(false);
156
+ }
157
+ }, [isReload]);
158
+
159
+ if (isReload) {
160
+ return null;
161
+ }
162
+
163
+ var errorComponent = React__namespace.createElement(SafeQueryError, {
164
+ componentErrorName: componentErrorName,
165
+ onReload: function () {
166
+ return setReload(true);
167
+ }
168
+ });
169
+ return React__namespace.createElement(errcatch.ErrCatch, {
170
+ name: componentErrorName,
171
+ errorComponent: errorComponent
172
+ }, React__namespace.createElement(components.Query, __assign({}, props), function (queryResult) {
173
+ var error = queryResult.error;
174
+ if (error) throw error;
175
+ return children(queryResult);
176
+ }));
177
+ };
178
+
179
+ exports.SafeQuery = SafeQuery;
180
+
181
+ require('./style.development.css');
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("@apollo/client/react/components"),r=require("@evo/errcatch"),n=require("@prom-ui/core/Box"),o=require("@prom-ui/core/Button"),a=require("@prom-ui/core/Text");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function i(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var c=l(e),u=i(e),f=function(){return f=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},f.apply(this,arguments)};var d="RWb3q",p=function(t){var r=t.componentErrorName,l=t.onReload,i=e.useState(!1),u=i[0],f=i[1];return u?null:"production"!==process.env.NODE_ENV?"undefined"==typeof window?null:c.default.createElement(n.Box,{className:d,"box-background":"red-500","box-padding":["s m","m@large l@large"],"box-position":"relative","box-round":"m","data-qaid":"err_catch_trace"},c.default.createElement(n.Box,{"box-margin-right":"5xl"},c.default.createElement(a.Text,{"text-color":"white"},"Возникла ошибка:"," ",c.default.createElement(a.Text,{"text-weight":"bold",style:{fontFamily:'Consolas, "Liberation Mono", Menlo, monospace',userSelect:"all"}},r))),c.default.createElement(n.Box,{"box-position":"absolute center-right","box-margin-right":"s"},c.default.createElement(o.Button,{"button-padding":"xxs","button-theme":"white-inherit",onClick:l,title:"Обновить"},c.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 18 18",width:18,height:18},c.default.createElement("path",{fill:"#fff",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"}))),c.default.createElement(o.Button,{"button-padding":"xxs","button-theme":"white-inherit",onClick:function(){return f(!0)},title:"Скрыть"},c.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:18,height:18},c.default.createElement("path",{fill:"#fff",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"}))))):null};exports.SafeQuery=function(e){var n=e.componentErrorName,o=void 0===n?"SafeQuery":n,a=e.children,l=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(e,["componentErrorName","children"]),i=u.useState(!1),c=i[0],d=i[1];if(u.useEffect((function(){c&&d(!1)}),[c]),c)return null;var s=u.createElement(p,{componentErrorName:o,onReload:function(){return d(!0)}});return u.createElement(r.ErrCatch,{name:o,errorComponent:s},u.createElement(t.Query,f({},l),(function(e){var t=e.error;if(t)throw t;return a(e)})))},require("./style.production.css");
@@ -0,0 +1 @@
1
+ .SafeQuery__root___RWb3q+.SafeQuery__root___RWb3q{margin-top:10px}
@@ -0,0 +1 @@
1
+ .RWb3q+.RWb3q{margin-top:10px}
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
- declare type tSafeQueryErrorProps = {
2
+ declare type SafeQueryErrorProps = {
3
3
  componentErrorName: string;
4
4
  onReload: () => void;
5
5
  };
6
- export declare const SafeQueryError: React.FC<tSafeQueryErrorProps>;
6
+ export declare const SafeQueryError: React.FC<SafeQueryErrorProps>;
7
7
  export {};
@@ -1,7 +1,10 @@
1
- import React from 'react';
2
- export declare type tSafeQueryProps = {
1
+ import * as React from 'react';
2
+ export declare type SafeQueryProps = {
3
+ /** Название компонента в тексте с ошибкой */
3
4
  componentErrorName?: string;
4
- onReload?: () => void;
5
+ /** React children */
5
6
  children: (arg: any) => JSX.Element;
7
+ query: any;
8
+ variables?: any;
6
9
  };
7
- export declare const SafeQuery: React.FC<tSafeQueryProps>;
10
+ export declare const SafeQuery: React.FC<SafeQueryProps>;