@purr-react-styled-components/components.loading-ripple 0.0.7 → 0.0.9
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/dist/index.cjs +54 -1
- package/dist/index.d.cts +14 -0
- package/dist/index.d.ts +14 -2
- package/dist/index.js +54 -37
- package/package.json +4 -2
- package/dist/_components.d.ts +0 -4
- package/dist/_style.d.ts +0 -9
- package/dist/_types.d.ts +0 -10
package/dist/index.cjs
CHANGED
|
@@ -1 +1,54 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';var s=require('clsx'),i=require('react'),l=require('styled-components');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var s__default=/*#__PURE__*/_interopDefault(s);var i__default=/*#__PURE__*/_interopDefault(i);var l__default=/*#__PURE__*/_interopDefault(l);var d=p=>l.keyframes`
|
|
2
|
+
0% {
|
|
3
|
+
top: ${p*.5}px;
|
|
4
|
+
left: ${p*.5}px;
|
|
5
|
+
width: 0;
|
|
6
|
+
height: 0;
|
|
7
|
+
opacity: 0;
|
|
8
|
+
}
|
|
9
|
+
4.9% {
|
|
10
|
+
top: ${p*.5}px;
|
|
11
|
+
left: ${p*.5}px;
|
|
12
|
+
width: 0;
|
|
13
|
+
height: 0;
|
|
14
|
+
opacity: 0;
|
|
15
|
+
}
|
|
16
|
+
5% {
|
|
17
|
+
top: ${p*.5}px;
|
|
18
|
+
left: ${p*.5}px;
|
|
19
|
+
width: 0;
|
|
20
|
+
height: 0;
|
|
21
|
+
opacity: 1;
|
|
22
|
+
}
|
|
23
|
+
100% {
|
|
24
|
+
top: 0px;
|
|
25
|
+
left: 0px;
|
|
26
|
+
width: ${p}px;
|
|
27
|
+
height: ${p}px;
|
|
28
|
+
opacity: 0;
|
|
29
|
+
}
|
|
30
|
+
`,o={Container:l__default.default.span`
|
|
31
|
+
display: flex;
|
|
32
|
+
align-items: center;
|
|
33
|
+
justify-content: center;
|
|
34
|
+
width: ${({$fullScreen:p})=>p?"100vw":"100%"};
|
|
35
|
+
height: ${({$fullScreen:p})=>p?"100vh":"100%"};
|
|
36
|
+
`,Ripple:l__default.default.span`
|
|
37
|
+
display: inline-block;
|
|
38
|
+
position: relative;
|
|
39
|
+
width: ${({$size:p})=>`${p+8}px`};
|
|
40
|
+
height: ${({$size:p})=>`${p+8}px`};
|
|
41
|
+
|
|
42
|
+
span {
|
|
43
|
+
position: absolute;
|
|
44
|
+
border: 4px solid ${({$color:p})=>p};
|
|
45
|
+
opacity: 1;
|
|
46
|
+
border-radius: 50%;
|
|
47
|
+
animation: ${({$size:p})=>d(p)} 1s cubic-bezier(0, 0.2, 0.8, 1)
|
|
48
|
+
infinite;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
span:nth-child(2) {
|
|
52
|
+
animation-delay: -0.5s;
|
|
53
|
+
}
|
|
54
|
+
`};var f=({size:p=80,color:t="#000000",fullScreen:e=false,className:n,htmlAttributes:r})=>i__default.default.createElement(o.Container,{...r,$fullScreen:e,className:s__default.default("loading-ripple",`loading-ripple--size-${p}`,`loading-ripple--color-${t}`,e&&"loading-ripple--fullScreen",n)},i__default.default.createElement(o.Ripple,{$size:p,$color:t,className:"loading-ripple-inner"},i__default.default.createElement("span",null),i__default.default.createElement("span",null)));exports.LoadingRipple=f;
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React, { HTMLAttributes } from 'react';
|
|
2
|
+
import { IExtendable } from '@purr-core/utils.definitions';
|
|
3
|
+
|
|
4
|
+
interface ILoadingRippleProps {
|
|
5
|
+
size?: number;
|
|
6
|
+
color?: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
fullScreen?: boolean;
|
|
9
|
+
htmlAttributes?: HTMLAttributes<HTMLSpanElement> & IExtendable;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
declare const LoadingRipple: ({ size, color, fullScreen, className, htmlAttributes, }: ILoadingRippleProps) => React.JSX.Element;
|
|
13
|
+
|
|
14
|
+
export { type ILoadingRippleProps, LoadingRipple };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import React, { HTMLAttributes } from 'react';
|
|
2
|
+
import { IExtendable } from '@purr-core/utils.definitions';
|
|
3
|
+
|
|
4
|
+
interface ILoadingRippleProps {
|
|
5
|
+
size?: number;
|
|
6
|
+
color?: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
fullScreen?: boolean;
|
|
9
|
+
htmlAttributes?: HTMLAttributes<HTMLSpanElement> & IExtendable;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
declare const LoadingRipple: ({ size, color, fullScreen, className, htmlAttributes, }: ILoadingRippleProps) => React.JSX.Element;
|
|
13
|
+
|
|
14
|
+
export { type ILoadingRippleProps, LoadingRipple };
|
package/dist/index.js
CHANGED
|
@@ -1,37 +1,54 @@
|
|
|
1
|
-
import
|
|
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
|
-
|
|
1
|
+
import s from'clsx';import i from'react';import l,{keyframes}from'styled-components';var d=p=>keyframes`
|
|
2
|
+
0% {
|
|
3
|
+
top: ${p*.5}px;
|
|
4
|
+
left: ${p*.5}px;
|
|
5
|
+
width: 0;
|
|
6
|
+
height: 0;
|
|
7
|
+
opacity: 0;
|
|
8
|
+
}
|
|
9
|
+
4.9% {
|
|
10
|
+
top: ${p*.5}px;
|
|
11
|
+
left: ${p*.5}px;
|
|
12
|
+
width: 0;
|
|
13
|
+
height: 0;
|
|
14
|
+
opacity: 0;
|
|
15
|
+
}
|
|
16
|
+
5% {
|
|
17
|
+
top: ${p*.5}px;
|
|
18
|
+
left: ${p*.5}px;
|
|
19
|
+
width: 0;
|
|
20
|
+
height: 0;
|
|
21
|
+
opacity: 1;
|
|
22
|
+
}
|
|
23
|
+
100% {
|
|
24
|
+
top: 0px;
|
|
25
|
+
left: 0px;
|
|
26
|
+
width: ${p}px;
|
|
27
|
+
height: ${p}px;
|
|
28
|
+
opacity: 0;
|
|
29
|
+
}
|
|
30
|
+
`,o={Container:l.span`
|
|
31
|
+
display: flex;
|
|
32
|
+
align-items: center;
|
|
33
|
+
justify-content: center;
|
|
34
|
+
width: ${({$fullScreen:p})=>p?"100vw":"100%"};
|
|
35
|
+
height: ${({$fullScreen:p})=>p?"100vh":"100%"};
|
|
36
|
+
`,Ripple:l.span`
|
|
37
|
+
display: inline-block;
|
|
38
|
+
position: relative;
|
|
39
|
+
width: ${({$size:p})=>`${p+8}px`};
|
|
40
|
+
height: ${({$size:p})=>`${p+8}px`};
|
|
41
|
+
|
|
42
|
+
span {
|
|
43
|
+
position: absolute;
|
|
44
|
+
border: 4px solid ${({$color:p})=>p};
|
|
45
|
+
opacity: 1;
|
|
46
|
+
border-radius: 50%;
|
|
47
|
+
animation: ${({$size:p})=>d(p)} 1s cubic-bezier(0, 0.2, 0.8, 1)
|
|
48
|
+
infinite;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
span:nth-child(2) {
|
|
52
|
+
animation-delay: -0.5s;
|
|
53
|
+
}
|
|
54
|
+
`};var f=({size:p=80,color:t="#000000",fullScreen:e=false,className:n,htmlAttributes:r})=>i.createElement(o.Container,{...r,$fullScreen:e,className:s("loading-ripple",`loading-ripple--size-${p}`,`loading-ripple--color-${t}`,e&&"loading-ripple--fullScreen",n)},i.createElement(o.Ripple,{$size:p,$color:t,className:"loading-ripple-inner"},i.createElement("span",null),i.createElement("span",null)));export{f as LoadingRipple};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@purr-react-styled-components/components.loading-ripple",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"react": "*",
|
|
26
26
|
"styled-components": "*",
|
|
27
27
|
"clsx": "*",
|
|
28
|
-
"@purr-core/utils.definitions": "0.0.
|
|
28
|
+
"@purr-core/utils.definitions": "0.0.12"
|
|
29
29
|
},
|
|
30
30
|
"author": "@DinhThienPhuc",
|
|
31
31
|
"license": "ISC",
|
|
@@ -34,6 +34,8 @@
|
|
|
34
34
|
"scripts": {
|
|
35
35
|
"dev": "vite build --watch",
|
|
36
36
|
"build": "tsc && vite build",
|
|
37
|
+
"build:vite": "tsc && vite build",
|
|
38
|
+
"build:tsup": "tsup",
|
|
37
39
|
"lint": "eslint . --ext ts,tsx --max-warnings 0"
|
|
38
40
|
}
|
|
39
41
|
}
|
package/dist/_components.d.ts
DELETED
package/dist/_style.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare const Styled: {
|
|
2
|
-
Container: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
|
|
3
|
-
$fullScreen: boolean;
|
|
4
|
-
}>> & string;
|
|
5
|
-
Ripple: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
|
|
6
|
-
$size: number;
|
|
7
|
-
$color: string;
|
|
8
|
-
}>> & string;
|
|
9
|
-
};
|
package/dist/_types.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { HTMLAttributes } from 'react';
|
|
2
|
-
import { IExtendable } from '@purr-core/utils.definitions';
|
|
3
|
-
|
|
4
|
-
export interface ILoadingRippleProps {
|
|
5
|
-
size?: number;
|
|
6
|
-
color?: string;
|
|
7
|
-
className?: string;
|
|
8
|
-
fullScreen?: boolean;
|
|
9
|
-
htmlAttributes?: HTMLAttributes<HTMLSpanElement> & IExtendable;
|
|
10
|
-
}
|