@hero-design/rn 7.23.0 → 7.25.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/assets/fonts/hero-icons.ttf +0 -0
- package/es/index.js +1364 -9239
- package/lib/assets/fonts/hero-icons.ttf +0 -0
- package/lib/index.js +1368 -9238
- package/package.json +7 -4
- package/rollup.config.js +1 -0
- package/src/components/Accordion/__tests__/__snapshots__/AccordionItem.spec.tsx.snap +4 -4
- package/src/components/Accordion/__tests__/__snapshots__/index.spec.tsx.snap +6 -6
- package/src/components/Attachment/StyledAttachment.tsx +44 -0
- package/src/components/Attachment/__tests__/__snapshots__/index.spec.tsx.snap +158 -0
- package/src/components/Attachment/__tests__/index.spec.tsx +59 -0
- package/src/components/Attachment/index.tsx +77 -0
- 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/Status.tsx +1 -1
- package/src/components/Badge/StyledBadge.tsx +8 -1
- package/src/components/Badge/__tests__/Badge.spec.tsx +9 -0
- package/src/components/Badge/__tests__/__snapshots__/Badge.spec.tsx.snap +44 -0
- package/src/components/Badge/index.tsx +1 -1
- package/src/components/BottomNavigation/__tests__/__snapshots__/index.spec.tsx.snap +3 -3
- package/src/components/BottomSheet/Header.tsx +2 -1
- package/src/components/BottomSheet/__tests__/__snapshots__/index.spec.tsx.snap +52 -52
- package/src/components/BottomSheet/index.tsx +4 -4
- package/src/components/Button/Button.tsx +0 -11
- package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/StyledLoadingIndicator.spec.tsx.snap +4 -4
- package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/index.spec.tsx.snap +12 -12
- package/src/components/Button/LoadingIndicator/index.tsx +1 -1
- package/src/components/Button/StyledButton.tsx +24 -63
- package/src/components/Button/UtilityButton/__tests__/index.spec.tsx +2 -2
- package/src/components/Button/__tests__/Button.spec.tsx +10 -5
- package/src/components/Button/__tests__/StyledButton.spec.tsx +0 -70
- package/src/components/Button/__tests__/__snapshots__/StyledButton.spec.tsx.snap +301 -1206
- package/src/components/Calendar/CalendarRowItem.tsx +1 -4
- package/src/components/Calendar/__tests__/__snapshots__/CalendarRowItem.spec.tsx.snap +5 -5
- package/src/components/Calendar/index.tsx +4 -3
- package/src/components/Card/DataCard/__tests__/__snapshots__/StyledDataCard.spec.tsx.snap +1 -1
- package/src/components/Card/__tests__/__snapshots__/StyledCard.spec.tsx.snap +1 -1
- package/src/components/Card/__tests__/__snapshots__/index.spec.tsx.snap +1 -1
- package/src/components/Checkbox/StyledCheckbox.tsx +7 -5
- package/src/components/Checkbox/__tests__/__snapshots__/StyledCheckbox.spec.tsx.snap +4 -12
- package/src/components/Checkbox/__tests__/__snapshots__/index.spec.tsx.snap +95 -42
- package/src/components/Checkbox/index.tsx +4 -2
- package/src/components/ContentNavigator/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
- package/src/components/ContentNavigator/index.tsx +14 -9
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerAndroid.spec.tsx.snap +2 -0
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerIOS.spec.tsx.snap +29 -27
- package/src/components/Drawer/DragableDrawer/index.tsx +0 -2
- package/src/components/Empty/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
- package/src/components/Empty/index.tsx +1 -2
- package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +12 -12
- package/src/components/FAB/__tests__/__snapshots__/StyledFAB.spec.tsx.snap +1 -1
- package/src/components/FAB/__tests__/__snapshots__/index.spec.tsx.snap +3 -3
- package/src/components/Icon/HeroIcon/fonts/hero-icons.ttf +0 -0
- package/src/components/Icon/HeroIcon/glyphMap.json +1 -0
- package/src/components/Icon/HeroIcon/index.tsx +3 -7
- package/src/components/Icon/IconList.ts +36 -6
- package/src/components/Icon/__tests__/__snapshots__/index.spec.tsx.snap +1 -1
- package/src/components/Icon/index.tsx +1 -0
- package/src/components/List/BasicListItem.tsx +13 -8
- package/src/components/List/ListItem.tsx +8 -6
- package/src/components/List/StyledBasicListItem.tsx +2 -2
- package/src/components/List/StyledListItem.tsx +2 -2
- package/src/components/List/__tests__/__snapshots__/BasicListItem.spec.tsx.snap +24 -36
- package/src/components/List/__tests__/__snapshots__/ListItem.spec.tsx.snap +39 -59
- package/src/components/List/__tests__/__snapshots__/StyledBasicListItem.spec.tsx.snap +40 -44
- package/src/components/List/__tests__/__snapshots__/StyledListItem.spec.tsx.snap +50 -50
- package/src/components/PinInput/__tests__/__snapshots__/PinCell.spec.tsx.snap +6 -6
- package/src/components/PinInput/__tests__/__snapshots__/index.spec.tsx.snap +21 -21
- package/src/components/Progress/ProgressBar.tsx +1 -1
- package/src/components/Progress/ProgressCircle.tsx +1 -1
- package/src/components/Progress/__tests__/__snapshots__/index.spec.js.snap +10 -10
- package/src/components/Progress/types.ts +7 -1
- package/src/components/Radio/__tests__/__snapshots__/Radio.spec.tsx.snap +20 -32
- package/src/components/Radio/__tests__/__snapshots__/RadioGroup.spec.tsx.snap +30 -48
- package/src/components/RefreshControl/__tests__/index.spec.tsx +1 -3
- package/src/components/RefreshControl/index.tsx +4 -2
- package/src/components/RichTextEditor/MentionList.tsx +12 -3
- package/src/components/RichTextEditor/RichTextEditor.tsx +4 -8
- package/src/components/RichTextEditor/__tests__/__snapshots__/RichTextEditor.spec.tsx.snap +6 -4
- package/src/components/SectionHeading/__tests__/__snapshots__/index.spec.tsx.snap +1 -1
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/Option.spec.tsx.snap +13 -20
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +154 -238
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +435 -650
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/Option.spec.tsx.snap +11 -18
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +144 -228
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +414 -629
- package/src/components/Select/StyledOptionList.tsx +0 -1
- package/src/components/Select/__tests__/__snapshots__/StyledSelect.spec.tsx.snap +1 -1
- package/src/components/Spinner/AnimatedSpinner.tsx +22 -7
- package/src/components/Spinner/StyledSpinner.tsx +15 -11
- package/src/components/Spinner/__tests__/AnimatedSpinner.spec.tsx +3 -1
- package/src/components/Spinner/__tests__/StyledSpinner.spec.tsx +42 -31
- package/src/components/Spinner/__tests__/__snapshots__/AnimatedSpinner.spec.tsx.snap +12 -8
- package/src/components/Spinner/__tests__/__snapshots__/StyledSpinner.spec.tsx.snap +543 -83
- package/src/components/Spinner/__tests__/__snapshots__/index.spec.tsx.snap +12 -8
- package/src/components/Spinner/index.tsx +6 -1
- package/src/components/Swipeable/StyledSwipeable.tsx +11 -0
- package/src/components/Swipeable/SwipeableAction.tsx +45 -0
- package/src/components/Swipeable/__tests__/SwipeableAction.spec.tsx +37 -0
- package/src/components/Swipeable/__tests__/__snapshots__/SwipeableAction.spec.tsx.snap +130 -0
- package/src/components/Swipeable/__tests__/__snapshots__/index.spec.tsx.snap +33 -0
- package/src/components/Swipeable/__tests__/index.spec.tsx +34 -0
- package/src/components/Swipeable/index.tsx +160 -0
- package/src/components/Switch/SelectorSwitch/Option.tsx +1 -5
- package/src/components/Switch/SelectorSwitch/__tests__/__snapshots__/Option.spec.tsx.snap +3 -3
- package/src/components/Switch/SelectorSwitch/__tests__/__snapshots__/index.spec.tsx.snap +3 -3
- package/src/components/Switch/SelectorSwitch/__tests__/index.spec.tsx +1 -0
- package/src/components/Switch/SelectorSwitch/index.tsx +4 -1
- package/src/components/Switch/__tests__/__snapshots__/StyledSwitch.spec.tsx.snap +1 -1
- package/src/components/Tabs/StyledTabs.tsx +1 -1
- package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabs.spec.tsx.snap +1 -1
- package/src/components/Tabs/__tests__/__snapshots__/index.spec.tsx.snap +1 -1
- package/src/components/Tag/__tests__/__snapshots__/Tag.spec.tsx.snap +2 -2
- package/src/components/TextInput/StyledTextInput.tsx +7 -12
- package/src/components/TextInput/__tests__/StyledTextInput.spec.tsx +12 -6
- package/src/components/TextInput/__tests__/__snapshots__/StyledTextInput.spec.tsx.snap +31 -146
- package/src/components/TextInput/__tests__/__snapshots__/index.spec.tsx.snap +40 -14
- package/src/components/TextInput/__tests__/index.spec.tsx +114 -124
- package/src/components/TextInput/index.tsx +8 -6
- package/src/components/TimePicker/__tests__/__snapshots__/TimePickerAndroid.spec.tsx.snap +2 -0
- package/src/components/TimePicker/__tests__/__snapshots__/TimePickerIOS.spec.tsx.snap +29 -27
- package/src/components/Toast/Toast.tsx +0 -3
- package/src/components/Toast/ToastProvider.tsx +1 -0
- package/src/components/Toast/__tests__/index.spec.tsx +1 -1
- package/src/components/Toolbar/__tests__/__snapshots__/ToolbarGroup.spec.tsx.snap +12 -12
- package/src/components/Toolbar/__tests__/__snapshots__/ToolbarItem.spec.tsx.snap +6 -6
- package/src/components/Typography/Text/__tests__/__snapshots__/StyledText.spec.tsx.snap +4 -4
- package/src/emotion.d.ts +1 -0
- package/src/index.ts +10 -0
- package/src/theme/ThemeSwitcher.tsx +7 -1
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +96 -78
- package/src/theme/__tests__/ensureCompatibleWithV7.spec.tsx +13 -0
- package/src/theme/components/alert.ts +1 -1
- package/src/theme/components/attachment.ts +28 -0
- package/src/theme/components/avatar.ts +1 -1
- package/src/theme/components/badge.ts +2 -1
- package/src/theme/components/bottomNavigation.ts +1 -1
- package/src/theme/components/bottomSheet.ts +2 -2
- package/src/theme/components/button.ts +4 -20
- package/src/theme/components/calendar.ts +3 -3
- package/src/theme/components/card.ts +1 -1
- package/src/theme/components/checkbox.ts +2 -2
- package/src/theme/components/divider.ts +1 -1
- package/src/theme/components/drawer.ts +2 -2
- package/src/theme/components/empty.ts +3 -3
- package/src/theme/components/fab.ts +7 -7
- package/src/theme/components/icon.ts +4 -4
- package/src/theme/components/list.ts +0 -2
- package/src/theme/components/pinInput.ts +4 -4
- package/src/theme/components/progress.ts +6 -5
- package/src/theme/components/radio.ts +1 -1
- package/src/theme/components/richTextEditor.ts +2 -2
- package/src/theme/components/slider.ts +2 -2
- package/src/theme/components/spinner.ts +4 -1
- package/src/theme/components/swipeable.ts +13 -0
- package/src/theme/components/switch.ts +4 -4
- package/src/theme/components/tabs.ts +6 -5
- package/src/theme/components/tag.ts +2 -2
- package/src/theme/components/textInput.ts +23 -33
- package/src/theme/components/toast.ts +3 -3
- package/src/theme/components/toolbar.ts +3 -3
- package/src/theme/components/typography.ts +7 -7
- package/src/theme/getTheme.ts +7 -1
- package/src/theme/global/colors/eBens.ts +23 -0
- package/src/theme/global/colors/global.ts +15 -6
- package/src/theme/global/colors/jobs.ts +15 -10
- package/src/theme/global/colors/legacySystemPalette.ts +6 -6
- package/src/theme/global/colors/swag.ts +32 -53
- package/src/theme/global/colors/types.ts +35 -15
- package/src/theme/global/colors/wallet.ts +23 -0
- package/src/theme/global/colors/work.ts +15 -11
- package/src/theme/global/index.ts +4 -0
- package/src/theme/index.ts +4 -0
- package/src/types.ts +2 -0
- package/src/utils/functions.ts +2 -0
- package/src/utils/scale.ts +1 -1
- package/testUtils/setup.tsx +13 -0
- package/tsconfig.json +8 -2
- package/types/components/Accordion/StyledAccordion.d.ts +14 -14
- package/types/components/Alert/StyledAlert.d.ts +15 -15
- package/types/components/Attachment/StyledAttachment.d.ts +28 -0
- package/types/components/Attachment/index.d.ts +37 -0
- package/types/components/Avatar/StyledAvatar.d.ts +15 -15
- package/types/components/Avatar/index.d.ts +1 -1
- package/types/components/Badge/Status.d.ts +1 -1
- package/types/components/Badge/StyledBadge.d.ts +8 -8
- package/types/components/Badge/index.d.ts +1 -1
- 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 +22 -22
- package/types/components/Box/StyledBox.d.ts +4 -4
- package/types/components/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +7 -7
- package/types/components/Button/StyledButton.d.ts +15 -18
- 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 +6 -6
- package/types/components/Card/StyledCard.d.ts +7 -7
- package/types/components/Checkbox/StyledCheckbox.d.ts +16 -10
- package/types/components/Collapse/StyledCollapse.d.ts +8 -8
- package/types/components/ContentNavigator/StyledContentNavigator.d.ts +5 -5
- package/types/components/ContentNavigator/index.d.ts +2 -1
- 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 +9 -9
- package/types/components/Empty/index.d.ts +1 -2
- 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/Icon/IconList.d.ts +1 -1
- package/types/components/Icon/index.d.ts +4 -1
- package/types/components/Icon/utils.d.ts +1 -1
- package/types/components/List/StyledBasicListItem.d.ts +16 -16
- package/types/components/List/StyledListItem.d.ts +25 -25
- package/types/components/PinInput/StyledPinInput.d.ts +30 -30
- package/types/components/Progress/ProgressBar.d.ts +1 -1
- package/types/components/Progress/ProgressCircle.d.ts +1 -1
- package/types/components/Progress/StyledProgressBar.d.ts +5 -5
- package/types/components/Progress/StyledProgressCircle.d.ts +18 -18
- package/types/components/Progress/types.d.ts +1 -1
- package/types/components/Radio/StyledRadio.d.ts +9 -9
- package/types/components/RefreshControl/index.d.ts +1 -2
- package/types/components/RichTextEditor/EditorToolbar.d.ts +1 -1
- package/types/components/RichTextEditor/MentionList.d.ts +1 -1
- package/types/components/RichTextEditor/StyledRichTextEditor.d.ts +6 -6
- package/types/components/RichTextEditor/StyledToolbar.d.ts +9 -9
- package/types/components/RichTextEditor/index.d.ts +2 -2
- 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 +2 -1
- package/types/components/Spinner/StyledSpinner.d.ts +13 -12
- package/types/components/Spinner/index.d.ts +5 -1
- package/types/components/Swipeable/StyledSwipeable.d.ts +10 -0
- package/types/components/Swipeable/SwipeableAction.d.ts +27 -0
- package/types/components/Swipeable/index.d.ts +45 -0
- package/types/components/Switch/SelectorSwitch/Option.d.ts +3 -1
- package/types/components/Switch/SelectorSwitch/StyledSelectorSwitch.d.ts +9 -9
- package/types/components/Switch/StyledSwitch.d.ts +5 -5
- package/types/components/Tabs/StyledScrollableTabs.d.ts +23 -23
- package/types/components/Tabs/StyledTabs.d.ts +22 -22
- package/types/components/Tag/StyledTag.d.ts +6 -6
- package/types/components/TextInput/StyledTextInput.d.ts +46 -45
- package/types/components/TextInput/index.d.ts +6 -6
- package/types/components/TimePicker/StyledTimePicker.d.ts +3 -3
- package/types/components/Toast/StyledToast.d.ts +17 -17
- package/types/components/Toolbar/StyledToolbar.d.ts +9 -9
- package/types/components/Typography/Text/StyledText.d.ts +3 -3
- package/types/index.d.ts +4 -2
- package/types/testHelpers/renderWithTheme.d.ts +1 -1
- package/types/theme/ThemeSwitcher.d.ts +2 -2
- package/types/theme/components/attachment.d.ts +21 -0
- package/types/theme/components/badge.d.ts +1 -0
- package/types/theme/components/button.d.ts +0 -15
- package/types/theme/components/list.d.ts +0 -1
- package/types/theme/components/progress.d.ts +1 -0
- package/types/theme/components/spinner.d.ts +4 -1
- package/types/theme/components/swipeable.d.ts +9 -0
- package/types/theme/components/tabs.d.ts +1 -0
- package/types/theme/components/tag.d.ts +2 -2
- package/types/theme/components/textInput.d.ts +0 -10
- package/types/theme/getTheme.d.ts +4 -0
- package/types/theme/global/colors/eBens.d.ts +3 -0
- package/types/theme/global/colors/types.d.ts +23 -16
- package/types/theme/global/colors/wallet.d.ts +3 -0
- package/types/theme/global/index.d.ts +26 -12
- package/types/theme/index.d.ts +2 -2
- package/types/types.d.ts +2 -1
- package/types/utils/functions.d.ts +1 -0
- package/types/utils/hooks.d.ts +1 -1
- package/src/components/Icon/HeroIcon/selection.json +0 -7029
|
@@ -56,15 +56,16 @@ exports[`Spinner renders correctly 1`] = `
|
|
|
56
56
|
style={
|
|
57
57
|
Array [
|
|
58
58
|
Object {
|
|
59
|
-
"backgroundColor": "#
|
|
59
|
+
"backgroundColor": "#401960",
|
|
60
60
|
"borderRadius": 999,
|
|
61
61
|
"height": 16,
|
|
62
|
-
"opacity":
|
|
62
|
+
"opacity": 0.9,
|
|
63
63
|
"width": 16,
|
|
64
64
|
},
|
|
65
65
|
Object {},
|
|
66
66
|
]
|
|
67
67
|
}
|
|
68
|
+
themeIntent="primary"
|
|
68
69
|
themePosition="topLeft"
|
|
69
70
|
themeSize="medium"
|
|
70
71
|
/>
|
|
@@ -74,16 +75,17 @@ exports[`Spinner renders correctly 1`] = `
|
|
|
74
75
|
style={
|
|
75
76
|
Array [
|
|
76
77
|
Object {
|
|
77
|
-
"backgroundColor": "#
|
|
78
|
+
"backgroundColor": "#401960",
|
|
78
79
|
"borderRadius": 999,
|
|
79
80
|
"height": 16,
|
|
80
81
|
"marginLeft": 8,
|
|
81
|
-
"opacity": 0.
|
|
82
|
+
"opacity": 0.675,
|
|
82
83
|
"width": 16,
|
|
83
84
|
},
|
|
84
85
|
Object {},
|
|
85
86
|
]
|
|
86
87
|
}
|
|
88
|
+
themeIntent="primary"
|
|
87
89
|
themePosition="topRight"
|
|
88
90
|
themeSize="medium"
|
|
89
91
|
/>
|
|
@@ -109,15 +111,16 @@ exports[`Spinner renders correctly 1`] = `
|
|
|
109
111
|
style={
|
|
110
112
|
Array [
|
|
111
113
|
Object {
|
|
112
|
-
"backgroundColor": "#
|
|
114
|
+
"backgroundColor": "#401960",
|
|
113
115
|
"borderRadius": 999,
|
|
114
116
|
"height": 16,
|
|
115
|
-
"opacity": 0.
|
|
117
|
+
"opacity": 0.45,
|
|
116
118
|
"width": 16,
|
|
117
119
|
},
|
|
118
120
|
Object {},
|
|
119
121
|
]
|
|
120
122
|
}
|
|
123
|
+
themeIntent="primary"
|
|
121
124
|
themePosition="bottomLeft"
|
|
122
125
|
themeSize="medium"
|
|
123
126
|
/>
|
|
@@ -127,16 +130,17 @@ exports[`Spinner renders correctly 1`] = `
|
|
|
127
130
|
style={
|
|
128
131
|
Array [
|
|
129
132
|
Object {
|
|
130
|
-
"backgroundColor": "#
|
|
133
|
+
"backgroundColor": "#401960",
|
|
131
134
|
"borderRadius": 999,
|
|
132
135
|
"height": 16,
|
|
133
136
|
"marginLeft": 8,
|
|
134
|
-
"opacity": 0.
|
|
137
|
+
"opacity": 0.225,
|
|
135
138
|
"width": 16,
|
|
136
139
|
},
|
|
137
140
|
Object {},
|
|
138
141
|
]
|
|
139
142
|
}
|
|
143
|
+
themeIntent="primary"
|
|
140
144
|
themePosition="bottomRight"
|
|
141
145
|
themeSize="medium"
|
|
142
146
|
/>
|
|
@@ -9,6 +9,10 @@ interface SpinnerProps extends ViewProps {
|
|
|
9
9
|
* Size of Spinner.
|
|
10
10
|
*/
|
|
11
11
|
size?: 'small' | 'medium';
|
|
12
|
+
/**
|
|
13
|
+
* Spinner's variant.
|
|
14
|
+
*/
|
|
15
|
+
intent?: 'primary' | 'inverted';
|
|
12
16
|
/**
|
|
13
17
|
* Testing id of the component.
|
|
14
18
|
*/
|
|
@@ -18,11 +22,12 @@ interface SpinnerProps extends ViewProps {
|
|
|
18
22
|
const Spinner = ({
|
|
19
23
|
testID,
|
|
20
24
|
size = 'medium',
|
|
25
|
+
intent = 'primary',
|
|
21
26
|
...nativeProps
|
|
22
27
|
}: SpinnerProps): ReactElement => (
|
|
23
28
|
<StyledView {...nativeProps}>
|
|
24
29
|
<StyledSpinnerContainer testID={testID}>
|
|
25
|
-
<AnimatedSpinner size={size} />
|
|
30
|
+
<AnimatedSpinner size={size} intent={intent} />
|
|
26
31
|
</StyledSpinnerContainer>
|
|
27
32
|
</StyledView>
|
|
28
33
|
);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import styled from '@emotion/native';
|
|
2
|
+
import { TouchableOpacity } from 'react-native';
|
|
3
|
+
|
|
4
|
+
export type ActionIntent = 'primary' | 'success' | 'danger';
|
|
5
|
+
|
|
6
|
+
export const StyledRectButton = styled(TouchableOpacity)<{
|
|
7
|
+
themeIntent: ActionIntent;
|
|
8
|
+
}>(({ theme, themeIntent }) => ({
|
|
9
|
+
flex: 1,
|
|
10
|
+
backgroundColor: theme.__hd__.swipeable.colors[themeIntent],
|
|
11
|
+
}));
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import { ActionIntent, StyledRectButton } from './StyledSwipeable';
|
|
4
|
+
|
|
5
|
+
export interface SwipeableActionProps {
|
|
6
|
+
/**
|
|
7
|
+
* Visual intent color applied to action.
|
|
8
|
+
*/
|
|
9
|
+
intent?: ActionIntent;
|
|
10
|
+
/**
|
|
11
|
+
* Callback when the action button is pressed.
|
|
12
|
+
*/
|
|
13
|
+
onPress?: () => void;
|
|
14
|
+
/**
|
|
15
|
+
* Action button's content
|
|
16
|
+
*/
|
|
17
|
+
children?: ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* Additional style.
|
|
20
|
+
*/
|
|
21
|
+
style?: StyleProp<ViewStyle>;
|
|
22
|
+
/**
|
|
23
|
+
* Testing id of the component.
|
|
24
|
+
*/
|
|
25
|
+
testID?: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const SwipeableAction = ({
|
|
29
|
+
intent = 'primary',
|
|
30
|
+
onPress,
|
|
31
|
+
style,
|
|
32
|
+
children,
|
|
33
|
+
testID,
|
|
34
|
+
}: SwipeableActionProps) => (
|
|
35
|
+
<StyledRectButton
|
|
36
|
+
onPress={onPress}
|
|
37
|
+
themeIntent={intent}
|
|
38
|
+
style={style}
|
|
39
|
+
testID={testID}
|
|
40
|
+
>
|
|
41
|
+
{children}
|
|
42
|
+
</StyledRectButton>
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
export default SwipeableAction;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { fireEvent } from '@testing-library/react-native';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import renderWithTheme from '../../../testHelpers/renderWithTheme';
|
|
4
|
+
import Typography from '../../Typography';
|
|
5
|
+
import SwipeableAction from '../SwipeableAction';
|
|
6
|
+
|
|
7
|
+
describe('rendering', () => {
|
|
8
|
+
it.each`
|
|
9
|
+
intent
|
|
10
|
+
${'primary'}
|
|
11
|
+
${'success'}
|
|
12
|
+
${'danger'}
|
|
13
|
+
`('renders correctly when intent is $intent', ({ intent }) => {
|
|
14
|
+
const { toJSON, getByText } = renderWithTheme(
|
|
15
|
+
<SwipeableAction intent={intent}>
|
|
16
|
+
<Typography.Text>Action title</Typography.Text>
|
|
17
|
+
</SwipeableAction>
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
expect(getByText('Action title')).toBeDefined();
|
|
21
|
+
expect(toJSON()).toMatchSnapshot();
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
describe('behavior', () => {
|
|
26
|
+
it('calls onPress', () => {
|
|
27
|
+
const onPress = jest.fn();
|
|
28
|
+
const { getByText } = renderWithTheme(
|
|
29
|
+
<SwipeableAction onPress={onPress}>
|
|
30
|
+
<Typography.Text>Action title</Typography.Text>
|
|
31
|
+
</SwipeableAction>
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
fireEvent.press(getByText('Action title'));
|
|
35
|
+
expect(onPress).toBeCalledTimes(1);
|
|
36
|
+
});
|
|
37
|
+
});
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`rendering renders correctly when intent is danger 1`] = `
|
|
4
|
+
<View
|
|
5
|
+
accessible={true}
|
|
6
|
+
collapsable={false}
|
|
7
|
+
focusable={false}
|
|
8
|
+
nativeID="animatedComponent"
|
|
9
|
+
onClick={[Function]}
|
|
10
|
+
onResponderGrant={[Function]}
|
|
11
|
+
onResponderMove={[Function]}
|
|
12
|
+
onResponderRelease={[Function]}
|
|
13
|
+
onResponderTerminate={[Function]}
|
|
14
|
+
onResponderTerminationRequest={[Function]}
|
|
15
|
+
onStartShouldSetResponder={[Function]}
|
|
16
|
+
style={
|
|
17
|
+
Object {
|
|
18
|
+
"backgroundColor": "#f46363",
|
|
19
|
+
"flex": 1,
|
|
20
|
+
"opacity": 1,
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
>
|
|
24
|
+
<Text
|
|
25
|
+
style={
|
|
26
|
+
Array [
|
|
27
|
+
Object {
|
|
28
|
+
"color": "#001f23",
|
|
29
|
+
"fontFamily": "BeVietnamPro-Regular",
|
|
30
|
+
"fontSize": 14,
|
|
31
|
+
"letterSpacing": 0.42,
|
|
32
|
+
"lineHeight": 22,
|
|
33
|
+
},
|
|
34
|
+
undefined,
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
themeFontSize="medium"
|
|
38
|
+
themeFontWeight="regular"
|
|
39
|
+
themeIntent="body"
|
|
40
|
+
>
|
|
41
|
+
Action title
|
|
42
|
+
</Text>
|
|
43
|
+
</View>
|
|
44
|
+
`;
|
|
45
|
+
|
|
46
|
+
exports[`rendering renders correctly when intent is primary 1`] = `
|
|
47
|
+
<View
|
|
48
|
+
accessible={true}
|
|
49
|
+
collapsable={false}
|
|
50
|
+
focusable={false}
|
|
51
|
+
nativeID="animatedComponent"
|
|
52
|
+
onClick={[Function]}
|
|
53
|
+
onResponderGrant={[Function]}
|
|
54
|
+
onResponderMove={[Function]}
|
|
55
|
+
onResponderRelease={[Function]}
|
|
56
|
+
onResponderTerminate={[Function]}
|
|
57
|
+
onResponderTerminationRequest={[Function]}
|
|
58
|
+
onStartShouldSetResponder={[Function]}
|
|
59
|
+
style={
|
|
60
|
+
Object {
|
|
61
|
+
"backgroundColor": "#401960",
|
|
62
|
+
"flex": 1,
|
|
63
|
+
"opacity": 1,
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
>
|
|
67
|
+
<Text
|
|
68
|
+
style={
|
|
69
|
+
Array [
|
|
70
|
+
Object {
|
|
71
|
+
"color": "#001f23",
|
|
72
|
+
"fontFamily": "BeVietnamPro-Regular",
|
|
73
|
+
"fontSize": 14,
|
|
74
|
+
"letterSpacing": 0.42,
|
|
75
|
+
"lineHeight": 22,
|
|
76
|
+
},
|
|
77
|
+
undefined,
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
themeFontSize="medium"
|
|
81
|
+
themeFontWeight="regular"
|
|
82
|
+
themeIntent="body"
|
|
83
|
+
>
|
|
84
|
+
Action title
|
|
85
|
+
</Text>
|
|
86
|
+
</View>
|
|
87
|
+
`;
|
|
88
|
+
|
|
89
|
+
exports[`rendering renders correctly when intent is success 1`] = `
|
|
90
|
+
<View
|
|
91
|
+
accessible={true}
|
|
92
|
+
collapsable={false}
|
|
93
|
+
focusable={false}
|
|
94
|
+
nativeID="animatedComponent"
|
|
95
|
+
onClick={[Function]}
|
|
96
|
+
onResponderGrant={[Function]}
|
|
97
|
+
onResponderMove={[Function]}
|
|
98
|
+
onResponderRelease={[Function]}
|
|
99
|
+
onResponderTerminate={[Function]}
|
|
100
|
+
onResponderTerminationRequest={[Function]}
|
|
101
|
+
onStartShouldSetResponder={[Function]}
|
|
102
|
+
style={
|
|
103
|
+
Object {
|
|
104
|
+
"backgroundColor": "#5ace7d",
|
|
105
|
+
"flex": 1,
|
|
106
|
+
"opacity": 1,
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
>
|
|
110
|
+
<Text
|
|
111
|
+
style={
|
|
112
|
+
Array [
|
|
113
|
+
Object {
|
|
114
|
+
"color": "#001f23",
|
|
115
|
+
"fontFamily": "BeVietnamPro-Regular",
|
|
116
|
+
"fontSize": 14,
|
|
117
|
+
"letterSpacing": 0.42,
|
|
118
|
+
"lineHeight": 22,
|
|
119
|
+
},
|
|
120
|
+
undefined,
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
themeFontSize="medium"
|
|
124
|
+
themeFontWeight="regular"
|
|
125
|
+
themeIntent="body"
|
|
126
|
+
>
|
|
127
|
+
Action title
|
|
128
|
+
</Text>
|
|
129
|
+
</View>
|
|
130
|
+
`;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`Swipeable renders correctly 1`] = `
|
|
4
|
+
<View>
|
|
5
|
+
<View
|
|
6
|
+
onSwipeableClose={[Function]}
|
|
7
|
+
onSwipeableLeftOpen={[Function]}
|
|
8
|
+
onSwipeableRightOpen={[Function]}
|
|
9
|
+
renderLeftActions={[Function]}
|
|
10
|
+
renderRightActions={[Function]}
|
|
11
|
+
>
|
|
12
|
+
<Text
|
|
13
|
+
style={
|
|
14
|
+
Array [
|
|
15
|
+
Object {
|
|
16
|
+
"color": "#001f23",
|
|
17
|
+
"fontFamily": "BeVietnamPro-Regular",
|
|
18
|
+
"fontSize": 14,
|
|
19
|
+
"letterSpacing": 0.42,
|
|
20
|
+
"lineHeight": 22,
|
|
21
|
+
},
|
|
22
|
+
undefined,
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
themeFontSize="medium"
|
|
26
|
+
themeFontWeight="regular"
|
|
27
|
+
themeIntent="body"
|
|
28
|
+
>
|
|
29
|
+
Swipeable Item
|
|
30
|
+
</Text>
|
|
31
|
+
</View>
|
|
32
|
+
</View>
|
|
33
|
+
`;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import renderWithTheme from '../../../testHelpers/renderWithTheme';
|
|
3
|
+
import Typography from '../../Typography';
|
|
4
|
+
import Swipeable from '..';
|
|
5
|
+
|
|
6
|
+
describe('Swipeable', () => {
|
|
7
|
+
it('renders correctly', () => {
|
|
8
|
+
const { toJSON, getByText } = renderWithTheme(
|
|
9
|
+
<Swipeable
|
|
10
|
+
leftActions={
|
|
11
|
+
<Swipeable.Action intent="primary">
|
|
12
|
+
<Typography.Text intent="inverted">Archived</Typography.Text>
|
|
13
|
+
</Swipeable.Action>
|
|
14
|
+
}
|
|
15
|
+
rightActions={
|
|
16
|
+
<>
|
|
17
|
+
<Swipeable.Action intent="success">
|
|
18
|
+
<Typography.Text>Approve</Typography.Text>
|
|
19
|
+
</Swipeable.Action>
|
|
20
|
+
<Swipeable.Action intent="danger">
|
|
21
|
+
<Typography.Text>Decline</Typography.Text>
|
|
22
|
+
</Swipeable.Action>
|
|
23
|
+
</>
|
|
24
|
+
}
|
|
25
|
+
rightActionsWidth={168}
|
|
26
|
+
>
|
|
27
|
+
<Typography.Text>Swipeable Item</Typography.Text>
|
|
28
|
+
</Swipeable>
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
expect(getByText('Swipeable Item')).toBeDefined();
|
|
32
|
+
expect(toJSON()).toMatchSnapshot();
|
|
33
|
+
});
|
|
34
|
+
});
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import React, {
|
|
2
|
+
ComponentProps,
|
|
3
|
+
ReactNode,
|
|
4
|
+
useCallback,
|
|
5
|
+
useEffect,
|
|
6
|
+
useRef,
|
|
7
|
+
} from 'react';
|
|
8
|
+
import { Animated, useWindowDimensions } from 'react-native';
|
|
9
|
+
import {
|
|
10
|
+
Swipeable as RnghSwipeable,
|
|
11
|
+
GestureHandlerRootView,
|
|
12
|
+
RectButton,
|
|
13
|
+
} from 'react-native-gesture-handler';
|
|
14
|
+
import SwipeableAction from './SwipeableAction';
|
|
15
|
+
|
|
16
|
+
type State = 'closed' | 'leftOpen' | 'rightOpen';
|
|
17
|
+
// We are supporting both v1 and v2 of RNGH at the same time.
|
|
18
|
+
// SwipeableProps is only exported in v2, so we have to use ComponentProps.
|
|
19
|
+
type RnghSwipeableProps = ComponentProps<typeof RnghSwipeable>;
|
|
20
|
+
export interface SwipeableProps
|
|
21
|
+
extends Pick<
|
|
22
|
+
RnghSwipeableProps,
|
|
23
|
+
| 'enableTrackpadTwoFingerGesture'
|
|
24
|
+
| 'friction'
|
|
25
|
+
| 'leftThreshold'
|
|
26
|
+
| 'rightThreshold'
|
|
27
|
+
| 'overshootLeft'
|
|
28
|
+
| 'overshootRight'
|
|
29
|
+
| 'overshootFriction'
|
|
30
|
+
| 'useNativeAnimations'
|
|
31
|
+
| 'containerStyle'
|
|
32
|
+
| 'childrenContainerStyle'
|
|
33
|
+
> {
|
|
34
|
+
/**
|
|
35
|
+
* React node that is swipeable.
|
|
36
|
+
*/
|
|
37
|
+
children: ReactNode;
|
|
38
|
+
/**
|
|
39
|
+
* State of the component.
|
|
40
|
+
*/
|
|
41
|
+
state?: 'closed' | 'leftOpen' | 'rightOpen';
|
|
42
|
+
/**
|
|
43
|
+
* Callback when the state of the component changes.
|
|
44
|
+
*/
|
|
45
|
+
onStateChange?: (state: State) => void;
|
|
46
|
+
/**
|
|
47
|
+
* Action panel that is going to be revealed from the left side when user swipes right.
|
|
48
|
+
*/
|
|
49
|
+
leftActions?: ReactNode;
|
|
50
|
+
/**
|
|
51
|
+
* Width of the left action panel.
|
|
52
|
+
* By default, it will take up the whole width of the device.
|
|
53
|
+
*/
|
|
54
|
+
leftActionsWidth?: number;
|
|
55
|
+
/**
|
|
56
|
+
* Action panel that is going to be revealed from the right side when user swipes left.
|
|
57
|
+
*/
|
|
58
|
+
rightActions?: ReactNode;
|
|
59
|
+
/**
|
|
60
|
+
* Width of the right action panel.
|
|
61
|
+
* By default, it will take up the whole width of the device.
|
|
62
|
+
*/
|
|
63
|
+
rightActionsWidth?: number;
|
|
64
|
+
/**
|
|
65
|
+
* Testing ID of the component
|
|
66
|
+
*/
|
|
67
|
+
testID?: string;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const renderActions = (
|
|
71
|
+
actions: ReactNode,
|
|
72
|
+
width: number,
|
|
73
|
+
progress: Animated.AnimatedInterpolation,
|
|
74
|
+
direction: 'left' | 'right'
|
|
75
|
+
) => {
|
|
76
|
+
const trans = progress.interpolate({
|
|
77
|
+
inputRange: [0, 1],
|
|
78
|
+
outputRange: direction === 'left' ? [-width, 0] : [width, 0],
|
|
79
|
+
extrapolate: 'clamp',
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
return (
|
|
83
|
+
<Animated.View
|
|
84
|
+
style={{
|
|
85
|
+
width,
|
|
86
|
+
flexDirection: 'row',
|
|
87
|
+
transform: [{ translateX: trans }],
|
|
88
|
+
}}
|
|
89
|
+
>
|
|
90
|
+
{actions}
|
|
91
|
+
</Animated.View>
|
|
92
|
+
);
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
const Swipeable = ({
|
|
96
|
+
children,
|
|
97
|
+
state,
|
|
98
|
+
onStateChange,
|
|
99
|
+
leftActions,
|
|
100
|
+
leftActionsWidth,
|
|
101
|
+
rightActions,
|
|
102
|
+
rightActionsWidth,
|
|
103
|
+
...swipeableProps
|
|
104
|
+
}: SwipeableProps) => {
|
|
105
|
+
const { width } = useWindowDimensions();
|
|
106
|
+
const swipeableRef = useRef<RnghSwipeable>(null);
|
|
107
|
+
|
|
108
|
+
const renderLeftActions = useCallback(
|
|
109
|
+
(progress: Animated.AnimatedInterpolation) =>
|
|
110
|
+
renderActions(leftActions, leftActionsWidth || width, progress, 'left'),
|
|
111
|
+
[leftActions, leftActionsWidth, width]
|
|
112
|
+
);
|
|
113
|
+
const renderRightActions = useCallback(
|
|
114
|
+
(progress: Animated.AnimatedInterpolation) =>
|
|
115
|
+
renderActions(
|
|
116
|
+
rightActions,
|
|
117
|
+
rightActionsWidth || width,
|
|
118
|
+
progress,
|
|
119
|
+
'right'
|
|
120
|
+
),
|
|
121
|
+
[rightActions, rightActionsWidth, width]
|
|
122
|
+
);
|
|
123
|
+
|
|
124
|
+
useEffect(() => {
|
|
125
|
+
if (swipeableRef.current === null) return;
|
|
126
|
+
|
|
127
|
+
switch (state) {
|
|
128
|
+
case 'leftOpen':
|
|
129
|
+
swipeableRef.current.openLeft();
|
|
130
|
+
break;
|
|
131
|
+
case 'rightOpen':
|
|
132
|
+
swipeableRef.current.openRight();
|
|
133
|
+
break;
|
|
134
|
+
case 'closed':
|
|
135
|
+
swipeableRef.current.close();
|
|
136
|
+
break;
|
|
137
|
+
}
|
|
138
|
+
}, [state]);
|
|
139
|
+
|
|
140
|
+
return (
|
|
141
|
+
<GestureHandlerRootView>
|
|
142
|
+
<RnghSwipeable
|
|
143
|
+
{...swipeableProps}
|
|
144
|
+
ref={swipeableRef}
|
|
145
|
+
{...(leftActions !== undefined && { renderLeftActions })}
|
|
146
|
+
{...(rightActions !== undefined && { renderRightActions })}
|
|
147
|
+
onSwipeableLeftOpen={() => onStateChange?.('leftOpen')}
|
|
148
|
+
onSwipeableRightOpen={() => onStateChange?.('rightOpen')}
|
|
149
|
+
onSwipeableClose={() => onStateChange?.('closed')}
|
|
150
|
+
>
|
|
151
|
+
{children}
|
|
152
|
+
</RnghSwipeable>
|
|
153
|
+
</GestureHandlerRootView>
|
|
154
|
+
);
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
export default Object.assign(Swipeable, {
|
|
158
|
+
Action: SwipeableAction,
|
|
159
|
+
Content: RectButton,
|
|
160
|
+
});
|
|
@@ -46,11 +46,7 @@ const Option = <T,>({
|
|
|
46
46
|
return (
|
|
47
47
|
<StyledTextWrapper>
|
|
48
48
|
<OptionContent
|
|
49
|
-
content={
|
|
50
|
-
<Typography.Text fontSize="large" intent="inverted">
|
|
51
|
-
{text}
|
|
52
|
-
</Typography.Text>
|
|
53
|
-
}
|
|
49
|
+
content={<Typography.Text fontSize="large">{text}</Typography.Text>}
|
|
54
50
|
badge={badge}
|
|
55
51
|
/>
|
|
56
52
|
</StyledTextWrapper>
|
|
@@ -67,7 +67,7 @@ exports[`Option renders correctly when selected 1`] = `
|
|
|
67
67
|
Array [
|
|
68
68
|
Object {
|
|
69
69
|
"alignItems": "center",
|
|
70
|
-
"backgroundColor": "#
|
|
70
|
+
"backgroundColor": "#ffffff",
|
|
71
71
|
"borderRadius": 999,
|
|
72
72
|
"flex": 1,
|
|
73
73
|
"justifyContent": "center",
|
|
@@ -88,7 +88,7 @@ exports[`Option renders correctly when selected 1`] = `
|
|
|
88
88
|
style={
|
|
89
89
|
Array [
|
|
90
90
|
Object {
|
|
91
|
-
"color": "#
|
|
91
|
+
"color": "#001f23",
|
|
92
92
|
"fontFamily": "BeVietnamPro-Regular",
|
|
93
93
|
"fontSize": 16,
|
|
94
94
|
"letterSpacing": 0.48,
|
|
@@ -99,7 +99,7 @@ exports[`Option renders correctly when selected 1`] = `
|
|
|
99
99
|
}
|
|
100
100
|
themeFontSize="large"
|
|
101
101
|
themeFontWeight="regular"
|
|
102
|
-
themeIntent="
|
|
102
|
+
themeIntent="body"
|
|
103
103
|
>
|
|
104
104
|
My Dashboard
|
|
105
105
|
</Text>
|
|
@@ -30,7 +30,7 @@ exports[`SelectorSwitch renders correctly 1`] = `
|
|
|
30
30
|
Array [
|
|
31
31
|
Object {
|
|
32
32
|
"alignItems": "center",
|
|
33
|
-
"backgroundColor": "#
|
|
33
|
+
"backgroundColor": "#ffffff",
|
|
34
34
|
"borderRadius": 999,
|
|
35
35
|
"flex": 1,
|
|
36
36
|
"justifyContent": "center",
|
|
@@ -43,7 +43,7 @@ exports[`SelectorSwitch renders correctly 1`] = `
|
|
|
43
43
|
style={
|
|
44
44
|
Array [
|
|
45
45
|
Object {
|
|
46
|
-
"color": "#
|
|
46
|
+
"color": "#001f23",
|
|
47
47
|
"fontFamily": "BeVietnamPro-Regular",
|
|
48
48
|
"fontSize": 16,
|
|
49
49
|
"letterSpacing": 0.48,
|
|
@@ -54,7 +54,7 @@ exports[`SelectorSwitch renders correctly 1`] = `
|
|
|
54
54
|
}
|
|
55
55
|
themeFontSize="large"
|
|
56
56
|
themeFontWeight="regular"
|
|
57
|
-
themeIntent="
|
|
57
|
+
themeIntent="body"
|
|
58
58
|
>
|
|
59
59
|
My Dashboard
|
|
60
60
|
</Text>
|
|
@@ -47,7 +47,10 @@ const SelectorSwitch = <T,>({
|
|
|
47
47
|
style,
|
|
48
48
|
testID,
|
|
49
49
|
}: SelectorSwitchProps<T>): ReactElement => (
|
|
50
|
-
<TouchableWithoutFeedback
|
|
50
|
+
<TouchableWithoutFeedback
|
|
51
|
+
onPress={onPress !== undefined ? () => onPress(value) : undefined}
|
|
52
|
+
testID={testID}
|
|
53
|
+
>
|
|
51
54
|
<StyledWrapper style={style}>
|
|
52
55
|
{options.map((opt, index) => (
|
|
53
56
|
// eslint-disable-next-line react/no-array-index-key
|
|
@@ -39,7 +39,7 @@ const StyledIndicator = styled(Animated.View)<{ themeWidth: number }>(
|
|
|
39
39
|
({ theme, themeWidth }) => ({
|
|
40
40
|
width: themeWidth,
|
|
41
41
|
height: theme.__hd__.tabs.sizes.indicator,
|
|
42
|
-
backgroundColor: theme.__hd__.tabs.colors.
|
|
42
|
+
backgroundColor: theme.__hd__.tabs.colors.indicator,
|
|
43
43
|
position: 'absolute',
|
|
44
44
|
bottom: 0,
|
|
45
45
|
})
|