rox-react-components 0.0.36 → 0.0.37

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 +1 @@
1
- import{__rest as t,__assign as o}from"tslib";import{css as e}from"aphrodite/no-important";import r,{useRef as i,useMemo as l,useCallback as n,useEffect as c}from"react";import a from"./styles.js";var d=["relative","absolute","fixed"],s=function(s){var u=s.children,f=s.style,p=void 0===f?{}:f,m=s.block,v=void 0!==m&&m,h=s.className,b=void 0===h?"":h,g=s.radius,y=void 0===g?4:g,C=s.bg,k=void 0===C?"rgba(0,0,0,.7)":C,x=s.color,w=void 0===x?"#ffffff":x,N=s.onClick,T=s.wavesColor,E=void 0===T?"rgba(255,255,255,.3)":T,R=t(s,["children","style","block","className","radius","bg","color","onClick","wavesColor"]),j=i([]),B=i(null),H=l((function(){return o(o({},p),{overflow:"hidden",borderRadius:y+"px",background:k,color:w})}),[p,y,k,w]),L=n((function(t){null==N||N(t);var o,r=t.currentTarget;j.current.length?o=j.current.shift():(o=document.createElement("div")).classList.add(e(a.ripple));var i=r.getBoundingClientRect();o.style.width=o.style.height=Math.max(i.width,i.height)+"px",o.style.backgroundColor=E,r.appendChild(o);var l=t.pageY-i.top-o.offsetHeight/2-document.body.scrollTop+"px",n=t.pageX-i.left-o.offsetWidth/2-document.body.scrollTop+"px";o.style.top=l,o.style.left=n,o.onanimationend=function(){r.removeChild(o),j.current.push(o)}}),[N,E]);return c((function(){if(B.current){var t=getComputedStyle(B.current);d.includes(t.position)||(B.current.style.position="relative")}}),[]),r.createElement("button",o({},R,{className:"".concat(b," ").concat(e(a.button)," ").concat(v?e(a.block):""),style:H,ref:B,onClick:L}),u)};export{s as default};
1
+ import{__rest as t,__assign as e}from"tslib";import{css as o}from"aphrodite/no-important";import r,{useRef as i,useMemo as n,useCallback as l,useEffect as a}from"react";import c from"./styles.js";var s=["relative","absolute","fixed"],d=function(d){var u=d.children,f=d.style,p=void 0===f?{}:f,v=d.block,m=void 0!==v&&v,h=d.className,g=void 0===h?"":h,b=d.radius,y=void 0===b?4:b,C=d.bg,k=void 0===C?"rgba(0,0,0,.7)":C,x=d.color,w=void 0===x?"#ffffff":x,N=d.onClick,E=d.wavesColor,R=void 0===E?"rgba(255,255,255,.3)":E,j=t(d,["children","style","block","className","radius","bg","color","onClick","wavesColor"]),B=i([]),H=i(null),L=n((function(){return e(e({},p),{overflow:"hidden",borderRadius:y+"px",background:k,color:w})}),[p,y,k,w]),M=l((function(t){null==N||N(t);var e,r=t.currentTarget;B.current.length?e=B.current.shift():(e=document.createElement("div")).classList.add(o(c.ripple));var i=r.getBoundingClientRect();e.style.width=e.style.height=Math.max(i.width,i.height)+"px",e.style.backgroundColor=R,r.appendChild(e);var n=t.pageY-i.top-e.offsetHeight/2+"px",l=t.pageX-i.left-e.offsetWidth/2+"px";e.style.top=n,e.style.left=l,e.onanimationend=function(){r.removeChild(e),B.current.push(e)}}),[N,R]);return a((function(){if(H.current){var t=getComputedStyle(H.current);s.includes(t.position)||(H.current.style.position="relative")}}),[]),r.createElement("button",e({},j,{className:"".concat(g," ").concat(o(c.button)," ").concat(m?o(c.block):""),style:L,ref:H,onClick:M}),u)};export{d as default};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("aphrodite/no-important"),o=require("react"),r=require("./styles.js"),l=["relative","absolute","fixed"];exports.default=function(s){var i=s.children,n=s.style,a=void 0===n?{}:n,c=s.block,u=void 0!==c&&c,d=s.className,f=void 0===d?"":d,p=s.radius,v=void 0===p?4:p,g=s.bg,b=void 0===g?"rgba(0,0,0,.7)":g,h=s.color,m=void 0===h?"#ffffff":h,y=s.onClick,C=s.wavesColor,_=void 0===C?"rgba(255,255,255,.3)":C,k=e.__rest(s,["children","style","block","className","radius","bg","color","onClick","wavesColor"]),x=o.useRef([]),w=o.useRef(null),q=o.useMemo((function(){return e.__assign(e.__assign({},a),{overflow:"hidden",borderRadius:v+"px",background:b,color:m})}),[a,v,b,m]),R=o.useCallback((function(e){null==y||y(e);var o,l=e.currentTarget;x.current.length?o=x.current.shift():(o=document.createElement("div")).classList.add(t.css(r.default.ripple));var s=l.getBoundingClientRect();o.style.width=o.style.height=Math.max(s.width,s.height)+"px",o.style.backgroundColor=_,l.appendChild(o);var i=e.pageY-s.top-o.offsetHeight/2-document.body.scrollTop+"px",n=e.pageX-s.left-o.offsetWidth/2-document.body.scrollTop+"px";o.style.top=i,o.style.left=n,o.onanimationend=function(){l.removeChild(o),x.current.push(o)}}),[y,_]);return o.useEffect((function(){if(w.current){var e=getComputedStyle(w.current);l.includes(e.position)||(w.current.style.position="relative")}}),[]),o.createElement("button",e.__assign({},k,{className:"".concat(f," ").concat(t.css(r.default.button)," ").concat(u?t.css(r.default.block):""),style:q,ref:w,onClick:R}),i)};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("aphrodite/no-important"),r=require("react"),o=require("./styles.js"),i=["relative","absolute","fixed"];exports.default=function(s){var l=s.children,n=s.style,a=void 0===n?{}:n,c=s.block,u=void 0!==c&&c,d=s.className,f=void 0===d?"":d,p=s.radius,v=void 0===p?4:p,g=s.bg,h=void 0===g?"rgba(0,0,0,.7)":g,b=s.color,m=void 0===b?"#ffffff":b,y=s.onClick,C=s.wavesColor,_=void 0===C?"rgba(255,255,255,.3)":C,k=e.__rest(s,["children","style","block","className","radius","bg","color","onClick","wavesColor"]),x=r.useRef([]),w=r.useRef(null),q=r.useMemo((function(){return e.__assign(e.__assign({},a),{overflow:"hidden",borderRadius:v+"px",background:h,color:m})}),[a,v,h,m]),R=r.useCallback((function(e){null==y||y(e);var r,i=e.currentTarget;x.current.length?r=x.current.shift():(r=document.createElement("div")).classList.add(t.css(o.default.ripple));var s=i.getBoundingClientRect();r.style.width=r.style.height=Math.max(s.width,s.height)+"px",r.style.backgroundColor=_,i.appendChild(r);var l=e.pageY-s.top-r.offsetHeight/2+"px",n=e.pageX-s.left-r.offsetWidth/2+"px";r.style.top=l,r.style.left=n,r.onanimationend=function(){i.removeChild(r),x.current.push(r)}}),[y,_]);return r.useEffect((function(){if(w.current){var e=getComputedStyle(w.current);i.includes(e.position)||(w.current.style.position="relative")}}),[]),r.createElement("button",e.__assign({},k,{className:"".concat(f," ").concat(t.css(o.default.button)," ").concat(u?t.css(o.default.block):""),style:q,ref:w,onClick:R}),l)};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rox-react-components",
3
- "version": "0.0.36",
3
+ "version": "0.0.37",
4
4
  "main": "dist/lib/index.js",
5
5
  "module": "dist/es/index.js",
6
6
  "types": "dist/index.d.ts",