@prom-ui/core 1.3.1 → 1.4.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 (233) hide show
  1. package/Avatar/cjs/index.development.js +99 -67
  2. package/Avatar/cjs/index.development.v2.js +99 -67
  3. package/Avatar/cjs/index.production.js +1 -1
  4. package/Avatar/cjs/index.production.v2.js +1 -1
  5. package/Avatar/index.d.ts +14 -14
  6. package/Avatar/package.json +1 -1
  7. package/Avatar/utils.d.ts +2 -2
  8. package/Backdrop/cjs/index.development.js +131 -77
  9. package/Backdrop/cjs/index.development.v2.js +131 -77
  10. package/Backdrop/cjs/index.production.js +1 -1
  11. package/Backdrop/cjs/index.production.v2.js +1 -1
  12. package/Backdrop/index.d.ts +25 -25
  13. package/Backdrop/package.json +1 -1
  14. package/Body/cjs/index.development.js +2 -0
  15. package/Body/cjs/index.development.v2.js +2 -0
  16. package/Body/index.d.ts +36 -36
  17. package/Body/package.json +1 -1
  18. package/BodyContext/cjs/index.development.js +6 -7
  19. package/BodyContext/cjs/index.development.v2.js +6 -7
  20. package/BodyContext/cjs/index.production.js +1 -1
  21. package/BodyContext/cjs/index.production.v2.js +1 -1
  22. package/BodyContext/index.d.ts +12 -12
  23. package/BodyContext/package.json +1 -1
  24. package/BodyProvider/cjs/index.development.js +7 -6
  25. package/BodyProvider/cjs/index.development.v2.js +7 -6
  26. package/BodyProvider/index.d.ts +10 -10
  27. package/BodyProvider/package.json +1 -1
  28. package/Box/cjs/index.development.js +4 -4
  29. package/Box/cjs/index.development.v2.js +4 -4
  30. package/Box/index.d.ts +106 -106
  31. package/Box/package.json +1 -1
  32. package/Button/cjs/index.development.js +67 -62
  33. package/Button/cjs/index.development.v2.js +67 -62
  34. package/Button/cjs/index.production.js +1 -1
  35. package/Button/cjs/index.production.v2.js +1 -1
  36. package/Button/index.d.ts +45 -45
  37. package/Button/package.json +1 -1
  38. package/ButtonPageUp/cjs/index.development.js +195 -85
  39. package/ButtonPageUp/cjs/index.development.v2.js +195 -85
  40. package/ButtonPageUp/cjs/index.production.js +1 -1
  41. package/ButtonPageUp/cjs/index.production.v2.js +1 -1
  42. package/ButtonPageUp/index.d.ts +18 -18
  43. package/ButtonPageUp/package.json +1 -1
  44. package/Checkbox/cjs/index.development.js +99 -67
  45. package/Checkbox/cjs/index.development.v2.js +99 -67
  46. package/Checkbox/cjs/index.production.js +1 -1
  47. package/Checkbox/cjs/index.production.v2.js +1 -1
  48. package/Checkbox/index.d.ts +8 -8
  49. package/Checkbox/package.json +1 -1
  50. package/Flex/index.d.ts +34 -34
  51. package/Flex/package.json +1 -1
  52. package/Grid/index.d.ts +46 -46
  53. package/Grid/package.json +1 -1
  54. package/Icon/index.d.ts +9 -9
  55. package/Icon/package.json +1 -1
  56. package/Image/index.d.ts +42 -42
  57. package/Image/package.json +1 -1
  58. package/ImageEmoji/cjs/index.development.js +70 -63
  59. package/ImageEmoji/cjs/index.development.v2.js +70 -63
  60. package/ImageEmoji/cjs/index.production.js +1 -1
  61. package/ImageEmoji/cjs/index.production.v2.js +1 -1
  62. package/ImageEmoji/index.d.ts +9 -9
  63. package/ImageEmoji/package.json +1 -1
  64. package/Input/index.d.ts +18 -18
  65. package/Input/package.json +1 -1
  66. package/InputField/addons/AfterClearValue.d.ts +3 -3
  67. package/InputField/addons/AfterCorrectValue.d.ts +2 -2
  68. package/InputField/addons/AfterLoading.d.ts +2 -2
  69. package/InputField/addons/AfterTogglePassword.d.ts +6 -6
  70. package/InputField/addons/ErrorText.d.ts +6 -6
  71. package/InputField/cjs/index.development.js +237 -173
  72. package/InputField/cjs/index.development.v2.js +237 -173
  73. package/InputField/cjs/index.production.js +1 -1
  74. package/InputField/cjs/index.production.v2.js +1 -1
  75. package/InputField/index.d.ts +18 -18
  76. package/InputField/package.json +1 -1
  77. package/InputField/utils.d.ts +10 -10
  78. package/KeyPress/cjs/index.development.js +13 -13
  79. package/KeyPress/cjs/index.development.v2.js +13 -13
  80. package/KeyPress/index.d.ts +14 -14
  81. package/KeyPress/package.json +1 -1
  82. package/Line/index.d.ts +13 -13
  83. package/Line/package.json +1 -1
  84. package/Link/cjs/index.development.js +5 -5
  85. package/Link/cjs/index.development.v2.js +5 -5
  86. package/Link/index.d.ts +28 -28
  87. package/Link/package.json +1 -1
  88. package/List/index.d.ts +23 -23
  89. package/List/package.json +1 -1
  90. package/Media/MediaProvider.d.ts +8 -8
  91. package/Media/cjs/index.development.js +70 -19
  92. package/Media/cjs/index.development.v2.js +70 -19
  93. package/Media/cjs/index.production.js +1 -1
  94. package/Media/cjs/index.production.v2.js +1 -1
  95. package/Media/index.d.ts +20 -20
  96. package/Media/package.json +1 -1
  97. package/OutsideClick/cjs/index.development.js +117 -61
  98. package/OutsideClick/cjs/index.development.v2.js +117 -61
  99. package/OutsideClick/cjs/index.production.js +1 -1
  100. package/OutsideClick/cjs/index.production.v2.js +1 -1
  101. package/OutsideClick/index.d.ts +12 -12
  102. package/OutsideClick/package.json +1 -1
  103. package/Overlay/cjs/index.development.js +197 -183
  104. package/Overlay/cjs/index.development.v2.js +197 -183
  105. package/Overlay/cjs/index.production.js +1 -1
  106. package/Overlay/cjs/index.production.v2.js +1 -1
  107. package/Overlay/components/OverlayHeader.d.ts +11 -11
  108. package/Overlay/components/SwipeClose.d.ts +11 -11
  109. package/Overlay/components/TouchScrollable.d.ts +8 -8
  110. package/Overlay/index.d.ts +76 -76
  111. package/Overlay/package.json +1 -1
  112. package/Overlay/utils.d.ts +10 -10
  113. package/Picture/index.d.ts +70 -70
  114. package/Picture/package.json +1 -1
  115. package/Portal/cjs/index.development.js +11 -11
  116. package/Portal/cjs/index.development.v2.js +11 -11
  117. package/Portal/index.d.ts +10 -10
  118. package/Portal/package.json +1 -1
  119. package/QRCode/cjs/index.development.js +11 -11
  120. package/QRCode/cjs/index.development.v2.js +11 -11
  121. package/QRCode/index.d.ts +17 -17
  122. package/QRCode/package.json +1 -1
  123. package/Rating/cjs/index.development.js +75 -69
  124. package/Rating/cjs/index.development.v2.js +75 -69
  125. package/Rating/cjs/index.production.js +1 -1
  126. package/Rating/cjs/index.production.v2.js +1 -1
  127. package/Rating/index.d.ts +17 -17
  128. package/Rating/package.json +1 -1
  129. package/RatingSelect/cjs/index.development.js +148 -68
  130. package/RatingSelect/cjs/index.development.v2.js +148 -68
  131. package/RatingSelect/cjs/index.production.js +1 -1
  132. package/RatingSelect/cjs/index.production.v2.js +1 -1
  133. package/RatingSelect/index.d.ts +22 -18
  134. package/RatingSelect/package.json +1 -1
  135. package/SafeQuery/cjs/index.development.js +158 -110
  136. package/SafeQuery/cjs/index.development.v2.js +158 -110
  137. package/SafeQuery/cjs/index.production.js +1 -1
  138. package/SafeQuery/cjs/index.production.v2.js +1 -1
  139. package/SafeQuery/components/Error.d.ts +7 -7
  140. package/SafeQuery/index.d.ts +10 -10
  141. package/SafeQuery/package.json +1 -1
  142. package/Scroll/index.d.ts +25 -25
  143. package/Scroll/package.json +1 -1
  144. package/ScrollControls/ScrollControlsButton.d.ts +11 -11
  145. package/ScrollControls/cjs/index.development.js +201 -113
  146. package/ScrollControls/cjs/index.development.v2.js +201 -113
  147. package/ScrollControls/cjs/index.production.js +1 -1
  148. package/ScrollControls/cjs/index.production.v2.js +1 -1
  149. package/ScrollControls/index.d.ts +16 -16
  150. package/ScrollControls/package.json +1 -1
  151. package/SimpleSlider/cjs/index.development.js +270 -158
  152. package/SimpleSlider/cjs/index.development.v2.js +270 -158
  153. package/SimpleSlider/cjs/index.production.js +1 -1
  154. package/SimpleSlider/cjs/index.production.v2.js +1 -1
  155. package/SimpleSlider/index.d.ts +41 -41
  156. package/SimpleSlider/package.json +1 -1
  157. package/SimpleSlider/useAutoPlay.d.ts +3 -3
  158. package/SimpleSlider/utils.d.ts +19 -19
  159. package/Skeleton/cjs/index.development.js +118 -64
  160. package/Skeleton/cjs/index.development.v2.js +118 -64
  161. package/Skeleton/cjs/index.production.js +1 -1
  162. package/Skeleton/cjs/index.production.v2.js +1 -1
  163. package/Skeleton/index.d.ts +37 -37
  164. package/Skeleton/package.json +1 -1
  165. package/Spinner/cjs/index.development.js +66 -61
  166. package/Spinner/cjs/index.development.v2.js +66 -61
  167. package/Spinner/cjs/index.production.js +1 -1
  168. package/Spinner/cjs/index.production.v2.js +1 -1
  169. package/Spinner/index.d.ts +29 -29
  170. package/Spinner/package.json +1 -1
  171. package/Text/index.d.ts +25 -25
  172. package/Text/package.json +1 -1
  173. package/TextEmoji/cjs/index.development.js +65 -60
  174. package/TextEmoji/cjs/index.development.v2.js +65 -60
  175. package/TextEmoji/cjs/index.production.js +1 -1
  176. package/TextEmoji/cjs/index.production.v2.js +1 -1
  177. package/TextEmoji/index.d.ts +9 -9
  178. package/TextEmoji/package.json +1 -1
  179. package/Tooltip/cjs/index.development.js +80 -91
  180. package/Tooltip/cjs/index.development.v2.js +80 -91
  181. package/Tooltip/cjs/index.production.js +1 -1
  182. package/Tooltip/cjs/index.production.v2.js +1 -1
  183. package/Tooltip/index.d.ts +87 -87
  184. package/Tooltip/package.json +1 -1
  185. package/Tumbler/cjs/index.development.js +98 -66
  186. package/Tumbler/cjs/index.development.v2.js +98 -66
  187. package/Tumbler/cjs/index.production.js +1 -1
  188. package/Tumbler/cjs/index.production.v2.js +1 -1
  189. package/Tumbler/index.d.ts +8 -8
  190. package/Tumbler/package.json +1 -1
  191. package/package.json +7 -5
  192. package/useBodyTTag/cjs/index.development.js +1 -1
  193. package/useBodyTTag/cjs/index.development.v2.js +1 -1
  194. package/useBodyTTag/index.d.ts +2 -2
  195. package/useBodyTTag/package.json +1 -1
  196. package/useDebounce/cjs/index.development.js +58 -6
  197. package/useDebounce/cjs/index.development.v2.js +58 -6
  198. package/useDebounce/cjs/index.production.js +1 -1
  199. package/useDebounce/cjs/index.production.v2.js +1 -1
  200. package/useDebounce/index.d.ts +4 -4
  201. package/useDebounce/package.json +1 -1
  202. package/useId/cjs/index.development.js +6 -7
  203. package/useId/cjs/index.development.v2.js +6 -7
  204. package/useId/cjs/index.production.js +1 -1
  205. package/useId/cjs/index.production.v2.js +1 -1
  206. package/useId/index.d.ts +4 -4
  207. package/useId/package.json +1 -1
  208. package/useIsMounted/cjs/index.development.js +3 -3
  209. package/useIsMounted/cjs/index.development.v2.js +3 -3
  210. package/useIsMounted/index.d.ts +4 -4
  211. package/useIsMounted/package.json +1 -1
  212. package/useKeyPress/cjs/index.development.js +76 -22
  213. package/useKeyPress/cjs/index.development.v2.js +76 -22
  214. package/useKeyPress/cjs/index.production.js +1 -1
  215. package/useKeyPress/cjs/index.production.v2.js +1 -1
  216. package/useKeyPress/index.d.ts +6 -6
  217. package/useKeyPress/package.json +1 -1
  218. package/useMedia/cjs/index.development.js +5 -5
  219. package/useMedia/cjs/index.development.v2.js +5 -5
  220. package/useMedia/index.d.ts +21 -21
  221. package/useMedia/package.json +1 -1
  222. package/useOutsideClick/cjs/index.development.js +2 -2
  223. package/useOutsideClick/cjs/index.development.v2.js +2 -2
  224. package/useOutsideClick/index.d.ts +5 -5
  225. package/useOutsideClick/package.json +1 -1
  226. package/usePortal/cjs/index.development.js +32 -27
  227. package/usePortal/cjs/index.development.v2.js +32 -27
  228. package/usePortal/index.d.ts +12 -12
  229. package/usePortal/package.json +1 -1
  230. package/useScrollPosition/cjs/index.development.js +2 -2
  231. package/useScrollPosition/cjs/index.development.v2.js +2 -2
  232. package/useScrollPosition/index.d.ts +5 -5
  233. package/useScrollPosition/package.json +1 -1
@@ -11,74 +11,154 @@ var StarFill = require('@prom-ui/icons/StarFill');
11
11
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
12
12
 
13
13
  function _interopNamespaceCompat(e) {
14
- if (e && typeof e === 'object' && 'default' in e) return e;
15
- var n = Object.create(null);
16
- if (e) {
17
- Object.keys(e).forEach(function (k) {
18
- if (k !== 'default') {
19
- var d = Object.getOwnPropertyDescriptor(e, k);
20
- Object.defineProperty(n, k, d.get ? d : {
21
- enumerable: true,
22
- get: function () { return e[k]; }
23
- });
24
- }
14
+ if (e && typeof e === 'object' && 'default' in e) return e;
15
+ var n = Object.create(null);
16
+ if (e) {
17
+ Object.keys(e).forEach(function (k) {
18
+ if (k !== 'default') {
19
+ var d = Object.getOwnPropertyDescriptor(e, k);
20
+ Object.defineProperty(n, k, d.get ? d : {
21
+ enumerable: true,
22
+ get: function () { return e[k]; }
25
23
  });
26
- }
27
- n.default = e;
28
- return Object.freeze(n);
24
+ }
25
+ });
26
+ }
27
+ n.default = e;
28
+ return Object.freeze(n);
29
29
  }
30
30
 
31
31
  var React__namespace = /*#__PURE__*/_interopNamespaceCompat(React);
32
32
  var classNames__default = /*#__PURE__*/_interopDefaultCompat(classNames);
33
33
 
34
- /******************************************************************************
35
- Copyright (c) Microsoft Corporation.
36
-
37
- Permission to use, copy, modify, and/or distribute this software for any
38
- purpose with or without fee is hereby granted.
39
-
40
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
41
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
42
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
43
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
44
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
45
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
46
- PERFORMANCE OF THIS SOFTWARE.
47
- ***************************************************************************** */
48
-
49
- function __rest(s, e) {
50
- var t = {};
51
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
52
- t[p] = s[p];
53
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
54
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
55
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
56
- t[p[i]] = s[p[i]];
57
- }
58
- return t;
34
+ function _iterableToArrayLimit(arr, i) {
35
+ var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
36
+ if (null != _i) {
37
+ var _s,
38
+ _e,
39
+ _x,
40
+ _r,
41
+ _arr = [],
42
+ _n = !0,
43
+ _d = !1;
44
+ try {
45
+ if (_x = (_i = _i.call(arr)).next, 0 === i) {
46
+ if (Object(_i) !== _i) return;
47
+ _n = !1;
48
+ } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
49
+ } catch (err) {
50
+ _d = !0, _e = err;
51
+ } finally {
52
+ try {
53
+ if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return;
54
+ } finally {
55
+ if (_d) throw _e;
56
+ }
57
+ }
58
+ return _arr;
59
+ }
60
+ }
61
+ function _defineProperty(obj, key, value) {
62
+ key = _toPropertyKey(key);
63
+ if (key in obj) {
64
+ Object.defineProperty(obj, key, {
65
+ value: value,
66
+ enumerable: true,
67
+ configurable: true,
68
+ writable: true
69
+ });
70
+ } else {
71
+ obj[key] = value;
72
+ }
73
+ return obj;
74
+ }
75
+ function _objectWithoutPropertiesLoose(source, excluded) {
76
+ if (source == null) return {};
77
+ var target = {};
78
+ var sourceKeys = Object.keys(source);
79
+ var key, i;
80
+ for (i = 0; i < sourceKeys.length; i++) {
81
+ key = sourceKeys[i];
82
+ if (excluded.indexOf(key) >= 0) continue;
83
+ target[key] = source[key];
84
+ }
85
+ return target;
86
+ }
87
+ function _objectWithoutProperties(source, excluded) {
88
+ if (source == null) return {};
89
+ var target = _objectWithoutPropertiesLoose(source, excluded);
90
+ var key, i;
91
+ if (Object.getOwnPropertySymbols) {
92
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
93
+ for (i = 0; i < sourceSymbolKeys.length; i++) {
94
+ key = sourceSymbolKeys[i];
95
+ if (excluded.indexOf(key) >= 0) continue;
96
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
97
+ target[key] = source[key];
98
+ }
99
+ }
100
+ return target;
101
+ }
102
+ function _slicedToArray(arr, i) {
103
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
104
+ }
105
+ function _arrayWithHoles(arr) {
106
+ if (Array.isArray(arr)) return arr;
107
+ }
108
+ function _unsupportedIterableToArray(o, minLen) {
109
+ if (!o) return;
110
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
111
+ var n = Object.prototype.toString.call(o).slice(8, -1);
112
+ if (n === "Object" && o.constructor) n = o.constructor.name;
113
+ if (n === "Map" || n === "Set") return Array.from(o);
114
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
115
+ }
116
+ function _arrayLikeToArray(arr, len) {
117
+ if (len == null || len > arr.length) len = arr.length;
118
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
119
+ return arr2;
120
+ }
121
+ function _nonIterableRest() {
122
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
123
+ }
124
+ function _toPrimitive(input, hint) {
125
+ if (typeof input !== "object" || input === null) return input;
126
+ var prim = input[Symbol.toPrimitive];
127
+ if (prim !== undefined) {
128
+ var res = prim.call(input, hint || "default");
129
+ if (typeof res !== "object") return res;
130
+ throw new TypeError("@@toPrimitive must return a primitive value.");
131
+ }
132
+ return (hint === "string" ? String : Number)(input);
133
+ }
134
+ function _toPropertyKey(arg) {
135
+ var key = _toPrimitive(arg, "string");
136
+ return typeof key === "symbol" ? key : String(key);
59
137
  }
60
138
 
61
139
  var css = {"root":"RatingSelect__root___8RSGF","label":"RatingSelect__label___FF3m3","icon":"RatingSelect__icon___1Zpyt","input":"RatingSelect__input___25gdX","hovered":"RatingSelect__hovered___DscdS"};
62
140
 
141
+ var _excluded = ["value", "name", "onChange", "onHover", "size", "disabled"];
63
142
  var ITEMS_LIST = [1, 2, 3, 4, 5];
64
- var RatingSelect = function (_a) {
65
- var _b;
66
- var value = _a.value,
67
- name = _a.name,
68
- onChange = _a.onChange,
69
- onHover = _a.onHover,
70
- _c = _a.size,
71
- size = _c === void 0 ? 18 : _c,
72
- disabled = _a.disabled,
73
- props = __rest(_a, ["value", "name", "onChange", "onHover", "size", "disabled"]);
143
+ var RatingSelect = function RatingSelect(_ref) {
144
+ var value = _ref.value,
145
+ name = _ref.name,
146
+ onChange = _ref.onChange,
147
+ onHover = _ref.onHover,
148
+ _ref$size = _ref.size,
149
+ size = _ref$size === void 0 ? 18 : _ref$size,
150
+ disabled = _ref.disabled,
151
+ props = _objectWithoutProperties(_ref, _excluded);
74
152
  var isMounted = useIsMounted.useIsMounted();
75
153
  var componentId = useId.useId();
76
- var _d = React__namespace.useState(value),
77
- selectedValue = _d[0],
78
- setSelectedValue = _d[1];
79
- var _e = React__namespace.useState(true),
80
- isHovered = _e[0],
81
- setIsHovered = _e[1];
154
+ var _React$useState = React__namespace.useState(value),
155
+ _React$useState2 = _slicedToArray(_React$useState, 2),
156
+ selectedValue = _React$useState2[0],
157
+ setSelectedValue = _React$useState2[1];
158
+ var _React$useState3 = React__namespace.useState(true),
159
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
160
+ isHovered = _React$useState4[0],
161
+ setIsHovered = _React$useState4[1];
82
162
  var inputName = name || componentId;
83
163
  React__namespace.useEffect(function () {
84
164
  if (isMounted && typeof onChange === 'function') {
@@ -90,18 +170,18 @@ var RatingSelect = function (_a) {
90
170
  setSelectedValue(value);
91
171
  }
92
172
  }, [value]);
93
- var onInputChange = function (inputValue) {
173
+ var onInputChange = function onInputChange(inputValue) {
94
174
  setIsHovered(false);
95
175
  setSelectedValue(inputValue);
96
176
  };
97
- var onLabelClick = function (inputValue, e) {
177
+ var onLabelClick = function onLabelClick(inputValue, e) {
98
178
  setIsHovered(false);
99
179
  if (!disabled && selectedValue === inputValue) {
100
180
  e === null || e === void 0 ? void 0 : e.preventDefault();
101
181
  setSelectedValue(undefined);
102
182
  }
103
183
  };
104
- var onLabelMouseEnter = function (inputValue) {
184
+ var onLabelMouseEnter = function onLabelMouseEnter(inputValue) {
105
185
  if (!isHovered) {
106
186
  setIsHovered(true);
107
187
  }
@@ -109,13 +189,13 @@ var RatingSelect = function (_a) {
109
189
  onHover(inputValue);
110
190
  }
111
191
  };
112
- var onRootMouseEnter = function () {
192
+ var onRootMouseEnter = function onRootMouseEnter() {
113
193
  if (typeof onHover === 'function') {
114
194
  onHover(undefined);
115
195
  }
116
196
  };
117
- return React__namespace.createElement("div", {
118
- className: classNames__default.default(css.root, (_b = {}, _b[css.hovered] = isHovered, _b)),
197
+ return /*#__PURE__*/React__namespace.createElement("div", {
198
+ className: classNames__default.default(css.root, _defineProperty({}, css.hovered, isHovered)),
119
199
  style: {
120
200
  fontSize: size
121
201
  },
@@ -124,15 +204,15 @@ var RatingSelect = function (_a) {
124
204
  "data-testid": props['data-testid'] || 'rating_select'
125
205
  }, ITEMS_LIST.map(function (inputValue) {
126
206
  var inputId = "".concat(inputName, "-").concat(inputValue);
127
- return React__namespace.createElement("input", {
207
+ return /*#__PURE__*/React__namespace.createElement("input", {
128
208
  key: inputValue,
129
209
  id: inputId,
130
210
  className: css.input,
131
- type: 'radio',
211
+ type: "radio",
132
212
  name: inputName,
133
213
  value: inputValue,
134
214
  checked: selectedValue === inputValue,
135
- onChange: function () {
215
+ onChange: function onChange() {
136
216
  return onInputChange(inputValue);
137
217
  },
138
218
  disabled: disabled,
@@ -141,19 +221,19 @@ var RatingSelect = function (_a) {
141
221
  });
142
222
  }), ITEMS_LIST.map(function (inputValue) {
143
223
  var inputId = "".concat(inputName, "-").concat(inputValue);
144
- return React__namespace.createElement("label", {
224
+ return /*#__PURE__*/React__namespace.createElement("label", {
145
225
  key: inputValue,
146
226
  className: css.label,
147
227
  htmlFor: inputId,
148
- onClick: function (e) {
228
+ onClick: function onClick(e) {
149
229
  return onLabelClick(inputValue, e);
150
230
  },
151
- onMouseEnter: function () {
231
+ onMouseEnter: function onMouseEnter() {
152
232
  return onLabelMouseEnter(inputValue);
153
233
  },
154
234
  "data-qaid": "rating_select_label_".concat(inputValue),
155
235
  "data-testid": "rating_select_label_".concat(inputValue)
156
- }, React__namespace.createElement(StarFill.SvgStarFill, {
236
+ }, /*#__PURE__*/React__namespace.createElement(StarFill.SvgStarFill, {
157
237
  className: css.icon,
158
238
  focusable: false,
159
239
  "aria-hidden": true
@@ -11,74 +11,154 @@ var StarFill = require('@prom-ui/icons/StarFill');
11
11
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
12
12
 
13
13
  function _interopNamespaceCompat(e) {
14
- if (e && typeof e === 'object' && 'default' in e) return e;
15
- var n = Object.create(null);
16
- if (e) {
17
- Object.keys(e).forEach(function (k) {
18
- if (k !== 'default') {
19
- var d = Object.getOwnPropertyDescriptor(e, k);
20
- Object.defineProperty(n, k, d.get ? d : {
21
- enumerable: true,
22
- get: function () { return e[k]; }
23
- });
24
- }
14
+ if (e && typeof e === 'object' && 'default' in e) return e;
15
+ var n = Object.create(null);
16
+ if (e) {
17
+ Object.keys(e).forEach(function (k) {
18
+ if (k !== 'default') {
19
+ var d = Object.getOwnPropertyDescriptor(e, k);
20
+ Object.defineProperty(n, k, d.get ? d : {
21
+ enumerable: true,
22
+ get: function () { return e[k]; }
25
23
  });
26
- }
27
- n.default = e;
28
- return Object.freeze(n);
24
+ }
25
+ });
26
+ }
27
+ n.default = e;
28
+ return Object.freeze(n);
29
29
  }
30
30
 
31
31
  var React__namespace = /*#__PURE__*/_interopNamespaceCompat(React);
32
32
  var classNames__default = /*#__PURE__*/_interopDefaultCompat(classNames);
33
33
 
34
- /******************************************************************************
35
- Copyright (c) Microsoft Corporation.
36
-
37
- Permission to use, copy, modify, and/or distribute this software for any
38
- purpose with or without fee is hereby granted.
39
-
40
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
41
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
42
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
43
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
44
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
45
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
46
- PERFORMANCE OF THIS SOFTWARE.
47
- ***************************************************************************** */
48
-
49
- function __rest(s, e) {
50
- var t = {};
51
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
52
- t[p] = s[p];
53
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
54
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
55
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
56
- t[p[i]] = s[p[i]];
57
- }
58
- return t;
34
+ function _iterableToArrayLimit(arr, i) {
35
+ var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
36
+ if (null != _i) {
37
+ var _s,
38
+ _e,
39
+ _x,
40
+ _r,
41
+ _arr = [],
42
+ _n = !0,
43
+ _d = !1;
44
+ try {
45
+ if (_x = (_i = _i.call(arr)).next, 0 === i) {
46
+ if (Object(_i) !== _i) return;
47
+ _n = !1;
48
+ } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
49
+ } catch (err) {
50
+ _d = !0, _e = err;
51
+ } finally {
52
+ try {
53
+ if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return;
54
+ } finally {
55
+ if (_d) throw _e;
56
+ }
57
+ }
58
+ return _arr;
59
+ }
60
+ }
61
+ function _defineProperty(obj, key, value) {
62
+ key = _toPropertyKey(key);
63
+ if (key in obj) {
64
+ Object.defineProperty(obj, key, {
65
+ value: value,
66
+ enumerable: true,
67
+ configurable: true,
68
+ writable: true
69
+ });
70
+ } else {
71
+ obj[key] = value;
72
+ }
73
+ return obj;
74
+ }
75
+ function _objectWithoutPropertiesLoose(source, excluded) {
76
+ if (source == null) return {};
77
+ var target = {};
78
+ var sourceKeys = Object.keys(source);
79
+ var key, i;
80
+ for (i = 0; i < sourceKeys.length; i++) {
81
+ key = sourceKeys[i];
82
+ if (excluded.indexOf(key) >= 0) continue;
83
+ target[key] = source[key];
84
+ }
85
+ return target;
86
+ }
87
+ function _objectWithoutProperties(source, excluded) {
88
+ if (source == null) return {};
89
+ var target = _objectWithoutPropertiesLoose(source, excluded);
90
+ var key, i;
91
+ if (Object.getOwnPropertySymbols) {
92
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
93
+ for (i = 0; i < sourceSymbolKeys.length; i++) {
94
+ key = sourceSymbolKeys[i];
95
+ if (excluded.indexOf(key) >= 0) continue;
96
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
97
+ target[key] = source[key];
98
+ }
99
+ }
100
+ return target;
101
+ }
102
+ function _slicedToArray(arr, i) {
103
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
104
+ }
105
+ function _arrayWithHoles(arr) {
106
+ if (Array.isArray(arr)) return arr;
107
+ }
108
+ function _unsupportedIterableToArray(o, minLen) {
109
+ if (!o) return;
110
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
111
+ var n = Object.prototype.toString.call(o).slice(8, -1);
112
+ if (n === "Object" && o.constructor) n = o.constructor.name;
113
+ if (n === "Map" || n === "Set") return Array.from(o);
114
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
115
+ }
116
+ function _arrayLikeToArray(arr, len) {
117
+ if (len == null || len > arr.length) len = arr.length;
118
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
119
+ return arr2;
120
+ }
121
+ function _nonIterableRest() {
122
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
123
+ }
124
+ function _toPrimitive(input, hint) {
125
+ if (typeof input !== "object" || input === null) return input;
126
+ var prim = input[Symbol.toPrimitive];
127
+ if (prim !== undefined) {
128
+ var res = prim.call(input, hint || "default");
129
+ if (typeof res !== "object") return res;
130
+ throw new TypeError("@@toPrimitive must return a primitive value.");
131
+ }
132
+ return (hint === "string" ? String : Number)(input);
133
+ }
134
+ function _toPropertyKey(arg) {
135
+ var key = _toPrimitive(arg, "string");
136
+ return typeof key === "symbol" ? key : String(key);
59
137
  }
60
138
 
61
139
  var css = {"root":"RatingSelect__root___V-LdE","label":"RatingSelect__label___sgjOY","icon":"RatingSelect__icon___FTT2B","input":"RatingSelect__input___DxUIq","hovered":"RatingSelect__hovered___LD2kV"};
62
140
 
141
+ var _excluded = ["value", "name", "onChange", "onHover", "size", "disabled"];
63
142
  var ITEMS_LIST = [1, 2, 3, 4, 5];
64
- var RatingSelect = function (_a) {
65
- var _b;
66
- var value = _a.value,
67
- name = _a.name,
68
- onChange = _a.onChange,
69
- onHover = _a.onHover,
70
- _c = _a.size,
71
- size = _c === void 0 ? 18 : _c,
72
- disabled = _a.disabled,
73
- props = __rest(_a, ["value", "name", "onChange", "onHover", "size", "disabled"]);
143
+ var RatingSelect = function RatingSelect(_ref) {
144
+ var value = _ref.value,
145
+ name = _ref.name,
146
+ onChange = _ref.onChange,
147
+ onHover = _ref.onHover,
148
+ _ref$size = _ref.size,
149
+ size = _ref$size === void 0 ? 18 : _ref$size,
150
+ disabled = _ref.disabled,
151
+ props = _objectWithoutProperties(_ref, _excluded);
74
152
  var isMounted = useIsMounted.useIsMounted();
75
153
  var componentId = useId.useId();
76
- var _d = React__namespace.useState(value),
77
- selectedValue = _d[0],
78
- setSelectedValue = _d[1];
79
- var _e = React__namespace.useState(true),
80
- isHovered = _e[0],
81
- setIsHovered = _e[1];
154
+ var _React$useState = React__namespace.useState(value),
155
+ _React$useState2 = _slicedToArray(_React$useState, 2),
156
+ selectedValue = _React$useState2[0],
157
+ setSelectedValue = _React$useState2[1];
158
+ var _React$useState3 = React__namespace.useState(true),
159
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
160
+ isHovered = _React$useState4[0],
161
+ setIsHovered = _React$useState4[1];
82
162
  var inputName = name || componentId;
83
163
  React__namespace.useEffect(function () {
84
164
  if (isMounted && typeof onChange === 'function') {
@@ -90,18 +170,18 @@ var RatingSelect = function (_a) {
90
170
  setSelectedValue(value);
91
171
  }
92
172
  }, [value]);
93
- var onInputChange = function (inputValue) {
173
+ var onInputChange = function onInputChange(inputValue) {
94
174
  setIsHovered(false);
95
175
  setSelectedValue(inputValue);
96
176
  };
97
- var onLabelClick = function (inputValue, e) {
177
+ var onLabelClick = function onLabelClick(inputValue, e) {
98
178
  setIsHovered(false);
99
179
  if (!disabled && selectedValue === inputValue) {
100
180
  e === null || e === void 0 ? void 0 : e.preventDefault();
101
181
  setSelectedValue(undefined);
102
182
  }
103
183
  };
104
- var onLabelMouseEnter = function (inputValue) {
184
+ var onLabelMouseEnter = function onLabelMouseEnter(inputValue) {
105
185
  if (!isHovered) {
106
186
  setIsHovered(true);
107
187
  }
@@ -109,13 +189,13 @@ var RatingSelect = function (_a) {
109
189
  onHover(inputValue);
110
190
  }
111
191
  };
112
- var onRootMouseEnter = function () {
192
+ var onRootMouseEnter = function onRootMouseEnter() {
113
193
  if (typeof onHover === 'function') {
114
194
  onHover(undefined);
115
195
  }
116
196
  };
117
- return React__namespace.createElement("div", {
118
- className: classNames__default.default(css.root, (_b = {}, _b[css.hovered] = isHovered, _b)),
197
+ return /*#__PURE__*/React__namespace.createElement("div", {
198
+ className: classNames__default.default(css.root, _defineProperty({}, css.hovered, isHovered)),
119
199
  style: {
120
200
  fontSize: size
121
201
  },
@@ -124,15 +204,15 @@ var RatingSelect = function (_a) {
124
204
  "data-testid": props['data-testid'] || 'rating_select'
125
205
  }, ITEMS_LIST.map(function (inputValue) {
126
206
  var inputId = "".concat(inputName, "-").concat(inputValue);
127
- return React__namespace.createElement("input", {
207
+ return /*#__PURE__*/React__namespace.createElement("input", {
128
208
  key: inputValue,
129
209
  id: inputId,
130
210
  className: css.input,
131
- type: 'radio',
211
+ type: "radio",
132
212
  name: inputName,
133
213
  value: inputValue,
134
214
  checked: selectedValue === inputValue,
135
- onChange: function () {
215
+ onChange: function onChange() {
136
216
  return onInputChange(inputValue);
137
217
  },
138
218
  disabled: disabled,
@@ -141,19 +221,19 @@ var RatingSelect = function (_a) {
141
221
  });
142
222
  }), ITEMS_LIST.map(function (inputValue) {
143
223
  var inputId = "".concat(inputName, "-").concat(inputValue);
144
- return React__namespace.createElement("label", {
224
+ return /*#__PURE__*/React__namespace.createElement("label", {
145
225
  key: inputValue,
146
226
  className: css.label,
147
227
  htmlFor: inputId,
148
- onClick: function (e) {
228
+ onClick: function onClick(e) {
149
229
  return onLabelClick(inputValue, e);
150
230
  },
151
- onMouseEnter: function () {
231
+ onMouseEnter: function onMouseEnter() {
152
232
  return onLabelMouseEnter(inputValue);
153
233
  },
154
234
  "data-qaid": "rating_select_label_".concat(inputValue),
155
235
  "data-testid": "rating_select_label_".concat(inputValue)
156
- }, React__namespace.createElement(StarFill.SvgStarFill, {
236
+ }, /*#__PURE__*/React__namespace.createElement(StarFill.SvgStarFill, {
157
237
  className: css.icon,
158
238
  focusable: false,
159
239
  "aria-hidden": true
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("classnames"),n=require("@prom-ui/core/useId"),a=require("@prom-ui/core/useIsMounted"),r=require("@prom-ui/icons/StarFill");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function c(e){if(e&&"object"==typeof e&&"default"in e)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var i=c(e),u=o(t);var l="_8RSGF",s="FF3m3",f="_1Zpyt",d="_25gdX",p="DscdS",y=[1,2,3,4,5],m=function(e){var t,o=e.value,c=e.name,m=e.onChange,v=e.onHover,b=e.size,g=void 0===b?18:b,_=e.disabled,O=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(n[a[r]]=e[a[r]])}return n}(e,["value","name","onChange","onHover","size","disabled"]),j=a.useIsMounted(),S=n.useId(),q=i.useState(o),h=q[0],E=q[1],F=i.useState(!0),P=F[0],k=F[1],I=c||S;i.useEffect((function(){j&&"function"==typeof m&&m(h)}),[h]),i.useEffect((function(){o!==h&&E(o)}),[o]);return i.createElement("div",{className:u.default(l,(t={},t[p]=P,t)),style:{fontSize:g},onMouseLeave:function(){"function"==typeof v&&v(void 0)},"data-qaid":O["data-qaid"]||"rating_select","data-testid":O["data-testid"]||"rating_select"},y.map((function(e){var t="".concat(I,"-").concat(e);return i.createElement("input",{key:e,id:t,className:d,type:"radio",name:I,value:e,checked:h===e,onChange:function(){return function(e){k(!1),E(e)}(e)},disabled:_,"data-qaid":"rating_select_input_".concat(e),"data-testid":"rating_select_input_".concat(e)})})),y.map((function(e){var t="".concat(I,"-").concat(e);return i.createElement("label",{key:e,className:s,htmlFor:t,onClick:function(t){return function(e,t){k(!1),_||h!==e||(null==t||t.preventDefault(),E(void 0))}(e,t)},onMouseEnter:function(){return function(e){P||k(!0),"function"==typeof v&&v(e)}(e)},"data-qaid":"rating_select_label_".concat(e),"data-testid":"rating_select_label_".concat(e)},i.createElement(r.SvgStarFill,{className:f,focusable:!1,"aria-hidden":!0}))})))};m.displayName="RatingSelect",exports.RatingSelect=m,require("./style.production.css");
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("classnames"),r=require("@prom-ui/core/useId"),n=require("@prom-ui/core/useIsMounted"),a=require("@prom-ui/icons/StarFill");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function o(e){if(e&&"object"==typeof e&&"default"in e)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 u=o(e),c=i(t);function l(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function f(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,i,o,u=[],c=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(f){l=!0,a=f}finally{try{if(!c&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(l)throw a}}return u}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return d(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return d(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var y="_8RSGF",p="FF3m3",b="_1Zpyt",m="_25gdX",v="DscdS",g=["value","name","onChange","onHover","size","disabled"],j=[1,2,3,4,5],O=function(e){var t=e.value,i=e.name,o=e.onChange,d=e.onHover,O=e.size,S=void 0===O?18:O,h=e.disabled,_=f(e,g),E=n.useIsMounted(),q=r.useId(),w=s(u.useState(t),2),I=w[0],P=w[1],k=s(u.useState(!0),2),A=k[0],F=k[1],M=i||q;u.useEffect((function(){E&&"function"==typeof o&&o(I)}),[I]),u.useEffect((function(){t!==I&&P(t)}),[t]);return u.createElement("div",{className:c.default(y,l({},v,A)),style:{fontSize:S},onMouseLeave:function(){"function"==typeof d&&d(void 0)},"data-qaid":_["data-qaid"]||"rating_select","data-testid":_["data-testid"]||"rating_select"},j.map((function(e){var t="".concat(M,"-").concat(e);return u.createElement("input",{key:e,id:t,className:m,type:"radio",name:M,value:e,checked:I===e,onChange:function(){return function(e){F(!1),P(e)}(e)},disabled:h,"data-qaid":"rating_select_input_".concat(e),"data-testid":"rating_select_input_".concat(e)})})),j.map((function(e){var t="".concat(M,"-").concat(e);return u.createElement("label",{key:e,className:p,htmlFor:t,onClick:function(t){return function(e,t){F(!1),h||I!==e||(null==t||t.preventDefault(),P(void 0))}(e,t)},onMouseEnter:function(){return function(e){A||F(!0),"function"==typeof d&&d(e)}(e)},"data-qaid":"rating_select_label_".concat(e),"data-testid":"rating_select_label_".concat(e)},u.createElement(a.SvgStarFill,{className:b,focusable:!1,"aria-hidden":!0}))})))};O.displayName="RatingSelect",exports.RatingSelect=O,require("./style.production.css");
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("classnames"),n=require("@prom-ui/core/useId"),a=require("@prom-ui/core/useIsMounted"),r=require("@prom-ui/icons/StarFill");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function c(e){if(e&&"object"==typeof e&&"default"in e)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var i=c(e),u=o(t);var l="V-LdE",s="sgjOY",f="FTT2B",d="DxUIq",p="LD2kV",v=[1,2,3,4,5],y=function(e){var t,o=e.value,c=e.name,y=e.onChange,b=e.onHover,m=e.size,g=void 0===m?18:m,O=e.disabled,_=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(n[a[r]]=e[a[r]])}return n}(e,["value","name","onChange","onHover","size","disabled"]),j=a.useIsMounted(),q=n.useId(),E=i.useState(o),S=E[0],h=E[1],k=i.useState(!0),I=k[0],P=k[1],x=c||q;i.useEffect((function(){j&&"function"==typeof y&&y(S)}),[S]),i.useEffect((function(){o!==S&&h(o)}),[o]);return i.createElement("div",{className:u.default(l,(t={},t[p]=I,t)),style:{fontSize:g},onMouseLeave:function(){"function"==typeof b&&b(void 0)},"data-qaid":_["data-qaid"]||"rating_select","data-testid":_["data-testid"]||"rating_select"},v.map((function(e){var t="".concat(x,"-").concat(e);return i.createElement("input",{key:e,id:t,className:d,type:"radio",name:x,value:e,checked:S===e,onChange:function(){return function(e){P(!1),h(e)}(e)},disabled:O,"data-qaid":"rating_select_input_".concat(e),"data-testid":"rating_select_input_".concat(e)})})),v.map((function(e){var t="".concat(x,"-").concat(e);return i.createElement("label",{key:e,className:s,htmlFor:t,onClick:function(t){return function(e,t){P(!1),O||S!==e||(null==t||t.preventDefault(),h(void 0))}(e,t)},onMouseEnter:function(){return function(e){I||P(!0),"function"==typeof b&&b(e)}(e)},"data-qaid":"rating_select_label_".concat(e),"data-testid":"rating_select_label_".concat(e)},i.createElement(r.SvgStarFill,{className:f,focusable:!1,"aria-hidden":!0}))})))};y.displayName="RatingSelect",exports.RatingSelect=y,require("./style.production.v2.css");
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("classnames"),r=require("@prom-ui/core/useId"),n=require("@prom-ui/core/useIsMounted"),a=require("@prom-ui/icons/StarFill");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function o(e){if(e&&"object"==typeof e&&"default"in e)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 u=o(e),c=i(t);function l(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function f(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,i,o,u=[],c=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(f){l=!0,a=f}finally{try{if(!c&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(l)throw a}}return u}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return d(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return d(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var y="V-LdE",p="sgjOY",b="FTT2B",m="DxUIq",v="LD2kV",g=["value","name","onChange","onHover","size","disabled"],j=[1,2,3,4,5],O=function(e){var t=e.value,i=e.name,o=e.onChange,d=e.onHover,O=e.size,h=void 0===O?18:O,S=e.disabled,_=f(e,g),E=n.useIsMounted(),q=r.useId(),w=s(u.useState(t),2),I=w[0],P=w[1],k=s(u.useState(!0),2),x=k[0],A=k[1],M=i||q;u.useEffect((function(){E&&"function"==typeof o&&o(I)}),[I]),u.useEffect((function(){t!==I&&P(t)}),[t]);return u.createElement("div",{className:c.default(y,l({},v,x)),style:{fontSize:h},onMouseLeave:function(){"function"==typeof d&&d(void 0)},"data-qaid":_["data-qaid"]||"rating_select","data-testid":_["data-testid"]||"rating_select"},j.map((function(e){var t="".concat(M,"-").concat(e);return u.createElement("input",{key:e,id:t,className:m,type:"radio",name:M,value:e,checked:I===e,onChange:function(){return function(e){A(!1),P(e)}(e)},disabled:S,"data-qaid":"rating_select_input_".concat(e),"data-testid":"rating_select_input_".concat(e)})})),j.map((function(e){var t="".concat(M,"-").concat(e);return u.createElement("label",{key:e,className:p,htmlFor:t,onClick:function(t){return function(e,t){A(!1),S||I!==e||(null==t||t.preventDefault(),P(void 0))}(e,t)},onMouseEnter:function(){return function(e){x||A(!0),"function"==typeof d&&d(e)}(e)},"data-qaid":"rating_select_label_".concat(e),"data-testid":"rating_select_label_".concat(e)},u.createElement(a.SvgStarFill,{className:b,focusable:!1,"aria-hidden":!0}))})))};O.displayName="RatingSelect",exports.RatingSelect=O,require("./style.production.v2.css");