@hero-design/rn 7.19.0 → 7.20.1
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/.eslintrc.json +6 -1
- package/.turbo/turbo-build.log +2 -2
- package/es/index.js +612 -242
- package/lib/index.js +612 -241
- package/package.json +4 -4
- package/src/components/Alert/StyledAlert.tsx +5 -5
- package/src/components/Alert/__tests__/__snapshots__/index.spec.tsx.snap +140 -19
- package/src/components/Alert/__tests__/index.spec.tsx +21 -0
- package/src/components/Alert/index.tsx +13 -6
- package/src/components/Avatar/StyledAvatar.tsx +2 -1
- package/src/components/Avatar/index.tsx +2 -1
- package/src/components/Box/StyledBox.tsx +54 -0
- package/src/components/Box/__tests__/__snapshots__/index.spec.tsx.snap +605 -0
- package/src/components/Box/__tests__/helpers.spec.ts +14 -0
- package/src/components/Box/__tests__/index.spec.tsx +155 -0
- package/src/components/Box/config.ts +201 -0
- package/src/components/Box/helpers.ts +10 -0
- package/src/components/Box/index.tsx +13 -0
- package/src/components/Box/types.ts +38 -0
- package/src/components/Calendar/__tests__/index.spec.tsx +13 -17
- package/src/components/Card/DataCard/StyledDataCard.tsx +8 -2
- package/src/components/Card/DataCard/__tests__/StyledDataCard.spec.tsx +1 -0
- package/src/components/Card/DataCard/__tests__/__snapshots__/StyledDataCard.spec.tsx.snap +16 -0
- package/src/components/Card/DataCard/index.tsx +1 -1
- package/src/components/Card/StyledCard.tsx +12 -19
- package/src/components/Card/__tests__/__snapshots__/index.spec.tsx.snap +147 -0
- package/src/components/Card/__tests__/index.spec.tsx +18 -0
- package/src/components/Card/index.tsx +6 -1
- package/src/components/Drawer/DragableDrawer/helpers.ts +3 -4
- package/src/components/FAB/ActionGroup/index.tsx +6 -8
- package/src/components/RichTextEditor/EditorToolbar.tsx +19 -18
- package/src/components/RichTextEditor/RichTextEditor.tsx +7 -2
- package/src/components/RichTextEditor/StyledRichTextEditor.ts +0 -2
- package/src/components/RichTextEditor/__tests__/RichTextEditor.spec.tsx +11 -12
- package/src/components/RichTextEditor/__tests__/__snapshots__/RichTextEditor.spec.tsx.snap +2 -10
- package/src/components/RichTextEditor/constants.ts +0 -11
- package/src/components/RichTextEditor/index.tsx +0 -3
- package/src/components/RichTextEditor/types.ts +9 -0
- package/src/components/SectionHeading/__tests__/__snapshots__/StyledHeading.spec.tsx.snap +1 -1
- package/src/components/SectionHeading/__tests__/__snapshots__/index.spec.tsx.snap +4 -4
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +22 -20
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +4 -4
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +22 -20
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +4 -4
- package/src/components/Spinner/AnimatedSpinner.tsx +7 -7
- package/src/components/Spinner/StyledSpinner.tsx +24 -19
- package/src/components/Spinner/__tests__/AnimatedSpinner.spec.tsx +1 -1
- package/src/components/Spinner/__tests__/StyledSpinner.spec.tsx +32 -16
- package/src/components/Spinner/__tests__/__snapshots__/AnimatedSpinner.spec.tsx.snap +14 -12
- package/src/components/Spinner/__tests__/__snapshots__/StyledSpinner.spec.tsx.snap +273 -31
- package/src/components/Spinner/__tests__/__snapshots__/index.spec.tsx.snap +14 -12
- package/src/components/Spinner/index.tsx +10 -2
- package/src/components/Tabs/ScrollableTabs.tsx +9 -4
- package/src/components/Tabs/StyledScrollableTabs.tsx +6 -5
- package/src/components/Tabs/StyledTabs.tsx +6 -0
- package/src/components/Tabs/TabWithBadge.tsx +68 -0
- package/src/components/Tabs/__tests__/ScrollableTabs.spec.tsx +13 -0
- package/src/components/Tabs/__tests__/TabWithBadge.spec.tsx +48 -0
- package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabs.spec.tsx.snap +205 -43
- package/src/components/Tabs/__tests__/__snapshots__/TabWithBadge.spec.tsx.snap +165 -0
- package/src/components/Tabs/__tests__/__snapshots__/index.spec.tsx.snap +135 -34
- package/src/components/Tabs/__tests__/index.spec.tsx +12 -0
- package/src/components/Tabs/index.tsx +11 -4
- package/src/components/Tag/StyledTag.tsx +1 -11
- package/src/components/Tag/__tests__/__snapshots__/Tag.spec.tsx.snap +4 -4
- package/src/components/Tag/index.tsx +2 -2
- package/src/components/TextInput/__tests__/index.spec.tsx +10 -14
- package/src/components/Toast/StyledToast.tsx +13 -7
- package/src/components/Toast/Toast.tsx +34 -9
- package/src/components/Toast/ToastProvider.tsx +15 -12
- package/src/components/Toast/__tests__/Toast.spec.tsx +17 -0
- package/src/components/Toast/__tests__/__snapshots__/Toast.spec.tsx.snap +299 -19
- package/src/components/Toast/types.ts +15 -1
- package/src/components/Typography/Text/StyledText.tsx +7 -1
- package/src/components/Typography/Text/__tests__/StyledText.spec.tsx +1 -0
- package/src/components/Typography/Text/__tests__/__snapshots__/StyledText.spec.tsx.snap +22 -0
- package/src/components/Typography/Text/index.tsx +7 -1
- package/src/index.ts +2 -0
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +76 -23
- package/src/theme/components/.eslintrc.json +10 -0
- package/src/theme/components/alert.ts +5 -1
- package/src/theme/components/avatar.ts +2 -0
- package/src/theme/components/card.ts +6 -7
- package/src/theme/components/sectionHeading.ts +1 -1
- package/src/theme/components/spinner.ts +19 -7
- package/src/theme/components/tabs.ts +3 -2
- package/src/theme/components/tag.ts +13 -13
- package/src/theme/components/toast.ts +17 -3
- package/src/theme/components/typography.ts +2 -0
- package/src/theme/global/colors/swag.ts +23 -0
- package/src/theme/global/colors/types.ts +23 -0
- package/src/theme/global/colors/work.ts +5 -0
- package/src/types.ts +0 -2
- package/tsconfig.json +4 -15
- package/types/components/Accordion/StyledAccordion.d.ts +14 -14
- package/types/components/Alert/StyledAlert.d.ts +16 -16
- package/types/components/Alert/index.d.ts +1 -1
- package/types/components/Avatar/StyledAvatar.d.ts +16 -16
- package/types/components/Avatar/index.d.ts +2 -2
- package/types/components/Badge/StyledBadge.d.ts +7 -7
- package/types/components/BottomNavigation/StyledBottomNavigation.d.ts +21 -21
- package/types/components/BottomSheet/Header.d.ts +1 -1
- package/types/components/BottomSheet/StyledBottomSheet.d.ts +19 -19
- package/types/components/Box/StyledBox.d.ts +15 -0
- package/types/components/Box/__tests__/helpers.spec.d.ts +1 -0
- package/types/components/Box/__tests__/index.spec.d.ts +1 -0
- package/types/components/Box/config.d.ts +170 -0
- package/types/components/Box/helpers.d.ts +1 -0
- package/types/components/Box/index.d.ts +5 -0
- package/types/components/Box/types.d.ts +31 -0
- package/types/components/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +7 -7
- package/types/components/Button/StyledButton.d.ts +16 -16
- package/types/components/Button/UtilityButton/StyledUtilityButton.d.ts +8 -8
- package/types/components/Calendar/StyledCalendar.d.ts +25 -25
- package/types/components/Calendar/helpers.d.ts +2 -2
- package/types/components/Card/DataCard/StyledDataCard.d.ts +7 -7
- package/types/components/Card/DataCard/index.d.ts +1 -1
- package/types/components/Card/StyledCard.d.ts +7 -6
- package/types/components/Card/index.d.ts +5 -1
- package/types/components/Checkbox/StyledCheckbox.d.ts +10 -10
- package/types/components/Collapse/StyledCollapse.d.ts +8 -8
- package/types/components/ContentNavigator/StyledContentNavigator.d.ts +5 -5
- package/types/components/DatePicker/StyledDatePicker.d.ts +3 -3
- package/types/components/Divider/StyledDivider.d.ts +5 -5
- package/types/components/Drawer/StyledDrawer.d.ts +19 -19
- package/types/components/Empty/StyledEmpty.d.ts +12 -12
- package/types/components/FAB/ActionGroup/StyledActionGroup.d.ts +11 -11
- package/types/components/FAB/ActionGroup/StyledActionItem.d.ts +7 -7
- package/types/components/FAB/StyledFAB.d.ts +8 -8
- package/types/components/Icon/HeroIcon/index.d.ts +3 -3
- package/types/components/List/StyledBasicListItem.d.ts +14 -14
- package/types/components/List/StyledListItem.d.ts +23 -23
- package/types/components/PinInput/StyledPinInput.d.ts +30 -30
- package/types/components/Progress/StyledProgressBar.d.ts +5 -5
- package/types/components/Progress/StyledProgressCircle.d.ts +18 -18
- package/types/components/Radio/StyledRadio.d.ts +9 -9
- package/types/components/RichTextEditor/EditorToolbar.d.ts +2 -2
- package/types/components/RichTextEditor/MentionList.d.ts +1 -1
- package/types/components/RichTextEditor/RichTextEditor.d.ts +4 -0
- package/types/components/RichTextEditor/StyledRichTextEditor.d.ts +6 -6
- package/types/components/RichTextEditor/StyledToolbar.d.ts +9 -9
- package/types/components/RichTextEditor/constants.d.ts +0 -10
- package/types/components/RichTextEditor/index.d.ts +2 -4
- package/types/components/RichTextEditor/types.d.ts +1 -0
- package/types/components/SectionHeading/StyledHeading.d.ts +9 -9
- package/types/components/Select/MultiSelect/Option.d.ts +1 -1
- package/types/components/Select/SingleSelect/Option.d.ts +1 -1
- package/types/components/Select/StyledSelect.d.ts +11 -11
- package/types/components/Select/helpers.d.ts +1 -1
- package/types/components/Spinner/AnimatedSpinner.d.ts +3 -1
- package/types/components/Spinner/StyledSpinner.d.ts +14 -12
- package/types/components/Spinner/index.d.ts +5 -1
- package/types/components/Switch/StyledSwitch.d.ts +5 -5
- package/types/components/Tabs/StyledScrollableTabs.d.ts +24 -22
- package/types/components/Tabs/StyledTabs.d.ts +26 -20
- package/types/components/Tabs/TabWithBadge.d.ts +17 -0
- package/types/components/Tabs/__tests__/TabWithBadge.spec.d.ts +1 -0
- package/types/components/Tabs/index.d.ts +3 -1
- package/types/components/Tag/StyledTag.d.ts +6 -6
- package/types/components/Tag/index.d.ts +1 -1
- package/types/components/TextInput/StyledTextInput.d.ts +44 -44
- package/types/components/TextInput/index.d.ts +5 -5
- package/types/components/TimePicker/StyledTimePicker.d.ts +3 -3
- package/types/components/Toast/StyledToast.d.ts +19 -18
- package/types/components/Toast/types.d.ts +2 -1
- package/types/components/Toolbar/StyledToolbar.d.ts +9 -9
- package/types/components/Typography/Text/StyledText.d.ts +4 -4
- package/types/components/Typography/Text/index.d.ts +1 -1
- package/types/index.d.ts +2 -1
- package/types/testHelpers/renderWithTheme.d.ts +1 -1
- package/types/theme/ThemeSwitcher.d.ts +1 -1
- package/types/theme/components/alert.d.ts +5 -1
- package/types/theme/components/avatar.d.ts +2 -0
- package/types/theme/components/card.d.ts +6 -7
- package/types/theme/components/spinner.d.ts +17 -5
- package/types/theme/components/tabs.d.ts +1 -0
- package/types/theme/components/tag.d.ts +2 -2
- package/types/theme/components/toast.d.ts +18 -2
- package/types/theme/components/typography.d.ts +2 -0
- package/types/theme/global/colors/types.d.ts +17 -0
- package/types/theme/global/index.d.ts +17 -0
- package/types/types.d.ts +1 -2
- package/types/utils/hooks.d.ts +1 -1
|
@@ -74,7 +74,7 @@ exports[`OptionList render isLoading correctly 1`] = `
|
|
|
74
74
|
Array [
|
|
75
75
|
Object {
|
|
76
76
|
"alignContent": "center",
|
|
77
|
-
"backgroundColor": "#
|
|
77
|
+
"backgroundColor": "#f6f6f7",
|
|
78
78
|
"display": "flex",
|
|
79
79
|
"flexDirection": "row",
|
|
80
80
|
"justifyContent": "space-between",
|
|
@@ -298,7 +298,7 @@ exports[`OptionList render isLoading correctly 1`] = `
|
|
|
298
298
|
Array [
|
|
299
299
|
Object {
|
|
300
300
|
"alignContent": "center",
|
|
301
|
-
"backgroundColor": "#
|
|
301
|
+
"backgroundColor": "#f6f6f7",
|
|
302
302
|
"display": "flex",
|
|
303
303
|
"flexDirection": "row",
|
|
304
304
|
"justifyContent": "space-between",
|
|
@@ -688,6 +688,7 @@ exports[`OptionList render isLoading correctly 1`] = `
|
|
|
688
688
|
]
|
|
689
689
|
}
|
|
690
690
|
themePosition="top"
|
|
691
|
+
themeSize="medium"
|
|
691
692
|
>
|
|
692
693
|
<View
|
|
693
694
|
collapsable={false}
|
|
@@ -695,16 +696,16 @@ exports[`OptionList render isLoading correctly 1`] = `
|
|
|
695
696
|
style={
|
|
696
697
|
Array [
|
|
697
698
|
Object {
|
|
698
|
-
"backgroundColor": "#
|
|
699
|
-
"borderRadius":
|
|
699
|
+
"backgroundColor": "#795e90",
|
|
700
|
+
"borderRadius": 999,
|
|
700
701
|
"height": 16,
|
|
701
|
-
"opacity": 1,
|
|
702
702
|
"width": 16,
|
|
703
703
|
},
|
|
704
704
|
Object {},
|
|
705
705
|
]
|
|
706
706
|
}
|
|
707
707
|
themePosition="topLeft"
|
|
708
|
+
themeSize="medium"
|
|
708
709
|
/>
|
|
709
710
|
<View
|
|
710
711
|
collapsable={false}
|
|
@@ -712,17 +713,17 @@ exports[`OptionList render isLoading correctly 1`] = `
|
|
|
712
713
|
style={
|
|
713
714
|
Array [
|
|
714
715
|
Object {
|
|
715
|
-
"backgroundColor": "#
|
|
716
|
-
"borderRadius":
|
|
716
|
+
"backgroundColor": "#a08cb0",
|
|
717
|
+
"borderRadius": 999,
|
|
717
718
|
"height": 16,
|
|
718
719
|
"marginLeft": 8,
|
|
719
|
-
"opacity": 0.7,
|
|
720
720
|
"width": 16,
|
|
721
721
|
},
|
|
722
722
|
Object {},
|
|
723
723
|
]
|
|
724
724
|
}
|
|
725
725
|
themePosition="topRight"
|
|
726
|
+
themeSize="medium"
|
|
726
727
|
/>
|
|
727
728
|
</View>
|
|
728
729
|
<View
|
|
@@ -738,6 +739,7 @@ exports[`OptionList render isLoading correctly 1`] = `
|
|
|
738
739
|
]
|
|
739
740
|
}
|
|
740
741
|
themePosition="bottom"
|
|
742
|
+
themeSize="medium"
|
|
741
743
|
>
|
|
742
744
|
<View
|
|
743
745
|
collapsable={false}
|
|
@@ -745,16 +747,16 @@ exports[`OptionList render isLoading correctly 1`] = `
|
|
|
745
747
|
style={
|
|
746
748
|
Array [
|
|
747
749
|
Object {
|
|
748
|
-
"backgroundColor": "#
|
|
749
|
-
"borderRadius":
|
|
750
|
+
"backgroundColor": "#d9d1df",
|
|
751
|
+
"borderRadius": 999,
|
|
750
752
|
"height": 16,
|
|
751
|
-
"opacity": 0.5,
|
|
752
753
|
"width": 16,
|
|
753
754
|
},
|
|
754
755
|
Object {},
|
|
755
756
|
]
|
|
756
757
|
}
|
|
757
758
|
themePosition="bottomLeft"
|
|
759
|
+
themeSize="medium"
|
|
758
760
|
/>
|
|
759
761
|
<View
|
|
760
762
|
collapsable={false}
|
|
@@ -762,17 +764,17 @@ exports[`OptionList render isLoading correctly 1`] = `
|
|
|
762
764
|
style={
|
|
763
765
|
Array [
|
|
764
766
|
Object {
|
|
765
|
-
"backgroundColor": "#
|
|
766
|
-
"borderRadius":
|
|
767
|
+
"backgroundColor": "#ece8ef",
|
|
768
|
+
"borderRadius": 999,
|
|
767
769
|
"height": 16,
|
|
768
770
|
"marginLeft": 8,
|
|
769
|
-
"opacity": 0.3,
|
|
770
771
|
"width": 16,
|
|
771
772
|
},
|
|
772
773
|
Object {},
|
|
773
774
|
]
|
|
774
775
|
}
|
|
775
776
|
themePosition="bottomRight"
|
|
777
|
+
themeSize="medium"
|
|
776
778
|
/>
|
|
777
779
|
</View>
|
|
778
780
|
</View>
|
|
@@ -846,7 +848,7 @@ exports[`OptionList renders correctly 1`] = `
|
|
|
846
848
|
Array [
|
|
847
849
|
Object {
|
|
848
850
|
"alignContent": "center",
|
|
849
|
-
"backgroundColor": "#
|
|
851
|
+
"backgroundColor": "#f6f6f7",
|
|
850
852
|
"display": "flex",
|
|
851
853
|
"flexDirection": "row",
|
|
852
854
|
"justifyContent": "space-between",
|
|
@@ -1070,7 +1072,7 @@ exports[`OptionList renders correctly 1`] = `
|
|
|
1070
1072
|
Array [
|
|
1071
1073
|
Object {
|
|
1072
1074
|
"alignContent": "center",
|
|
1073
|
-
"backgroundColor": "#
|
|
1075
|
+
"backgroundColor": "#f6f6f7",
|
|
1074
1076
|
"display": "flex",
|
|
1075
1077
|
"flexDirection": "row",
|
|
1076
1078
|
"justifyContent": "space-between",
|
|
@@ -1468,7 +1470,7 @@ exports[`OptionList trigger onPress correctly on select new value 1`] = `
|
|
|
1468
1470
|
Array [
|
|
1469
1471
|
Object {
|
|
1470
1472
|
"alignContent": "center",
|
|
1471
|
-
"backgroundColor": "#
|
|
1473
|
+
"backgroundColor": "#f6f6f7",
|
|
1472
1474
|
"display": "flex",
|
|
1473
1475
|
"flexDirection": "row",
|
|
1474
1476
|
"justifyContent": "space-between",
|
|
@@ -1692,7 +1694,7 @@ exports[`OptionList trigger onPress correctly on select new value 1`] = `
|
|
|
1692
1694
|
Array [
|
|
1693
1695
|
Object {
|
|
1694
1696
|
"alignContent": "center",
|
|
1695
|
-
"backgroundColor": "#
|
|
1697
|
+
"backgroundColor": "#f6f6f7",
|
|
1696
1698
|
"display": "flex",
|
|
1697
1699
|
"flexDirection": "row",
|
|
1698
1700
|
"justifyContent": "space-between",
|
|
@@ -2090,7 +2092,7 @@ exports[`OptionList trigger onPress correctly on unselect current value 1`] = `
|
|
|
2090
2092
|
Array [
|
|
2091
2093
|
Object {
|
|
2092
2094
|
"alignContent": "center",
|
|
2093
|
-
"backgroundColor": "#
|
|
2095
|
+
"backgroundColor": "#f6f6f7",
|
|
2094
2096
|
"display": "flex",
|
|
2095
2097
|
"flexDirection": "row",
|
|
2096
2098
|
"justifyContent": "space-between",
|
|
@@ -2314,7 +2316,7 @@ exports[`OptionList trigger onPress correctly on unselect current value 1`] = `
|
|
|
2314
2316
|
Array [
|
|
2315
2317
|
Object {
|
|
2316
2318
|
"alignContent": "center",
|
|
2317
|
-
"backgroundColor": "#
|
|
2319
|
+
"backgroundColor": "#f6f6f7",
|
|
2318
2320
|
"display": "flex",
|
|
2319
2321
|
"flexDirection": "row",
|
|
2320
2322
|
"justifyContent": "space-between",
|
|
@@ -449,7 +449,7 @@ Array [
|
|
|
449
449
|
Array [
|
|
450
450
|
Object {
|
|
451
451
|
"alignContent": "center",
|
|
452
|
-
"backgroundColor": "#
|
|
452
|
+
"backgroundColor": "#f6f6f7",
|
|
453
453
|
"display": "flex",
|
|
454
454
|
"flexDirection": "row",
|
|
455
455
|
"justifyContent": "space-between",
|
|
@@ -852,7 +852,7 @@ Array [
|
|
|
852
852
|
Array [
|
|
853
853
|
Object {
|
|
854
854
|
"alignContent": "center",
|
|
855
|
-
"backgroundColor": "#
|
|
855
|
+
"backgroundColor": "#f6f6f7",
|
|
856
856
|
"display": "flex",
|
|
857
857
|
"flexDirection": "row",
|
|
858
858
|
"justifyContent": "space-between",
|
|
@@ -5898,7 +5898,7 @@ Array [
|
|
|
5898
5898
|
Array [
|
|
5899
5899
|
Object {
|
|
5900
5900
|
"alignContent": "center",
|
|
5901
|
-
"backgroundColor": "#
|
|
5901
|
+
"backgroundColor": "#f6f6f7",
|
|
5902
5902
|
"display": "flex",
|
|
5903
5903
|
"flexDirection": "row",
|
|
5904
5904
|
"justifyContent": "space-between",
|
|
@@ -6122,7 +6122,7 @@ Array [
|
|
|
6122
6122
|
Array [
|
|
6123
6123
|
Object {
|
|
6124
6124
|
"alignContent": "center",
|
|
6125
|
-
"backgroundColor": "#
|
|
6125
|
+
"backgroundColor": "#f6f6f7",
|
|
6126
6126
|
"display": "flex",
|
|
6127
6127
|
"flexDirection": "row",
|
|
6128
6128
|
"justifyContent": "space-between",
|
|
@@ -7,7 +7,7 @@ const AnimatedRow = Animated.createAnimatedComponent(StyledSpinnerRow);
|
|
|
7
7
|
|
|
8
8
|
const AnimatedDot = Animated.createAnimatedComponent(StyledSpinnerDot);
|
|
9
9
|
|
|
10
|
-
const AnimatedSpinner = () => {
|
|
10
|
+
const AnimatedSpinner = ({ size = 'medium' }: { size: 'small' | 'medium' }) => {
|
|
11
11
|
const rotateAnimation = useRef<Animated.Value>(new Animated.Value(0));
|
|
12
12
|
|
|
13
13
|
useEffect(() => {
|
|
@@ -40,13 +40,13 @@ const AnimatedSpinner = () => {
|
|
|
40
40
|
},
|
|
41
41
|
])}
|
|
42
42
|
>
|
|
43
|
-
<AnimatedRow themePosition="top">
|
|
44
|
-
<AnimatedDot themePosition="topLeft" />
|
|
45
|
-
<AnimatedDot themePosition="topRight" />
|
|
43
|
+
<AnimatedRow themePosition="top" themeSize={size}>
|
|
44
|
+
<AnimatedDot themePosition="topLeft" themeSize={size} />
|
|
45
|
+
<AnimatedDot themePosition="topRight" themeSize={size} />
|
|
46
46
|
</AnimatedRow>
|
|
47
|
-
<AnimatedRow themePosition="bottom">
|
|
48
|
-
<AnimatedDot themePosition="bottomLeft" />
|
|
49
|
-
<AnimatedDot themePosition="bottomRight" />
|
|
47
|
+
<AnimatedRow themePosition="bottom" themeSize={size}>
|
|
48
|
+
<AnimatedDot themePosition="bottomLeft" themeSize={size} />
|
|
49
|
+
<AnimatedDot themePosition="bottomRight" themeSize={size} />
|
|
50
50
|
</AnimatedRow>
|
|
51
51
|
</Animated.View>
|
|
52
52
|
);
|
|
@@ -11,43 +11,48 @@ const StyledSpinnerContainer = styled(View)<ViewProps>({
|
|
|
11
11
|
alignItems: 'center',
|
|
12
12
|
});
|
|
13
13
|
|
|
14
|
-
const StyledSpinnerRow = styled(View)<{
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
14
|
+
const StyledSpinnerRow = styled(View)<{
|
|
15
|
+
themePosition: 'top' | 'bottom';
|
|
16
|
+
themeSize: 'small' | 'medium';
|
|
17
|
+
}>(({ themePosition, themeSize = 'medium', theme }) => ({
|
|
18
|
+
flexDirection: 'row',
|
|
19
|
+
marginBottom:
|
|
20
|
+
themePosition === 'top'
|
|
21
|
+
? theme.__hd__.spinner.space.spinnerDotPadding[themeSize]
|
|
22
|
+
: 0,
|
|
23
|
+
}));
|
|
23
24
|
|
|
24
25
|
const StyledSpinnerDot = styled(View)<{
|
|
25
26
|
themePosition: 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight';
|
|
26
|
-
|
|
27
|
+
themeSize: 'small' | 'medium';
|
|
28
|
+
}>(({ themePosition, themeSize = 'medium', theme }) => {
|
|
27
29
|
const themeStyling = () => {
|
|
28
30
|
switch (themePosition) {
|
|
29
31
|
case 'topLeft':
|
|
30
|
-
return {
|
|
32
|
+
return {
|
|
33
|
+
backgroundColor: theme.__hd__.spinner.colors.dot1,
|
|
34
|
+
};
|
|
31
35
|
case 'topRight':
|
|
32
36
|
return {
|
|
33
|
-
marginLeft: theme.__hd__.spinner.space.spinnerDotPadding,
|
|
34
|
-
|
|
37
|
+
marginLeft: theme.__hd__.spinner.space.spinnerDotPadding[themeSize],
|
|
38
|
+
backgroundColor: theme.__hd__.spinner.colors.dot2,
|
|
35
39
|
};
|
|
36
40
|
case 'bottomLeft':
|
|
37
|
-
return {
|
|
41
|
+
return {
|
|
42
|
+
backgroundColor: theme.__hd__.spinner.colors.dot3,
|
|
43
|
+
};
|
|
38
44
|
case 'bottomRight':
|
|
39
45
|
return {
|
|
40
|
-
marginLeft: theme.__hd__.spinner.space.spinnerDotPadding,
|
|
41
|
-
|
|
46
|
+
marginLeft: theme.__hd__.spinner.space.spinnerDotPadding[themeSize],
|
|
47
|
+
backgroundColor: theme.__hd__.spinner.colors.dot4,
|
|
42
48
|
};
|
|
43
49
|
}
|
|
44
50
|
};
|
|
45
51
|
|
|
46
52
|
return {
|
|
47
|
-
height: scale(theme.__hd__.spinner.space.spinnerDot),
|
|
48
|
-
width: scale(theme.__hd__.spinner.space.spinnerDot),
|
|
53
|
+
height: scale(theme.__hd__.spinner.space.spinnerDot[themeSize]),
|
|
54
|
+
width: scale(theme.__hd__.spinner.space.spinnerDot[themeSize]),
|
|
49
55
|
borderRadius: theme.__hd__.spinner.radii.default,
|
|
50
|
-
backgroundColor: theme.__hd__.spinner.color.default,
|
|
51
56
|
...themeStyling(),
|
|
52
57
|
};
|
|
53
58
|
});
|
|
@@ -4,7 +4,7 @@ import { AnimatedSpinner } from '../AnimatedSpinner';
|
|
|
4
4
|
|
|
5
5
|
describe('AnimatedSpinner', () => {
|
|
6
6
|
it('renders correctly', () => {
|
|
7
|
-
const { toJSON } = renderWithTheme(<AnimatedSpinner />);
|
|
7
|
+
const { toJSON } = renderWithTheme(<AnimatedSpinner size="medium" />);
|
|
8
8
|
|
|
9
9
|
expect(toJSON()).toMatchSnapshot();
|
|
10
10
|
});
|
|
@@ -8,10 +8,20 @@ import {
|
|
|
8
8
|
} from '../StyledSpinner';
|
|
9
9
|
|
|
10
10
|
describe('StyledSpinnerContainer', () => {
|
|
11
|
-
it('renders correctly', () => {
|
|
11
|
+
it('renders correctly in small size', () => {
|
|
12
12
|
const { toJSON } = renderWithTheme(
|
|
13
13
|
<StyledSpinnerContainer>
|
|
14
|
-
<AnimatedSpinner />
|
|
14
|
+
<AnimatedSpinner size="small" />
|
|
15
|
+
</StyledSpinnerContainer>
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
expect(toJSON()).toMatchSnapshot();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('renders correctly in medium size', () => {
|
|
22
|
+
const { toJSON } = renderWithTheme(
|
|
23
|
+
<StyledSpinnerContainer>
|
|
24
|
+
<AnimatedSpinner size="medium" />
|
|
15
25
|
</StyledSpinnerContainer>
|
|
16
26
|
);
|
|
17
27
|
|
|
@@ -21,14 +31,16 @@ describe('StyledSpinnerContainer', () => {
|
|
|
21
31
|
|
|
22
32
|
describe('StyledSpinnerRow', () => {
|
|
23
33
|
it.each`
|
|
24
|
-
themePosition
|
|
25
|
-
${'top'}
|
|
26
|
-
${'bottom'}
|
|
34
|
+
themePosition | themeSize
|
|
35
|
+
${'top'} | ${'small'}
|
|
36
|
+
${'bottom'} | ${'small'}
|
|
37
|
+
${'top'} | ${'medium'}
|
|
38
|
+
${'bottom'} | ${'medium'}
|
|
27
39
|
`(
|
|
28
|
-
'renders correctly when position is $themePosition',
|
|
29
|
-
({ themePosition }) => {
|
|
40
|
+
'renders correctly when position is $themePosition, and size is $themeSize',
|
|
41
|
+
({ themePosition, themeSize }) => {
|
|
30
42
|
const { toJSON } = renderWithTheme(
|
|
31
|
-
<StyledSpinnerRow themePosition={themePosition} />
|
|
43
|
+
<StyledSpinnerRow themePosition={themePosition} themeSize={themeSize} />
|
|
32
44
|
);
|
|
33
45
|
|
|
34
46
|
expect(toJSON()).toMatchSnapshot();
|
|
@@ -38,16 +50,20 @@ describe('StyledSpinnerRow', () => {
|
|
|
38
50
|
|
|
39
51
|
describe('StyledSpinnerText', () => {
|
|
40
52
|
it.each`
|
|
41
|
-
themePosition
|
|
42
|
-
${'topLeft'}
|
|
43
|
-
${'topRight'}
|
|
44
|
-
${'bottomLeft'}
|
|
45
|
-
${'bottomRight'}
|
|
53
|
+
themePosition | themeSize
|
|
54
|
+
${'topLeft'} | ${'small'}
|
|
55
|
+
${'topRight'} | ${'small'}
|
|
56
|
+
${'bottomLeft'} | ${'small'}
|
|
57
|
+
${'bottomRight'} | ${'small'}
|
|
58
|
+
${'topLeft'} | ${'medium'}
|
|
59
|
+
${'topRight'} | ${'medium'}
|
|
60
|
+
${'bottomLeft'} | ${'medium'}
|
|
61
|
+
${'bottomRight'} | ${'medium'}
|
|
46
62
|
`(
|
|
47
|
-
'renders correctly when position is $themePosition',
|
|
48
|
-
({ themePosition }) => {
|
|
63
|
+
'renders correctly when position is $themePosition, size is $themeSize',
|
|
64
|
+
({ themePosition, themeSize }) => {
|
|
49
65
|
const { toJSON } = renderWithTheme(
|
|
50
|
-
<StyledSpinnerDot themePosition={themePosition} />
|
|
66
|
+
<StyledSpinnerDot themePosition={themePosition} themeSize={themeSize} />
|
|
51
67
|
);
|
|
52
68
|
|
|
53
69
|
expect(toJSON()).toMatchSnapshot();
|
|
@@ -27,6 +27,7 @@ exports[`AnimatedSpinner renders correctly 1`] = `
|
|
|
27
27
|
]
|
|
28
28
|
}
|
|
29
29
|
themePosition="top"
|
|
30
|
+
themeSize="medium"
|
|
30
31
|
>
|
|
31
32
|
<View
|
|
32
33
|
collapsable={false}
|
|
@@ -34,16 +35,16 @@ exports[`AnimatedSpinner renders correctly 1`] = `
|
|
|
34
35
|
style={
|
|
35
36
|
Array [
|
|
36
37
|
Object {
|
|
37
|
-
"backgroundColor": "#
|
|
38
|
-
"borderRadius":
|
|
38
|
+
"backgroundColor": "#795e90",
|
|
39
|
+
"borderRadius": 999,
|
|
39
40
|
"height": 16,
|
|
40
|
-
"opacity": 1,
|
|
41
41
|
"width": 16,
|
|
42
42
|
},
|
|
43
43
|
Object {},
|
|
44
44
|
]
|
|
45
45
|
}
|
|
46
46
|
themePosition="topLeft"
|
|
47
|
+
themeSize="medium"
|
|
47
48
|
/>
|
|
48
49
|
<View
|
|
49
50
|
collapsable={false}
|
|
@@ -51,17 +52,17 @@ exports[`AnimatedSpinner renders correctly 1`] = `
|
|
|
51
52
|
style={
|
|
52
53
|
Array [
|
|
53
54
|
Object {
|
|
54
|
-
"backgroundColor": "#
|
|
55
|
-
"borderRadius":
|
|
55
|
+
"backgroundColor": "#a08cb0",
|
|
56
|
+
"borderRadius": 999,
|
|
56
57
|
"height": 16,
|
|
57
58
|
"marginLeft": 8,
|
|
58
|
-
"opacity": 0.7,
|
|
59
59
|
"width": 16,
|
|
60
60
|
},
|
|
61
61
|
Object {},
|
|
62
62
|
]
|
|
63
63
|
}
|
|
64
64
|
themePosition="topRight"
|
|
65
|
+
themeSize="medium"
|
|
65
66
|
/>
|
|
66
67
|
</View>
|
|
67
68
|
<View
|
|
@@ -77,6 +78,7 @@ exports[`AnimatedSpinner renders correctly 1`] = `
|
|
|
77
78
|
]
|
|
78
79
|
}
|
|
79
80
|
themePosition="bottom"
|
|
81
|
+
themeSize="medium"
|
|
80
82
|
>
|
|
81
83
|
<View
|
|
82
84
|
collapsable={false}
|
|
@@ -84,16 +86,16 @@ exports[`AnimatedSpinner renders correctly 1`] = `
|
|
|
84
86
|
style={
|
|
85
87
|
Array [
|
|
86
88
|
Object {
|
|
87
|
-
"backgroundColor": "#
|
|
88
|
-
"borderRadius":
|
|
89
|
+
"backgroundColor": "#d9d1df",
|
|
90
|
+
"borderRadius": 999,
|
|
89
91
|
"height": 16,
|
|
90
|
-
"opacity": 0.5,
|
|
91
92
|
"width": 16,
|
|
92
93
|
},
|
|
93
94
|
Object {},
|
|
94
95
|
]
|
|
95
96
|
}
|
|
96
97
|
themePosition="bottomLeft"
|
|
98
|
+
themeSize="medium"
|
|
97
99
|
/>
|
|
98
100
|
<View
|
|
99
101
|
collapsable={false}
|
|
@@ -101,17 +103,17 @@ exports[`AnimatedSpinner renders correctly 1`] = `
|
|
|
101
103
|
style={
|
|
102
104
|
Array [
|
|
103
105
|
Object {
|
|
104
|
-
"backgroundColor": "#
|
|
105
|
-
"borderRadius":
|
|
106
|
+
"backgroundColor": "#ece8ef",
|
|
107
|
+
"borderRadius": 999,
|
|
106
108
|
"height": 16,
|
|
107
109
|
"marginLeft": 8,
|
|
108
|
-
"opacity": 0.3,
|
|
109
110
|
"width": 16,
|
|
110
111
|
},
|
|
111
112
|
Object {},
|
|
112
113
|
]
|
|
113
114
|
}
|
|
114
115
|
themePosition="bottomRight"
|
|
116
|
+
themeSize="medium"
|
|
115
117
|
/>
|
|
116
118
|
</View>
|
|
117
119
|
</View>
|