@tecsinapse/cortex-react 1.7.0-beta.2 → 1.7.0-beta.3
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/cjs/components/ProgressBar/Progress.js +27 -0
- package/dist/cjs/components/ProgressBar/ProgressBar.js +5 -32
- package/dist/cjs/components/Uploader/Upload.js +1 -1
- package/dist/cjs/styles/progressBar.js +15 -30
- package/dist/esm/components/ProgressBar/Progress.js +25 -0
- package/dist/esm/components/ProgressBar/ProgressBar.js +6 -33
- package/dist/esm/components/Uploader/Upload.js +1 -1
- package/dist/esm/styles/progressBar.js +15 -29
- package/dist/types/components/ProgressBar/Progress.d.ts +8 -0
- package/dist/types/components/ProgressBar/ProgressBar.d.ts +4 -8
- package/dist/types/styles/progressBar.d.ts +64 -135
- package/package.json +2 -2
- package/dist/cjs/components/ProgressBar/ProgressBarInfinite.js +0 -15
- package/dist/cjs/components/ProgressBar/ProgressBarSegments.js +0 -48
- package/dist/esm/components/ProgressBar/ProgressBarInfinite.js +0 -13
- package/dist/esm/components/ProgressBar/ProgressBarSegments.js +0 -46
- package/dist/types/components/ProgressBar/ProgressBarInfinite.d.ts +0 -6
- package/dist/types/components/ProgressBar/ProgressBarSegments.d.ts +0 -9
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
require('../../styles/calendar-cell.js');
|
|
5
|
+
require('../../styles/groupButton.js');
|
|
6
|
+
var progressBar = require('../../styles/progressBar.js');
|
|
7
|
+
|
|
8
|
+
const { container, bar, progress } = progressBar.ProgressVariants();
|
|
9
|
+
const Progress = ({
|
|
10
|
+
value,
|
|
11
|
+
intent = "default",
|
|
12
|
+
infinite
|
|
13
|
+
}) => {
|
|
14
|
+
return /* @__PURE__ */ React.createElement("div", { className: container(), "data-testid": "linear-progress" }, /* @__PURE__ */ React.createElement("div", { className: bar() }, /* @__PURE__ */ React.createElement(
|
|
15
|
+
"div",
|
|
16
|
+
{
|
|
17
|
+
style: {
|
|
18
|
+
width: !infinite ? `${value}%` : void 0,
|
|
19
|
+
transition: !infinite ? "width 0.5s ease" : void 0
|
|
20
|
+
},
|
|
21
|
+
"data-testid": "progress-filled",
|
|
22
|
+
className: progress({ intent, infinite })
|
|
23
|
+
}
|
|
24
|
+
)));
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
exports.Progress = Progress;
|
|
@@ -1,41 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
|
-
var
|
|
5
|
-
var ProgressBarSegments = require('./ProgressBarSegments.js');
|
|
4
|
+
var Progress = require('./Progress.js');
|
|
6
5
|
|
|
7
6
|
const ProgressBar = ({
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
valueCurrent = 50,
|
|
12
|
-
intentProgress = "default",
|
|
13
|
-
type = "default",
|
|
14
|
-
animated = true
|
|
7
|
+
value = 50,
|
|
8
|
+
intent = "default",
|
|
9
|
+
infinite = false
|
|
15
10
|
}) => {
|
|
16
|
-
|
|
17
|
-
const [showAnimation, setShowAnimation] = React.useState(true);
|
|
18
|
-
React.useEffect(() => {
|
|
19
|
-
const timeout = setTimeout(() => {
|
|
20
|
-
if (valueCurrent < displayedValue) {
|
|
21
|
-
setShowAnimation(false);
|
|
22
|
-
}
|
|
23
|
-
if (animated && valueCurrent > displayedValue) setShowAnimation(true);
|
|
24
|
-
setDisplayedValue(valueCurrent);
|
|
25
|
-
}, 0);
|
|
26
|
-
return () => clearTimeout(timeout);
|
|
27
|
-
}, [valueCurrent]);
|
|
28
|
-
const totalProgress = (displayedValue - valueMin) / (valueMax - valueMin) * 100;
|
|
29
|
-
const segments = Math.max(1, _segments);
|
|
30
|
-
return type === "infinite" ? /* @__PURE__ */ React.createElement(ProgressBarInfinite.ProgressBarInfinite, { intentProgress }) : /* @__PURE__ */ React.createElement(
|
|
31
|
-
ProgressBarSegments.ProgressBarSegments,
|
|
32
|
-
{
|
|
33
|
-
segments,
|
|
34
|
-
totalProgress,
|
|
35
|
-
intentProgress,
|
|
36
|
-
showAnimation
|
|
37
|
-
}
|
|
38
|
-
);
|
|
11
|
+
return /* @__PURE__ */ React.createElement(Progress.Progress, { value, intent, infinite });
|
|
39
12
|
};
|
|
40
13
|
|
|
41
14
|
exports.ProgressBar = ProgressBar;
|
|
@@ -25,7 +25,7 @@ const File = ({ file, index, onDelete }) => {
|
|
|
25
25
|
})
|
|
26
26
|
},
|
|
27
27
|
/* @__PURE__ */ React.createElement(md.MdClose, { size: 20 })
|
|
28
|
-
)), /* @__PURE__ */ React.createElement(ProgressBar.ProgressBar, {
|
|
28
|
+
)), /* @__PURE__ */ React.createElement(ProgressBar.ProgressBar, { intent: "info", infinite: file.status !== "success" }));
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
exports.File = File;
|
|
@@ -2,51 +2,36 @@
|
|
|
2
2
|
|
|
3
3
|
var tailwindVariants = require('tailwind-variants');
|
|
4
4
|
|
|
5
|
-
const
|
|
6
|
-
base: "h-full first:rounded-l-pill last:rounded-r-pill",
|
|
7
|
-
variants: {
|
|
8
|
-
intentProgress: {
|
|
9
|
-
default: "bg-primary-medium",
|
|
10
|
-
error: "bg-error-medium",
|
|
11
|
-
info: "bg-info-medium",
|
|
12
|
-
warning: "bg-warning-medium",
|
|
13
|
-
success: "bg-success-medium",
|
|
14
|
-
uploading: ""
|
|
15
|
-
},
|
|
16
|
-
showAnimation: {
|
|
17
|
-
true: "transition-[width] duration-1000 ease-linear"
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
const progressBarInfiniteVariants = tailwindVariants.tv({
|
|
5
|
+
const ProgressVariants = tailwindVariants.tv({
|
|
22
6
|
slots: {
|
|
23
7
|
container: "relative mb-mili",
|
|
24
|
-
bar: "h-1.5 w-full overflow-hidden",
|
|
25
|
-
progress: "w-full h-full
|
|
8
|
+
bar: "h-1.5 w-full overflow-hidden bg-secondary-xlight",
|
|
9
|
+
progress: "w-full h-full rounded-mili"
|
|
26
10
|
},
|
|
27
11
|
variants: {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
progress: "bg-
|
|
31
|
-
},
|
|
32
|
-
success: {
|
|
33
|
-
progress: "bg-success-medium"
|
|
12
|
+
intent: {
|
|
13
|
+
default: {
|
|
14
|
+
progress: "bg-primary-medium"
|
|
34
15
|
},
|
|
35
16
|
error: {
|
|
36
17
|
progress: "bg-error-medium"
|
|
37
18
|
},
|
|
38
|
-
default: {
|
|
39
|
-
progress: "bg-primary-medium"
|
|
40
|
-
},
|
|
41
19
|
info: {
|
|
42
20
|
progress: "bg-info-medium"
|
|
43
21
|
},
|
|
44
22
|
warning: {
|
|
45
23
|
progress: "bg-warning-medium"
|
|
24
|
+
},
|
|
25
|
+
success: {
|
|
26
|
+
progress: "bg-success-medium"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
infinite: {
|
|
30
|
+
true: {
|
|
31
|
+
progress: "animate-progress origin-left-right"
|
|
46
32
|
}
|
|
47
33
|
}
|
|
48
34
|
}
|
|
49
35
|
});
|
|
50
36
|
|
|
51
|
-
exports.
|
|
52
|
-
exports.progressBarInfiniteVariants = progressBarInfiniteVariants;
|
|
37
|
+
exports.ProgressVariants = ProgressVariants;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import '../../styles/calendar-cell.js';
|
|
3
|
+
import '../../styles/groupButton.js';
|
|
4
|
+
import { ProgressVariants } from '../../styles/progressBar.js';
|
|
5
|
+
|
|
6
|
+
const { container, bar, progress } = ProgressVariants();
|
|
7
|
+
const Progress = ({
|
|
8
|
+
value,
|
|
9
|
+
intent = "default",
|
|
10
|
+
infinite
|
|
11
|
+
}) => {
|
|
12
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: container(), "data-testid": "linear-progress" }, /* @__PURE__ */ React__default.createElement("div", { className: bar() }, /* @__PURE__ */ React__default.createElement(
|
|
13
|
+
"div",
|
|
14
|
+
{
|
|
15
|
+
style: {
|
|
16
|
+
width: !infinite ? `${value}%` : void 0,
|
|
17
|
+
transition: !infinite ? "width 0.5s ease" : void 0
|
|
18
|
+
},
|
|
19
|
+
"data-testid": "progress-filled",
|
|
20
|
+
className: progress({ intent, infinite })
|
|
21
|
+
}
|
|
22
|
+
)));
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export { Progress };
|
|
@@ -1,39 +1,12 @@
|
|
|
1
|
-
import React__default
|
|
2
|
-
import {
|
|
3
|
-
import { ProgressBarSegments } from './ProgressBarSegments.js';
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { Progress } from './Progress.js';
|
|
4
3
|
|
|
5
4
|
const ProgressBar = ({
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
valueCurrent = 50,
|
|
10
|
-
intentProgress = "default",
|
|
11
|
-
type = "default",
|
|
12
|
-
animated = true
|
|
5
|
+
value = 50,
|
|
6
|
+
intent = "default",
|
|
7
|
+
infinite = false
|
|
13
8
|
}) => {
|
|
14
|
-
|
|
15
|
-
const [showAnimation, setShowAnimation] = useState(true);
|
|
16
|
-
useEffect(() => {
|
|
17
|
-
const timeout = setTimeout(() => {
|
|
18
|
-
if (valueCurrent < displayedValue) {
|
|
19
|
-
setShowAnimation(false);
|
|
20
|
-
}
|
|
21
|
-
if (animated && valueCurrent > displayedValue) setShowAnimation(true);
|
|
22
|
-
setDisplayedValue(valueCurrent);
|
|
23
|
-
}, 0);
|
|
24
|
-
return () => clearTimeout(timeout);
|
|
25
|
-
}, [valueCurrent]);
|
|
26
|
-
const totalProgress = (displayedValue - valueMin) / (valueMax - valueMin) * 100;
|
|
27
|
-
const segments = Math.max(1, _segments);
|
|
28
|
-
return type === "infinite" ? /* @__PURE__ */ React__default.createElement(ProgressBarInfinite, { intentProgress }) : /* @__PURE__ */ React__default.createElement(
|
|
29
|
-
ProgressBarSegments,
|
|
30
|
-
{
|
|
31
|
-
segments,
|
|
32
|
-
totalProgress,
|
|
33
|
-
intentProgress,
|
|
34
|
-
showAnimation
|
|
35
|
-
}
|
|
36
|
-
);
|
|
9
|
+
return /* @__PURE__ */ React__default.createElement(Progress, { value, intent, infinite });
|
|
37
10
|
};
|
|
38
11
|
|
|
39
12
|
export { ProgressBar };
|
|
@@ -23,7 +23,7 @@ const File = ({ file, index, onDelete }) => {
|
|
|
23
23
|
})
|
|
24
24
|
},
|
|
25
25
|
/* @__PURE__ */ React__default.createElement(MdClose, { size: 20 })
|
|
26
|
-
)), /* @__PURE__ */ React__default.createElement(ProgressBar, {
|
|
26
|
+
)), /* @__PURE__ */ React__default.createElement(ProgressBar, { intent: "info", infinite: file.status !== "success" }));
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
export { File };
|
|
@@ -1,49 +1,35 @@
|
|
|
1
1
|
import { tv } from 'tailwind-variants';
|
|
2
2
|
|
|
3
|
-
const
|
|
4
|
-
base: "h-full first:rounded-l-pill last:rounded-r-pill",
|
|
5
|
-
variants: {
|
|
6
|
-
intentProgress: {
|
|
7
|
-
default: "bg-primary-medium",
|
|
8
|
-
error: "bg-error-medium",
|
|
9
|
-
info: "bg-info-medium",
|
|
10
|
-
warning: "bg-warning-medium",
|
|
11
|
-
success: "bg-success-medium",
|
|
12
|
-
uploading: ""
|
|
13
|
-
},
|
|
14
|
-
showAnimation: {
|
|
15
|
-
true: "transition-[width] duration-1000 ease-linear"
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
const progressBarInfiniteVariants = tv({
|
|
3
|
+
const ProgressVariants = tv({
|
|
20
4
|
slots: {
|
|
21
5
|
container: "relative mb-mili",
|
|
22
|
-
bar: "h-1.5 w-full overflow-hidden",
|
|
23
|
-
progress: "w-full h-full
|
|
6
|
+
bar: "h-1.5 w-full overflow-hidden bg-secondary-xlight",
|
|
7
|
+
progress: "w-full h-full rounded-mili"
|
|
24
8
|
},
|
|
25
9
|
variants: {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
progress: "bg-
|
|
29
|
-
},
|
|
30
|
-
success: {
|
|
31
|
-
progress: "bg-success-medium"
|
|
10
|
+
intent: {
|
|
11
|
+
default: {
|
|
12
|
+
progress: "bg-primary-medium"
|
|
32
13
|
},
|
|
33
14
|
error: {
|
|
34
15
|
progress: "bg-error-medium"
|
|
35
16
|
},
|
|
36
|
-
default: {
|
|
37
|
-
progress: "bg-primary-medium"
|
|
38
|
-
},
|
|
39
17
|
info: {
|
|
40
18
|
progress: "bg-info-medium"
|
|
41
19
|
},
|
|
42
20
|
warning: {
|
|
43
21
|
progress: "bg-warning-medium"
|
|
22
|
+
},
|
|
23
|
+
success: {
|
|
24
|
+
progress: "bg-success-medium"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
infinite: {
|
|
28
|
+
true: {
|
|
29
|
+
progress: "animate-progress origin-left-right"
|
|
44
30
|
}
|
|
45
31
|
}
|
|
46
32
|
}
|
|
47
33
|
});
|
|
48
34
|
|
|
49
|
-
export {
|
|
35
|
+
export { ProgressVariants };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface ProgressProps {
|
|
3
|
+
value: number;
|
|
4
|
+
intent?: 'default' | 'success' | 'warning' | 'info' | 'error';
|
|
5
|
+
infinite: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const Progress: ({ value, intent, infinite, }: ProgressProps) => JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export interface ProgressBarProps {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
valueCurrent?: number;
|
|
7
|
-
intentProgress?: 'default' | 'success' | 'warning' | 'info' | 'error' | 'uploading';
|
|
8
|
-
type?: 'infinite' | 'default';
|
|
9
|
-
animated?: boolean;
|
|
3
|
+
value?: number;
|
|
4
|
+
intent?: 'default' | 'success' | 'warning' | 'info' | 'error';
|
|
5
|
+
infinite?: boolean;
|
|
10
6
|
}
|
|
11
|
-
export declare const ProgressBar: ({
|
|
7
|
+
export declare const ProgressBar: ({ value, intent, infinite, }: ProgressBarProps) => JSX.Element;
|
|
@@ -1,106 +1,23 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
|
|
3
|
-
default:
|
|
4
|
-
error: string;
|
|
5
|
-
info: string;
|
|
6
|
-
warning: string;
|
|
7
|
-
success: string;
|
|
8
|
-
uploading: string;
|
|
9
|
-
};
|
|
10
|
-
showAnimation: {
|
|
11
|
-
true: string;
|
|
12
|
-
};
|
|
13
|
-
}, undefined, "h-full first:rounded-l-pill last:rounded-r-pill", import("tailwind-variants/dist/config").TVConfig<{
|
|
14
|
-
intentProgress: {
|
|
15
|
-
default: string;
|
|
16
|
-
error: string;
|
|
17
|
-
info: string;
|
|
18
|
-
warning: string;
|
|
19
|
-
success: string;
|
|
20
|
-
uploading: string;
|
|
21
|
-
};
|
|
22
|
-
showAnimation: {
|
|
23
|
-
true: string;
|
|
24
|
-
};
|
|
25
|
-
}, {
|
|
26
|
-
intentProgress: {
|
|
27
|
-
default: string;
|
|
28
|
-
error: string;
|
|
29
|
-
info: string;
|
|
30
|
-
warning: string;
|
|
31
|
-
success: string;
|
|
32
|
-
uploading: string;
|
|
33
|
-
};
|
|
34
|
-
showAnimation: {
|
|
35
|
-
true: string;
|
|
36
|
-
};
|
|
37
|
-
}>, {
|
|
38
|
-
intentProgress: {
|
|
39
|
-
default: string;
|
|
40
|
-
error: string;
|
|
41
|
-
info: string;
|
|
42
|
-
warning: string;
|
|
43
|
-
success: string;
|
|
44
|
-
uploading: string;
|
|
45
|
-
};
|
|
46
|
-
showAnimation: {
|
|
47
|
-
true: string;
|
|
48
|
-
};
|
|
49
|
-
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
50
|
-
intentProgress: {
|
|
51
|
-
default: string;
|
|
52
|
-
error: string;
|
|
53
|
-
info: string;
|
|
54
|
-
warning: string;
|
|
55
|
-
success: string;
|
|
56
|
-
uploading: string;
|
|
57
|
-
};
|
|
58
|
-
showAnimation: {
|
|
59
|
-
true: string;
|
|
60
|
-
};
|
|
61
|
-
}, undefined, "h-full first:rounded-l-pill last:rounded-r-pill", import("tailwind-variants/dist/config").TVConfig<{
|
|
62
|
-
intentProgress: {
|
|
63
|
-
default: string;
|
|
64
|
-
error: string;
|
|
65
|
-
info: string;
|
|
66
|
-
warning: string;
|
|
67
|
-
success: string;
|
|
68
|
-
uploading: string;
|
|
69
|
-
};
|
|
70
|
-
showAnimation: {
|
|
71
|
-
true: string;
|
|
72
|
-
};
|
|
73
|
-
}, {
|
|
74
|
-
intentProgress: {
|
|
75
|
-
default: string;
|
|
76
|
-
error: string;
|
|
77
|
-
info: string;
|
|
78
|
-
warning: string;
|
|
79
|
-
success: string;
|
|
80
|
-
uploading: string;
|
|
81
|
-
};
|
|
82
|
-
showAnimation: {
|
|
83
|
-
true: string;
|
|
84
|
-
};
|
|
85
|
-
}>, unknown, unknown, undefined>>;
|
|
86
|
-
export declare const progressBarInfiniteVariants: import("tailwind-variants").TVReturnType<{
|
|
87
|
-
status: {
|
|
88
|
-
uploading: {
|
|
1
|
+
export declare const ProgressVariants: import("tailwind-variants").TVReturnType<{
|
|
2
|
+
intent: {
|
|
3
|
+
default: {
|
|
89
4
|
progress: string;
|
|
90
5
|
};
|
|
91
|
-
|
|
6
|
+
error: {
|
|
92
7
|
progress: string;
|
|
93
8
|
};
|
|
94
|
-
|
|
9
|
+
info: {
|
|
95
10
|
progress: string;
|
|
96
11
|
};
|
|
97
|
-
|
|
12
|
+
warning: {
|
|
98
13
|
progress: string;
|
|
99
14
|
};
|
|
100
|
-
|
|
15
|
+
success: {
|
|
101
16
|
progress: string;
|
|
102
17
|
};
|
|
103
|
-
|
|
18
|
+
};
|
|
19
|
+
infinite: {
|
|
20
|
+
true: {
|
|
104
21
|
progress: string;
|
|
105
22
|
};
|
|
106
23
|
};
|
|
@@ -109,65 +26,71 @@ export declare const progressBarInfiniteVariants: import("tailwind-variants").TV
|
|
|
109
26
|
bar: string;
|
|
110
27
|
progress: string;
|
|
111
28
|
}, undefined, import("tailwind-variants/dist/config").TVConfig<{
|
|
112
|
-
|
|
113
|
-
|
|
29
|
+
intent: {
|
|
30
|
+
default: {
|
|
114
31
|
progress: string;
|
|
115
32
|
};
|
|
116
|
-
|
|
33
|
+
error: {
|
|
117
34
|
progress: string;
|
|
118
35
|
};
|
|
119
|
-
|
|
36
|
+
info: {
|
|
120
37
|
progress: string;
|
|
121
38
|
};
|
|
122
|
-
|
|
39
|
+
warning: {
|
|
123
40
|
progress: string;
|
|
124
41
|
};
|
|
125
|
-
|
|
42
|
+
success: {
|
|
126
43
|
progress: string;
|
|
127
44
|
};
|
|
128
|
-
|
|
45
|
+
};
|
|
46
|
+
infinite: {
|
|
47
|
+
true: {
|
|
129
48
|
progress: string;
|
|
130
49
|
};
|
|
131
50
|
};
|
|
132
51
|
}, {
|
|
133
|
-
|
|
134
|
-
|
|
52
|
+
intent: {
|
|
53
|
+
default: {
|
|
135
54
|
progress: string;
|
|
136
55
|
};
|
|
137
|
-
|
|
56
|
+
error: {
|
|
138
57
|
progress: string;
|
|
139
58
|
};
|
|
140
|
-
|
|
59
|
+
info: {
|
|
141
60
|
progress: string;
|
|
142
61
|
};
|
|
143
|
-
|
|
62
|
+
warning: {
|
|
144
63
|
progress: string;
|
|
145
64
|
};
|
|
146
|
-
|
|
65
|
+
success: {
|
|
147
66
|
progress: string;
|
|
148
67
|
};
|
|
149
|
-
|
|
68
|
+
};
|
|
69
|
+
infinite: {
|
|
70
|
+
true: {
|
|
150
71
|
progress: string;
|
|
151
72
|
};
|
|
152
73
|
};
|
|
153
74
|
}>, {
|
|
154
|
-
|
|
155
|
-
|
|
75
|
+
intent: {
|
|
76
|
+
default: {
|
|
156
77
|
progress: string;
|
|
157
78
|
};
|
|
158
|
-
|
|
79
|
+
error: {
|
|
159
80
|
progress: string;
|
|
160
81
|
};
|
|
161
|
-
|
|
82
|
+
info: {
|
|
162
83
|
progress: string;
|
|
163
84
|
};
|
|
164
|
-
|
|
85
|
+
warning: {
|
|
165
86
|
progress: string;
|
|
166
87
|
};
|
|
167
|
-
|
|
88
|
+
success: {
|
|
168
89
|
progress: string;
|
|
169
90
|
};
|
|
170
|
-
|
|
91
|
+
};
|
|
92
|
+
infinite: {
|
|
93
|
+
true: {
|
|
171
94
|
progress: string;
|
|
172
95
|
};
|
|
173
96
|
};
|
|
@@ -176,23 +99,25 @@ export declare const progressBarInfiniteVariants: import("tailwind-variants").TV
|
|
|
176
99
|
bar: string;
|
|
177
100
|
progress: string;
|
|
178
101
|
}, import("tailwind-variants").TVReturnType<{
|
|
179
|
-
|
|
180
|
-
|
|
102
|
+
intent: {
|
|
103
|
+
default: {
|
|
181
104
|
progress: string;
|
|
182
105
|
};
|
|
183
|
-
|
|
106
|
+
error: {
|
|
184
107
|
progress: string;
|
|
185
108
|
};
|
|
186
|
-
|
|
109
|
+
info: {
|
|
187
110
|
progress: string;
|
|
188
111
|
};
|
|
189
|
-
|
|
112
|
+
warning: {
|
|
190
113
|
progress: string;
|
|
191
114
|
};
|
|
192
|
-
|
|
115
|
+
success: {
|
|
193
116
|
progress: string;
|
|
194
117
|
};
|
|
195
|
-
|
|
118
|
+
};
|
|
119
|
+
infinite: {
|
|
120
|
+
true: {
|
|
196
121
|
progress: string;
|
|
197
122
|
};
|
|
198
123
|
};
|
|
@@ -201,44 +126,48 @@ export declare const progressBarInfiniteVariants: import("tailwind-variants").TV
|
|
|
201
126
|
bar: string;
|
|
202
127
|
progress: string;
|
|
203
128
|
}, undefined, import("tailwind-variants/dist/config").TVConfig<{
|
|
204
|
-
|
|
205
|
-
|
|
129
|
+
intent: {
|
|
130
|
+
default: {
|
|
206
131
|
progress: string;
|
|
207
132
|
};
|
|
208
|
-
|
|
133
|
+
error: {
|
|
209
134
|
progress: string;
|
|
210
135
|
};
|
|
211
|
-
|
|
136
|
+
info: {
|
|
212
137
|
progress: string;
|
|
213
138
|
};
|
|
214
|
-
|
|
139
|
+
warning: {
|
|
215
140
|
progress: string;
|
|
216
141
|
};
|
|
217
|
-
|
|
142
|
+
success: {
|
|
218
143
|
progress: string;
|
|
219
144
|
};
|
|
220
|
-
|
|
145
|
+
};
|
|
146
|
+
infinite: {
|
|
147
|
+
true: {
|
|
221
148
|
progress: string;
|
|
222
149
|
};
|
|
223
150
|
};
|
|
224
151
|
}, {
|
|
225
|
-
|
|
226
|
-
|
|
152
|
+
intent: {
|
|
153
|
+
default: {
|
|
227
154
|
progress: string;
|
|
228
155
|
};
|
|
229
|
-
|
|
156
|
+
error: {
|
|
230
157
|
progress: string;
|
|
231
158
|
};
|
|
232
|
-
|
|
159
|
+
info: {
|
|
233
160
|
progress: string;
|
|
234
161
|
};
|
|
235
|
-
|
|
162
|
+
warning: {
|
|
236
163
|
progress: string;
|
|
237
164
|
};
|
|
238
|
-
|
|
165
|
+
success: {
|
|
239
166
|
progress: string;
|
|
240
167
|
};
|
|
241
|
-
|
|
168
|
+
};
|
|
169
|
+
infinite: {
|
|
170
|
+
true: {
|
|
242
171
|
progress: string;
|
|
243
172
|
};
|
|
244
173
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tecsinapse/cortex-react",
|
|
3
|
-
"version": "1.7.0-beta.
|
|
3
|
+
"version": "1.7.0-beta.3",
|
|
4
4
|
"description": "React components based in @tecsinapse/cortex-core",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/esm/index.js",
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"react-dom": ">=18.0.0",
|
|
49
49
|
"tailwind": ">=3.3.0"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "c97f1fcd1035ed4383b7d6b52eadd7ff473c88c7"
|
|
52
52
|
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var React = require('react');
|
|
4
|
-
require('../../styles/calendar-cell.js');
|
|
5
|
-
require('../../styles/groupButton.js');
|
|
6
|
-
var progressBar = require('../../styles/progressBar.js');
|
|
7
|
-
|
|
8
|
-
const { container, bar, progress } = progressBar.progressBarInfiniteVariants();
|
|
9
|
-
const ProgressBarInfinite = ({
|
|
10
|
-
intentProgress
|
|
11
|
-
}) => {
|
|
12
|
-
return /* @__PURE__ */ React.createElement("div", { className: container() }, /* @__PURE__ */ React.createElement("div", { className: bar(), "data-testid": "infinite-progress-bar" }, /* @__PURE__ */ React.createElement("div", { className: progress({ status: intentProgress }) })));
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
exports.ProgressBarInfinite = ProgressBarInfinite;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var React = require('react');
|
|
4
|
-
require('../../styles/calendar-cell.js');
|
|
5
|
-
require('../../styles/groupButton.js');
|
|
6
|
-
var progressBar = require('../../styles/progressBar.js');
|
|
7
|
-
|
|
8
|
-
const ProgressBarSegments = ({
|
|
9
|
-
segments,
|
|
10
|
-
totalProgress,
|
|
11
|
-
intentProgress,
|
|
12
|
-
showAnimation
|
|
13
|
-
}) => {
|
|
14
|
-
const lengthSeg = 100 / segments;
|
|
15
|
-
const items = [...Array(segments).keys()];
|
|
16
|
-
const progressStyle = React.useCallback(
|
|
17
|
-
(width, index) => {
|
|
18
|
-
return {
|
|
19
|
-
width: `${width}%`,
|
|
20
|
-
transitionDelay: `${showAnimation ? `${index * 1e3}ms` : `0ms`}`
|
|
21
|
-
};
|
|
22
|
-
},
|
|
23
|
-
[showAnimation]
|
|
24
|
-
);
|
|
25
|
-
return /* @__PURE__ */ React.createElement("div", { className: "flex gap-x-nano flex-row", "data-testid": "progress-bar" }, items.map((_, index) => {
|
|
26
|
-
const max = lengthSeg * (index + 1);
|
|
27
|
-
const min = lengthSeg * index;
|
|
28
|
-
const minmax = (totalProgress - min) / (max - min);
|
|
29
|
-
const width = (minmax > 1 ? 1 : minmax < 0 ? 0 : minmax) * 100;
|
|
30
|
-
return /* @__PURE__ */ React.createElement(
|
|
31
|
-
"div",
|
|
32
|
-
{
|
|
33
|
-
key: index,
|
|
34
|
-
className: "h-[0.5rem] bg-secondary-light flex flex-1 first:rounded-l-pill last:rounded-r-pill"
|
|
35
|
-
},
|
|
36
|
-
/* @__PURE__ */ React.createElement(
|
|
37
|
-
"div",
|
|
38
|
-
{
|
|
39
|
-
style: progressStyle(width, index),
|
|
40
|
-
"data-testid": "div-segment-filled",
|
|
41
|
-
className: progressBar.progressBarFilled({ intentProgress, showAnimation })
|
|
42
|
-
}
|
|
43
|
-
)
|
|
44
|
-
);
|
|
45
|
-
}));
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
exports.ProgressBarSegments = ProgressBarSegments;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React__default from 'react';
|
|
2
|
-
import '../../styles/calendar-cell.js';
|
|
3
|
-
import '../../styles/groupButton.js';
|
|
4
|
-
import { progressBarInfiniteVariants } from '../../styles/progressBar.js';
|
|
5
|
-
|
|
6
|
-
const { container, bar, progress } = progressBarInfiniteVariants();
|
|
7
|
-
const ProgressBarInfinite = ({
|
|
8
|
-
intentProgress
|
|
9
|
-
}) => {
|
|
10
|
-
return /* @__PURE__ */ React__default.createElement("div", { className: container() }, /* @__PURE__ */ React__default.createElement("div", { className: bar(), "data-testid": "infinite-progress-bar" }, /* @__PURE__ */ React__default.createElement("div", { className: progress({ status: intentProgress }) })));
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export { ProgressBarInfinite };
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import React__default, { useCallback } from 'react';
|
|
2
|
-
import '../../styles/calendar-cell.js';
|
|
3
|
-
import '../../styles/groupButton.js';
|
|
4
|
-
import { progressBarFilled } from '../../styles/progressBar.js';
|
|
5
|
-
|
|
6
|
-
const ProgressBarSegments = ({
|
|
7
|
-
segments,
|
|
8
|
-
totalProgress,
|
|
9
|
-
intentProgress,
|
|
10
|
-
showAnimation
|
|
11
|
-
}) => {
|
|
12
|
-
const lengthSeg = 100 / segments;
|
|
13
|
-
const items = [...Array(segments).keys()];
|
|
14
|
-
const progressStyle = useCallback(
|
|
15
|
-
(width, index) => {
|
|
16
|
-
return {
|
|
17
|
-
width: `${width}%`,
|
|
18
|
-
transitionDelay: `${showAnimation ? `${index * 1e3}ms` : `0ms`}`
|
|
19
|
-
};
|
|
20
|
-
},
|
|
21
|
-
[showAnimation]
|
|
22
|
-
);
|
|
23
|
-
return /* @__PURE__ */ React__default.createElement("div", { className: "flex gap-x-nano flex-row", "data-testid": "progress-bar" }, items.map((_, index) => {
|
|
24
|
-
const max = lengthSeg * (index + 1);
|
|
25
|
-
const min = lengthSeg * index;
|
|
26
|
-
const minmax = (totalProgress - min) / (max - min);
|
|
27
|
-
const width = (minmax > 1 ? 1 : minmax < 0 ? 0 : minmax) * 100;
|
|
28
|
-
return /* @__PURE__ */ React__default.createElement(
|
|
29
|
-
"div",
|
|
30
|
-
{
|
|
31
|
-
key: index,
|
|
32
|
-
className: "h-[0.5rem] bg-secondary-light flex flex-1 first:rounded-l-pill last:rounded-r-pill"
|
|
33
|
-
},
|
|
34
|
-
/* @__PURE__ */ React__default.createElement(
|
|
35
|
-
"div",
|
|
36
|
-
{
|
|
37
|
-
style: progressStyle(width, index),
|
|
38
|
-
"data-testid": "div-segment-filled",
|
|
39
|
-
className: progressBarFilled({ intentProgress, showAnimation })
|
|
40
|
-
}
|
|
41
|
-
)
|
|
42
|
-
);
|
|
43
|
-
}));
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
export { ProgressBarSegments };
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
interface ProgressBarInfiniteProps {
|
|
3
|
-
intentProgress?: 'default' | 'success' | 'warning' | 'info' | 'error' | 'uploading';
|
|
4
|
-
}
|
|
5
|
-
export declare const ProgressBarInfinite: ({ intentProgress, }: ProgressBarInfiniteProps) => JSX.Element;
|
|
6
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
interface ProgressBarSegmentsProps {
|
|
3
|
-
segments: number;
|
|
4
|
-
totalProgress: number;
|
|
5
|
-
intentProgress?: 'default' | 'success' | 'warning' | 'info' | 'error' | 'uploading';
|
|
6
|
-
showAnimation: boolean;
|
|
7
|
-
}
|
|
8
|
-
export declare const ProgressBarSegments: ({ segments, totalProgress, intentProgress, showAnimation, }: ProgressBarSegmentsProps) => JSX.Element;
|
|
9
|
-
export {};
|