@rc-component/progress 1.0.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.
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
+ var _default = ({
10
+ id,
11
+ loading
12
+ }) => {
13
+ if (!loading) {
14
+ return {
15
+ indeterminateStyleProps: {},
16
+ indeterminateStyleAnimation: null
17
+ };
18
+ }
19
+ const animationName = `${id}-indeterminate-animate`;
20
+ return {
21
+ indeterminateStyleProps: {
22
+ transform: 'rotate(0deg)',
23
+ animation: `${animationName} 1s linear infinite`
24
+ },
25
+ indeterminateStyleAnimation: /*#__PURE__*/_react.default.createElement("style", null, `@keyframes ${animationName} {
26
+ 0% { transform: rotate(0deg); }
27
+ 100% { transform: rotate(360deg); }
28
+ }`)
29
+ };
30
+ };
31
+ exports.default = _default;
@@ -0,0 +1,25 @@
1
+ import type { StrokeLinecapType } from "../interface";
2
+ import React from 'react';
3
+ interface IndeterminateOption {
4
+ id: string;
5
+ loading: boolean;
6
+ percent: number;
7
+ strokeLinecap: StrokeLinecapType;
8
+ strokeWidth: number;
9
+ }
10
+ declare const _default: (options: IndeterminateOption) => {
11
+ indeterminateStyleProps: {
12
+ strokeDasharray?: undefined;
13
+ animation?: undefined;
14
+ strokeDashoffset?: undefined;
15
+ };
16
+ indeterminateStyleAnimation: any;
17
+ } | {
18
+ indeterminateStyleProps: {
19
+ strokeDasharray: string;
20
+ animation: string;
21
+ strokeDashoffset: number;
22
+ };
23
+ indeterminateStyleAnimation: React.JSX.Element;
24
+ };
25
+ export default _default;
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
+ var _default = options => {
10
+ const {
11
+ id,
12
+ percent,
13
+ strokeLinecap,
14
+ strokeWidth,
15
+ loading
16
+ } = options;
17
+ if (!loading) {
18
+ return {
19
+ indeterminateStyleProps: {},
20
+ indeterminateStyleAnimation: null
21
+ };
22
+ }
23
+ const animationName = `${id}-indeterminate-animate`;
24
+ const strokeDashOffset = 100 - (percent + (strokeLinecap === 'round' ? strokeWidth : 0));
25
+ return {
26
+ indeterminateStyleProps: {
27
+ strokeDasharray: `${percent} 100`,
28
+ animation: `${animationName} .6s linear alternate infinite`,
29
+ strokeDashoffset: 0
30
+ },
31
+ indeterminateStyleAnimation: /*#__PURE__*/_react.default.createElement("style", null, `@keyframes ${animationName} {
32
+ 0% { stroke-dashoffset: 0; }
33
+ 100% { stroke-dashoffset: -${strokeDashOffset};
34
+ }`)
35
+ };
36
+ };
37
+ exports.default = _default;
package/package.json ADDED
@@ -0,0 +1,73 @@
1
+ {
2
+ "name": "@rc-component/progress",
3
+ "version": "1.0.0",
4
+ "description": "progress ui component for react",
5
+ "keywords": [
6
+ "react",
7
+ "react-component",
8
+ "react-progress",
9
+ "progress"
10
+ ],
11
+ "homepage": "http://github.com/react-component/progress",
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "git@github.com:react-component/progress.git"
15
+ },
16
+ "bugs": {
17
+ "url": "http://github.com/react-component/progress/issues"
18
+ },
19
+ "license": "MIT",
20
+ "main": "./lib/index",
21
+ "module": "./es/index",
22
+ "files": [
23
+ "lib",
24
+ "es"
25
+ ],
26
+ "scripts": {
27
+ "start": "dumi dev",
28
+ "docs:build": "dumi build",
29
+ "docs:deploy": "gh-pages -d dist",
30
+ "deploy": "npm run docs:build && npm run docs:deploy",
31
+ "compile": "father build",
32
+ "prepare": "dumi setup",
33
+ "gh-pages": "npm run now-build && father doc deploy",
34
+ "prepublishOnly": "npm run compile && rc-np",
35
+ "lint": "eslint src/ --ext .ts,.tsx,.jsx,.js",
36
+ "prettier": "prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"",
37
+ "test": "rc-test",
38
+ "tsc": "tsc --noEmit",
39
+ "coverage": "father test --coverage",
40
+ "now-build": "npm run docs:build"
41
+ },
42
+ "peerDependencies": {
43
+ "react": ">=16.9.0",
44
+ "react-dom": ">=16.9.0"
45
+ },
46
+ "dependencies": {
47
+ "@rc-component/util": "^1.2.1",
48
+ "classnames": "^2.2.6"
49
+ },
50
+ "devDependencies": {
51
+ "@rc-component/father-plugin": "^2.0.4",
52
+ "@rc-component/np": "^1.0.4",
53
+ "@testing-library/react": "^13.0.0",
54
+ "@types/classnames": "^2.2.9",
55
+ "@types/jest": "^29.4.0",
56
+ "@types/keyv": "3.1.4",
57
+ "@types/react": "^18.0.9",
58
+ "@types/react-dom": "^18.0.3",
59
+ "@umijs/fabric": "^3.0.0",
60
+ "cross-env": "^7.0.0",
61
+ "dumi": "^2.0.0",
62
+ "eslint": "^8.57.0",
63
+ "eslint-plugin-jest": "^27.6.0",
64
+ "eslint-plugin-unicorn": "^50.0.1",
65
+ "father": "^4.0.0",
66
+ "glob": "^8.0.1",
67
+ "prettier": "^3.1.1",
68
+ "rc-test": "^7.0.15",
69
+ "react": "^18.0.0",
70
+ "react-dom": "^18.0.0",
71
+ "typescript": "^5.0.0"
72
+ }
73
+ }