@hero-design/rn 7.17.0 → 7.18.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.
- package/.turbo/turbo-build.log +2 -2
- package/es/index.js +3712 -3473
- package/lib/index.js +3716 -3475
- package/package.json +2 -2
- package/src/components/Accordion/__tests__/__snapshots__/AccordionItem.spec.tsx.snap +12 -12
- package/src/components/Accordion/__tests__/__snapshots__/index.spec.tsx.snap +18 -18
- package/src/components/Alert/__tests__/__snapshots__/index.spec.tsx.snap +26 -26
- package/src/components/Avatar/__tests__/__snapshots__/StyledAvatar.spec.tsx.snap +3 -3
- package/src/components/Avatar/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
- package/src/components/Badge/__tests__/__snapshots__/Badge.spec.tsx.snap +1 -1
- package/src/components/Badge/__tests__/__snapshots__/Status.spec.tsx.snap +2 -2
- package/src/components/BottomNavigation/__tests__/__snapshots__/index.spec.tsx.snap +9 -9
- package/src/components/BottomNavigation/index.tsx +1 -1
- package/src/components/BottomSheet/__tests__/__snapshots__/index.spec.tsx.snap +12 -12
- package/src/components/Button/Button.tsx +1 -0
- package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/StyledLoadingIndicator.spec.tsx.snap +2 -2
- package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/index.spec.tsx.snap +6 -6
- package/src/components/Button/UtilityButton/{styled.tsx → StyledUtilityButton.tsx} +2 -2
- package/src/components/Button/UtilityButton/__tests__/__snapshots__/index.spec.tsx.snap +8 -8
- package/src/components/Button/UtilityButton/index.tsx +5 -1
- package/src/components/Button/__tests__/__snapshots__/IconButton.spec.tsx.snap +1 -1
- package/src/components/Button/__tests__/__snapshots__/StyledButton.spec.tsx.snap +69 -69
- package/src/components/Calendar/__tests__/__snapshots__/CalendarRowItem.spec.tsx.snap +12 -12
- package/src/components/Card/__tests__/__snapshots__/StyledCard.spec.tsx.snap +1 -1
- package/src/components/Checkbox/__tests__/__snapshots__/StyledCheckbox.spec.tsx.snap +1 -1
- package/src/components/Checkbox/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
- package/src/components/ContentNavigator/__tests__/__snapshots__/StyledContentNavigator.spec.tsx.snap +1 -1
- package/src/components/ContentNavigator/__tests__/__snapshots__/index.spec.tsx.snap +6 -6
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerAndroid.spec.tsx.snap +6 -5
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerIOS.spec.tsx.snap +13 -12
- package/src/components/Divider/__tests__/__snapshots__/StyledDivider.spec.tsx.snap +12 -12
- package/src/components/Drawer/DragableDrawer/__tests__/__snapshots__/index.spec.tsx.snap +99 -0
- package/src/components/Drawer/DragableDrawer/__tests__/helpers.spec.ts +39 -0
- package/src/components/Drawer/DragableDrawer/__tests__/index.spec.tsx +24 -0
- package/src/components/Drawer/DragableDrawer/helpers.ts +43 -0
- package/src/components/Drawer/DragableDrawer/index.tsx +205 -0
- package/src/components/Drawer/StyledDrawer.tsx +70 -26
- package/src/components/Drawer/__tests__/__snapshots__/index.spec.tsx.snap +3 -3
- package/src/components/Drawer/index.tsx +4 -1
- package/src/components/Empty/StyledEmpty.tsx +4 -3
- package/src/components/Empty/__tests__/__snapshots__/index.spec.tsx.snap +4 -3
- package/src/components/Empty/index.tsx +2 -2
- package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +28 -28
- package/src/components/FAB/ActionGroup/index.tsx +1 -1
- package/src/components/FAB/__tests__/__snapshots__/AnimatedFABIcon.spec.tsx.snap +2 -2
- package/src/components/FAB/__tests__/__snapshots__/StyledFAB.spec.tsx.snap +3 -3
- package/src/components/FAB/__tests__/__snapshots__/index.spec.tsx.snap +9 -9
- package/src/components/Icon/__tests__/__snapshots__/index.spec.tsx.snap +3 -3
- package/src/components/List/ListItem.tsx +1 -1
- package/src/components/List/__tests__/__snapshots__/BasicListItem.spec.tsx.snap +3 -3
- package/src/components/List/__tests__/__snapshots__/ListItem.spec.tsx.snap +20 -20
- package/src/components/List/__tests__/__snapshots__/StyledBasicListItem.spec.tsx.snap +6 -6
- package/src/components/List/__tests__/__snapshots__/StyledListItem.spec.tsx.snap +12 -12
- package/src/components/PinInput/__tests__/__snapshots__/PinCell.spec.tsx.snap +4 -4
- package/src/components/PinInput/__tests__/__snapshots__/index.spec.tsx.snap +22 -22
- package/src/components/Progress/ProgressCircle.tsx +25 -22
- package/src/components/Progress/StyledProgressCircle.tsx +33 -28
- package/src/components/Progress/__tests__/__snapshots__/index.spec.js.snap +102 -92
- package/src/components/Radio/__tests__/__snapshots__/Radio.spec.tsx.snap +5 -5
- package/src/components/Radio/__tests__/__snapshots__/RadioGroup.spec.tsx.snap +6 -6
- package/src/components/Radio/__tests__/__snapshots__/StyledRadio.spec.tsx.snap +3 -3
- package/src/components/RichTextEditor/__tests__/__snapshots__/EditorToolbar.spec.tsx.snap +11 -11
- package/src/components/RichTextEditor/__tests__/__snapshots__/RichTextEditor.spec.tsx.snap +8 -6
- package/src/components/SectionHeading/__tests__/__snapshots__/StyledHeading.spec.tsx.snap +1 -1
- package/src/components/SectionHeading/__tests__/__snapshots__/index.spec.tsx.snap +9 -9
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/Option.spec.tsx.snap +3 -3
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +42 -42
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +126 -121
- package/src/components/Select/MultiSelect/index.tsx +1 -4
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/Option.spec.tsx.snap +2 -2
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +36 -36
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +99 -94
- package/src/components/Select/SingleSelect/index.tsx +2 -6
- package/src/components/Select/__tests__/__snapshots__/StyledSelect.spec.tsx.snap +2 -2
- package/src/components/Spinner/__tests__/__snapshots__/AnimatedSpinner.spec.tsx.snap +4 -4
- package/src/components/Spinner/__tests__/__snapshots__/StyledSpinner.spec.tsx.snap +8 -8
- package/src/components/Spinner/__tests__/__snapshots__/index.spec.tsx.snap +4 -4
- package/src/components/Switch/__tests__/__snapshots__/StyledHeading.spec.tsx.snap +1 -1
- package/src/components/Switch/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
- package/src/components/Tabs/ScrollableTabs.tsx +1 -1
- package/src/components/Tabs/__tests__/ScrollableTabs.spec.tsx +8 -0
- package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabs.spec.tsx.snap +85 -6
- package/src/components/Tabs/__tests__/__snapshots__/index.spec.tsx.snap +87 -8
- package/src/components/Tabs/__tests__/index.spec.tsx +8 -0
- package/src/components/Tabs/index.tsx +8 -3
- package/src/components/Tag/__tests__/__snapshots__/Tag.spec.tsx.snap +9 -9
- package/src/components/TextInput/StyledTextInput.tsx +1 -0
- package/src/components/TextInput/__tests__/__snapshots__/StyledTextInput.spec.tsx.snap +50 -50
- package/src/components/TextInput/__tests__/__snapshots__/index.spec.tsx.snap +100 -87
- package/src/components/TextInput/index.tsx +2 -2
- package/src/components/TimePicker/__tests__/__snapshots__/TimePickerAndroid.spec.tsx.snap +6 -5
- package/src/components/TimePicker/__tests__/__snapshots__/TimePickerIOS.spec.tsx.snap +13 -12
- package/src/components/Toast/__tests__/__snapshots__/Toast.spec.tsx.snap +22 -22
- package/src/components/Toolbar/__tests__/__snapshots__/ToolbarGroup.spec.tsx.snap +12 -12
- package/src/components/Toolbar/__tests__/__snapshots__/ToolbarItem.spec.tsx.snap +8 -8
- package/src/components/Typography/Text/__tests__/__snapshots__/StyledText.spec.tsx.snap +13 -13
- package/src/index.ts +9 -1
- package/src/theme/ThemeProvider.ts +19 -0
- package/src/theme/ThemeSwitcher.tsx +27 -0
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +161 -149
- package/src/theme/components/alert.ts +3 -3
- package/src/theme/components/badge.ts +1 -1
- package/src/theme/components/button.ts +9 -8
- package/src/theme/components/card.ts +4 -4
- package/src/theme/components/drawer.ts +14 -2
- package/src/theme/components/empty.ts +3 -2
- package/src/theme/components/list.ts +4 -4
- package/src/theme/components/pinInput.ts +2 -2
- package/src/theme/components/progress.ts +5 -5
- package/src/theme/components/toast.ts +3 -3
- package/src/theme/getTheme.ts +129 -0
- package/src/theme/global/colors/swag.ts +54 -0
- package/src/theme/global/colors/types.ts +45 -0
- package/src/theme/global/colors/work.ts +14 -0
- package/src/theme/global/index.ts +6 -2
- package/src/theme/index.ts +16 -143
- package/src/utils/scale.ts +4 -1
- package/types/components/Button/Button.d.ts +1 -0
- package/types/components/Button/UtilityButton/{styled.d.ts → StyledUtilityButton.d.ts} +0 -0
- package/types/components/Drawer/DragableDrawer/__tests__/helpers.spec.d.ts +1 -0
- package/types/components/Drawer/DragableDrawer/__tests__/index.spec.d.ts +1 -0
- package/types/components/Drawer/DragableDrawer/helpers.d.ts +8 -0
- package/types/components/Drawer/DragableDrawer/index.d.ts +33 -0
- package/types/components/Drawer/StyledDrawer.d.ts +34 -4
- package/types/components/Drawer/index.d.ts +4 -2
- package/types/components/Empty/index.d.ts +1 -1
- package/types/components/Icon/utils.d.ts +1 -1
- package/types/components/Progress/StyledProgressCircle.d.ts +12 -6
- package/types/index.d.ts +2 -2
- package/types/theme/ThemeProvider.d.ts +12 -0
- package/types/theme/ThemeSwitcher.d.ts +7 -0
- package/types/theme/components/button.d.ts +1 -1
- package/types/theme/components/drawer.d.ts +9 -0
- package/types/theme/components/empty.d.ts +3 -2
- package/types/theme/components/progress.d.ts +1 -2
- package/types/theme/getTheme.d.ts +74 -0
- package/types/theme/global/colors/swag.d.ts +3 -0
- package/types/theme/global/{colors.d.ts → colors/types.d.ts} +4 -3
- package/types/theme/global/colors/work.d.ts +3 -0
- package/types/theme/global/index.d.ts +7 -2
- package/types/theme/index.d.ts +7 -84
- package/src/theme/global/colors.ts +0 -50
|
@@ -26,7 +26,7 @@ exports[`rendering renders correctly 1`] = `
|
|
|
26
26
|
Array [
|
|
27
27
|
Object {
|
|
28
28
|
"alignItems": "center",
|
|
29
|
-
"borderColor": "#
|
|
29
|
+
"borderColor": "#001f23",
|
|
30
30
|
"borderRadius": 8,
|
|
31
31
|
"borderWidth": 1,
|
|
32
32
|
"height": 48,
|
|
@@ -43,8 +43,8 @@ exports[`rendering renders correctly 1`] = `
|
|
|
43
43
|
style={
|
|
44
44
|
Array [
|
|
45
45
|
Object {
|
|
46
|
-
"backgroundColor": "#
|
|
47
|
-
"borderColor": "#
|
|
46
|
+
"backgroundColor": "#001f23",
|
|
47
|
+
"borderColor": "#001f23",
|
|
48
48
|
"borderRadius": 999,
|
|
49
49
|
"borderWidth": 1,
|
|
50
50
|
"height": 16,
|
|
@@ -72,7 +72,7 @@ exports[`rendering renders correctly 1`] = `
|
|
|
72
72
|
Array [
|
|
73
73
|
Object {
|
|
74
74
|
"alignItems": "center",
|
|
75
|
-
"borderColor": "#
|
|
75
|
+
"borderColor": "#001f23",
|
|
76
76
|
"borderRadius": 8,
|
|
77
77
|
"borderWidth": 1,
|
|
78
78
|
"height": 48,
|
|
@@ -89,8 +89,8 @@ exports[`rendering renders correctly 1`] = `
|
|
|
89
89
|
style={
|
|
90
90
|
Array [
|
|
91
91
|
Object {
|
|
92
|
-
"backgroundColor": "#
|
|
93
|
-
"borderColor": "#
|
|
92
|
+
"backgroundColor": "#001f23",
|
|
93
|
+
"borderColor": "#001f23",
|
|
94
94
|
"borderRadius": 999,
|
|
95
95
|
"borderWidth": 1,
|
|
96
96
|
"height": 16,
|
|
@@ -118,7 +118,7 @@ exports[`rendering renders correctly 1`] = `
|
|
|
118
118
|
Array [
|
|
119
119
|
Object {
|
|
120
120
|
"alignItems": "center",
|
|
121
|
-
"borderColor": "#
|
|
121
|
+
"borderColor": "#001f23",
|
|
122
122
|
"borderRadius": 8,
|
|
123
123
|
"borderWidth": 1,
|
|
124
124
|
"height": 48,
|
|
@@ -135,7 +135,7 @@ exports[`rendering renders correctly 1`] = `
|
|
|
135
135
|
style={
|
|
136
136
|
Array [
|
|
137
137
|
Object {
|
|
138
|
-
"borderColor": "#
|
|
138
|
+
"borderColor": "#001f23",
|
|
139
139
|
"borderRadius": 999,
|
|
140
140
|
"borderWidth": 1,
|
|
141
141
|
"height": 16,
|
|
@@ -163,7 +163,7 @@ exports[`rendering renders correctly 1`] = `
|
|
|
163
163
|
Array [
|
|
164
164
|
Object {
|
|
165
165
|
"alignItems": "center",
|
|
166
|
-
"borderColor": "#
|
|
166
|
+
"borderColor": "#001f23",
|
|
167
167
|
"borderRadius": 8,
|
|
168
168
|
"borderWidth": 1,
|
|
169
169
|
"height": 48,
|
|
@@ -180,7 +180,7 @@ exports[`rendering renders correctly 1`] = `
|
|
|
180
180
|
style={
|
|
181
181
|
Array [
|
|
182
182
|
Object {
|
|
183
|
-
"borderColor": "#
|
|
183
|
+
"borderColor": "#001f23",
|
|
184
184
|
"borderRadius": 999,
|
|
185
185
|
"borderWidth": 1,
|
|
186
186
|
"height": 16,
|
|
@@ -476,7 +476,7 @@ exports[`rendering renders correctly when length is 6 and secure is false 1`] =
|
|
|
476
476
|
Array [
|
|
477
477
|
Object {
|
|
478
478
|
"alignItems": "center",
|
|
479
|
-
"borderColor": "#
|
|
479
|
+
"borderColor": "#001f23",
|
|
480
480
|
"borderRadius": 8,
|
|
481
481
|
"borderWidth": 1,
|
|
482
482
|
"height": 48,
|
|
@@ -493,7 +493,7 @@ exports[`rendering renders correctly when length is 6 and secure is false 1`] =
|
|
|
493
493
|
style={
|
|
494
494
|
Array [
|
|
495
495
|
Object {
|
|
496
|
-
"color": "#
|
|
496
|
+
"color": "#001f23",
|
|
497
497
|
"fontFamily": "BeVietnamPro-SemiBold",
|
|
498
498
|
"fontSize": 28,
|
|
499
499
|
},
|
|
@@ -520,7 +520,7 @@ exports[`rendering renders correctly when length is 6 and secure is false 1`] =
|
|
|
520
520
|
Array [
|
|
521
521
|
Object {
|
|
522
522
|
"alignItems": "center",
|
|
523
|
-
"borderColor": "#
|
|
523
|
+
"borderColor": "#001f23",
|
|
524
524
|
"borderRadius": 8,
|
|
525
525
|
"borderWidth": 1,
|
|
526
526
|
"height": 48,
|
|
@@ -537,7 +537,7 @@ exports[`rendering renders correctly when length is 6 and secure is false 1`] =
|
|
|
537
537
|
style={
|
|
538
538
|
Array [
|
|
539
539
|
Object {
|
|
540
|
-
"color": "#
|
|
540
|
+
"color": "#001f23",
|
|
541
541
|
"fontFamily": "BeVietnamPro-SemiBold",
|
|
542
542
|
"fontSize": 28,
|
|
543
543
|
},
|
|
@@ -564,7 +564,7 @@ exports[`rendering renders correctly when length is 6 and secure is false 1`] =
|
|
|
564
564
|
Array [
|
|
565
565
|
Object {
|
|
566
566
|
"alignItems": "center",
|
|
567
|
-
"borderColor": "#
|
|
567
|
+
"borderColor": "#001f23",
|
|
568
568
|
"borderRadius": 8,
|
|
569
569
|
"borderWidth": 1,
|
|
570
570
|
"height": 48,
|
|
@@ -581,7 +581,7 @@ exports[`rendering renders correctly when length is 6 and secure is false 1`] =
|
|
|
581
581
|
style={
|
|
582
582
|
Array [
|
|
583
583
|
Object {
|
|
584
|
-
"color": "#
|
|
584
|
+
"color": "#001f23",
|
|
585
585
|
"fontFamily": "BeVietnamPro-SemiBold",
|
|
586
586
|
"fontSize": 28,
|
|
587
587
|
},
|
|
@@ -608,7 +608,7 @@ exports[`rendering renders correctly when length is 6 and secure is false 1`] =
|
|
|
608
608
|
Array [
|
|
609
609
|
Object {
|
|
610
610
|
"alignItems": "center",
|
|
611
|
-
"borderColor": "#
|
|
611
|
+
"borderColor": "#001f23",
|
|
612
612
|
"borderRadius": 8,
|
|
613
613
|
"borderWidth": 1,
|
|
614
614
|
"height": 48,
|
|
@@ -625,7 +625,7 @@ exports[`rendering renders correctly when length is 6 and secure is false 1`] =
|
|
|
625
625
|
style={
|
|
626
626
|
Array [
|
|
627
627
|
Object {
|
|
628
|
-
"borderColor": "#
|
|
628
|
+
"borderColor": "#001f23",
|
|
629
629
|
"borderRadius": 999,
|
|
630
630
|
"borderWidth": 1,
|
|
631
631
|
"height": 16,
|
|
@@ -653,7 +653,7 @@ exports[`rendering renders correctly when length is 6 and secure is false 1`] =
|
|
|
653
653
|
Array [
|
|
654
654
|
Object {
|
|
655
655
|
"alignItems": "center",
|
|
656
|
-
"borderColor": "#
|
|
656
|
+
"borderColor": "#001f23",
|
|
657
657
|
"borderRadius": 8,
|
|
658
658
|
"borderWidth": 1,
|
|
659
659
|
"height": 48,
|
|
@@ -670,7 +670,7 @@ exports[`rendering renders correctly when length is 6 and secure is false 1`] =
|
|
|
670
670
|
style={
|
|
671
671
|
Array [
|
|
672
672
|
Object {
|
|
673
|
-
"borderColor": "#
|
|
673
|
+
"borderColor": "#001f23",
|
|
674
674
|
"borderRadius": 999,
|
|
675
675
|
"borderWidth": 1,
|
|
676
676
|
"height": 16,
|
|
@@ -698,7 +698,7 @@ exports[`rendering renders correctly when length is 6 and secure is false 1`] =
|
|
|
698
698
|
Array [
|
|
699
699
|
Object {
|
|
700
700
|
"alignItems": "center",
|
|
701
|
-
"borderColor": "#
|
|
701
|
+
"borderColor": "#001f23",
|
|
702
702
|
"borderRadius": 8,
|
|
703
703
|
"borderWidth": 1,
|
|
704
704
|
"height": 48,
|
|
@@ -715,7 +715,7 @@ exports[`rendering renders correctly when length is 6 and secure is false 1`] =
|
|
|
715
715
|
style={
|
|
716
716
|
Array [
|
|
717
717
|
Object {
|
|
718
|
-
"borderColor": "#
|
|
718
|
+
"borderColor": "#001f23",
|
|
719
719
|
"borderRadius": 999,
|
|
720
720
|
"borderWidth": 1,
|
|
721
721
|
"height": 16,
|
|
@@ -9,11 +9,12 @@ import {
|
|
|
9
9
|
ViewStyle,
|
|
10
10
|
} from 'react-native';
|
|
11
11
|
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
StyledContainer,
|
|
13
|
+
StyledDonutCircle,
|
|
14
|
+
StyledHalfCircleInnerFG,
|
|
15
|
+
StyledHalfCircleInnerBG,
|
|
16
|
+
StyledHalfCircleWrapper,
|
|
17
|
+
StyledStrokeEnd,
|
|
17
18
|
} from './StyledProgressCircle';
|
|
18
19
|
import { ThemeIntent } from './types';
|
|
19
20
|
import Typography from '../Typography';
|
|
@@ -44,13 +45,13 @@ const HalfCircle = ({
|
|
|
44
45
|
type: 'background' | 'foreground';
|
|
45
46
|
themeIntent?: ThemeIntent;
|
|
46
47
|
}) => (
|
|
47
|
-
<
|
|
48
|
+
<StyledHalfCircleWrapper>
|
|
48
49
|
{type === 'background' ? (
|
|
49
|
-
<
|
|
50
|
+
<StyledHalfCircleInnerBG />
|
|
50
51
|
) : (
|
|
51
|
-
<
|
|
52
|
+
<StyledHalfCircleInnerFG themeIntent={themeIntent} />
|
|
52
53
|
)}
|
|
53
|
-
</
|
|
54
|
+
</StyledHalfCircleWrapper>
|
|
54
55
|
);
|
|
55
56
|
|
|
56
57
|
const ProgressCircle = ({
|
|
@@ -61,7 +62,7 @@ const ProgressCircle = ({
|
|
|
61
62
|
...nativeProps
|
|
62
63
|
}: ProgressCircleProps): JSX.Element => {
|
|
63
64
|
const theme = useTheme();
|
|
64
|
-
const
|
|
65
|
+
const radius = theme.__hd__.progress.sizes.circleWidth / 2;
|
|
65
66
|
const progressAnimatedValue = useRef<Animated.Value>(new Animated.Value(0));
|
|
66
67
|
|
|
67
68
|
useEffect(() => {
|
|
@@ -108,11 +109,7 @@ const ProgressCircle = ({
|
|
|
108
109
|
|
|
109
110
|
return (
|
|
110
111
|
<View {...nativeProps} testID={testID} style={style}>
|
|
111
|
-
<
|
|
112
|
-
style={{
|
|
113
|
-
flexDirection: 'row',
|
|
114
|
-
}}
|
|
115
|
-
>
|
|
112
|
+
<StyledContainer>
|
|
116
113
|
<View>
|
|
117
114
|
<HalfCircle type="foreground" themeIntent={intent} />
|
|
118
115
|
<Animated.View
|
|
@@ -128,7 +125,13 @@ const ProgressCircle = ({
|
|
|
128
125
|
<HalfCircle type="background" />
|
|
129
126
|
</Animated.View>
|
|
130
127
|
</View>
|
|
131
|
-
<View
|
|
128
|
+
<View
|
|
129
|
+
style={{
|
|
130
|
+
transform: [{ rotate: '180deg' }],
|
|
131
|
+
zIndex: 1,
|
|
132
|
+
marginLeft: -0.1,
|
|
133
|
+
}}
|
|
134
|
+
>
|
|
132
135
|
<HalfCircle type="foreground" themeIntent={intent} />
|
|
133
136
|
<Animated.View
|
|
134
137
|
style={{
|
|
@@ -144,7 +147,7 @@ const ProgressCircle = ({
|
|
|
144
147
|
<HalfCircle type="background" />
|
|
145
148
|
</Animated.View>
|
|
146
149
|
</View>
|
|
147
|
-
<
|
|
150
|
+
<StyledStrokeEnd themeIntent={intent} />
|
|
148
151
|
<Animated.View
|
|
149
152
|
style={{
|
|
150
153
|
...StyleSheet.absoluteFillObject,
|
|
@@ -152,12 +155,12 @@ const ProgressCircle = ({
|
|
|
152
155
|
transform: [{ rotate: interpolateDotRotate }],
|
|
153
156
|
}}
|
|
154
157
|
>
|
|
155
|
-
<
|
|
158
|
+
<StyledStrokeEnd themeIntent={intent} />
|
|
156
159
|
</Animated.View>
|
|
157
|
-
<
|
|
158
|
-
<Typography.Text fontSize="
|
|
159
|
-
</
|
|
160
|
-
</
|
|
160
|
+
<StyledDonutCircle>
|
|
161
|
+
<Typography.Text fontSize="large">{`${value}%`}</Typography.Text>
|
|
162
|
+
</StyledDonutCircle>
|
|
163
|
+
</StyledContainer>
|
|
161
164
|
</View>
|
|
162
165
|
);
|
|
163
166
|
};
|
|
@@ -3,38 +3,42 @@ import styled from '@emotion/native';
|
|
|
3
3
|
|
|
4
4
|
import { ThemeIntent } from './types';
|
|
5
5
|
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
const INNER_CIRCLE_PERCENTAGE = 0.85; // 85% width according to design
|
|
7
|
+
const STROKE_WIDTH_PERCENTAGE = 0.075; // 7.5% width according to design
|
|
8
|
+
|
|
9
|
+
const StyledContainer = styled(View)<ViewProps>(({ theme }) => ({
|
|
10
|
+
flexDirection: 'row',
|
|
11
|
+
borderRadius: theme.__hd__.progress.radii.default,
|
|
12
|
+
}));
|
|
13
|
+
|
|
14
|
+
const StyledHalfCircleWrapper = styled(View)<ViewProps>(({ theme }) => ({
|
|
15
|
+
width: theme.__hd__.progress.sizes.circleWidth / 2,
|
|
16
|
+
height: theme.__hd__.progress.sizes.circleWidth,
|
|
9
17
|
overflow: 'hidden',
|
|
10
18
|
}));
|
|
11
19
|
|
|
12
|
-
const
|
|
20
|
+
const StyledHalfCircleInnerFG = styled(View)<{ themeIntent: ThemeIntent }>(
|
|
13
21
|
({ theme, themeIntent }) => ({
|
|
14
|
-
width: theme.__hd__.progress.sizes.
|
|
15
|
-
height: theme.__hd__.progress.sizes.
|
|
22
|
+
width: theme.__hd__.progress.sizes.circleWidth,
|
|
23
|
+
height: theme.__hd__.progress.sizes.circleWidth,
|
|
16
24
|
backgroundColor: theme.__hd__.progress.colors[themeIntent],
|
|
17
25
|
borderRadius: theme.__hd__.progress.radii.default,
|
|
18
26
|
})
|
|
19
27
|
);
|
|
20
28
|
|
|
21
|
-
const
|
|
22
|
-
width: theme.__hd__.progress.sizes.
|
|
23
|
-
height: theme.__hd__.progress.sizes.
|
|
29
|
+
const StyledHalfCircleInnerBG = styled(View)<ViewProps>(({ theme }) => ({
|
|
30
|
+
width: theme.__hd__.progress.sizes.circleWidth,
|
|
31
|
+
height: theme.__hd__.progress.sizes.circleWidth,
|
|
24
32
|
backgroundColor: theme.__hd__.progress.colors.background,
|
|
25
33
|
borderRadius: theme.__hd__.progress.radii.default,
|
|
26
34
|
}));
|
|
27
35
|
|
|
28
|
-
const
|
|
36
|
+
const StyledDonutCircle = styled(View)<ViewProps>(({ theme }) => ({
|
|
29
37
|
position: 'absolute',
|
|
30
|
-
top: theme.__hd__.progress.sizes.
|
|
31
|
-
left: theme.__hd__.progress.sizes.
|
|
32
|
-
width:
|
|
33
|
-
|
|
34
|
-
theme.__hd__.progress.sizes.strokeWidth * 2,
|
|
35
|
-
height:
|
|
36
|
-
theme.__hd__.progress.sizes.radius * 2 -
|
|
37
|
-
theme.__hd__.progress.sizes.strokeWidth * 2,
|
|
38
|
+
top: theme.__hd__.progress.sizes.circleWidth * STROKE_WIDTH_PERCENTAGE,
|
|
39
|
+
left: theme.__hd__.progress.sizes.circleWidth * STROKE_WIDTH_PERCENTAGE,
|
|
40
|
+
width: theme.__hd__.progress.sizes.circleWidth * INNER_CIRCLE_PERCENTAGE,
|
|
41
|
+
height: theme.__hd__.progress.sizes.circleWidth * INNER_CIRCLE_PERCENTAGE,
|
|
38
42
|
zIndex: 3,
|
|
39
43
|
backgroundColor: theme.__hd__.progress.colors.innerBackground,
|
|
40
44
|
borderRadius: theme.__hd__.progress.radii.default,
|
|
@@ -42,15 +46,15 @@ const DonutCircle = styled(View)<ViewProps>(({ theme }) => ({
|
|
|
42
46
|
justifyContent: 'center',
|
|
43
47
|
}));
|
|
44
48
|
|
|
45
|
-
const
|
|
49
|
+
const StyledStrokeEnd = styled(View)<{ themeIntent: ThemeIntent }>(
|
|
46
50
|
({ theme, themeIntent }) => ({
|
|
47
51
|
position: 'absolute',
|
|
48
52
|
top: 0,
|
|
49
53
|
left:
|
|
50
|
-
theme.__hd__.progress.sizes.
|
|
51
|
-
theme.__hd__.progress.sizes.
|
|
52
|
-
width: theme.__hd__.progress.sizes.
|
|
53
|
-
height: theme.__hd__.progress.sizes.
|
|
54
|
+
theme.__hd__.progress.sizes.circleWidth / 2 -
|
|
55
|
+
(theme.__hd__.progress.sizes.circleWidth * STROKE_WIDTH_PERCENTAGE) / 2,
|
|
56
|
+
width: theme.__hd__.progress.sizes.circleWidth * STROKE_WIDTH_PERCENTAGE,
|
|
57
|
+
height: theme.__hd__.progress.sizes.circleWidth * STROKE_WIDTH_PERCENTAGE,
|
|
54
58
|
borderRadius: theme.__hd__.progress.radii.default,
|
|
55
59
|
backgroundColor: theme.__hd__.progress.colors[themeIntent],
|
|
56
60
|
zIndex: 2,
|
|
@@ -58,9 +62,10 @@ const StrokeEnd = styled(View)<{ themeIntent: ThemeIntent }>(
|
|
|
58
62
|
);
|
|
59
63
|
|
|
60
64
|
export {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
65
|
+
StyledContainer,
|
|
66
|
+
StyledDonutCircle,
|
|
67
|
+
StyledHalfCircleWrapper,
|
|
68
|
+
StyledHalfCircleInnerFG,
|
|
69
|
+
StyledHalfCircleInnerBG,
|
|
70
|
+
StyledStrokeEnd,
|
|
66
71
|
};
|