-
Notifications
You must be signed in to change notification settings - Fork 2.4k
/
Copy pathprogress.ts
64 lines (60 loc) · 923 Bytes
/
progress.ts
1
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
const defaultProps = {
colorScheme: 'primary',
size: 'sm',
rounded: 'full',
min: 0,
max: 100,
value: 0,
isIndeterminate: false,
};
function baseStyle(props: Record<string, any>) {
const { colorScheme: c } = props;
return {
overflow: 'hidden',
_filledTrack: {
bg: `${c}.600`,
shadow: 0,
height: '100%',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
rounded: 'full',
_text: {
color: 'white',
fontWeight: 'bold',
},
},
bg: 'muted.200',
_dark: {
bg: 'muted.700',
_filledTrack: {
bg: `${c}.400`,
},
},
};
}
const sizes = {
'xs': {
height: 1,
},
'sm': {
height: 2,
},
'md': {
height: 3,
},
'lg': {
height: 4,
},
'xl': {
height: 5,
},
'2xl': {
height: 6,
},
};
export default {
baseStyle,
defaultProps,
sizes,
};