rox-react-components 0.0.37 → 0.0.39

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 (69) hide show
  1. package/README.md +1 -1
  2. package/dist/es/Card/Card.js +1 -1
  3. package/dist/es/Popup/Popup.js +1 -1
  4. package/dist/es/Popup/styles.js +1 -1
  5. package/dist/index.d.ts +12 -3
  6. package/dist/lib/Card/Card.js +1 -1
  7. package/dist/lib/Popup/Popup.js +1 -1
  8. package/dist/lib/Popup/styles.js +1 -1
  9. package/package.json +5 -7
  10. package/dist/es/Button/Button.d.ts +0 -10
  11. package/dist/es/Button/index.d.ts +0 -2
  12. package/dist/es/Button/styles.d.ts +0 -6
  13. package/dist/es/Card/Card.d.ts +0 -7
  14. package/dist/es/Card/index.d.ts +0 -2
  15. package/dist/es/Card/styles.d.ts +0 -6
  16. package/dist/es/Container/Container.d.ts +0 -6
  17. package/dist/es/Container/index.d.ts +0 -2
  18. package/dist/es/Container/styles.d.ts +0 -11
  19. package/dist/es/Loading/Inner.d.ts +0 -15
  20. package/dist/es/Loading/Loading.d.ts +0 -17
  21. package/dist/es/Loading/dom.d.ts +0 -7
  22. package/dist/es/Loading/index.d.ts +0 -2
  23. package/dist/es/Loading/styles.d.ts +0 -16
  24. package/dist/es/Loading/type.d.ts +0 -13
  25. package/dist/es/Popup/Popup.d.ts +0 -17
  26. package/dist/es/Popup/index.d.ts +0 -2
  27. package/dist/es/Popup/styles.d.ts +0 -4
  28. package/dist/es/Popup/type.d.ts +0 -2
  29. package/dist/es/ScrollView/ScrollView.d.ts +0 -19
  30. package/dist/es/ScrollView/index.d.ts +0 -2
  31. package/dist/es/ScrollView/styles.d.ts +0 -7
  32. package/dist/es/ScrollView/type.d.ts +0 -8
  33. package/dist/es/Swiper/Swiper.d.ts +0 -7
  34. package/dist/es/Swiper/index.d.ts +0 -2
  35. package/dist/es/Swiper/styles.d.ts +0 -17
  36. package/dist/es/Swiper/type.d.ts +0 -20
  37. package/dist/es/index.d.ts +0 -9
  38. package/dist/es/types.d.ts +0 -3
  39. package/dist/es/utils.d.ts +0 -8
  40. package/dist/lib/Button/Button.d.ts +0 -10
  41. package/dist/lib/Button/index.d.ts +0 -2
  42. package/dist/lib/Button/styles.d.ts +0 -6
  43. package/dist/lib/Card/Card.d.ts +0 -7
  44. package/dist/lib/Card/index.d.ts +0 -2
  45. package/dist/lib/Card/styles.d.ts +0 -6
  46. package/dist/lib/Container/Container.d.ts +0 -6
  47. package/dist/lib/Container/index.d.ts +0 -2
  48. package/dist/lib/Container/styles.d.ts +0 -11
  49. package/dist/lib/Loading/Inner.d.ts +0 -15
  50. package/dist/lib/Loading/Loading.d.ts +0 -17
  51. package/dist/lib/Loading/dom.d.ts +0 -7
  52. package/dist/lib/Loading/index.d.ts +0 -2
  53. package/dist/lib/Loading/styles.d.ts +0 -16
  54. package/dist/lib/Loading/type.d.ts +0 -13
  55. package/dist/lib/Popup/Popup.d.ts +0 -17
  56. package/dist/lib/Popup/index.d.ts +0 -2
  57. package/dist/lib/Popup/styles.d.ts +0 -4
  58. package/dist/lib/Popup/type.d.ts +0 -2
  59. package/dist/lib/ScrollView/ScrollView.d.ts +0 -19
  60. package/dist/lib/ScrollView/index.d.ts +0 -2
  61. package/dist/lib/ScrollView/styles.d.ts +0 -7
  62. package/dist/lib/ScrollView/type.d.ts +0 -8
  63. package/dist/lib/Swiper/Swiper.d.ts +0 -7
  64. package/dist/lib/Swiper/index.d.ts +0 -2
  65. package/dist/lib/Swiper/styles.d.ts +0 -17
  66. package/dist/lib/Swiper/type.d.ts +0 -20
  67. package/dist/lib/index.d.ts +0 -9
  68. package/dist/lib/types.d.ts +0 -3
  69. package/dist/lib/utils.d.ts +0 -8
package/README.md CHANGED
@@ -10,4 +10,4 @@
10
10
 
11
11
  ## Button [Button Demo](https://stackblitz.com/edit/stackblitz-starters-mze3as?file=src%2FApp.tsx)
12
12
 
13
- ## Popup -> Designing
13
+ ## Popup -> [Popup Demo](https://stackblitz.com/edit/stackblitz-starters-zko4zq?file=src%2FApp.tsx)
@@ -1 +1 @@
1
- import{__assign as t}from"tslib";import{css as n}from"aphrodite/no-important";import a,{useMemo as o}from"react";import r from"./styles.js";var i={expand:!1,duration:200},e=function(e){var c=t(t({},i),e),s=c.duration,m=c.expand,d=c.children,l=o((function(){return{transitionDuration:"".concat(s,"ms"),msTransitionDuration:"".concat(s,"ms"),MozTransitionDuration:"".concat(s,"ms"),WebkitTransitionDuration:"".concat(s,"ms")}}),[s]);return a.createElement("div",{style:l,className:"".concat(n(r.collapse)," ").concat(m?n(r.expand):"")},a.createElement("div",{className:n(r.hide0)},d))};export{e as default};
1
+ import{__assign as n}from"tslib";import{css as t}from"aphrodite/no-important";import o,{useMemo as a,useCallback as r}from"react";import i from"./styles.js";var e={expand:!1,duration:200,onClose:function(){return null}},c=function(c){var s=n(n({},e),c),l=s.duration,m=s.expand,u=s.children,d=s.onClose,p=a((function(){return{transitionDuration:"".concat(l,"ms"),msTransitionDuration:"".concat(l,"ms"),MozTransitionDuration:"".concat(l,"ms"),WebkitTransitionDuration:"".concat(l,"ms")}}),[l]),f=r((function(){null==d||d()}),[d]);return o.createElement("div",{onBlur:f,style:p,className:"".concat(t(i.collapse)," ").concat(m?t(i.expand):""),tabIndex:-1},o.createElement("div",{className:t(i.hide0)},u))};export{c as default};
@@ -1 +1 @@
1
- import{__assign as r}from"tslib";import{css as t}from"aphrodite/no-important";import e,{useRef as o,useEffect as n,useState as i}from"react";import{createPortal as a}from"react-dom";import m from"./styles.js";var u={visible:!1,position:"bottom",duration:300,bg:"rgba(0,0,0,.3)",maskClosable:!0,popupType:"slide"};function c(r){var o=r.bg;r.visible,r.duration;var n=i(!1);return n[0],n[1],e.createElement("div",{style:{"--bg":o},className:t(m.container)})}function l(t){var i=r(r({},u),t),m=o(document.createElement("div"));return n((function(){var r=m.current;return document.body.appendChild(r),function(){document.body.removeChild(r)}}),[]),m.current?a(e.createElement(c,r({},i)),m.current):null}export{l as default};
1
+ import{__assign as t}from"tslib";import e,{useRef as n,useCallback as i,useEffect as o,useState as r,useMemo as a}from"react";import{createPortal as l}from"react-dom";import{css as s}from"aphrodite/no-important";import c,{animateStyles as u}from"./styles.js";var f={visible:!1,position:"bottom",duration:200,bg:"rgba(0,0,0,.35)",maskClosable:!0,popupType:"fade",onClose:function(){return null},contentClassName:"",contentStyle:{},scale:[.2],curve:"linear"};function m(n){var l=n.bg,f=n.visible,m=n.duration,d=n.inject,p=n.dispose,_=n.maskClosable,y=n.onClose,b=n.children,v=n.position,g=n.contentStyle,C=n.contentClassName,h=n.popupType,j=n.scale,E=n.curve,x=r(f),I=x[0],N=x[1],k=r(!1),A=k[0],S=k[1];o((function(){N(f),f&&(p(),d(),S(!0))}),[f]),o((function(){return function(){S(!1),p()}}),[]);var T=i((function(){_&&N(!1)}),[_]),q=i((function(){I||(S(!1),y(),p())}),[I,y]),w=a((function(){return"bottom"===v?{justifyContent:"center",alignItems:"flex-end"}:"top"===v?{justifyContent:"center",alignItems:"flex-start"}:"left"===v?{justifyContent:"flex-start",alignItems:"center"}:"right"===v?{justifyContent:"flex-end",alignItems:"center"}:"center"===v?{justifyContent:"center",alignItems:"center"}:{}}),[v]),z=a((function(){if("slide"===h){if("top"===v)return I?c.slide_in_top:c.slide_out_top;if("bottom"===v)return I?c.slide_in_bottom:c.slide_out_bottom;if("left"===v)return I?c.slide_in_left:c.slide_out_left;if("right"===v)return I?c.slide_in_right:c.slide_out_right}else if("scale"===h&&Array.isArray(j)&&j.length>=1){var t=u(j);return I?t.scale_in:t.scale_out}return I?c.fade_in:c.fade_out}),[h,v,I,j]);return A?e.createElement("div",{style:t({"--bg":l,"--duration":m+"ms","--curve":E},w),className:s(c.container)},e.createElement("div",{onClick:T,onAnimationEnd:q,className:s(c.mask,c.animation_properties,I?c.fade_in:c.fade_out)}),e.createElement("div",{style:g,className:"".concat(C," ").concat(s(c.animation_properties,z))},b)):null}function d(r){var a=t(t({},f),r),s=n(document.createElement("div")),c=i((function(){document.body.appendChild(s.current)}),[]),u=i((function(){try{document.body.removeChild(s.current)}catch(t){}}),[]);return o((function(){return function(){return u()}}),[]),l(e.createElement(m,t({},a,{inject:c,dispose:u})),s.current)}export{d as default};
@@ -1 +1 @@
1
- import{StyleSheet as o}from"aphrodite/no-important";var t=o.create({container:{position:"fixed",width:"100%",height:"100%",top:0,left:0,zIndex:99,backgroundColor:"var(--bg)"}});export{t as default};
1
+ import{__assign as t}from"tslib";import{StyleSheet as a}from"aphrodite/no-important";function n(t){return{from:{opacity:t?0:1},to:{opacity:t?1:0}}}function i(t,a){var n="0",i="0";return t?(n=a?"-100%":"100%",i="0"):(n="0",i=a?"-100%":"100%"),{from:{transform:"translate3d(0, ".concat(n,", 0)")},to:{transform:"translate3d(0, ".concat(i,", 0)")}}}function o(t,a){var n="0",i="0";return t?(n=a?"-100%":"100%",i="0"):(n="0",i=a?"-100%":"100%"),{from:{transform:"translate3d(".concat(n,", 0, 0)")},to:{transform:"translate3d(".concat(i,", 0, 0)")}}}var e=a.create({container:{position:"absolute",display:"flex",width:"100%",height:"100%",top:0,left:0,zIndex:99},mask:{position:"absolute",top:0,left:0,width:"100%",height:"100%",zIndex:-10,backgroundColor:"var(--bg)"},animation_properties:{animationFillMode:"forwards",animationTimingFunction:"var(--curve)",animationDuration:"var(--duration)"},fade_in:{animationName:[n(!0)]},fade_out:{animationName:[n(!1)]},slide_in_top:{animationName:[i(!0,!0)]},slide_out_top:{animationName:[i(!1,!0)]},slide_in_right:{animationName:[o(!0,!1)]},slide_out_right:{animationName:[o(!1,!1)]},slide_in_bottom:{animationName:[i(!0,!1)]},slide_out_bottom:{animationName:[i(!1,!1)]},slide_in_left:{animationName:[o(!0,!0)]},slide_out_left:{animationName:[o(!1,!0)]}}),r=function(n){var i=1===n[n.length-1]?n.slice(0,-1):n,o={},e={};if(i.length){var r=100/i.length;o=t(t({},m({step:"0%",value:i[0]})),m({step:"100%",value:1})),e=t(t({},m({step:"0%",value:1})),m({step:"100%",value:i[0]})),i.forEach((function(t,a){a>0&&(Object.assign(o,m({step:"".concat(r*a,"%"),value:t})),Object.assign(e,m({step:"".concat(r*(n.length-a),"%"),value:t})))}))}return a.create({scale_in:{animationName:[o]},scale_out:{animationName:[e]}})};function m(t){var a;return(a={})[t.step]={transform:"scale3d(".concat(t.value,", ").concat(t.value,", 1)")},a}export{r as animateStyles,e as default};
package/dist/index.d.ts CHANGED
@@ -1,7 +1,8 @@
1
- import React, { PropsWithChildren, ReactNode, CSSProperties, FC, HTMLAttributes, Component } from 'react';
1
+ import React, { CSSProperties, PropsWithChildren, ReactNode, FC, HTMLAttributes, Component } from 'react';
2
2
 
3
3
  type PopupPosition = 'left' | 'top' | 'right' | 'bottom' | 'center';
4
4
  type PopupType = 'slide' | 'fade' | 'scale';
5
+ type AnimationTimingFunction = CSSProperties['animationTimingFunction'];
5
6
 
6
7
  interface ToParams {
7
8
  x?: number;
@@ -52,6 +53,7 @@ declare const Button: FC<ButtonProps>;
52
53
  interface CardProps extends PropsWithChildren {
53
54
  expand?: boolean;
54
55
  duration?: number;
56
+ onClose?: () => any;
55
57
  }
56
58
  declare const Card: FC<CardProps>;
57
59
 
@@ -90,6 +92,8 @@ declare class Loading extends Component<LoadingProps, LoadingState> {
90
92
  declare module 'react' {
91
93
  interface CSSProperties {
92
94
  '--bg'?: string;
95
+ '--duration'?: string;
96
+ '--curve'?: AnimationTimingFunction;
93
97
  }
94
98
  }
95
99
  interface PopupProps extends PropsWithChildren {
@@ -99,8 +103,13 @@ interface PopupProps extends PropsWithChildren {
99
103
  bg?: string;
100
104
  maskClosable?: boolean;
101
105
  popupType?: PopupType;
106
+ onClose?: Function;
107
+ contentClassName?: string;
108
+ contentStyle?: CSSProperties;
109
+ scale?: number[];
110
+ curve?: AnimationTimingFunction;
102
111
  }
103
- declare function PopupContainer(_props: PopupProps): React.ReactPortal | null;
112
+ declare function Popup(_props: PopupProps): React.ReactPortal;
104
113
 
105
114
  interface OnScrollParameters {
106
115
  x?: number;
@@ -124,4 +133,4 @@ declare module 'react' {
124
133
  }
125
134
  declare const _default: <T extends unknown>(props: SwiperProps<T> & React.RefAttributes<SwiperExposeMethods>) => React.ReactNode;
126
135
 
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 };
136
+ export { type AnimationTimingFunction, Button, Card, Container, Loading, Popup, type PopupPosition, type PopupType, _default$1 as ScrollView, type ScrollViewExposeMethods, _default as Swiper, type SwiperExposeMethods, type SwiperProps, type ToParams, _default$2 as utils };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("aphrodite/no-important"),a=require("react"),n=require("./styles.js"),r={expand:!1,duration:200};exports.default=function(s){var i=e.__assign(e.__assign({},r),s),o=i.duration,c=i.expand,u=i.children,d=a.useMemo((function(){return{transitionDuration:"".concat(o,"ms"),msTransitionDuration:"".concat(o,"ms"),MozTransitionDuration:"".concat(o,"ms"),WebkitTransitionDuration:"".concat(o,"ms")}}),[o]);return a.createElement("div",{style:d,className:"".concat(t.css(n.default.collapse)," ").concat(c?t.css(n.default.expand):"")},a.createElement("div",{className:t.css(n.default.hide0)},u))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("aphrodite/no-important"),t=require("react"),a=require("./styles.js"),r={expand:!1,duration:200,onClose:function(){return null}};exports.default=function(s){var o=e.__assign(e.__assign({},r),s),i=o.duration,c=o.expand,u=o.children,l=o.onClose,d=t.useMemo((function(){return{transitionDuration:"".concat(i,"ms"),msTransitionDuration:"".concat(i,"ms"),MozTransitionDuration:"".concat(i,"ms"),WebkitTransitionDuration:"".concat(i,"ms")}}),[i]),m=t.useCallback((function(){null==l||l()}),[l]);return t.createElement("div",{onBlur:m,style:d,className:"".concat(n.css(a.default.collapse)," ").concat(c?n.css(a.default.expand):""),tabIndex:-1},t.createElement("div",{className:n.css(a.default.hide0)},u))};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("aphrodite/no-important"),t=require("react"),n=require("react-dom"),i=require("./styles.js"),a={visible:!1,position:"bottom",duration:300,bg:"rgba(0,0,0,.3)",maskClosable:!0,popupType:"slide"};function u(e){var n=e.bg;e.visible,e.duration;var a=t.useState(!1);return a[0],a[1],t.createElement("div",{style:{"--bg":n},className:r.css(i.default.container)})}exports.default=function(r){var i=e.__assign(e.__assign({},a),r),s=t.useRef(document.createElement("div"));return t.useEffect((function(){var e=s.current;return document.body.appendChild(e),function(){document.body.removeChild(e)}}),[]),s.current?n.createPortal(t.createElement(u,e.__assign({},i)),s.current):null};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react"),n=require("react-dom"),a=require("aphrodite/no-important"),i=require("./styles.js"),r={visible:!1,position:"bottom",duration:200,bg:"rgba(0,0,0,.35)",maskClosable:!0,popupType:"fade",onClose:function(){return null},contentClassName:"",contentStyle:{},scale:[.2],curve:"linear"};function s(n){var r=n.bg,s=n.visible,u=n.duration,l=n.inject,o=n.dispose,c=n.maskClosable,f=n.onClose,d=n.children,m=n.position,_=n.contentStyle,p=n.contentClassName,b=n.popupType,y=n.scale,g=n.curve,C=t.useState(s),v=C[0],h=C[1],j=t.useState(!1),E=j[0],k=j[1];t.useEffect((function(){h(s),s&&(o(),l(),k(!0))}),[s]),t.useEffect((function(){return function(){k(!1),o()}}),[]);var x=t.useCallback((function(){c&&h(!1)}),[c]),q=t.useCallback((function(){v||(k(!1),f(),o())}),[v,f]),I=t.useMemo((function(){return"bottom"===m?{justifyContent:"center",alignItems:"flex-end"}:"top"===m?{justifyContent:"center",alignItems:"flex-start"}:"left"===m?{justifyContent:"flex-start",alignItems:"center"}:"right"===m?{justifyContent:"flex-end",alignItems:"center"}:"center"===m?{justifyContent:"center",alignItems:"center"}:{}}),[m]),N=t.useMemo((function(){if("slide"===b){if("top"===m)return v?i.default.slide_in_top:i.default.slide_out_top;if("bottom"===m)return v?i.default.slide_in_bottom:i.default.slide_out_bottom;if("left"===m)return v?i.default.slide_in_left:i.default.slide_out_left;if("right"===m)return v?i.default.slide_in_right:i.default.slide_out_right}else if("scale"===b&&Array.isArray(y)&&y.length>=1){var e=i.animateStyles(y);return v?e.scale_in:e.scale_out}return v?i.default.fade_in:i.default.fade_out}),[b,m,v,y]);return E?t.createElement("div",{style:e.__assign({"--bg":r,"--duration":u+"ms","--curve":g},I),className:a.css(i.default.container)},t.createElement("div",{onClick:x,onAnimationEnd:q,className:a.css(i.default.mask,i.default.animation_properties,v?i.default.fade_in:i.default.fade_out)}),t.createElement("div",{style:_,className:"".concat(p," ").concat(a.css(i.default.animation_properties,N))},d)):null}exports.default=function(a){var i=e.__assign(e.__assign({},r),a),u=t.useRef(document.createElement("div")),l=t.useCallback((function(){document.body.appendChild(u.current)}),[]),o=t.useCallback((function(){try{document.body.removeChild(u.current)}catch(e){}}),[]);return t.useEffect((function(){return function(){return o()}}),[]),n.createPortal(t.createElement(s,e.__assign({},i,{inject:l,dispose:o})),u.current)};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("aphrodite/no-important").StyleSheet.create({container:{position:"fixed",width:"100%",height:"100%",top:0,left:0,zIndex:99,backgroundColor:"var(--bg)"}});exports.default=e;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("tslib"),a=require("aphrodite/no-important");function e(t){return{from:{opacity:t?0:1},to:{opacity:t?1:0}}}function n(t,a){var e="0",n="0";return t?(e=a?"-100%":"100%",n="0"):(e="0",n=a?"-100%":"100%"),{from:{transform:"translate3d(0, ".concat(e,", 0)")},to:{transform:"translate3d(0, ".concat(n,", 0)")}}}function i(t,a){var e="0",n="0";return t?(e=a?"-100%":"100%",n="0"):(e="0",n=a?"-100%":"100%"),{from:{transform:"translate3d(".concat(e,", 0, 0)")},to:{transform:"translate3d(".concat(n,", 0, 0)")}}}var o=a.StyleSheet.create({container:{position:"absolute",display:"flex",width:"100%",height:"100%",top:0,left:0,zIndex:99},mask:{position:"absolute",top:0,left:0,width:"100%",height:"100%",zIndex:-10,backgroundColor:"var(--bg)"},animation_properties:{animationFillMode:"forwards",animationTimingFunction:"var(--curve)",animationDuration:"var(--duration)"},fade_in:{animationName:[e(!0)]},fade_out:{animationName:[e(!1)]},slide_in_top:{animationName:[n(!0,!0)]},slide_out_top:{animationName:[n(!1,!0)]},slide_in_right:{animationName:[i(!0,!1)]},slide_out_right:{animationName:[i(!1,!1)]},slide_in_bottom:{animationName:[n(!0,!1)]},slide_out_bottom:{animationName:[n(!1,!1)]},slide_in_left:{animationName:[i(!0,!0)]},slide_out_left:{animationName:[i(!1,!0)]}});function r(t){var a;return(a={})[t.step]={transform:"scale3d(".concat(t.value,", ").concat(t.value,", 1)")},a}exports.animateStyles=function(e){var n=1===e[e.length-1]?e.slice(0,-1):e,i={},o={};if(n.length){var s=100/n.length;i=t.__assign(t.__assign({},r({step:"0%",value:n[0]})),r({step:"100%",value:1})),o=t.__assign(t.__assign({},r({step:"0%",value:1})),r({step:"100%",value:n[0]})),n.forEach((function(t,a){a>0&&(Object.assign(i,r({step:"".concat(s*a,"%"),value:t})),Object.assign(o,r({step:"".concat(s*(e.length-a),"%"),value:t})))}))}return a.StyleSheet.create({scale_in:{animationName:[i]},scale_out:{animationName:[o]}})},exports.default=o;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rox-react-components",
3
- "version": "0.0.37",
3
+ "version": "0.0.39",
4
4
  "main": "dist/lib/index.js",
5
5
  "module": "dist/es/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -20,7 +20,8 @@
20
20
  "react swiper carousel pc mobile touch mouse",
21
21
  "touch events swiper",
22
22
  "touch events carousel",
23
- "scrollview reachTop reachBottom reachLeft reachRight"
23
+ "scrollview reachTop reachBottom reachLeft reachRight",
24
+ "popup、modal"
24
25
  ],
25
26
  "files": [
26
27
  "dist",
@@ -31,10 +32,6 @@
31
32
  "node": ">=14"
32
33
  },
33
34
  "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
35
  "license": "MIT",
39
36
  "devDependencies": {
40
37
  "@rollup/plugin-commonjs": "^25.0.7",
@@ -49,7 +46,8 @@
49
46
  "rollup": "^4.3.0",
50
47
  "rollup-plugin-delete": "^2.0.0",
51
48
  "rollup-plugin-dts": "^6.1.0",
52
- "rollup-plugin-node-externals": "^6.1.2"
49
+ "rollup-plugin-node-externals": "^6.1.2",
50
+ "typescript": "^5.3.3"
53
51
  },
54
52
  "peerDependencies": {
55
53
  "react": "^18.2.0",
@@ -1,10 +0,0 @@
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;
@@ -1,2 +0,0 @@
1
- import Button from './Button';
2
- export default Button;
@@ -1,6 +0,0 @@
1
- declare const styles: {
2
- button: object;
3
- block: object;
4
- ripple: object;
5
- };
6
- export default styles;
@@ -1,7 +0,0 @@
1
- import { FC, PropsWithChildren } from 'react';
2
- interface CardProps extends PropsWithChildren {
3
- expand?: boolean;
4
- duration?: number;
5
- }
6
- declare const Card: FC<CardProps>;
7
- export default Card;
@@ -1,2 +0,0 @@
1
- import Card from './Card';
2
- export default Card;
@@ -1,6 +0,0 @@
1
- declare const styles: {
2
- collapse: object;
3
- expand: object;
4
- hide0: object;
5
- };
6
- export default styles;
@@ -1,6 +0,0 @@
1
- import { FC, PropsWithChildren } from 'react';
2
- interface ContainerProps extends PropsWithChildren {
3
- ratio?: number;
4
- }
5
- declare const Container: FC<ContainerProps>;
6
- export default Container;
@@ -1,2 +0,0 @@
1
- import Container from './Container';
2
- export default Container;
@@ -1,11 +0,0 @@
1
- declare const styles: {
2
- relative: object;
3
- absolute: object;
4
- top_0: object;
5
- left_0: object;
6
- w_full: object;
7
- h_full: object;
8
- h_0: object;
9
- border_box: object;
10
- };
11
- export default styles;
@@ -1,15 +0,0 @@
1
- import { FC } from 'react';
2
- import { LoadingProps } from './type';
3
- declare module 'react' {
4
- interface CSSProperties {
5
- '--delay'?: string;
6
- '--width'?: string;
7
- '--height'?: string;
8
- '--bg'?: string;
9
- '--margin'?: string;
10
- }
11
- }
12
- declare const Inner: FC<{
13
- style: LoadingProps['loadingStyle'];
14
- }>;
15
- export default Inner;
@@ -1,17 +0,0 @@
1
- import { Component, ReactNode } from 'react';
2
- import { LoadingProps } from './type';
3
- interface LoadingState {
4
- }
5
- declare class Loading extends Component<LoadingProps, LoadingState> {
6
- state: Readonly<LoadingState>;
7
- static defaultProps: LoadingProps;
8
- private static el;
9
- static show(options?: Pick<LoadingProps, 'bg' | 'loadingStyle' | 'customLoading'>): void;
10
- static hide(): void;
11
- render(): ReactNode;
12
- static getDerivedStateFromProps(props: LoadingProps, state: LoadingState): null;
13
- getSnapshotBeforeUpdate(prevProps: Readonly<LoadingProps>, prevState: Readonly<LoadingState>): null;
14
- componentDidUpdate(prevProps: Readonly<LoadingProps>, prevState: Readonly<LoadingState>, snapshot?: any): void;
15
- componentWillUnmount(): void;
16
- }
17
- export default Loading;
@@ -1,7 +0,0 @@
1
- declare function addClass<T extends HTMLElement>(el: T, cls: string): void;
2
- declare function removeClass<T extends HTMLElement>(el: T, cls: string): void;
3
- declare const _default: {
4
- addClass: typeof addClass;
5
- removeClass: typeof removeClass;
6
- };
7
- export default _default;
@@ -1,2 +0,0 @@
1
- import Loading from './Loading';
2
- export default Loading;
@@ -1,16 +0,0 @@
1
- declare const styles: {
2
- relative: object;
3
- center: object;
4
- absolute: object;
5
- top_0: object;
6
- left_0: object;
7
- w_full: object;
8
- h_full: object;
9
- border_box: object;
10
- z_99: object;
11
- inner_box: object;
12
- inner_box_item: object;
13
- fixed: object;
14
- page_hide: object;
15
- };
16
- export default styles;
@@ -1,13 +0,0 @@
1
- import { PropsWithChildren, ReactNode } from 'react';
2
- export interface LoadingProps extends PropsWithChildren {
3
- visible?: boolean;
4
- bg?: string;
5
- customLoading?: ReactNode;
6
- loadingStyle?: {
7
- width?: string;
8
- height?: string;
9
- bg?: string;
10
- margin?: string;
11
- };
12
- }
13
- export declare const initLoadingStyle: LoadingProps['loadingStyle'];
@@ -1,17 +0,0 @@
1
- import React, { PropsWithChildren } from 'react';
2
- import { PopupPosition, PopupType } from './type';
3
- declare module 'react' {
4
- interface CSSProperties {
5
- '--bg'?: string;
6
- }
7
- }
8
- interface PopupProps extends PropsWithChildren {
9
- visible?: boolean;
10
- position?: PopupPosition;
11
- duration?: number;
12
- bg?: string;
13
- maskClosable?: boolean;
14
- popupType?: PopupType;
15
- }
16
- declare function PopupContainer(_props: PopupProps): React.ReactPortal | null;
17
- export default PopupContainer;
@@ -1,2 +0,0 @@
1
- import Popup from './Popup';
2
- export default Popup;
@@ -1,4 +0,0 @@
1
- declare const styles: {
2
- container: object;
3
- };
4
- export default styles;
@@ -1,2 +0,0 @@
1
- export type PopupPosition = 'left' | 'top' | 'right' | 'bottom' | 'center';
2
- export type PopupType = 'slide' | 'fade' | 'scale';
@@ -1,19 +0,0 @@
1
- import React, { CSSProperties, PropsWithChildren } from 'react';
2
- import { ScrollViewExposeMethods } from './type';
3
- interface OnScrollParameters {
4
- x?: number;
5
- y?: number;
6
- }
7
- interface ScrollViewProps extends PropsWithChildren {
8
- style?: CSSProperties;
9
- horizontal?: boolean;
10
- vertical?: boolean;
11
- onScroll?: (position: OnScrollParameters) => void;
12
- threshold?: number;
13
- onReachTop?: (done: Function) => void;
14
- onReachBottom?: (done: Function) => void;
15
- onReachLeft?: (done: Function) => void;
16
- onReachRight?: (done: Function) => void;
17
- }
18
- declare const _default: (props: ScrollViewProps & React.RefAttributes<ScrollViewExposeMethods>) => React.ReactNode;
19
- export default _default;
@@ -1,2 +0,0 @@
1
- import ScrollView from './ScrollView';
2
- export default ScrollView;
@@ -1,7 +0,0 @@
1
- declare const styles: {
2
- border_box: object;
3
- w_full: object;
4
- h_full: object;
5
- scroll_bar_hide: object;
6
- };
7
- export default styles;
@@ -1,8 +0,0 @@
1
- export interface ToParams {
2
- x?: number;
3
- y?: number;
4
- animation?: boolean;
5
- }
6
- export interface ScrollViewExposeMethods {
7
- to: (data?: ToParams) => void;
8
- }
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- import { SwiperExposeMethods, SwiperProps } from './type';
3
- declare module 'react' {
4
- function forwardRef<T, P = {}>(render: (props: P, ref: React.Ref<T>) => React.ReactNode | null): (props: P & React.RefAttributes<T>) => React.ReactNode | null;
5
- }
6
- declare const _default: <T extends unknown>(props: SwiperProps<T> & React.RefAttributes<SwiperExposeMethods>) => React.ReactNode;
7
- export default _default;
@@ -1,2 +0,0 @@
1
- import Swiper from './Swiper';
2
- export default Swiper;
@@ -1,17 +0,0 @@
1
- declare const styles: {
2
- relative: object;
3
- absolute: object;
4
- w_full: object;
5
- border_box: object;
6
- overflow_hidden: object;
7
- flex: object;
8
- nowrap: object;
9
- flex_1: object;
10
- item_center: object;
11
- justify_center: object;
12
- left_0: object;
13
- bottom_20: object;
14
- style_none: object;
15
- gap: object;
16
- };
17
- export default styles;
@@ -1,20 +0,0 @@
1
- import { CSSProperties, PropsWithChildren, ReactNode } from 'react';
2
- export interface SwiperProps<T> extends PropsWithChildren {
3
- data: T[];
4
- renderItem: (item: T) => ReactNode;
5
- onChange?: (index: number) => void;
6
- boundary?: number;
7
- duration?: number;
8
- delay?: number;
9
- autoPlay?: boolean;
10
- active?: number;
11
- dotVisible?: boolean;
12
- renderDots?: ReactNode;
13
- dotBoxStyle?: CSSProperties;
14
- dotStyle?: CSSProperties;
15
- activeDotStyle?: CSSProperties;
16
- }
17
- export interface SwiperExposeMethods {
18
- next: () => any;
19
- pre: () => any;
20
- }
@@ -1,9 +0,0 @@
1
- export * from './types';
2
- export { default as utils } from './utils';
3
- export { default as Button } from './Button';
4
- export { default as Card } from './Card';
5
- export { default as Container } from './Container';
6
- export { default as Loading } from './Loading';
7
- export { default as Popup } from './Popup';
8
- export { default as ScrollView } from './ScrollView';
9
- export { default as Swiper } from './Swiper';
@@ -1,3 +0,0 @@
1
- export * from './Popup/type';
2
- export * from './ScrollView/type';
3
- export * from './Swiper/type';
@@ -1,8 +0,0 @@
1
- declare function sleep(timestamp?: number, result?: boolean): Promise<boolean>;
2
- type parseUrlResponse = Record<string, string | (string | boolean)[] | boolean> | string | boolean | (string | boolean)[] | undefined;
3
- declare function parseUrl(key?: string): parseUrlResponse;
4
- declare const _default: {
5
- sleep: typeof sleep;
6
- parseUrl: typeof parseUrl;
7
- };
8
- export default _default;
@@ -1,10 +0,0 @@
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;
@@ -1,2 +0,0 @@
1
- import Button from './Button';
2
- export default Button;
@@ -1,6 +0,0 @@
1
- declare const styles: {
2
- button: object;
3
- block: object;
4
- ripple: object;
5
- };
6
- export default styles;
@@ -1,7 +0,0 @@
1
- import { FC, PropsWithChildren } from 'react';
2
- interface CardProps extends PropsWithChildren {
3
- expand?: boolean;
4
- duration?: number;
5
- }
6
- declare const Card: FC<CardProps>;
7
- export default Card;
@@ -1,2 +0,0 @@
1
- import Card from './Card';
2
- export default Card;
@@ -1,6 +0,0 @@
1
- declare const styles: {
2
- collapse: object;
3
- expand: object;
4
- hide0: object;
5
- };
6
- export default styles;
@@ -1,6 +0,0 @@
1
- import { FC, PropsWithChildren } from 'react';
2
- interface ContainerProps extends PropsWithChildren {
3
- ratio?: number;
4
- }
5
- declare const Container: FC<ContainerProps>;
6
- export default Container;
@@ -1,2 +0,0 @@
1
- import Container from './Container';
2
- export default Container;
@@ -1,11 +0,0 @@
1
- declare const styles: {
2
- relative: object;
3
- absolute: object;
4
- top_0: object;
5
- left_0: object;
6
- w_full: object;
7
- h_full: object;
8
- h_0: object;
9
- border_box: object;
10
- };
11
- export default styles;
@@ -1,15 +0,0 @@
1
- import { FC } from 'react';
2
- import { LoadingProps } from './type';
3
- declare module 'react' {
4
- interface CSSProperties {
5
- '--delay'?: string;
6
- '--width'?: string;
7
- '--height'?: string;
8
- '--bg'?: string;
9
- '--margin'?: string;
10
- }
11
- }
12
- declare const Inner: FC<{
13
- style: LoadingProps['loadingStyle'];
14
- }>;
15
- export default Inner;
@@ -1,17 +0,0 @@
1
- import { Component, ReactNode } from 'react';
2
- import { LoadingProps } from './type';
3
- interface LoadingState {
4
- }
5
- declare class Loading extends Component<LoadingProps, LoadingState> {
6
- state: Readonly<LoadingState>;
7
- static defaultProps: LoadingProps;
8
- private static el;
9
- static show(options?: Pick<LoadingProps, 'bg' | 'loadingStyle' | 'customLoading'>): void;
10
- static hide(): void;
11
- render(): ReactNode;
12
- static getDerivedStateFromProps(props: LoadingProps, state: LoadingState): null;
13
- getSnapshotBeforeUpdate(prevProps: Readonly<LoadingProps>, prevState: Readonly<LoadingState>): null;
14
- componentDidUpdate(prevProps: Readonly<LoadingProps>, prevState: Readonly<LoadingState>, snapshot?: any): void;
15
- componentWillUnmount(): void;
16
- }
17
- export default Loading;
@@ -1,7 +0,0 @@
1
- declare function addClass<T extends HTMLElement>(el: T, cls: string): void;
2
- declare function removeClass<T extends HTMLElement>(el: T, cls: string): void;
3
- declare const _default: {
4
- addClass: typeof addClass;
5
- removeClass: typeof removeClass;
6
- };
7
- export default _default;
@@ -1,2 +0,0 @@
1
- import Loading from './Loading';
2
- export default Loading;
@@ -1,16 +0,0 @@
1
- declare const styles: {
2
- relative: object;
3
- center: object;
4
- absolute: object;
5
- top_0: object;
6
- left_0: object;
7
- w_full: object;
8
- h_full: object;
9
- border_box: object;
10
- z_99: object;
11
- inner_box: object;
12
- inner_box_item: object;
13
- fixed: object;
14
- page_hide: object;
15
- };
16
- export default styles;
@@ -1,13 +0,0 @@
1
- import { PropsWithChildren, ReactNode } from 'react';
2
- export interface LoadingProps extends PropsWithChildren {
3
- visible?: boolean;
4
- bg?: string;
5
- customLoading?: ReactNode;
6
- loadingStyle?: {
7
- width?: string;
8
- height?: string;
9
- bg?: string;
10
- margin?: string;
11
- };
12
- }
13
- export declare const initLoadingStyle: LoadingProps['loadingStyle'];
@@ -1,17 +0,0 @@
1
- import React, { PropsWithChildren } from 'react';
2
- import { PopupPosition, PopupType } from './type';
3
- declare module 'react' {
4
- interface CSSProperties {
5
- '--bg'?: string;
6
- }
7
- }
8
- interface PopupProps extends PropsWithChildren {
9
- visible?: boolean;
10
- position?: PopupPosition;
11
- duration?: number;
12
- bg?: string;
13
- maskClosable?: boolean;
14
- popupType?: PopupType;
15
- }
16
- declare function PopupContainer(_props: PopupProps): React.ReactPortal | null;
17
- export default PopupContainer;
@@ -1,2 +0,0 @@
1
- import Popup from './Popup';
2
- export default Popup;
@@ -1,4 +0,0 @@
1
- declare const styles: {
2
- container: object;
3
- };
4
- export default styles;
@@ -1,2 +0,0 @@
1
- export type PopupPosition = 'left' | 'top' | 'right' | 'bottom' | 'center';
2
- export type PopupType = 'slide' | 'fade' | 'scale';
@@ -1,19 +0,0 @@
1
- import React, { CSSProperties, PropsWithChildren } from 'react';
2
- import { ScrollViewExposeMethods } from './type';
3
- interface OnScrollParameters {
4
- x?: number;
5
- y?: number;
6
- }
7
- interface ScrollViewProps extends PropsWithChildren {
8
- style?: CSSProperties;
9
- horizontal?: boolean;
10
- vertical?: boolean;
11
- onScroll?: (position: OnScrollParameters) => void;
12
- threshold?: number;
13
- onReachTop?: (done: Function) => void;
14
- onReachBottom?: (done: Function) => void;
15
- onReachLeft?: (done: Function) => void;
16
- onReachRight?: (done: Function) => void;
17
- }
18
- declare const _default: (props: ScrollViewProps & React.RefAttributes<ScrollViewExposeMethods>) => React.ReactNode;
19
- export default _default;
@@ -1,2 +0,0 @@
1
- import ScrollView from './ScrollView';
2
- export default ScrollView;
@@ -1,7 +0,0 @@
1
- declare const styles: {
2
- border_box: object;
3
- w_full: object;
4
- h_full: object;
5
- scroll_bar_hide: object;
6
- };
7
- export default styles;
@@ -1,8 +0,0 @@
1
- export interface ToParams {
2
- x?: number;
3
- y?: number;
4
- animation?: boolean;
5
- }
6
- export interface ScrollViewExposeMethods {
7
- to: (data?: ToParams) => void;
8
- }
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- import { SwiperExposeMethods, SwiperProps } from './type';
3
- declare module 'react' {
4
- function forwardRef<T, P = {}>(render: (props: P, ref: React.Ref<T>) => React.ReactNode | null): (props: P & React.RefAttributes<T>) => React.ReactNode | null;
5
- }
6
- declare const _default: <T extends unknown>(props: SwiperProps<T> & React.RefAttributes<SwiperExposeMethods>) => React.ReactNode;
7
- export default _default;
@@ -1,2 +0,0 @@
1
- import Swiper from './Swiper';
2
- export default Swiper;
@@ -1,17 +0,0 @@
1
- declare const styles: {
2
- relative: object;
3
- absolute: object;
4
- w_full: object;
5
- border_box: object;
6
- overflow_hidden: object;
7
- flex: object;
8
- nowrap: object;
9
- flex_1: object;
10
- item_center: object;
11
- justify_center: object;
12
- left_0: object;
13
- bottom_20: object;
14
- style_none: object;
15
- gap: object;
16
- };
17
- export default styles;
@@ -1,20 +0,0 @@
1
- import { CSSProperties, PropsWithChildren, ReactNode } from 'react';
2
- export interface SwiperProps<T> extends PropsWithChildren {
3
- data: T[];
4
- renderItem: (item: T) => ReactNode;
5
- onChange?: (index: number) => void;
6
- boundary?: number;
7
- duration?: number;
8
- delay?: number;
9
- autoPlay?: boolean;
10
- active?: number;
11
- dotVisible?: boolean;
12
- renderDots?: ReactNode;
13
- dotBoxStyle?: CSSProperties;
14
- dotStyle?: CSSProperties;
15
- activeDotStyle?: CSSProperties;
16
- }
17
- export interface SwiperExposeMethods {
18
- next: () => any;
19
- pre: () => any;
20
- }
@@ -1,9 +0,0 @@
1
- export * from './types';
2
- export { default as utils } from './utils';
3
- export { default as Button } from './Button';
4
- export { default as Card } from './Card';
5
- export { default as Container } from './Container';
6
- export { default as Loading } from './Loading';
7
- export { default as Popup } from './Popup';
8
- export { default as ScrollView } from './ScrollView';
9
- export { default as Swiper } from './Swiper';
@@ -1,3 +0,0 @@
1
- export * from './Popup/type';
2
- export * from './ScrollView/type';
3
- export * from './Swiper/type';
@@ -1,8 +0,0 @@
1
- declare function sleep(timestamp?: number, result?: boolean): Promise<boolean>;
2
- type parseUrlResponse = Record<string, string | (string | boolean)[] | boolean> | string | boolean | (string | boolean)[] | undefined;
3
- declare function parseUrl(key?: string): parseUrlResponse;
4
- declare const _default: {
5
- sleep: typeof sleep;
6
- parseUrl: typeof parseUrl;
7
- };
8
- export default _default;