@aristobyte-ui/utils 2.8.1 → 2.9.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.
@@ -1,3 +1,4 @@
1
+ import * as React from 'react';
1
2
  type RippleParamsRef = HTMLButtonElement | HTMLAnchorElement;
2
3
  export type RippleParams<HTMLElementType extends RippleParamsRef> = {
3
4
  ref: React.RefObject<HTMLElementType | null>;
@@ -3,15 +3,15 @@ export var renderRipple = function (_a) {
3
3
  var button = ref.current;
4
4
  if (!button)
5
5
  return;
6
- var circle = document.createElement("span");
6
+ var circle = document.createElement('span');
7
7
  var diameter = Math.max(button.clientWidth, button.clientHeight);
8
8
  var radius = diameter / 2;
9
- circle.id = "ripple";
10
- var style = document.createElement("style");
9
+ circle.id = 'ripple';
10
+ var style = document.createElement('style');
11
11
  style.innerHTML = "\n #ripple {\n animation: ripple 300ms linear;\n background-color: rgba(255, 255, 255, 0.3);\n border-radius: 50%;\n height: ".concat(diameter, "px;\n left: ").concat(clientX - button.getBoundingClientRect().left - radius, "px;\n pointer-events: none;\n position: absolute;\n top: ").concat(clientY - button.getBoundingClientRect().top - radius, "px;\n transform: scale(0);\n width: ").concat(diameter, "px;\n z-index: 0;\n }\n \n @keyframes ripple {\n to {\n opacity: 0;\n transform: scale(2);\n }\n }\n ");
12
12
  button.appendChild(style);
13
13
  button.appendChild(circle);
14
- circle.addEventListener("animationend", function () {
14
+ circle.addEventListener('animationend', function () {
15
15
  circle.remove();
16
16
  style.remove();
17
17
  });