rox-react-components 0.0.35 → 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.
- package/README.md +2 -0
- package/dist/es/Button/Button.d.ts +10 -0
- package/dist/es/Button/Button.js +1 -0
- package/dist/es/Button/index.d.ts +2 -0
- package/dist/es/Button/index.js +1 -0
- package/dist/es/Button/styles.d.ts +6 -0
- package/dist/es/Button/styles.js +1 -0
- package/dist/es/index.d.ts +1 -0
- package/dist/es/index.js +1 -1
- package/dist/index.d.ts +11 -2
- package/dist/lib/Button/Button.d.ts +10 -0
- package/dist/lib/Button/Button.js +1 -0
- package/dist/lib/Button/index.d.ts +2 -0
- package/dist/lib/Button/index.js +1 -0
- package/dist/lib/Button/styles.d.ts +6 -0
- package/dist/lib/Button/styles.js +1 -0
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.js +1 -1
- package/package.json +60 -60
package/README.md
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FC, HTMLAttributes, PropsWithChildren } from 'react';
|
|
2
|
+
interface ButtonProps extends HTMLAttributes<HTMLButtonElement>, PropsWithChildren {
|
|
3
|
+
wavesColor?: string;
|
|
4
|
+
radius?: number;
|
|
5
|
+
bg?: string;
|
|
6
|
+
color?: string;
|
|
7
|
+
block?: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare const Button: FC<ButtonProps>;
|
|
10
|
+
export default Button;
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"./Button.js";export{t as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{StyleSheet as o}from"aphrodite/no-important";var n=o.create({button:{border:"1px solid transparent",boxSizing:"border-box",padding:"8px 20px",cursor:"pointer",outline:"none",":focus":{outline:"none"},":focus-within":{outline:"none"}},block:{display:"block",width:"100%"},ripple:{position:"absolute",borderRadius:"100%",pointerEvents:"none",transform:"scale(0)",opacity:1,animationName:[{to:{opacity:0,transform:"scale(2)","-webkit-transform":"scale(2)"}}],animationDuration:"0.4s",animationTimingFunction:"ease-out"}});export{n as default};
|
package/dist/es/index.d.ts
CHANGED
package/dist/es/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{default as utils}from"./utils.js";export{default as Card}from"./Card/Card.js";export{default as Container}from"./Container/Container.js";export{default as Loading}from"./Loading/Loading.js";export{default as Popup}from"./Popup/Popup.js";export{default as ScrollView}from"./ScrollView/ScrollView.js";export{default as Swiper}from"./Swiper/Swiper.js";
|
|
1
|
+
export{default as utils}from"./utils.js";export{default as Button}from"./Button/Button.js";export{default as Card}from"./Card/Card.js";export{default as Container}from"./Container/Container.js";export{default as Loading}from"./Loading/Loading.js";export{default as Popup}from"./Popup/Popup.js";export{default as ScrollView}from"./ScrollView/ScrollView.js";export{default as Swiper}from"./Swiper/Swiper.js";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { PropsWithChildren, ReactNode, CSSProperties, FC, Component } from 'react';
|
|
1
|
+
import React, { PropsWithChildren, ReactNode, CSSProperties, FC, HTMLAttributes, Component } from 'react';
|
|
2
2
|
|
|
3
3
|
type PopupPosition = 'left' | 'top' | 'right' | 'bottom' | 'center';
|
|
4
4
|
type PopupType = 'slide' | 'fade' | 'scale';
|
|
@@ -40,6 +40,15 @@ declare const _default$2: {
|
|
|
40
40
|
parseUrl: typeof parseUrl;
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
+
interface ButtonProps extends HTMLAttributes<HTMLButtonElement>, PropsWithChildren {
|
|
44
|
+
wavesColor?: string;
|
|
45
|
+
radius?: number;
|
|
46
|
+
bg?: string;
|
|
47
|
+
color?: string;
|
|
48
|
+
block?: boolean;
|
|
49
|
+
}
|
|
50
|
+
declare const Button: FC<ButtonProps>;
|
|
51
|
+
|
|
43
52
|
interface CardProps extends PropsWithChildren {
|
|
44
53
|
expand?: boolean;
|
|
45
54
|
duration?: number;
|
|
@@ -115,4 +124,4 @@ declare module 'react' {
|
|
|
115
124
|
}
|
|
116
125
|
declare const _default: <T extends unknown>(props: SwiperProps<T> & React.RefAttributes<SwiperExposeMethods>) => React.ReactNode;
|
|
117
126
|
|
|
118
|
-
export { Card, Container, Loading, PopupContainer as Popup, type PopupPosition, type PopupType, _default$1 as ScrollView, type ScrollViewExposeMethods, _default as Swiper, type SwiperExposeMethods, type SwiperProps, type ToParams, _default$2 as utils };
|
|
127
|
+
export { Button, Card, Container, Loading, PopupContainer as Popup, type PopupPosition, type PopupType, _default$1 as ScrollView, type ScrollViewExposeMethods, _default as Swiper, type SwiperExposeMethods, type SwiperProps, type ToParams, _default$2 as utils };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FC, HTMLAttributes, PropsWithChildren } from 'react';
|
|
2
|
+
interface ButtonProps extends HTMLAttributes<HTMLButtonElement>, PropsWithChildren {
|
|
3
|
+
wavesColor?: string;
|
|
4
|
+
radius?: number;
|
|
5
|
+
bg?: string;
|
|
6
|
+
color?: string;
|
|
7
|
+
block?: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare const Button: FC<ButtonProps>;
|
|
10
|
+
export default Button;
|
|
@@ -0,0 +1 @@
|
|
|
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)};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./Button.js");exports.default=e.default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var o=require("aphrodite/no-important").StyleSheet.create({button:{border:"1px solid transparent",boxSizing:"border-box",padding:"8px 20px",cursor:"pointer",outline:"none",":focus":{outline:"none"},":focus-within":{outline:"none"}},block:{display:"block",width:"100%"},ripple:{position:"absolute",borderRadius:"100%",pointerEvents:"none",transform:"scale(0)",opacity:1,animationName:[{to:{opacity:0,transform:"scale(2)","-webkit-transform":"scale(2)"}}],animationDuration:"0.4s",animationTimingFunction:"ease-out"}});exports.default=o;
|
package/dist/lib/index.d.ts
CHANGED
package/dist/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("./utils.js"),r=require("./Card/Card.js"),
|
|
1
|
+
"use strict";var e=require("./utils.js"),r=require("./Button/Button.js"),t=require("./Card/Card.js"),u=require("./Container/Container.js"),i=require("./Loading/Loading.js"),o=require("./Popup/Popup.js"),s=require("./ScrollView/ScrollView.js"),a=require("./Swiper/Swiper.js");exports.utils=e.default,exports.Button=r.default,exports.Card=t.default,exports.Container=u.default,exports.Loading=i.default,exports.Popup=o.default,exports.ScrollView=s.default,exports.Swiper=a.default;
|
package/package.json
CHANGED
|
@@ -1,62 +1,62 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
2
|
+
"name": "rox-react-components",
|
|
3
|
+
"version": "0.0.37",
|
|
4
|
+
"main": "dist/lib/index.js",
|
|
5
|
+
"module": "dist/es/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"description": "A React UI Component Library with swiper that support pc and mobile events, and with loading",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"react",
|
|
10
|
+
"slideMenu",
|
|
11
|
+
"card",
|
|
12
|
+
"swiper",
|
|
13
|
+
"mobile swiper",
|
|
14
|
+
"pc swiper",
|
|
15
|
+
"carousel",
|
|
16
|
+
"mobile carousel",
|
|
17
|
+
"ps carousel",
|
|
18
|
+
"loading",
|
|
19
|
+
"container with ratio",
|
|
20
|
+
"react swiper carousel pc mobile touch mouse",
|
|
21
|
+
"touch events swiper",
|
|
22
|
+
"touch events carousel",
|
|
23
|
+
"scrollview reachTop reachBottom reachLeft reachRight"
|
|
24
|
+
],
|
|
25
|
+
"files": [
|
|
26
|
+
"dist",
|
|
27
|
+
"README.md",
|
|
28
|
+
"pakcage.json"
|
|
29
|
+
],
|
|
30
|
+
"engines": {
|
|
31
|
+
"node": ">=14"
|
|
32
|
+
},
|
|
33
|
+
"author": "YangSu.Zhou",
|
|
34
|
+
"scripts": {
|
|
35
|
+
"dev": "cross-env NODE_ENV=development rollup -c -w",
|
|
36
|
+
"build": "cross-env NODE_ENV=production rollup -c"
|
|
37
|
+
},
|
|
38
|
+
"license": "MIT",
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@rollup/plugin-commonjs": "^25.0.7",
|
|
41
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
42
|
+
"@rollup/plugin-strip": "^3.0.4",
|
|
43
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
44
|
+
"@rollup/plugin-typescript": "^11.1.5",
|
|
45
|
+
"@types/node": "^20.8.10",
|
|
46
|
+
"@types/react": "^18.2.35",
|
|
47
|
+
"@types/react-dom": "^18.2.14",
|
|
48
|
+
"cross-env": "^7.0.3",
|
|
49
|
+
"rollup": "^4.3.0",
|
|
50
|
+
"rollup-plugin-delete": "^2.0.0",
|
|
51
|
+
"rollup-plugin-dts": "^6.1.0",
|
|
52
|
+
"rollup-plugin-node-externals": "^6.1.2"
|
|
53
|
+
},
|
|
54
|
+
"peerDependencies": {
|
|
55
|
+
"react": "^18.2.0",
|
|
56
|
+
"react-dom": "^18.2.0"
|
|
57
|
+
},
|
|
58
|
+
"dependencies": {
|
|
59
|
+
"aphrodite": "^2.4.0",
|
|
60
|
+
"tslib": "^2.6.2"
|
|
61
|
+
}
|
|
62
62
|
}
|