@prom-ui/core 1.1.1 → 1.2.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 (126) hide show
  1. package/Avatar/package.json +1 -1
  2. package/Backdrop/package.json +1 -1
  3. package/Body/package.json +1 -1
  4. package/BodyContext/cjs/index.development.js +57 -0
  5. package/BodyContext/cjs/index.development.v2.js +57 -0
  6. package/BodyContext/cjs/index.production.js +1 -0
  7. package/BodyContext/cjs/index.production.v2.js +1 -0
  8. package/BodyContext/index.d.ts +12 -0
  9. package/BodyContext/index.js +7 -0
  10. package/BodyContext/index.v2.js +7 -0
  11. package/BodyContext/package.json +12 -0
  12. package/BodyProvider/cjs/index.development.js +7 -15
  13. package/BodyProvider/cjs/index.development.v2.js +7 -15
  14. package/BodyProvider/cjs/index.production.js +1 -1
  15. package/BodyProvider/cjs/index.production.v2.js +1 -1
  16. package/BodyProvider/index.d.ts +3 -2
  17. package/BodyProvider/package.json +1 -1
  18. package/Box/package.json +1 -1
  19. package/Button/package.json +1 -1
  20. package/ButtonPageUp/cjs/index.development.js +2 -2
  21. package/ButtonPageUp/cjs/index.development.v2.js +2 -2
  22. package/ButtonPageUp/cjs/index.production.js +1 -1
  23. package/ButtonPageUp/cjs/index.production.v2.js +1 -1
  24. package/ButtonPageUp/package.json +1 -1
  25. package/Checkbox/package.json +1 -1
  26. package/Flex/package.json +1 -1
  27. package/Grid/package.json +1 -1
  28. package/Icon/package.json +1 -1
  29. package/Image/package.json +1 -1
  30. package/ImageEmoji/package.json +1 -1
  31. package/Input/package.json +1 -1
  32. package/InputField/cjs/index.development.js +3 -3
  33. package/InputField/cjs/index.development.v2.js +3 -3
  34. package/InputField/cjs/index.production.js +1 -1
  35. package/InputField/cjs/index.production.v2.js +1 -1
  36. package/InputField/package.json +1 -1
  37. package/KeyPress/package.json +1 -1
  38. package/Line/package.json +1 -1
  39. package/Link/package.json +1 -1
  40. package/List/package.json +1 -1
  41. package/Media/package.json +1 -1
  42. package/OutsideClick/package.json +1 -1
  43. package/Overlay/cjs/index.development.js +2 -2
  44. package/Overlay/cjs/index.development.v2.js +2 -2
  45. package/Overlay/cjs/index.production.js +1 -1
  46. package/Overlay/cjs/index.production.v2.js +1 -1
  47. package/Overlay/package.json +1 -1
  48. package/Picture/cjs/index.development.js +1 -1
  49. package/Picture/cjs/index.development.v2.js +1 -1
  50. package/Picture/cjs/index.production.js +1 -1
  51. package/Picture/cjs/index.production.v2.js +1 -1
  52. package/Picture/cjs/style.development.css +1 -1
  53. package/Picture/cjs/style.development.v2.css +1 -1
  54. package/Picture/cjs/style.production.css +1 -1
  55. package/Picture/cjs/style.production.v2.css +1 -1
  56. package/Picture/index.d.ts +1 -0
  57. package/Picture/package.json +1 -1
  58. package/Portal/package.json +1 -1
  59. package/QRCode/package.json +1 -1
  60. package/Rating/cjs/index.development.js +2 -1
  61. package/Rating/cjs/index.development.v2.js +2 -1
  62. package/Rating/cjs/index.production.js +1 -1
  63. package/Rating/cjs/index.production.v2.js +1 -1
  64. package/Rating/package.json +1 -1
  65. package/RatingSelect/cjs/index.development.js +167 -0
  66. package/RatingSelect/cjs/index.development.v2.js +167 -0
  67. package/RatingSelect/cjs/index.production.js +1 -0
  68. package/RatingSelect/cjs/index.production.v2.js +1 -0
  69. package/RatingSelect/cjs/style.development.css +1 -0
  70. package/RatingSelect/cjs/style.development.v2.css +1 -0
  71. package/RatingSelect/cjs/style.production.css +1 -0
  72. package/RatingSelect/cjs/style.production.v2.css +1 -0
  73. package/RatingSelect/index.d.ts +18 -0
  74. package/RatingSelect/index.js +7 -0
  75. package/RatingSelect/index.v2.js +7 -0
  76. package/RatingSelect/package.json +12 -0
  77. package/SafeQuery/cjs/index.development.js +2 -2
  78. package/SafeQuery/cjs/index.development.v2.js +2 -2
  79. package/SafeQuery/cjs/index.production.js +1 -1
  80. package/SafeQuery/cjs/index.production.v2.js +1 -1
  81. package/SafeQuery/package.json +1 -1
  82. package/Scroll/package.json +1 -1
  83. package/ScrollControls/cjs/index.development.js +2 -2
  84. package/ScrollControls/cjs/index.development.v2.js +2 -2
  85. package/ScrollControls/cjs/index.production.js +1 -1
  86. package/ScrollControls/cjs/index.production.v2.js +1 -1
  87. package/ScrollControls/package.json +1 -1
  88. package/SimpleSlider/cjs/index.development.js +2 -2
  89. package/SimpleSlider/cjs/index.development.v2.js +2 -2
  90. package/SimpleSlider/cjs/index.production.js +1 -1
  91. package/SimpleSlider/cjs/index.production.v2.js +1 -1
  92. package/SimpleSlider/package.json +1 -1
  93. package/Skeleton/package.json +1 -1
  94. package/Spinner/package.json +1 -1
  95. package/Text/package.json +1 -1
  96. package/TextEmoji/package.json +1 -1
  97. package/Tooltip/package.json +1 -1
  98. package/Tumbler/package.json +1 -1
  99. package/base/colors-dark.css +64 -64
  100. package/base/colors.css +13 -13
  101. package/package.json +2 -2
  102. package/useBodyTTag/cjs/index.development.js +33 -0
  103. package/useBodyTTag/cjs/index.development.v2.js +33 -0
  104. package/useBodyTTag/cjs/index.production.js +1 -0
  105. package/useBodyTTag/cjs/index.production.v2.js +1 -0
  106. package/useBodyTTag/index.d.ts +2 -0
  107. package/useBodyTTag/index.js +7 -0
  108. package/useBodyTTag/index.v2.js +7 -0
  109. package/useBodyTTag/package.json +9 -0
  110. package/useDebounce/package.json +1 -1
  111. package/useId/cjs/index.development.js +44 -0
  112. package/useId/cjs/index.development.v2.js +44 -0
  113. package/useId/cjs/index.production.js +1 -0
  114. package/useId/cjs/index.production.v2.js +1 -0
  115. package/useId/index.d.ts +4 -0
  116. package/useId/index.js +7 -0
  117. package/useId/index.v2.js +7 -0
  118. package/useId/package.json +9 -0
  119. package/useIsMounted/package.json +1 -1
  120. package/useKeyPress/package.json +1 -1
  121. package/useMedia/package.json +1 -1
  122. package/useOutsideClick/package.json +1 -1
  123. package/usePortal/package.json +1 -1
  124. package/useScrollPosition/package.json +1 -1
  125. package/BodyProvider/BodyContext.d.ts +0 -5
  126. package/BodyProvider/useBodyLocale.d.ts +0 -2
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Portal",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/QRCode",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
6
  var classNames = require('classnames');
7
+ var useId = require('@prom-ui/core/useId');
7
8
 
8
9
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
9
10
 
@@ -80,7 +81,7 @@ var Rating = React__namespace.forwardRef(function (_a, ref) {
80
81
  className = _a.className,
81
82
  props = __rest(_a, ["value", "percent", "size", "theme", "className"]);
82
83
  var gradientOffset = Math.round(percent > 0 ? percent : value / 5 * 100);
83
- var gradientId = "pds-rating-gradient-".concat(gradientOffset, "-").concat(theme);
84
+ var gradientId = useId.useId();
84
85
  var currentSize = size;
85
86
  // DEPRECATED
86
87
  if (size === 'small') {
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
6
  var classNames = require('classnames');
7
+ var useId = require('@prom-ui/core/useId');
7
8
 
8
9
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
9
10
 
@@ -80,7 +81,7 @@ var Rating = React__namespace.forwardRef(function (_a, ref) {
80
81
  className = _a.className,
81
82
  props = __rest(_a, ["value", "percent", "size", "theme", "className"]);
82
83
  var gradientOffset = Math.round(percent > 0 ? percent : value / 5 * 100);
83
- var gradientId = "pds-rating-gradient-".concat(gradientOffset, "-").concat(theme);
84
+ var gradientId = useId.useId();
84
85
  var currentSize = size;
85
86
  // DEPRECATED
86
87
  if (size === 'small') {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),n=require("classnames");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function r(e){if(e&&"object"==typeof e&&"default"in e)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 a=r(e),o=t(n),c=function(){return c=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},c.apply(this,arguments)};var C="AYAsy",l=a.forwardRef((function(e,n){var t=e.value,r=void 0===t?0:t,l=e.percent,L=void 0===l?0:l,i=e.size,f=void 0===i?18:i,s=e.theme,u=void 0===s?"violet-500":s,p=e.className,d=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","theme","className"]),v=Math.round(L>0?L:r/5*100),b="pds-rating-gradient-".concat(v,"-").concat(u),y=f;return"small"===f?y=14:"default"===f?y=18:"big"===f&&(y=22),a.createElement("svg",c({className:o.default(C,p),height:y},d,{ref:n,viewBox:"0 0 120 24",tabIndex:-1,focusable:!1}),a.createElement("defs",null,a.createElement("linearGradient",{id:b},a.createElement("stop",{offset:"".concat(v,"%"),stopColor:"var(--".concat(u,")")}),a.createElement("stop",{offset:"".concat(v,"%"),stopColor:"var(--black-400)"}))),a.createElement("path",{fill:"url(#".concat(b,")"),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"}))}));l.displayName="Rating",exports.Rating=l,require("./style.production.css");
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),n=require("classnames"),t=require("@prom-ui/core/useId");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function a(e){if(e&&"object"==typeof e&&"default"in e)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 o=a(e),C=r(n),c=function(){return c=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},c.apply(this,arguments)};var l="AYAsy",L=o.forwardRef((function(e,n){var r=e.value,a=void 0===r?0:r,L=e.percent,i=void 0===L?0:L,u=e.size,s=void 0===u?18:u,f=e.theme,p=void 0===f?"violet-500":f,d=e.className,v=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","theme","className"]),b=Math.round(i>0?i:a/5*100),y=t.useId(),m=s;return"small"===s?m=14:"default"===s?m=18:"big"===s&&(m=22),o.createElement("svg",c({className:C.default(l,d),height:m},v,{ref:n,viewBox:"0 0 120 24",tabIndex:-1,focusable:!1}),o.createElement("defs",null,o.createElement("linearGradient",{id:y},o.createElement("stop",{offset:"".concat(b,"%"),stopColor:"var(--".concat(p,")")}),o.createElement("stop",{offset:"".concat(b,"%"),stopColor:"var(--black-400)"}))),o.createElement("path",{fill:"url(#".concat(y,")"),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"}))}));L.displayName="Rating",exports.Rating=L,require("./style.production.css");
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),n=require("classnames");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function r(e){if(e&&"object"==typeof e&&"default"in e)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 a=r(e),o=t(n),c=function(){return c=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},c.apply(this,arguments)};var C="aJlm0",l=a.forwardRef((function(e,n){var t=e.value,r=void 0===t?0:t,l=e.percent,L=void 0===l?0:l,i=e.size,f=void 0===i?18:i,s=e.theme,u=void 0===s?"violet-500":s,p=e.className,d=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","theme","className"]),v=Math.round(L>0?L:r/5*100),b="pds-rating-gradient-".concat(v,"-").concat(u),y=f;return"small"===f?y=14:"default"===f?y=18:"big"===f&&(y=22),a.createElement("svg",c({className:o.default(C,p),height:y},d,{ref:n,viewBox:"0 0 120 24",tabIndex:-1,focusable:!1}),a.createElement("defs",null,a.createElement("linearGradient",{id:b},a.createElement("stop",{offset:"".concat(v,"%"),stopColor:"var(--".concat(u,")")}),a.createElement("stop",{offset:"".concat(v,"%"),stopColor:"var(--black-400)"}))),a.createElement("path",{fill:"url(#".concat(b,")"),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"}))}));l.displayName="Rating",exports.Rating=l,require("./style.production.v2.css");
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),n=require("classnames"),t=require("@prom-ui/core/useId");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function a(e){if(e&&"object"==typeof e&&"default"in e)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 o=a(e),C=r(n),c=function(){return c=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},c.apply(this,arguments)};var l="aJlm0",L=o.forwardRef((function(e,n){var r=e.value,a=void 0===r?0:r,L=e.percent,i=void 0===L?0:L,u=e.size,f=void 0===u?18:u,s=e.theme,p=void 0===s?"violet-500":s,d=e.className,v=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","theme","className"]),b=Math.round(i>0?i:a/5*100),m=t.useId(),y=f;return"small"===f?y=14:"default"===f?y=18:"big"===f&&(y=22),o.createElement("svg",c({className:C.default(l,d),height:y},v,{ref:n,viewBox:"0 0 120 24",tabIndex:-1,focusable:!1}),o.createElement("defs",null,o.createElement("linearGradient",{id:m},o.createElement("stop",{offset:"".concat(b,"%"),stopColor:"var(--".concat(p,")")}),o.createElement("stop",{offset:"".concat(b,"%"),stopColor:"var(--black-400)"}))),o.createElement("path",{fill:"url(#".concat(m,")"),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"}))}));L.displayName="Rating",exports.Rating=L,require("./style.production.v2.css");
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Rating",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -0,0 +1,167 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var React = require('react');
6
+ var classNames = require('classnames');
7
+ var useId = require('@prom-ui/core/useId');
8
+ var useIsMounted = require('@prom-ui/core/useIsMounted');
9
+ var StarFill = require('@prom-ui/icons/StarFill');
10
+
11
+ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
12
+
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
+ }
25
+ });
26
+ }
27
+ n.default = e;
28
+ return Object.freeze(n);
29
+ }
30
+
31
+ var React__namespace = /*#__PURE__*/_interopNamespaceCompat(React);
32
+ var classNames__default = /*#__PURE__*/_interopDefaultCompat(classNames);
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;
59
+ }
60
+
61
+ var css = {"root":"RatingSelect__root___8RSGF","label":"RatingSelect__label___FF3m3","icon":"RatingSelect__icon___1Zpyt","input":"RatingSelect__input___25gdX","hovered":"RatingSelect__hovered___DscdS"};
62
+
63
+ 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"]);
74
+ var isMounted = useIsMounted.useIsMounted();
75
+ 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];
82
+ var inputName = name || componentId;
83
+ React__namespace.useEffect(function () {
84
+ if (isMounted && typeof onChange === 'function') {
85
+ onChange(selectedValue);
86
+ }
87
+ }, [selectedValue]);
88
+ React__namespace.useEffect(function () {
89
+ if (value !== selectedValue) {
90
+ setSelectedValue(value);
91
+ }
92
+ }, [value]);
93
+ var onInputChange = function (inputValue) {
94
+ setIsHovered(false);
95
+ setSelectedValue(inputValue);
96
+ };
97
+ var onLabelClick = function (inputValue, e) {
98
+ setIsHovered(false);
99
+ if (!disabled && selectedValue === inputValue) {
100
+ e === null || e === void 0 ? void 0 : e.preventDefault();
101
+ setSelectedValue(undefined);
102
+ }
103
+ };
104
+ var onLabelMouseEnter = function (inputValue) {
105
+ if (!isHovered) {
106
+ setIsHovered(true);
107
+ }
108
+ if (typeof onHover === 'function') {
109
+ onHover(inputValue);
110
+ }
111
+ };
112
+ var onRootMouseEnter = function () {
113
+ if (typeof onHover === 'function') {
114
+ onHover(undefined);
115
+ }
116
+ };
117
+ return React__namespace.createElement("div", {
118
+ className: classNames__default.default(css.root, (_b = {}, _b[css.hovered] = isHovered, _b)),
119
+ style: {
120
+ fontSize: size
121
+ },
122
+ onMouseLeave: onRootMouseEnter,
123
+ "data-qaid": props['data-qaid'] || 'rating_select',
124
+ "data-testid": props['data-testid'] || 'rating_select'
125
+ }, ITEMS_LIST.map(function (inputValue) {
126
+ var inputId = "".concat(inputName, "-").concat(inputValue);
127
+ return React__namespace.createElement("input", {
128
+ key: inputValue,
129
+ id: inputId,
130
+ className: css.input,
131
+ type: 'radio',
132
+ name: inputName,
133
+ value: inputValue,
134
+ checked: selectedValue === inputValue,
135
+ onChange: function () {
136
+ return onInputChange(inputValue);
137
+ },
138
+ disabled: disabled,
139
+ "data-qaid": "rating_select_input_".concat(inputValue),
140
+ "data-testid": "rating_select_input_".concat(inputValue)
141
+ });
142
+ }), ITEMS_LIST.map(function (inputValue) {
143
+ var inputId = "".concat(inputName, "-").concat(inputValue);
144
+ return React__namespace.createElement("label", {
145
+ key: inputValue,
146
+ className: css.label,
147
+ htmlFor: inputId,
148
+ onClick: function (e) {
149
+ return onLabelClick(inputValue, e);
150
+ },
151
+ onMouseEnter: function () {
152
+ return onLabelMouseEnter(inputValue);
153
+ },
154
+ "data-qaid": "rating_select_label_".concat(inputValue),
155
+ "data-testid": "rating_select_label_".concat(inputValue)
156
+ }, React__namespace.createElement(StarFill.SvgStarFill, {
157
+ className: css.icon,
158
+ focusable: false,
159
+ "aria-hidden": true
160
+ }));
161
+ }));
162
+ };
163
+ RatingSelect.displayName = 'RatingSelect';
164
+
165
+ exports.RatingSelect = RatingSelect;
166
+
167
+ require('./style.development.css');
@@ -0,0 +1,167 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var React = require('react');
6
+ var classNames = require('classnames');
7
+ var useId = require('@prom-ui/core/useId');
8
+ var useIsMounted = require('@prom-ui/core/useIsMounted');
9
+ var StarFill = require('@prom-ui/icons/StarFill');
10
+
11
+ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
12
+
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
+ }
25
+ });
26
+ }
27
+ n.default = e;
28
+ return Object.freeze(n);
29
+ }
30
+
31
+ var React__namespace = /*#__PURE__*/_interopNamespaceCompat(React);
32
+ var classNames__default = /*#__PURE__*/_interopDefaultCompat(classNames);
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;
59
+ }
60
+
61
+ var css = {"root":"RatingSelect__root___V-LdE","label":"RatingSelect__label___sgjOY","icon":"RatingSelect__icon___FTT2B","input":"RatingSelect__input___DxUIq","hovered":"RatingSelect__hovered___LD2kV"};
62
+
63
+ 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"]);
74
+ var isMounted = useIsMounted.useIsMounted();
75
+ 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];
82
+ var inputName = name || componentId;
83
+ React__namespace.useEffect(function () {
84
+ if (isMounted && typeof onChange === 'function') {
85
+ onChange(selectedValue);
86
+ }
87
+ }, [selectedValue]);
88
+ React__namespace.useEffect(function () {
89
+ if (value !== selectedValue) {
90
+ setSelectedValue(value);
91
+ }
92
+ }, [value]);
93
+ var onInputChange = function (inputValue) {
94
+ setIsHovered(false);
95
+ setSelectedValue(inputValue);
96
+ };
97
+ var onLabelClick = function (inputValue, e) {
98
+ setIsHovered(false);
99
+ if (!disabled && selectedValue === inputValue) {
100
+ e === null || e === void 0 ? void 0 : e.preventDefault();
101
+ setSelectedValue(undefined);
102
+ }
103
+ };
104
+ var onLabelMouseEnter = function (inputValue) {
105
+ if (!isHovered) {
106
+ setIsHovered(true);
107
+ }
108
+ if (typeof onHover === 'function') {
109
+ onHover(inputValue);
110
+ }
111
+ };
112
+ var onRootMouseEnter = function () {
113
+ if (typeof onHover === 'function') {
114
+ onHover(undefined);
115
+ }
116
+ };
117
+ return React__namespace.createElement("div", {
118
+ className: classNames__default.default(css.root, (_b = {}, _b[css.hovered] = isHovered, _b)),
119
+ style: {
120
+ fontSize: size
121
+ },
122
+ onMouseLeave: onRootMouseEnter,
123
+ "data-qaid": props['data-qaid'] || 'rating_select',
124
+ "data-testid": props['data-testid'] || 'rating_select'
125
+ }, ITEMS_LIST.map(function (inputValue) {
126
+ var inputId = "".concat(inputName, "-").concat(inputValue);
127
+ return React__namespace.createElement("input", {
128
+ key: inputValue,
129
+ id: inputId,
130
+ className: css.input,
131
+ type: 'radio',
132
+ name: inputName,
133
+ value: inputValue,
134
+ checked: selectedValue === inputValue,
135
+ onChange: function () {
136
+ return onInputChange(inputValue);
137
+ },
138
+ disabled: disabled,
139
+ "data-qaid": "rating_select_input_".concat(inputValue),
140
+ "data-testid": "rating_select_input_".concat(inputValue)
141
+ });
142
+ }), ITEMS_LIST.map(function (inputValue) {
143
+ var inputId = "".concat(inputName, "-").concat(inputValue);
144
+ return React__namespace.createElement("label", {
145
+ key: inputValue,
146
+ className: css.label,
147
+ htmlFor: inputId,
148
+ onClick: function (e) {
149
+ return onLabelClick(inputValue, e);
150
+ },
151
+ onMouseEnter: function () {
152
+ return onLabelMouseEnter(inputValue);
153
+ },
154
+ "data-qaid": "rating_select_label_".concat(inputValue),
155
+ "data-testid": "rating_select_label_".concat(inputValue)
156
+ }, React__namespace.createElement(StarFill.SvgStarFill, {
157
+ className: css.icon,
158
+ focusable: false,
159
+ "aria-hidden": true
160
+ }));
161
+ }));
162
+ };
163
+ RatingSelect.displayName = 'RatingSelect';
164
+
165
+ exports.RatingSelect = RatingSelect;
166
+
167
+ require('./style.development.v2.css');
@@ -0,0 +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");
@@ -0,0 +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");
@@ -0,0 +1 @@
1
+ .RatingSelect__root___8RSGF{display:inline-flex;vertical-align:top;font-size:1em;user-seelct:none;position:relative;-webkit-tap-highlight-color:transparent}.RatingSelect__label___FF3m3{transition:transform 100ms ease-in-out 0ms;transform-origin:center;color:var(--black-400);cursor:pointer}.RatingSelect__label___FF3m3:first-of-type{margin-left:-.125em}.RatingSelect__label___FF3m3:last-of-type{margin-right:-.125em}.RatingSelect__icon___1Zpyt{display:block;width:1.25em;height:1em;fill:currentColor;flex-shrink:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none;transition:fill 100ms ease-in-out 0ms,color 100ms ease-in-out 0ms}.RatingSelect__input___25gdX{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.RatingSelect__input___25gdX:checked:nth-of-type(1)~.RatingSelect__label___FF3m3:nth-of-type(-n+1){color:var(--violet-500)}.RatingSelect__input___25gdX:checked:nth-of-type(1):disabled~.RatingSelect__label___FF3m3:nth-of-type(-n+1){color:var(--violet-200)}.RatingSelect__input___25gdX:checked:nth-of-type(2)~.RatingSelect__label___FF3m3:nth-of-type(-n+2){color:var(--violet-500)}.RatingSelect__input___25gdX:checked:nth-of-type(2):disabled~.RatingSelect__label___FF3m3:nth-of-type(-n+2){color:var(--violet-200)}.RatingSelect__input___25gdX:checked:nth-of-type(3)~.RatingSelect__label___FF3m3:nth-of-type(-n+3){color:var(--violet-500)}.RatingSelect__input___25gdX:checked:nth-of-type(3):disabled~.RatingSelect__label___FF3m3:nth-of-type(-n+3){color:var(--violet-200)}.RatingSelect__input___25gdX:checked:nth-of-type(4)~.RatingSelect__label___FF3m3:nth-of-type(-n+4){color:var(--violet-500)}.RatingSelect__input___25gdX:checked:nth-of-type(4):disabled~.RatingSelect__label___FF3m3:nth-of-type(-n+4){color:var(--violet-200)}.RatingSelect__input___25gdX:checked:nth-of-type(5)~.RatingSelect__label___FF3m3:nth-of-type(-n+5){color:var(--violet-500)}.RatingSelect__input___25gdX:checked:nth-of-type(5):disabled~.RatingSelect__label___FF3m3:nth-of-type(-n+5){color:var(--violet-200)}.RatingSelect__input___25gdX:disabled~.RatingSelect__label___FF3m3{pointer-events:none}.RatingSelect__input___25gdX:focus-visible:nth-of-type(1)~.RatingSelect__label___FF3m3:nth-of-type(1){transform:scale(1.2);outline:var(--pds-round-xxs) auto Highlight;outline:var(--pds-round-xxs) auto -webkit-focus-ring-color}.RatingSelect__input___25gdX:focus-visible:nth-of-type(2)~.RatingSelect__label___FF3m3:nth-of-type(2){transform:scale(1.2);outline:var(--pds-round-xxs) auto Highlight;outline:var(--pds-round-xxs) auto -webkit-focus-ring-color}.RatingSelect__input___25gdX:focus-visible:nth-of-type(3)~.RatingSelect__label___FF3m3:nth-of-type(3){transform:scale(1.2);outline:var(--pds-round-xxs) auto Highlight;outline:var(--pds-round-xxs) auto -webkit-focus-ring-color}.RatingSelect__input___25gdX:focus-visible:nth-of-type(4)~.RatingSelect__label___FF3m3:nth-of-type(4){transform:scale(1.2);outline:var(--pds-round-xxs) auto Highlight;outline:var(--pds-round-xxs) auto -webkit-focus-ring-color}.RatingSelect__input___25gdX:focus-visible:nth-of-type(5)~.RatingSelect__label___FF3m3:nth-of-type(5){transform:scale(1.2);outline:var(--pds-round-xxs) auto Highlight;outline:var(--pds-round-xxs) auto -webkit-focus-ring-color}@media (hover){.RatingSelect__hovered___DscdS:hover>.RatingSelect__input___25gdX:not(:disabled)~.RatingSelect__label___FF3m3{transform:scale(1)}.RatingSelect__hovered___DscdS:hover>.RatingSelect__input___25gdX:not(:disabled)~.RatingSelect__label___FF3m3:nth-of-type(n){color:var(--violet-500)}.RatingSelect__hovered___DscdS:hover>.RatingSelect__input___25gdX:not(:disabled)~.RatingSelect__label___FF3m3:hover{transform:scale(1.2)}.RatingSelect__hovered___DscdS:hover>.RatingSelect__input___25gdX:not(:disabled)~.RatingSelect__label___FF3m3:hover~.RatingSelect__label___FF3m3{color:var(--black-400)}}
@@ -0,0 +1 @@
1
+ .RatingSelect__root___V-LdE{display:inline-flex;vertical-align:top;font-size:1em;user-seelct:none;position:relative;-webkit-tap-highlight-color:transparent}.RatingSelect__label___sgjOY{transition:transform 100ms ease-in-out 0ms;transform-origin:center;color:var(--black-400);cursor:pointer}.RatingSelect__label___sgjOY:first-of-type{margin-left:-.125em}.RatingSelect__label___sgjOY:last-of-type{margin-right:-.125em}.RatingSelect__icon___FTT2B{display:block;width:1.25em;height:1em;fill:currentColor;flex-shrink:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none;transition:fill 100ms ease-in-out 0ms,color 100ms ease-in-out 0ms}.RatingSelect__input___DxUIq{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.RatingSelect__input___DxUIq:checked:nth-of-type(1)~.RatingSelect__label___sgjOY:nth-of-type(-n+1){color:var(--violet-500)}.RatingSelect__input___DxUIq:checked:nth-of-type(1):disabled~.RatingSelect__label___sgjOY:nth-of-type(-n+1){color:var(--violet-200)}.RatingSelect__input___DxUIq:checked:nth-of-type(2)~.RatingSelect__label___sgjOY:nth-of-type(-n+2){color:var(--violet-500)}.RatingSelect__input___DxUIq:checked:nth-of-type(2):disabled~.RatingSelect__label___sgjOY:nth-of-type(-n+2){color:var(--violet-200)}.RatingSelect__input___DxUIq:checked:nth-of-type(3)~.RatingSelect__label___sgjOY:nth-of-type(-n+3){color:var(--violet-500)}.RatingSelect__input___DxUIq:checked:nth-of-type(3):disabled~.RatingSelect__label___sgjOY:nth-of-type(-n+3){color:var(--violet-200)}.RatingSelect__input___DxUIq:checked:nth-of-type(4)~.RatingSelect__label___sgjOY:nth-of-type(-n+4){color:var(--violet-500)}.RatingSelect__input___DxUIq:checked:nth-of-type(4):disabled~.RatingSelect__label___sgjOY:nth-of-type(-n+4){color:var(--violet-200)}.RatingSelect__input___DxUIq:checked:nth-of-type(5)~.RatingSelect__label___sgjOY:nth-of-type(-n+5){color:var(--violet-500)}.RatingSelect__input___DxUIq:checked:nth-of-type(5):disabled~.RatingSelect__label___sgjOY:nth-of-type(-n+5){color:var(--violet-200)}.RatingSelect__input___DxUIq:disabled~.RatingSelect__label___sgjOY{pointer-events:none}.RatingSelect__input___DxUIq:focus-visible:nth-of-type(1)~.RatingSelect__label___sgjOY:nth-of-type(1){transform:scale(1.2);outline:var(--pds-round-xxs) auto Highlight;outline:var(--pds-round-xxs) auto -webkit-focus-ring-color}.RatingSelect__input___DxUIq:focus-visible:nth-of-type(2)~.RatingSelect__label___sgjOY:nth-of-type(2){transform:scale(1.2);outline:var(--pds-round-xxs) auto Highlight;outline:var(--pds-round-xxs) auto -webkit-focus-ring-color}.RatingSelect__input___DxUIq:focus-visible:nth-of-type(3)~.RatingSelect__label___sgjOY:nth-of-type(3){transform:scale(1.2);outline:var(--pds-round-xxs) auto Highlight;outline:var(--pds-round-xxs) auto -webkit-focus-ring-color}.RatingSelect__input___DxUIq:focus-visible:nth-of-type(4)~.RatingSelect__label___sgjOY:nth-of-type(4){transform:scale(1.2);outline:var(--pds-round-xxs) auto Highlight;outline:var(--pds-round-xxs) auto -webkit-focus-ring-color}.RatingSelect__input___DxUIq:focus-visible:nth-of-type(5)~.RatingSelect__label___sgjOY:nth-of-type(5){transform:scale(1.2);outline:var(--pds-round-xxs) auto Highlight;outline:var(--pds-round-xxs) auto -webkit-focus-ring-color}@media (hover){.RatingSelect__hovered___LD2kV:hover>.RatingSelect__input___DxUIq:not(:disabled)~.RatingSelect__label___sgjOY{transform:scale(1)}.RatingSelect__hovered___LD2kV:hover>.RatingSelect__input___DxUIq:not(:disabled)~.RatingSelect__label___sgjOY:nth-of-type(n){color:var(--violet-500)}.RatingSelect__hovered___LD2kV:hover>.RatingSelect__input___DxUIq:not(:disabled)~.RatingSelect__label___sgjOY:hover{transform:scale(1.2)}.RatingSelect__hovered___LD2kV:hover>.RatingSelect__input___DxUIq:not(:disabled)~.RatingSelect__label___sgjOY:hover~.RatingSelect__label___sgjOY{color:var(--black-400)}}
@@ -0,0 +1 @@
1
+ ._8RSGF{display:inline-flex;vertical-align:top;font-size:1em;user-seelct:none;position:relative;-webkit-tap-highlight-color:transparent}.FF3m3{transition:transform 100ms ease-in-out 0ms;transform-origin:center;color:var(--black-400);cursor:pointer}.FF3m3:first-of-type{margin-left:-.125em}.FF3m3:last-of-type{margin-right:-.125em}._1Zpyt{display:block;width:1.25em;height:1em;fill:currentColor;flex-shrink:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none;transition:fill 100ms ease-in-out 0ms,color 100ms ease-in-out 0ms}._25gdX{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}._25gdX:checked:nth-of-type(1)~.FF3m3:nth-of-type(-n+1){color:var(--violet-500)}._25gdX:checked:nth-of-type(1):disabled~.FF3m3:nth-of-type(-n+1){color:var(--violet-200)}._25gdX:checked:nth-of-type(2)~.FF3m3:nth-of-type(-n+2){color:var(--violet-500)}._25gdX:checked:nth-of-type(2):disabled~.FF3m3:nth-of-type(-n+2){color:var(--violet-200)}._25gdX:checked:nth-of-type(3)~.FF3m3:nth-of-type(-n+3){color:var(--violet-500)}._25gdX:checked:nth-of-type(3):disabled~.FF3m3:nth-of-type(-n+3){color:var(--violet-200)}._25gdX:checked:nth-of-type(4)~.FF3m3:nth-of-type(-n+4){color:var(--violet-500)}._25gdX:checked:nth-of-type(4):disabled~.FF3m3:nth-of-type(-n+4){color:var(--violet-200)}._25gdX:checked:nth-of-type(5)~.FF3m3:nth-of-type(-n+5){color:var(--violet-500)}._25gdX:checked:nth-of-type(5):disabled~.FF3m3:nth-of-type(-n+5){color:var(--violet-200)}._25gdX:disabled~.FF3m3{pointer-events:none}._25gdX:focus-visible:nth-of-type(1)~.FF3m3:nth-of-type(1){transform:scale(1.2);outline:var(--pds-round-xxs) auto Highlight;outline:var(--pds-round-xxs) auto -webkit-focus-ring-color}._25gdX:focus-visible:nth-of-type(2)~.FF3m3:nth-of-type(2){transform:scale(1.2);outline:var(--pds-round-xxs) auto Highlight;outline:var(--pds-round-xxs) auto -webkit-focus-ring-color}._25gdX:focus-visible:nth-of-type(3)~.FF3m3:nth-of-type(3){transform:scale(1.2);outline:var(--pds-round-xxs) auto Highlight;outline:var(--pds-round-xxs) auto -webkit-focus-ring-color}._25gdX:focus-visible:nth-of-type(4)~.FF3m3:nth-of-type(4){transform:scale(1.2);outline:var(--pds-round-xxs) auto Highlight;outline:var(--pds-round-xxs) auto -webkit-focus-ring-color}._25gdX:focus-visible:nth-of-type(5)~.FF3m3:nth-of-type(5){transform:scale(1.2);outline:var(--pds-round-xxs) auto Highlight;outline:var(--pds-round-xxs) auto -webkit-focus-ring-color}@media (hover){.DscdS:hover>._25gdX:not(:disabled)~.FF3m3{transform:scale(1)}.DscdS:hover>._25gdX:not(:disabled)~.FF3m3:nth-of-type(n){color:var(--violet-500)}.DscdS:hover>._25gdX:not(:disabled)~.FF3m3:hover{transform:scale(1.2)}.DscdS:hover>._25gdX:not(:disabled)~.FF3m3:hover~.FF3m3{color:var(--black-400)}}
@@ -0,0 +1 @@
1
+ .V-LdE{display:inline-flex;vertical-align:top;font-size:1em;user-seelct:none;position:relative;-webkit-tap-highlight-color:transparent}.sgjOY{transition:transform 100ms ease-in-out 0ms;transform-origin:center;color:var(--black-400);cursor:pointer}.sgjOY:first-of-type{margin-left:-.125em}.sgjOY:last-of-type{margin-right:-.125em}.FTT2B{display:block;width:1.25em;height:1em;fill:currentColor;flex-shrink:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none;transition:fill 100ms ease-in-out 0ms,color 100ms ease-in-out 0ms}.DxUIq{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.DxUIq:checked:nth-of-type(1)~.sgjOY:nth-of-type(-n+1){color:var(--violet-500)}.DxUIq:checked:nth-of-type(1):disabled~.sgjOY:nth-of-type(-n+1){color:var(--violet-200)}.DxUIq:checked:nth-of-type(2)~.sgjOY:nth-of-type(-n+2){color:var(--violet-500)}.DxUIq:checked:nth-of-type(2):disabled~.sgjOY:nth-of-type(-n+2){color:var(--violet-200)}.DxUIq:checked:nth-of-type(3)~.sgjOY:nth-of-type(-n+3){color:var(--violet-500)}.DxUIq:checked:nth-of-type(3):disabled~.sgjOY:nth-of-type(-n+3){color:var(--violet-200)}.DxUIq:checked:nth-of-type(4)~.sgjOY:nth-of-type(-n+4){color:var(--violet-500)}.DxUIq:checked:nth-of-type(4):disabled~.sgjOY:nth-of-type(-n+4){color:var(--violet-200)}.DxUIq:checked:nth-of-type(5)~.sgjOY:nth-of-type(-n+5){color:var(--violet-500)}.DxUIq:checked:nth-of-type(5):disabled~.sgjOY:nth-of-type(-n+5){color:var(--violet-200)}.DxUIq:disabled~.sgjOY{pointer-events:none}.DxUIq:focus-visible:nth-of-type(1)~.sgjOY:nth-of-type(1){transform:scale(1.2);outline:var(--pds-round-xxs) auto Highlight;outline:var(--pds-round-xxs) auto -webkit-focus-ring-color}.DxUIq:focus-visible:nth-of-type(2)~.sgjOY:nth-of-type(2){transform:scale(1.2);outline:var(--pds-round-xxs) auto Highlight;outline:var(--pds-round-xxs) auto -webkit-focus-ring-color}.DxUIq:focus-visible:nth-of-type(3)~.sgjOY:nth-of-type(3){transform:scale(1.2);outline:var(--pds-round-xxs) auto Highlight;outline:var(--pds-round-xxs) auto -webkit-focus-ring-color}.DxUIq:focus-visible:nth-of-type(4)~.sgjOY:nth-of-type(4){transform:scale(1.2);outline:var(--pds-round-xxs) auto Highlight;outline:var(--pds-round-xxs) auto -webkit-focus-ring-color}.DxUIq:focus-visible:nth-of-type(5)~.sgjOY:nth-of-type(5){transform:scale(1.2);outline:var(--pds-round-xxs) auto Highlight;outline:var(--pds-round-xxs) auto -webkit-focus-ring-color}@media (hover){.LD2kV:hover>.DxUIq:not(:disabled)~.sgjOY{transform:scale(1)}.LD2kV:hover>.DxUIq:not(:disabled)~.sgjOY:nth-of-type(n){color:var(--violet-500)}.LD2kV:hover>.DxUIq:not(:disabled)~.sgjOY:hover{transform:scale(1.2)}.LD2kV:hover>.DxUIq:not(:disabled)~.sgjOY:hover~.sgjOY{color:var(--black-400)}}
@@ -0,0 +1,18 @@
1
+ import * as React from 'react';
2
+ declare const ITEMS_LIST: readonly [1, 2, 3, 4, 5];
3
+ export type RatingSelectProps = {
4
+ /** Значение рейтинга, от 1 до 5 */
5
+ value?: (typeof ITEMS_LIST)[number];
6
+ /** Имя элемента ввода для использования в форме при отправке данных */
7
+ name?: string;
8
+ /** Функция обратного вызова, которая вызывается при изменении значения рейтинга */
9
+ onChange?: (value?: RatingSelectProps['value']) => void;
10
+ /** Функция обратного вызова, которая вызывается при наведении курсора на элементы рейтинга */
11
+ onHover?: (value?: RatingSelectProps['value']) => void;
12
+ /** Свойство определяет, должен ли быть компонент рейтинга отключен (неактивным) */
13
+ disabled?: boolean;
14
+ /** Hазмер компонента рейтинга */
15
+ size?: string | number;
16
+ };
17
+ export declare const RatingSelect: React.FC<RatingSelectProps>;
18
+ export {};
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
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');
7
+ }
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ if (process.env.NODE_ENV === 'production') {
4
+ module.exports = require('./cjs/index.production.v2.js');
5
+ } else {
6
+ module.exports = require('./cjs/index.development.v2.js');
7
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "@prom-ui/core/RatingSelect",
3
+ "version": "1.2.0",
4
+ "main": "index.js",
5
+ "types": "index.d.ts",
6
+ "sideEffects": [
7
+ "*.css"
8
+ ],
9
+ "dependencies": {
10
+ "classnames": "^2.3.1"
11
+ }
12
+ }
@@ -8,7 +8,7 @@ var errcatch = require('@evo/errcatch');
8
8
  var Box = require('@prom-ui/core/Box');
9
9
  var Button = require('@prom-ui/core/Button');
10
10
  var Text = require('@prom-ui/core/Text');
11
- var BodyProvider = require('@prom-ui/core/BodyProvider');
11
+ var useBodyTTag = require('@prom-ui/core/useBodyTTag');
12
12
 
13
13
  function _interopNamespaceCompat(e) {
14
14
  if (e && typeof e === 'object' && 'default' in e) return e;
@@ -78,7 +78,7 @@ var css = {"root":"SafeQuery__root___RWb3q"};
78
78
  var SafeQueryError = function (_a) {
79
79
  var componentErrorName = _a.componentErrorName,
80
80
  onReload = _a.onReload;
81
- var t = BodyProvider.useBodyLocale().t;
81
+ var t = useBodyTTag.useBodyTTag().t;
82
82
  var _b = React.useState(false),
83
83
  isHidden = _b[0],
84
84
  setHidden = _b[1];
@@ -8,7 +8,7 @@ var errcatch = require('@evo/errcatch');
8
8
  var Box = require('@prom-ui/core/Box');
9
9
  var Button = require('@prom-ui/core/Button');
10
10
  var Text = require('@prom-ui/core/Text');
11
- var BodyProvider = require('@prom-ui/core/BodyProvider');
11
+ var useBodyTTag = require('@prom-ui/core/useBodyTTag');
12
12
 
13
13
  function _interopNamespaceCompat(e) {
14
14
  if (e && typeof e === 'object' && 'default' in e) return e;
@@ -78,7 +78,7 @@ var css = {"root":"SafeQuery__root___IHinP"};
78
78
  var SafeQueryError = function (_a) {
79
79
  var componentErrorName = _a.componentErrorName,
80
80
  onReload = _a.onReload;
81
- var t = BodyProvider.useBodyLocale().t;
81
+ var t = useBodyTTag.useBodyTTag().t;
82
82
  var _b = React.useState(false),
83
83
  isHidden = _b[0],
84
84
  setHidden = _b[1];
@@ -1 +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"),l=require("@prom-ui/core/BodyProvider");function i(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 c=i(e),u=function(){return u=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},u.apply(this,arguments)};function f(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var d,p,m,s="RWb3q",b=function(t){var r=t.componentErrorName,i=t.onReload,u=l.useBodyLocale().t,b=e.useState(!1),h=b[0],x=b[1];return h?null:"production"!==process.env.NODE_ENV?"undefined"==typeof window?null:c.default.createElement(n.Box,{className:s,"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"},u(d||(d=f(["Возникла ошибка:"],["Возникла ошибка:"])))," ",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:i,title:u(p||(p=f(["Обновить"],["Обновить"])))},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 x(!0)},title:u(m||(m=f(["Скрыть"],["Скрыть"])))},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=c.useState(!1),f=i[0],d=i[1];if(c.useEffect((function(){f&&d(!1)}),[f]),f)return null;var p=c.createElement(b,{componentErrorName:o,onReload:function(){return d(!0)}});return c.createElement(r.ErrCatch,{name:o,errorComponent:p},c.createElement(t.Query,u({},l),(function(e){var t=e.error;if(t)throw t;return a(e)})))},require("./style.production.css");
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"),l=require("@prom-ui/core/useBodyTTag");function i(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 c=i(e),u=function(){return u=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},u.apply(this,arguments)};function f(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var d,p,s,m="RWb3q",b=function(t){var r=t.componentErrorName,i=t.onReload,u=l.useBodyTTag().t,b=e.useState(!1),h=b[0],g=b[1];return h?null:"production"!==process.env.NODE_ENV?"undefined"==typeof window?null:c.default.createElement(n.Box,{className:m,"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"},u(d||(d=f(["Возникла ошибка:"],["Возникла ошибка:"])))," ",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:i,title:u(p||(p=f(["Обновить"],["Обновить"])))},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 g(!0)},title:u(s||(s=f(["Скрыть"],["Скрыть"])))},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=c.useState(!1),f=i[0],d=i[1];if(c.useEffect((function(){f&&d(!1)}),[f]),f)return null;var p=c.createElement(b,{componentErrorName:o,onReload:function(){return d(!0)}});return c.createElement(r.ErrCatch,{name:o,errorComponent:p},c.createElement(t.Query,u({},l),(function(e){var t=e.error;if(t)throw t;return a(e)})))},require("./style.production.css");