@hero-design/rn 7.24.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 +845 -752
- package/lib/assets/fonts/hero-icons.ttf +0 -0
- package/lib/index.js +846 -750
- package/package.json +6 -5
- 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 +1 -0
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerIOS.spec.tsx.snap +28 -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/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/glyphMap.json +1 -1
- package/src/components/Icon/IconList.ts +30 -3
- package/src/components/Icon/__tests__/__snapshots__/index.spec.tsx.snap +1 -1
- 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 +3 -4
- package/src/components/RichTextEditor/__tests__/__snapshots__/RichTextEditor.spec.tsx.snap +4 -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 +146 -234
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +430 -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 +136 -224
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +409 -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/StyledSpinner.tsx +1 -2
- package/src/components/Spinner/__tests__/__snapshots__/AnimatedSpinner.spec.tsx.snap +4 -4
- package/src/components/Spinner/__tests__/__snapshots__/StyledSpinner.spec.tsx.snap +16 -16
- package/src/components/Spinner/__tests__/__snapshots__/index.spec.tsx.snap +4 -4
- package/src/components/Swipeable/__tests__/__snapshots__/SwipeableAction.spec.tsx.snap +1 -1
- package/src/components/Swipeable/index.tsx +14 -2
- 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 +1 -0
- package/src/components/TextInput/__tests__/__snapshots__/StyledTextInput.spec.tsx.snap +11 -10
- package/src/components/TextInput/__tests__/__snapshots__/index.spec.tsx.snap +27 -14
- package/src/components/TextInput/index.tsx +1 -0
- package/src/components/TimePicker/__tests__/__snapshots__/TimePickerAndroid.spec.tsx.snap +1 -0
- package/src/components/TimePicker/__tests__/__snapshots__/TimePickerIOS.spec.tsx.snap +28 -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 +6 -0
- package/src/theme/ThemeSwitcher.tsx +7 -1
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +87 -74
- 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/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 -28
- 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 +4 -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 -9
- 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 -9
- package/src/theme/global/index.ts +4 -0
- package/src/theme/index.ts +4 -0
- package/src/utils/functions.ts +2 -0
- package/src/utils/scale.ts +1 -1
- 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/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 +1 -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/StyledSpinner.d.ts +12 -12
- package/types/components/Swipeable/StyledSwipeable.d.ts +3 -3
- package/types/components/Swipeable/index.d.ts +7 -3
- 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 +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 +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 +3 -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/tabs.d.ts +1 -0
- package/types/theme/components/tag.d.ts +2 -2
- package/types/theme/components/textInput.d.ts +0 -5
- package/types/theme/getTheme.d.ts +2 -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/utils/functions.d.ts +1 -0
- package/types/utils/hooks.d.ts +1 -1
|
@@ -23,32 +23,6 @@ exports[`BottomSheet renders correctly with close state 1`] = `
|
|
|
23
23
|
]
|
|
24
24
|
}
|
|
25
25
|
>
|
|
26
|
-
<View
|
|
27
|
-
accessible={true}
|
|
28
|
-
collapsable={false}
|
|
29
|
-
focusable={true}
|
|
30
|
-
nativeID="animatedComponent"
|
|
31
|
-
onBlur={[Function]}
|
|
32
|
-
onClick={[Function]}
|
|
33
|
-
onFocus={[Function]}
|
|
34
|
-
onResponderGrant={[Function]}
|
|
35
|
-
onResponderMove={[Function]}
|
|
36
|
-
onResponderRelease={[Function]}
|
|
37
|
-
onResponderTerminate={[Function]}
|
|
38
|
-
onResponderTerminationRequest={[Function]}
|
|
39
|
-
onStartShouldSetResponder={[Function]}
|
|
40
|
-
style={
|
|
41
|
-
Object {
|
|
42
|
-
"backgroundColor": "#001f23",
|
|
43
|
-
"bottom": 0,
|
|
44
|
-
"left": 0,
|
|
45
|
-
"opacity": 0.48,
|
|
46
|
-
"position": "absolute",
|
|
47
|
-
"right": 0,
|
|
48
|
-
"top": 0,
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
/>
|
|
52
26
|
<View
|
|
53
27
|
onLayout={[Function]}
|
|
54
28
|
style={
|
|
@@ -66,6 +40,32 @@ exports[`BottomSheet renders correctly with close state 1`] = `
|
|
|
66
40
|
]
|
|
67
41
|
}
|
|
68
42
|
>
|
|
43
|
+
<View
|
|
44
|
+
accessible={true}
|
|
45
|
+
collapsable={false}
|
|
46
|
+
focusable={true}
|
|
47
|
+
nativeID="animatedComponent"
|
|
48
|
+
onBlur={[Function]}
|
|
49
|
+
onClick={[Function]}
|
|
50
|
+
onFocus={[Function]}
|
|
51
|
+
onResponderGrant={[Function]}
|
|
52
|
+
onResponderMove={[Function]}
|
|
53
|
+
onResponderRelease={[Function]}
|
|
54
|
+
onResponderTerminate={[Function]}
|
|
55
|
+
onResponderTerminationRequest={[Function]}
|
|
56
|
+
onStartShouldSetResponder={[Function]}
|
|
57
|
+
style={
|
|
58
|
+
Object {
|
|
59
|
+
"backgroundColor": "#001f23",
|
|
60
|
+
"bottom": 0,
|
|
61
|
+
"left": 0,
|
|
62
|
+
"opacity": 0.48,
|
|
63
|
+
"position": "absolute",
|
|
64
|
+
"right": 0,
|
|
65
|
+
"top": 0,
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/>
|
|
69
69
|
<RCTSafeAreaView
|
|
70
70
|
collapsable={false}
|
|
71
71
|
emulateUnlessSupported={true}
|
|
@@ -305,32 +305,6 @@ exports[`BottomSheet renders correctly with open state 1`] = `
|
|
|
305
305
|
]
|
|
306
306
|
}
|
|
307
307
|
>
|
|
308
|
-
<View
|
|
309
|
-
accessible={true}
|
|
310
|
-
collapsable={false}
|
|
311
|
-
focusable={true}
|
|
312
|
-
nativeID="animatedComponent"
|
|
313
|
-
onBlur={[Function]}
|
|
314
|
-
onClick={[Function]}
|
|
315
|
-
onFocus={[Function]}
|
|
316
|
-
onResponderGrant={[Function]}
|
|
317
|
-
onResponderMove={[Function]}
|
|
318
|
-
onResponderRelease={[Function]}
|
|
319
|
-
onResponderTerminate={[Function]}
|
|
320
|
-
onResponderTerminationRequest={[Function]}
|
|
321
|
-
onStartShouldSetResponder={[Function]}
|
|
322
|
-
style={
|
|
323
|
-
Object {
|
|
324
|
-
"backgroundColor": "#001f23",
|
|
325
|
-
"bottom": 0,
|
|
326
|
-
"left": 0,
|
|
327
|
-
"opacity": 0,
|
|
328
|
-
"position": "absolute",
|
|
329
|
-
"right": 0,
|
|
330
|
-
"top": 0,
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
/>
|
|
334
308
|
<View
|
|
335
309
|
onLayout={[Function]}
|
|
336
310
|
style={
|
|
@@ -348,6 +322,32 @@ exports[`BottomSheet renders correctly with open state 1`] = `
|
|
|
348
322
|
]
|
|
349
323
|
}
|
|
350
324
|
>
|
|
325
|
+
<View
|
|
326
|
+
accessible={true}
|
|
327
|
+
collapsable={false}
|
|
328
|
+
focusable={true}
|
|
329
|
+
nativeID="animatedComponent"
|
|
330
|
+
onBlur={[Function]}
|
|
331
|
+
onClick={[Function]}
|
|
332
|
+
onFocus={[Function]}
|
|
333
|
+
onResponderGrant={[Function]}
|
|
334
|
+
onResponderMove={[Function]}
|
|
335
|
+
onResponderRelease={[Function]}
|
|
336
|
+
onResponderTerminate={[Function]}
|
|
337
|
+
onResponderTerminationRequest={[Function]}
|
|
338
|
+
onStartShouldSetResponder={[Function]}
|
|
339
|
+
style={
|
|
340
|
+
Object {
|
|
341
|
+
"backgroundColor": "#001f23",
|
|
342
|
+
"bottom": 0,
|
|
343
|
+
"left": 0,
|
|
344
|
+
"opacity": 0,
|
|
345
|
+
"position": "absolute",
|
|
346
|
+
"right": 0,
|
|
347
|
+
"top": 0,
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
/>
|
|
351
351
|
<RCTSafeAreaView
|
|
352
352
|
collapsable={false}
|
|
353
353
|
emulateUnlessSupported={true}
|
|
@@ -155,14 +155,14 @@ const BottomSheet = ({
|
|
|
155
155
|
onShow={onOpen}
|
|
156
156
|
>
|
|
157
157
|
<StyledWrapper pointerEvents="box-none">
|
|
158
|
-
<StyledBackdrop
|
|
159
|
-
style={{ opacity: interpolateOpacity }}
|
|
160
|
-
onPress={onRequestClose}
|
|
161
|
-
/>
|
|
162
158
|
<StyledKeyboardAvoidingView
|
|
163
159
|
behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
|
|
164
160
|
{...keyboardAvoidingViewProps}
|
|
165
161
|
>
|
|
162
|
+
<StyledBackdrop
|
|
163
|
+
style={{ opacity: interpolateOpacity }}
|
|
164
|
+
onPress={onRequestClose}
|
|
165
|
+
/>
|
|
166
166
|
<StyledBottomSheet
|
|
167
167
|
style={[
|
|
168
168
|
style,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { useTheme } from '@emotion/react';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import type { ReactChild } from 'react';
|
|
4
3
|
import type { StyleProp, ViewStyle } from 'react-native';
|
|
@@ -112,21 +111,14 @@ const Button = ({
|
|
|
112
111
|
text,
|
|
113
112
|
variant = 'filled',
|
|
114
113
|
}: ButtonProps): JSX.Element => {
|
|
115
|
-
const [pressed, setPressed] = React.useState(false);
|
|
116
|
-
const theme = useTheme();
|
|
117
114
|
const themeVariant = getThemeVariant(variant, intent);
|
|
118
115
|
return (
|
|
119
116
|
<StyledButtonContainer
|
|
120
|
-
onShowUnderlay={() => setPressed(true)}
|
|
121
|
-
onHideUnderlay={() => setPressed(false)}
|
|
122
|
-
underlayColor={theme.__hd__.button.colors.underlayColors[themeVariant]}
|
|
123
117
|
accessibilityHint={accessibilityHint}
|
|
124
118
|
accessibilityLabel={accessibilityLabel}
|
|
125
119
|
disabled={disabled || loading}
|
|
126
|
-
activeOpacity={0.5}
|
|
127
120
|
onPress={onPress}
|
|
128
121
|
testID={testID}
|
|
129
|
-
pressed={pressed}
|
|
130
122
|
themeVariant={themeVariant}
|
|
131
123
|
style={style}
|
|
132
124
|
>
|
|
@@ -142,7 +134,6 @@ const Button = ({
|
|
|
142
134
|
<StyledButtonIcon
|
|
143
135
|
disabled={disabled}
|
|
144
136
|
icon={icon}
|
|
145
|
-
pressed={pressed}
|
|
146
137
|
testID={`${testID}-left-icon`}
|
|
147
138
|
themeVariant={themeVariant}
|
|
148
139
|
/>
|
|
@@ -152,7 +143,6 @@ const Button = ({
|
|
|
152
143
|
disabled={disabled}
|
|
153
144
|
ellipsizeMode="tail"
|
|
154
145
|
numberOfLines={1}
|
|
155
|
-
pressed={pressed}
|
|
156
146
|
themeVariant={themeVariant}
|
|
157
147
|
>
|
|
158
148
|
{text}
|
|
@@ -162,7 +152,6 @@ const Button = ({
|
|
|
162
152
|
<StyledButtonIcon
|
|
163
153
|
disabled={disabled}
|
|
164
154
|
icon={rightIcon}
|
|
165
|
-
pressed={pressed}
|
|
166
155
|
testID={`${testID}-right-icon`}
|
|
167
156
|
themeVariant={themeVariant}
|
|
168
157
|
/>
|
|
@@ -105,7 +105,7 @@ exports[`StyledLoadingIndicator has outlined-primary style 1`] = `
|
|
|
105
105
|
style={
|
|
106
106
|
Array [
|
|
107
107
|
Object {
|
|
108
|
-
"backgroundColor": "#
|
|
108
|
+
"backgroundColor": "#401960",
|
|
109
109
|
"borderRadius": 8,
|
|
110
110
|
"height": 12,
|
|
111
111
|
"marginBottom": 4,
|
|
@@ -125,7 +125,7 @@ exports[`StyledLoadingIndicator has outlined-secondary style 1`] = `
|
|
|
125
125
|
style={
|
|
126
126
|
Array [
|
|
127
127
|
Object {
|
|
128
|
-
"backgroundColor": "#
|
|
128
|
+
"backgroundColor": "#795e90",
|
|
129
129
|
"borderRadius": 8,
|
|
130
130
|
"height": 12,
|
|
131
131
|
"marginBottom": 4,
|
|
@@ -165,7 +165,7 @@ exports[`StyledLoadingIndicator has text-primary style 1`] = `
|
|
|
165
165
|
style={
|
|
166
166
|
Array [
|
|
167
167
|
Object {
|
|
168
|
-
"backgroundColor": "#
|
|
168
|
+
"backgroundColor": "#401960",
|
|
169
169
|
"borderRadius": 8,
|
|
170
170
|
"height": 12,
|
|
171
171
|
"marginBottom": 4,
|
|
@@ -185,7 +185,7 @@ exports[`StyledLoadingIndicator has text-secondary style 1`] = `
|
|
|
185
185
|
style={
|
|
186
186
|
Array [
|
|
187
187
|
Object {
|
|
188
|
-
"backgroundColor": "#
|
|
188
|
+
"backgroundColor": "#795e90",
|
|
189
189
|
"borderRadius": 8,
|
|
190
190
|
"height": 12,
|
|
191
191
|
"marginBottom": 4,
|
|
@@ -641,7 +641,7 @@ exports[`LoadingIndicator renders correctly when themeVariant is outlined-primar
|
|
|
641
641
|
style={
|
|
642
642
|
Array [
|
|
643
643
|
Object {
|
|
644
|
-
"backgroundColor": "#
|
|
644
|
+
"backgroundColor": "#401960",
|
|
645
645
|
"borderRadius": 8,
|
|
646
646
|
"height": 12,
|
|
647
647
|
"marginBottom": 4,
|
|
@@ -675,7 +675,7 @@ exports[`LoadingIndicator renders correctly when themeVariant is outlined-primar
|
|
|
675
675
|
style={
|
|
676
676
|
Array [
|
|
677
677
|
Object {
|
|
678
|
-
"backgroundColor": "#
|
|
678
|
+
"backgroundColor": "#401960",
|
|
679
679
|
"borderRadius": 8,
|
|
680
680
|
"height": 12,
|
|
681
681
|
"marginBottom": 4,
|
|
@@ -709,7 +709,7 @@ exports[`LoadingIndicator renders correctly when themeVariant is outlined-primar
|
|
|
709
709
|
style={
|
|
710
710
|
Array [
|
|
711
711
|
Object {
|
|
712
|
-
"backgroundColor": "#
|
|
712
|
+
"backgroundColor": "#401960",
|
|
713
713
|
"borderRadius": 8,
|
|
714
714
|
"height": 12,
|
|
715
715
|
"marginBottom": 4,
|
|
@@ -762,7 +762,7 @@ exports[`LoadingIndicator renders correctly when themeVariant is outlined-second
|
|
|
762
762
|
style={
|
|
763
763
|
Array [
|
|
764
764
|
Object {
|
|
765
|
-
"backgroundColor": "#
|
|
765
|
+
"backgroundColor": "#795e90",
|
|
766
766
|
"borderRadius": 8,
|
|
767
767
|
"height": 12,
|
|
768
768
|
"marginBottom": 4,
|
|
@@ -796,7 +796,7 @@ exports[`LoadingIndicator renders correctly when themeVariant is outlined-second
|
|
|
796
796
|
style={
|
|
797
797
|
Array [
|
|
798
798
|
Object {
|
|
799
|
-
"backgroundColor": "#
|
|
799
|
+
"backgroundColor": "#795e90",
|
|
800
800
|
"borderRadius": 8,
|
|
801
801
|
"height": 12,
|
|
802
802
|
"marginBottom": 4,
|
|
@@ -830,7 +830,7 @@ exports[`LoadingIndicator renders correctly when themeVariant is outlined-second
|
|
|
830
830
|
style={
|
|
831
831
|
Array [
|
|
832
832
|
Object {
|
|
833
|
-
"backgroundColor": "#
|
|
833
|
+
"backgroundColor": "#795e90",
|
|
834
834
|
"borderRadius": 8,
|
|
835
835
|
"height": 12,
|
|
836
836
|
"marginBottom": 4,
|
|
@@ -1004,7 +1004,7 @@ exports[`LoadingIndicator renders correctly when themeVariant is text-primary 1`
|
|
|
1004
1004
|
style={
|
|
1005
1005
|
Array [
|
|
1006
1006
|
Object {
|
|
1007
|
-
"backgroundColor": "#
|
|
1007
|
+
"backgroundColor": "#401960",
|
|
1008
1008
|
"borderRadius": 8,
|
|
1009
1009
|
"height": 12,
|
|
1010
1010
|
"marginBottom": 4,
|
|
@@ -1038,7 +1038,7 @@ exports[`LoadingIndicator renders correctly when themeVariant is text-primary 1`
|
|
|
1038
1038
|
style={
|
|
1039
1039
|
Array [
|
|
1040
1040
|
Object {
|
|
1041
|
-
"backgroundColor": "#
|
|
1041
|
+
"backgroundColor": "#401960",
|
|
1042
1042
|
"borderRadius": 8,
|
|
1043
1043
|
"height": 12,
|
|
1044
1044
|
"marginBottom": 4,
|
|
@@ -1072,7 +1072,7 @@ exports[`LoadingIndicator renders correctly when themeVariant is text-primary 1`
|
|
|
1072
1072
|
style={
|
|
1073
1073
|
Array [
|
|
1074
1074
|
Object {
|
|
1075
|
-
"backgroundColor": "#
|
|
1075
|
+
"backgroundColor": "#401960",
|
|
1076
1076
|
"borderRadius": 8,
|
|
1077
1077
|
"height": 12,
|
|
1078
1078
|
"marginBottom": 4,
|
|
@@ -1125,7 +1125,7 @@ exports[`LoadingIndicator renders correctly when themeVariant is text-secondary
|
|
|
1125
1125
|
style={
|
|
1126
1126
|
Array [
|
|
1127
1127
|
Object {
|
|
1128
|
-
"backgroundColor": "#
|
|
1128
|
+
"backgroundColor": "#795e90",
|
|
1129
1129
|
"borderRadius": 8,
|
|
1130
1130
|
"height": 12,
|
|
1131
1131
|
"marginBottom": 4,
|
|
@@ -1159,7 +1159,7 @@ exports[`LoadingIndicator renders correctly when themeVariant is text-secondary
|
|
|
1159
1159
|
style={
|
|
1160
1160
|
Array [
|
|
1161
1161
|
Object {
|
|
1162
|
-
"backgroundColor": "#
|
|
1162
|
+
"backgroundColor": "#795e90",
|
|
1163
1163
|
"borderRadius": 8,
|
|
1164
1164
|
"height": 12,
|
|
1165
1165
|
"marginBottom": 4,
|
|
@@ -1193,7 +1193,7 @@ exports[`LoadingIndicator renders correctly when themeVariant is text-secondary
|
|
|
1193
1193
|
style={
|
|
1194
1194
|
Array [
|
|
1195
1195
|
Object {
|
|
1196
|
-
"backgroundColor": "#
|
|
1196
|
+
"backgroundColor": "#795e90",
|
|
1197
1197
|
"borderRadius": 8,
|
|
1198
1198
|
"height": 12,
|
|
1199
1199
|
"marginBottom": 4,
|
|
@@ -115,7 +115,7 @@ const LoadingIndicator = ({
|
|
|
115
115
|
};
|
|
116
116
|
}, []);
|
|
117
117
|
|
|
118
|
-
const renderLoadingDot = (
|
|
118
|
+
const renderLoadingDot = (_item: any, index: number) => {
|
|
119
119
|
if (typeof renderDotComponent === 'function') {
|
|
120
120
|
return renderDotComponent({
|
|
121
121
|
index,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TouchableOpacity, View } from 'react-native';
|
|
2
2
|
import styled from '@emotion/native';
|
|
3
3
|
import type { ReactNativeStyle } from '@emotion/native';
|
|
4
4
|
import type { Theme } from '@emotion/react';
|
|
@@ -19,15 +19,8 @@ type ThemeVariant =
|
|
|
19
19
|
| 'text-secondary'
|
|
20
20
|
| 'text-danger';
|
|
21
21
|
|
|
22
|
-
const PRESSED_COLORS = {
|
|
23
|
-
primary: 'pressedPrimary',
|
|
24
|
-
secondary: 'pressedSecondary',
|
|
25
|
-
danger: 'pressedDanger',
|
|
26
|
-
} as const;
|
|
27
|
-
|
|
28
22
|
const genBasicTransparentContainerStyles = (
|
|
29
23
|
theme: Theme,
|
|
30
|
-
pressed: boolean,
|
|
31
24
|
disabled: boolean
|
|
32
25
|
): ReactNativeStyle => {
|
|
33
26
|
const borderColorStyling = () => {
|
|
@@ -51,7 +44,6 @@ const genBasicTransparentContainerStyles = (
|
|
|
51
44
|
borderWidth: theme.__hd__.button.borderWidth.default,
|
|
52
45
|
borderRadius: theme.__hd__.button.radii.default,
|
|
53
46
|
backgroundColor: 'transparent',
|
|
54
|
-
opacity: pressed ? 0.6 : 1,
|
|
55
47
|
...borderColorStyling(),
|
|
56
48
|
};
|
|
57
49
|
};
|
|
@@ -59,7 +51,6 @@ const genBasicTransparentContainerStyles = (
|
|
|
59
51
|
const genFilledContainerStyles = (
|
|
60
52
|
theme: Theme,
|
|
61
53
|
intent: Intent,
|
|
62
|
-
pressed: boolean,
|
|
63
54
|
disabled: boolean
|
|
64
55
|
): ReactNativeStyle => {
|
|
65
56
|
const backgroundColorStyling = () => {
|
|
@@ -69,12 +60,6 @@ const genFilledContainerStyles = (
|
|
|
69
60
|
};
|
|
70
61
|
}
|
|
71
62
|
|
|
72
|
-
if (pressed) {
|
|
73
|
-
return {
|
|
74
|
-
backgroundColor: theme.__hd__.button.colors[PRESSED_COLORS[intent]],
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
|
|
78
63
|
return { backgroundColor: theme.__hd__.button.colors[intent] };
|
|
79
64
|
};
|
|
80
65
|
|
|
@@ -92,7 +77,6 @@ const genFilledContainerStyles = (
|
|
|
92
77
|
const genOutlineContainerStyles = (
|
|
93
78
|
theme: Theme,
|
|
94
79
|
intent: Intent,
|
|
95
|
-
pressed: boolean,
|
|
96
80
|
disabled: boolean
|
|
97
81
|
): ReactNativeStyle => {
|
|
98
82
|
const borderColorStyling = () => {
|
|
@@ -102,12 +86,6 @@ const genOutlineContainerStyles = (
|
|
|
102
86
|
};
|
|
103
87
|
}
|
|
104
88
|
|
|
105
|
-
if (pressed) {
|
|
106
|
-
return {
|
|
107
|
-
borderColor: theme.__hd__.button.colors[PRESSED_COLORS[intent]],
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
|
|
111
89
|
return { borderColor: theme.__hd__.button.colors[intent] };
|
|
112
90
|
};
|
|
113
91
|
|
|
@@ -129,7 +107,6 @@ const genOutlineContainerStyles = (
|
|
|
129
107
|
const genOutlineTextStyles = (
|
|
130
108
|
theme: Theme,
|
|
131
109
|
intent: Intent,
|
|
132
|
-
pressed?: boolean,
|
|
133
110
|
disabled?: boolean
|
|
134
111
|
): ReactNativeStyle => {
|
|
135
112
|
const textColorStyling = () => {
|
|
@@ -139,12 +116,6 @@ const genOutlineTextStyles = (
|
|
|
139
116
|
};
|
|
140
117
|
}
|
|
141
118
|
|
|
142
|
-
if (pressed) {
|
|
143
|
-
return {
|
|
144
|
-
color: theme.__hd__.button.colors[PRESSED_COLORS[intent]],
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
|
|
148
119
|
return { color: theme.__hd__.button.colors[intent] };
|
|
149
120
|
};
|
|
150
121
|
|
|
@@ -158,7 +129,6 @@ const genOutlineTextStyles = (
|
|
|
158
129
|
const genTextVariantTextStyles = (
|
|
159
130
|
theme: Theme,
|
|
160
131
|
intent: Intent,
|
|
161
|
-
pressed?: boolean,
|
|
162
132
|
disabled?: boolean
|
|
163
133
|
): ReactNativeStyle => {
|
|
164
134
|
const textColorStyling = () => {
|
|
@@ -168,12 +138,6 @@ const genTextVariantTextStyles = (
|
|
|
168
138
|
};
|
|
169
139
|
}
|
|
170
140
|
|
|
171
|
-
if (pressed) {
|
|
172
|
-
return {
|
|
173
|
-
color: theme.__hd__.button.colors[PRESSED_COLORS[intent]],
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
|
|
177
141
|
return { color: theme.__hd__.button.colors[intent] };
|
|
178
142
|
};
|
|
179
143
|
|
|
@@ -184,26 +148,25 @@ const genTextVariantTextStyles = (
|
|
|
184
148
|
};
|
|
185
149
|
};
|
|
186
150
|
|
|
187
|
-
const StyledButtonContainer = styled(
|
|
151
|
+
const StyledButtonContainer = styled(TouchableOpacity)<{
|
|
188
152
|
disabled?: boolean;
|
|
189
|
-
pressed?: boolean;
|
|
190
153
|
themeVariant: ThemeVariant;
|
|
191
|
-
}>(({ disabled = false,
|
|
154
|
+
}>(({ disabled = false, themeVariant, theme }) => {
|
|
192
155
|
switch (themeVariant) {
|
|
193
156
|
case 'basic-transparent':
|
|
194
|
-
return genBasicTransparentContainerStyles(theme,
|
|
157
|
+
return genBasicTransparentContainerStyles(theme, disabled);
|
|
195
158
|
case 'filled-primary':
|
|
196
|
-
return genFilledContainerStyles(theme, 'primary',
|
|
159
|
+
return genFilledContainerStyles(theme, 'primary', disabled);
|
|
197
160
|
case 'filled-secondary':
|
|
198
|
-
return genFilledContainerStyles(theme, 'secondary',
|
|
161
|
+
return genFilledContainerStyles(theme, 'secondary', disabled);
|
|
199
162
|
case 'filled-danger':
|
|
200
|
-
return genFilledContainerStyles(theme, 'danger',
|
|
163
|
+
return genFilledContainerStyles(theme, 'danger', disabled);
|
|
201
164
|
case 'outlined-primary':
|
|
202
|
-
return genOutlineContainerStyles(theme, 'primary',
|
|
165
|
+
return genOutlineContainerStyles(theme, 'primary', disabled);
|
|
203
166
|
case 'outlined-secondary':
|
|
204
|
-
return genOutlineContainerStyles(theme, 'secondary',
|
|
167
|
+
return genOutlineContainerStyles(theme, 'secondary', disabled);
|
|
205
168
|
case 'outlined-danger':
|
|
206
|
-
return genOutlineContainerStyles(theme, 'danger',
|
|
169
|
+
return genOutlineContainerStyles(theme, 'danger', disabled);
|
|
207
170
|
case 'text-primary':
|
|
208
171
|
case 'text-secondary':
|
|
209
172
|
case 'text-danger':
|
|
@@ -219,9 +182,8 @@ const StyledButtonContainer = styled(TouchableHighlight)<{
|
|
|
219
182
|
|
|
220
183
|
const StyledButtonText = styled(Typography.Text)<{
|
|
221
184
|
disabled?: boolean;
|
|
222
|
-
pressed?: boolean;
|
|
223
185
|
themeVariant: ThemeVariant;
|
|
224
|
-
}>(({ disabled,
|
|
186
|
+
}>(({ disabled, themeVariant, theme }) => {
|
|
225
187
|
const themeStyling = () => {
|
|
226
188
|
switch (themeVariant) {
|
|
227
189
|
case 'basic-transparent':
|
|
@@ -241,17 +203,17 @@ const StyledButtonText = styled(Typography.Text)<{
|
|
|
241
203
|
color: theme.__hd__.button.colors.invertedText,
|
|
242
204
|
};
|
|
243
205
|
case 'outlined-primary':
|
|
244
|
-
return genOutlineTextStyles(theme, 'primary',
|
|
206
|
+
return genOutlineTextStyles(theme, 'primary', disabled);
|
|
245
207
|
case 'outlined-secondary':
|
|
246
|
-
return genOutlineTextStyles(theme, 'secondary',
|
|
208
|
+
return genOutlineTextStyles(theme, 'secondary', disabled);
|
|
247
209
|
case 'outlined-danger':
|
|
248
|
-
return genOutlineTextStyles(theme, 'danger',
|
|
210
|
+
return genOutlineTextStyles(theme, 'danger', disabled);
|
|
249
211
|
case 'text-primary':
|
|
250
|
-
return genTextVariantTextStyles(theme, 'primary',
|
|
212
|
+
return genTextVariantTextStyles(theme, 'primary', disabled);
|
|
251
213
|
case 'text-secondary':
|
|
252
|
-
return genTextVariantTextStyles(theme, 'secondary',
|
|
214
|
+
return genTextVariantTextStyles(theme, 'secondary', disabled);
|
|
253
215
|
case 'text-danger':
|
|
254
|
-
return genTextVariantTextStyles(theme, 'danger',
|
|
216
|
+
return genTextVariantTextStyles(theme, 'danger', disabled);
|
|
255
217
|
}
|
|
256
218
|
};
|
|
257
219
|
return {
|
|
@@ -275,9 +237,8 @@ const StyledButtonIconWrapper = styled(View)<{
|
|
|
275
237
|
|
|
276
238
|
const StyledButtonIcon = styled(Icon)<{
|
|
277
239
|
disabled?: boolean;
|
|
278
|
-
pressed?: boolean;
|
|
279
240
|
themeVariant: ThemeVariant;
|
|
280
|
-
}>(({ disabled,
|
|
241
|
+
}>(({ disabled, themeVariant, theme }) => {
|
|
281
242
|
const themeStyling = () => {
|
|
282
243
|
switch (themeVariant) {
|
|
283
244
|
case 'basic-transparent':
|
|
@@ -291,17 +252,17 @@ const StyledButtonIcon = styled(Icon)<{
|
|
|
291
252
|
case 'filled-danger':
|
|
292
253
|
return { color: theme.__hd__.button.colors.invertedText };
|
|
293
254
|
case 'outlined-primary':
|
|
294
|
-
return genOutlineTextStyles(theme, 'primary',
|
|
255
|
+
return genOutlineTextStyles(theme, 'primary', disabled);
|
|
295
256
|
case 'outlined-secondary':
|
|
296
|
-
return genOutlineTextStyles(theme, 'secondary',
|
|
257
|
+
return genOutlineTextStyles(theme, 'secondary', disabled);
|
|
297
258
|
case 'outlined-danger':
|
|
298
|
-
return genOutlineTextStyles(theme, 'danger',
|
|
259
|
+
return genOutlineTextStyles(theme, 'danger', disabled);
|
|
299
260
|
case 'text-primary':
|
|
300
|
-
return genTextVariantTextStyles(theme, 'primary',
|
|
261
|
+
return genTextVariantTextStyles(theme, 'primary', disabled);
|
|
301
262
|
case 'text-secondary':
|
|
302
|
-
return genTextVariantTextStyles(theme, 'secondary',
|
|
263
|
+
return genTextVariantTextStyles(theme, 'secondary', disabled);
|
|
303
264
|
case 'text-danger':
|
|
304
|
-
return genTextVariantTextStyles(theme, 'danger',
|
|
265
|
+
return genTextVariantTextStyles(theme, 'danger', disabled);
|
|
305
266
|
}
|
|
306
267
|
};
|
|
307
268
|
|
|
@@ -12,7 +12,7 @@ describe('UtilityButton', () => {
|
|
|
12
12
|
text="Settings"
|
|
13
13
|
icon="cog-outlined"
|
|
14
14
|
testID="settings-btn"
|
|
15
|
-
onPress={()
|
|
15
|
+
onPress={jest.fn()}
|
|
16
16
|
/>
|
|
17
17
|
);
|
|
18
18
|
|
|
@@ -46,7 +46,7 @@ describe('UtilityButton snapshot', () => {
|
|
|
46
46
|
text="Settings"
|
|
47
47
|
icon="cog-outlined"
|
|
48
48
|
testID="settings-btn"
|
|
49
|
-
onPress={()
|
|
49
|
+
onPress={jest.fn()}
|
|
50
50
|
/>
|
|
51
51
|
);
|
|
52
52
|
|
|
@@ -9,21 +9,26 @@ import { getThemeVariant } from '../Button';
|
|
|
9
9
|
describe('Button', () => {
|
|
10
10
|
it('renders button text', () => {
|
|
11
11
|
const { getByText } = renderWithTheme(
|
|
12
|
-
<Button text="A button" onPress={()
|
|
12
|
+
<Button text="A button" onPress={jest.fn()} />
|
|
13
13
|
);
|
|
14
14
|
expect(getByText('A button')).toBeDefined();
|
|
15
15
|
});
|
|
16
16
|
|
|
17
17
|
it('renders no icon by default', () => {
|
|
18
18
|
const { queryByTestId } = renderWithTheme(
|
|
19
|
-
<Button text="A button" testID="button" onPress={()
|
|
19
|
+
<Button text="A button" testID="button" onPress={jest.fn()} />
|
|
20
20
|
);
|
|
21
21
|
expect(queryByTestId('button-left-icon')).toBeNull();
|
|
22
22
|
});
|
|
23
23
|
|
|
24
24
|
it('renders icon', () => {
|
|
25
25
|
const { getByTestId } = renderWithTheme(
|
|
26
|
-
<Button
|
|
26
|
+
<Button
|
|
27
|
+
text="A button"
|
|
28
|
+
icon="heart"
|
|
29
|
+
testID="button"
|
|
30
|
+
onPress={jest.fn()}
|
|
31
|
+
/>
|
|
27
32
|
);
|
|
28
33
|
expect(getByTestId('button-left-icon')).toBeDefined();
|
|
29
34
|
});
|
|
@@ -34,7 +39,7 @@ describe('Button', () => {
|
|
|
34
39
|
text="A button"
|
|
35
40
|
rightIcon="heart"
|
|
36
41
|
testID="button"
|
|
37
|
-
onPress={()
|
|
42
|
+
onPress={jest.fn()}
|
|
38
43
|
/>
|
|
39
44
|
);
|
|
40
45
|
expect(getByTestId('button-right-icon')).toBeDefined();
|
|
@@ -42,7 +47,7 @@ describe('Button', () => {
|
|
|
42
47
|
|
|
43
48
|
it('renders loading icon', () => {
|
|
44
49
|
const { getByTestId } = renderWithTheme(
|
|
45
|
-
<Button text="A button" testID="button" onPress={()
|
|
50
|
+
<Button text="A button" testID="button" onPress={jest.fn()} loading />
|
|
46
51
|
);
|
|
47
52
|
expect(getByTestId('button-loading-indicator')).toBeDefined();
|
|
48
53
|
});
|