@bitrise/bitkit 10.32.2 → 10.33.0-alpha-chakra.2
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/package.json +1 -1
- package/src/Components/ProgressBar/ProgressBar.stories.tsx +11 -0
- package/src/Components/ProgressBar/ProgressBar.theme.ts +19 -0
- package/src/Components/ProgressBar/ProgressBar.tsx +12 -0
- package/src/index.ts +3 -0
- package/src/old.ts +0 -3
- package/src/theme.ts +2 -0
- package/src/tsconfig.tsbuildinfo +1 -1
- package/src/Old/Progress/ProgressBar.css +0 -36
- package/src/Old/Progress/ProgressBar.tsx +0 -53
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
@keyframes ProgressBarStripes {
|
|
2
|
-
from { background-position-x: calc(var(--ProgressBar--height) * 2); }
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.ProgressBar {
|
|
6
|
-
position: relative;
|
|
7
|
-
overflow: hidden;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.ProgressBar--striped {
|
|
11
|
-
background-image:
|
|
12
|
-
linear-gradient(-45deg,
|
|
13
|
-
var(--ProgressBar--stripe-color) 25%,
|
|
14
|
-
transparent 25%,
|
|
15
|
-
transparent 50%,
|
|
16
|
-
var(--ProgressBar--stripe-color) 50%,
|
|
17
|
-
var(--ProgressBar--stripe-color) 75%,
|
|
18
|
-
transparent 75%,
|
|
19
|
-
transparent
|
|
20
|
-
);
|
|
21
|
-
background-size: calc(var(--ProgressBar--height) * 2) calc(var(--ProgressBar--height) * 2);
|
|
22
|
-
animation-name: ProgressBarStripes;
|
|
23
|
-
animation-duration: var(--transition-duration--slow);
|
|
24
|
-
animation-iteration-count: infinite;
|
|
25
|
-
animation-timing-function: linear;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.ProgressBar__progress {
|
|
29
|
-
position: absolute;
|
|
30
|
-
top: 0;
|
|
31
|
-
bottom: 0;
|
|
32
|
-
left: 0;
|
|
33
|
-
transition-property: width;
|
|
34
|
-
transition-duration: var(--transition-duration--slow);
|
|
35
|
-
transition-timing-function: var(--transition-timing-function);
|
|
36
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import classnames from 'classnames';
|
|
3
|
-
import { colorMap } from '../variables';
|
|
4
|
-
import Base, { newToOld, Props as BaseProps, TypeColors } from '../Base/Base';
|
|
5
|
-
import './ProgressBar.css';
|
|
6
|
-
|
|
7
|
-
export interface Props extends BaseProps {
|
|
8
|
-
/** The color that is applied to the track */
|
|
9
|
-
backgroundColor?: TypeColors;
|
|
10
|
-
/** The color that is applied to the progressing bar */
|
|
11
|
-
foregroundColor: TypeColors;
|
|
12
|
-
/** The height of the bar */
|
|
13
|
-
height: string;
|
|
14
|
-
/** A number between 0 and 1 that represents the progress to display */
|
|
15
|
-
progress: number;
|
|
16
|
-
/** Color of the stripes on the track */
|
|
17
|
-
stripeColor?: TypeColors;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* A determinate progress indicatior
|
|
22
|
-
*/
|
|
23
|
-
const ProgressBar: React.FunctionComponent<Props> = (props: Props) => {
|
|
24
|
-
const { borderRadius, foregroundColor, height, progress, stripeColor, ...rest } = props;
|
|
25
|
-
|
|
26
|
-
const classes = classnames('ProgressBar', {
|
|
27
|
-
'ProgressBar--striped': stripeColor,
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
const progressClamped = React.useMemo(() => Math.max(0, Math.min(progress * 100, 100)), [progress]);
|
|
31
|
-
|
|
32
|
-
return (
|
|
33
|
-
<Base
|
|
34
|
-
{...rest}
|
|
35
|
-
borderRadius={borderRadius}
|
|
36
|
-
className={classes}
|
|
37
|
-
height={height}
|
|
38
|
-
style={{
|
|
39
|
-
'--ProgressBar--height': height,
|
|
40
|
-
'--ProgressBar--stripe-color': stripeColor ? colorMap[newToOld[stripeColor]] : '',
|
|
41
|
-
}}
|
|
42
|
-
>
|
|
43
|
-
<Base
|
|
44
|
-
backgroundColor={foregroundColor}
|
|
45
|
-
borderRadius={borderRadius}
|
|
46
|
-
className="ProgressBar__progress"
|
|
47
|
-
width={`${progressClamped}%`}
|
|
48
|
-
/>
|
|
49
|
-
</Base>
|
|
50
|
-
);
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
export default ProgressBar;
|