@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
|
@@ -1,37 +1,27 @@
|
|
|
1
|
-
import { fireEvent, within } from
|
|
2
|
-
import React from
|
|
3
|
-
import { theme } from
|
|
4
|
-
import renderWithTheme from
|
|
5
|
-
import Icon from
|
|
6
|
-
import TextInput, { getVariant } from
|
|
7
|
-
|
|
8
|
-
describe(
|
|
1
|
+
import { fireEvent, within } from '@testing-library/react-native';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { theme } from '../../..';
|
|
4
|
+
import renderWithTheme from '../../../testHelpers/renderWithTheme';
|
|
5
|
+
import Icon from '../../Icon';
|
|
6
|
+
import TextInput, { getVariant } from '../index';
|
|
7
|
+
|
|
8
|
+
describe('getVariant', () => {
|
|
9
9
|
it.each`
|
|
10
|
-
disabled | error | editable | loading |
|
|
11
|
-
${false} | ${undefined} | ${true} | ${false} | ${
|
|
12
|
-
${false} | ${undefined} | ${true} | ${false} | ${false}
|
|
13
|
-
${false} | ${undefined} | ${
|
|
14
|
-
${false} | ${
|
|
15
|
-
${
|
|
16
|
-
${true} | ${"This field is required"} | ${false} | ${false} | ${true} | ${true} | ${"disabled"}
|
|
10
|
+
disabled | error | editable | loading | isEmptyValue | expected
|
|
11
|
+
${false} | ${undefined} | ${true} | ${false} | ${true} | ${'default'}
|
|
12
|
+
${false} | ${undefined} | ${true} | ${false} | ${false} | ${'filled'}
|
|
13
|
+
${false} | ${undefined} | ${false} | ${true} | ${true} | ${'readonly'}
|
|
14
|
+
${false} | ${'This field is required'} | ${false} | ${false} | ${true} | ${'error'}
|
|
15
|
+
${true} | ${'This field is required'} | ${false} | ${false} | ${true} | ${'disabled'}
|
|
17
16
|
`(
|
|
18
|
-
|
|
19
|
-
({
|
|
20
|
-
disabled,
|
|
21
|
-
error,
|
|
22
|
-
editable,
|
|
23
|
-
loading,
|
|
24
|
-
isFocused,
|
|
25
|
-
isEmptyValue,
|
|
26
|
-
expected,
|
|
27
|
-
}) => {
|
|
17
|
+
'should return the correct variant when disabled $disabled, errorMessage $errorMessage, editable $false, isEmptyValue $isEmptyValue',
|
|
18
|
+
({ disabled, error, editable, loading, isEmptyValue, expected }) => {
|
|
28
19
|
expect(
|
|
29
20
|
getVariant({
|
|
30
21
|
disabled,
|
|
31
22
|
error,
|
|
32
23
|
editable,
|
|
33
24
|
loading,
|
|
34
|
-
isFocused,
|
|
35
25
|
isEmptyValue,
|
|
36
26
|
})
|
|
37
27
|
).toBe(expected);
|
|
@@ -39,9 +29,9 @@ describe("getVariant", () => {
|
|
|
39
29
|
);
|
|
40
30
|
});
|
|
41
31
|
|
|
42
|
-
describe(
|
|
43
|
-
describe(
|
|
44
|
-
it(
|
|
32
|
+
describe('TextInput', () => {
|
|
33
|
+
describe('idle', () => {
|
|
34
|
+
it('renders correctly', () => {
|
|
45
35
|
const { getByTestId, toJSON } = renderWithTheme(
|
|
46
36
|
<TextInput
|
|
47
37
|
label="Amount (AUD)"
|
|
@@ -53,25 +43,25 @@ describe("TextInput", () => {
|
|
|
53
43
|
);
|
|
54
44
|
|
|
55
45
|
expect(toJSON()).toMatchSnapshot();
|
|
56
|
-
expect(getByTestId(
|
|
46
|
+
expect(getByTestId('idle-text-input')).toBeTruthy();
|
|
57
47
|
expect(
|
|
58
|
-
within(getByTestId(
|
|
48
|
+
within(getByTestId('idle-text-input')).queryAllByTestId('text-input')
|
|
59
49
|
).toHaveLength(1);
|
|
60
50
|
expect(
|
|
61
|
-
within(getByTestId(
|
|
51
|
+
within(getByTestId('idle-text-input')).queryAllByText('Amount (AUD)')
|
|
62
52
|
).toHaveLength(1);
|
|
63
53
|
expect(
|
|
64
|
-
within(getByTestId(
|
|
54
|
+
within(getByTestId('idle-text-input')).queryAllByTestId('input-label')
|
|
65
55
|
).toHaveLength(1);
|
|
66
56
|
expect(
|
|
67
|
-
within(getByTestId(
|
|
57
|
+
within(getByTestId('idle-text-input')).queryAllByTestId('input-prefix')
|
|
68
58
|
).toHaveLength(1);
|
|
69
59
|
expect(
|
|
70
|
-
within(getByTestId(
|
|
60
|
+
within(getByTestId('idle-text-input')).queryAllByTestId('input-suffix')
|
|
71
61
|
).toHaveLength(1);
|
|
72
62
|
});
|
|
73
63
|
|
|
74
|
-
it(
|
|
64
|
+
it('should not render input-label if label is empty', () => {
|
|
75
65
|
const { getByTestId } = renderWithTheme(
|
|
76
66
|
<TextInput
|
|
77
67
|
prefix="dollar-sign"
|
|
@@ -80,13 +70,13 @@ describe("TextInput", () => {
|
|
|
80
70
|
/>
|
|
81
71
|
);
|
|
82
72
|
|
|
83
|
-
expect(getByTestId(
|
|
73
|
+
expect(getByTestId('idle-text-input')).toBeTruthy();
|
|
84
74
|
expect(
|
|
85
|
-
within(getByTestId(
|
|
75
|
+
within(getByTestId('idle-text-input')).queryAllByTestId('input-label')
|
|
86
76
|
).toHaveLength(0);
|
|
87
77
|
});
|
|
88
78
|
|
|
89
|
-
it(
|
|
79
|
+
it('onChangeText, onBlur, onFocus', () => {
|
|
90
80
|
const onChangeText = jest.fn();
|
|
91
81
|
const onBlur = jest.fn();
|
|
92
82
|
const onFocus = jest.fn();
|
|
@@ -102,23 +92,23 @@ describe("TextInput", () => {
|
|
|
102
92
|
/>
|
|
103
93
|
);
|
|
104
94
|
|
|
105
|
-
const testInput = within(getByTestId(
|
|
106
|
-
|
|
95
|
+
const testInput = within(getByTestId('idle-text-input')).getByTestId(
|
|
96
|
+
'text-input'
|
|
107
97
|
);
|
|
108
98
|
|
|
109
|
-
fireEvent.changeText(testInput,
|
|
110
|
-
expect(onChangeText).toHaveBeenCalledWith(
|
|
99
|
+
fireEvent.changeText(testInput, 'Thong Quach');
|
|
100
|
+
expect(onChangeText).toHaveBeenCalledWith('Thong Quach');
|
|
111
101
|
|
|
112
|
-
fireEvent(testInput,
|
|
102
|
+
fireEvent(testInput, 'blur');
|
|
113
103
|
expect(onBlur).toHaveBeenCalledTimes(1);
|
|
114
104
|
|
|
115
|
-
fireEvent(testInput,
|
|
105
|
+
fireEvent(testInput, 'focus');
|
|
116
106
|
expect(onFocus).toHaveBeenCalledTimes(1);
|
|
117
107
|
});
|
|
118
108
|
});
|
|
119
109
|
|
|
120
|
-
describe(
|
|
121
|
-
it(
|
|
110
|
+
describe('idle with suffix and prefix are React Element', () => {
|
|
111
|
+
it('renders correctly', () => {
|
|
122
112
|
const { toJSON, queryAllByTestId, queryAllByText } = renderWithTheme(
|
|
123
113
|
<TextInput
|
|
124
114
|
label="Amount (AUD)"
|
|
@@ -129,16 +119,16 @@ describe("TextInput", () => {
|
|
|
129
119
|
);
|
|
130
120
|
|
|
131
121
|
expect(toJSON()).toMatchSnapshot();
|
|
132
|
-
expect(queryAllByText(
|
|
133
|
-
expect(queryAllByText(
|
|
134
|
-
expect(queryAllByTestId(
|
|
135
|
-
expect(queryAllByTestId(
|
|
136
|
-
expect(queryAllByTestId(
|
|
137
|
-
expect(queryAllByTestId(
|
|
122
|
+
expect(queryAllByText('Amount (AUD)')).toHaveLength(1);
|
|
123
|
+
expect(queryAllByText('*')).toHaveLength(1);
|
|
124
|
+
expect(queryAllByTestId('input-label')).toHaveLength(1);
|
|
125
|
+
expect(queryAllByTestId('prefix-element')).toHaveLength(1);
|
|
126
|
+
expect(queryAllByTestId('suffix-element')).toHaveLength(1);
|
|
127
|
+
expect(queryAllByTestId('text-input')).toHaveLength(1);
|
|
138
128
|
});
|
|
139
129
|
});
|
|
140
|
-
describe(
|
|
141
|
-
it(
|
|
130
|
+
describe('required', () => {
|
|
131
|
+
it('renders correctly', () => {
|
|
142
132
|
const { toJSON, queryAllByTestId, queryAllByText } = renderWithTheme(
|
|
143
133
|
<TextInput
|
|
144
134
|
label="Amount (AUD)"
|
|
@@ -149,17 +139,17 @@ describe("TextInput", () => {
|
|
|
149
139
|
);
|
|
150
140
|
|
|
151
141
|
expect(toJSON()).toMatchSnapshot();
|
|
152
|
-
expect(queryAllByText(
|
|
153
|
-
expect(queryAllByText(
|
|
154
|
-
expect(queryAllByTestId(
|
|
155
|
-
expect(queryAllByTestId(
|
|
156
|
-
expect(queryAllByTestId(
|
|
157
|
-
expect(queryAllByTestId(
|
|
142
|
+
expect(queryAllByText('Amount (AUD)')).toHaveLength(1);
|
|
143
|
+
expect(queryAllByText('*')).toHaveLength(1);
|
|
144
|
+
expect(queryAllByTestId('input-label')).toHaveLength(1);
|
|
145
|
+
expect(queryAllByTestId('input-prefix')).toHaveLength(1);
|
|
146
|
+
expect(queryAllByTestId('input-suffix')).toHaveLength(1);
|
|
147
|
+
expect(queryAllByTestId('text-input')).toHaveLength(1);
|
|
158
148
|
});
|
|
159
149
|
});
|
|
160
150
|
|
|
161
|
-
describe(
|
|
162
|
-
it(
|
|
151
|
+
describe('filled', () => {
|
|
152
|
+
it('renders correctly', () => {
|
|
163
153
|
const {
|
|
164
154
|
toJSON,
|
|
165
155
|
queryAllByTestId,
|
|
@@ -175,17 +165,17 @@ describe("TextInput", () => {
|
|
|
175
165
|
);
|
|
176
166
|
|
|
177
167
|
expect(toJSON()).toMatchSnapshot();
|
|
178
|
-
expect(queryAllByText(
|
|
179
|
-
expect(queryAllByDisplayValue(
|
|
180
|
-
expect(queryAllByTestId(
|
|
181
|
-
expect(queryAllByTestId(
|
|
182
|
-
expect(queryAllByTestId(
|
|
183
|
-
expect(queryAllByTestId(
|
|
168
|
+
expect(queryAllByText('Amount (AUD)')).toHaveLength(1);
|
|
169
|
+
expect(queryAllByDisplayValue('100')).toHaveLength(1);
|
|
170
|
+
expect(queryAllByTestId('input-label')).toHaveLength(1);
|
|
171
|
+
expect(queryAllByTestId('input-prefix')).toHaveLength(1);
|
|
172
|
+
expect(queryAllByTestId('input-suffix')).toHaveLength(1);
|
|
173
|
+
expect(queryAllByTestId('text-input')).toHaveLength(1);
|
|
184
174
|
});
|
|
185
175
|
});
|
|
186
176
|
|
|
187
|
-
describe(
|
|
188
|
-
it(
|
|
177
|
+
describe('readonly', () => {
|
|
178
|
+
it('renders correctly', () => {
|
|
189
179
|
const onChangeText = jest.fn();
|
|
190
180
|
const {
|
|
191
181
|
toJSON,
|
|
@@ -206,31 +196,31 @@ describe("TextInput", () => {
|
|
|
206
196
|
);
|
|
207
197
|
|
|
208
198
|
expect(toJSON()).toMatchSnapshot();
|
|
209
|
-
expect(queryAllByText(
|
|
210
|
-
expect(queryAllByDisplayValue(
|
|
211
|
-
expect(queryAllByTestId(
|
|
212
|
-
expect(queryAllByTestId(
|
|
213
|
-
expect(queryAllByTestId(
|
|
214
|
-
expect(queryAllByTestId(
|
|
215
|
-
|
|
216
|
-
expect(getByTestId(
|
|
199
|
+
expect(queryAllByText('Amount (AUD)')).toHaveLength(1);
|
|
200
|
+
expect(queryAllByDisplayValue('100')).toHaveLength(1);
|
|
201
|
+
expect(queryAllByTestId('input-label')).toHaveLength(1);
|
|
202
|
+
expect(queryAllByTestId('input-prefix')).toHaveLength(1);
|
|
203
|
+
expect(queryAllByTestId('input-suffix')).toHaveLength(1);
|
|
204
|
+
expect(queryAllByTestId('text-input')).toHaveLength(1);
|
|
205
|
+
|
|
206
|
+
expect(getByTestId('text-input')).not.toHaveProp('editable', 'false');
|
|
217
207
|
});
|
|
218
208
|
});
|
|
219
209
|
|
|
220
|
-
describe(
|
|
221
|
-
it(
|
|
210
|
+
describe('loading', () => {
|
|
211
|
+
it('renders correctly', () => {
|
|
222
212
|
const { toJSON, queryAllByTestId, getByTestId } = renderWithTheme(
|
|
223
213
|
<TextInput suffix="arrow-down" loading />
|
|
224
214
|
);
|
|
225
215
|
|
|
226
216
|
expect(toJSON()).toMatchSnapshot();
|
|
227
|
-
expect(queryAllByTestId(
|
|
228
|
-
expect(getByTestId(
|
|
217
|
+
expect(queryAllByTestId('text-input')).toHaveLength(1);
|
|
218
|
+
expect(getByTestId('input-suffix')).toHaveProp('name', 'loading');
|
|
229
219
|
});
|
|
230
220
|
});
|
|
231
221
|
|
|
232
|
-
describe(
|
|
233
|
-
it(
|
|
222
|
+
describe('max length', () => {
|
|
223
|
+
it('renders correctly', () => {
|
|
234
224
|
const {
|
|
235
225
|
toJSON,
|
|
236
226
|
queryAllByTestId,
|
|
@@ -249,18 +239,18 @@ describe("TextInput", () => {
|
|
|
249
239
|
);
|
|
250
240
|
|
|
251
241
|
expect(toJSON()).toMatchSnapshot();
|
|
252
|
-
expect(queryAllByText(
|
|
253
|
-
expect(queryAllByDisplayValue(
|
|
254
|
-
expect(queryAllByText(
|
|
255
|
-
expect(queryAllByTestId(
|
|
256
|
-
expect(queryAllByTestId(
|
|
242
|
+
expect(queryAllByText('Shout out')).toHaveLength(1);
|
|
243
|
+
expect(queryAllByDisplayValue('shout out Tung Van')).toHaveLength(1);
|
|
244
|
+
expect(queryAllByText('18/255')).toHaveLength(1);
|
|
245
|
+
expect(queryAllByTestId('input-label')).toHaveLength(1);
|
|
246
|
+
expect(queryAllByTestId('text-input')).toHaveLength(1);
|
|
257
247
|
|
|
258
|
-
expect(getByTestId(
|
|
248
|
+
expect(getByTestId('text-input')).not.toHaveProp('multiline', 'true');
|
|
259
249
|
});
|
|
260
250
|
});
|
|
261
251
|
|
|
262
|
-
describe(
|
|
263
|
-
it(
|
|
252
|
+
describe('disabled', () => {
|
|
253
|
+
it('renders correctly', () => {
|
|
264
254
|
const { toJSON, queryAllByTestId, queryAllByText, getByTestId } =
|
|
265
255
|
renderWithTheme(
|
|
266
256
|
<TextInput
|
|
@@ -273,17 +263,17 @@ describe("TextInput", () => {
|
|
|
273
263
|
);
|
|
274
264
|
|
|
275
265
|
expect(toJSON()).toMatchSnapshot();
|
|
276
|
-
expect(queryAllByText(
|
|
277
|
-
expect(queryAllByTestId(
|
|
278
|
-
expect(queryAllByTestId(
|
|
279
|
-
expect(getByTestId(
|
|
266
|
+
expect(queryAllByText('Amount (AUD)')).toHaveLength(1);
|
|
267
|
+
expect(queryAllByTestId('input-label')).toHaveLength(1);
|
|
268
|
+
expect(queryAllByTestId('text-input')).toHaveLength(1);
|
|
269
|
+
expect(getByTestId('disabled-text-input')).toBeDisabled();
|
|
280
270
|
|
|
281
|
-
expect(getByTestId(
|
|
271
|
+
expect(getByTestId('text-input')).not.toHaveProp('multiline', 'true');
|
|
282
272
|
});
|
|
283
273
|
});
|
|
284
274
|
|
|
285
|
-
describe(
|
|
286
|
-
it(
|
|
275
|
+
describe('error', () => {
|
|
276
|
+
it('renders correctly', () => {
|
|
287
277
|
const { toJSON, queryAllByText } = renderWithTheme(
|
|
288
278
|
<TextInput
|
|
289
279
|
label="Amount (AUD)"
|
|
@@ -294,12 +284,12 @@ describe("TextInput", () => {
|
|
|
294
284
|
);
|
|
295
285
|
|
|
296
286
|
expect(toJSON()).toMatchSnapshot();
|
|
297
|
-
expect(queryAllByText(
|
|
298
|
-
expect(queryAllByText(
|
|
287
|
+
expect(queryAllByText('Amount (AUD)')).toHaveLength(1);
|
|
288
|
+
expect(queryAllByText('This field is required')).toHaveLength(1);
|
|
299
289
|
});
|
|
300
290
|
});
|
|
301
|
-
describe(
|
|
302
|
-
it(
|
|
291
|
+
describe('helper text', () => {
|
|
292
|
+
it('renders correctly', () => {
|
|
303
293
|
const { toJSON, queryAllByText } = renderWithTheme(
|
|
304
294
|
<TextInput
|
|
305
295
|
label="Amount (AUD)"
|
|
@@ -310,14 +300,14 @@ describe("TextInput", () => {
|
|
|
310
300
|
);
|
|
311
301
|
|
|
312
302
|
expect(toJSON()).toMatchSnapshot();
|
|
313
|
-
expect(queryAllByText(
|
|
314
|
-
expect(queryAllByText(
|
|
303
|
+
expect(queryAllByText('Amount (AUD)')).toHaveLength(1);
|
|
304
|
+
expect(queryAllByText('This is helper text')).toHaveLength(1);
|
|
315
305
|
});
|
|
316
306
|
});
|
|
317
307
|
|
|
318
|
-
describe(
|
|
319
|
-
describe(
|
|
320
|
-
it(
|
|
308
|
+
describe('placeholder', () => {
|
|
309
|
+
describe('TextInput is idle', () => {
|
|
310
|
+
it('renders correctly', () => {
|
|
321
311
|
const wrapper = renderWithTheme(
|
|
322
312
|
<TextInput
|
|
323
313
|
label="Amount (AUD)"
|
|
@@ -329,20 +319,20 @@ describe("TextInput", () => {
|
|
|
329
319
|
);
|
|
330
320
|
|
|
331
321
|
expect(wrapper.toJSON()).toMatchSnapshot();
|
|
332
|
-
expect(wrapper.queryByPlaceholderText(
|
|
322
|
+
expect(wrapper.queryByPlaceholderText('Enter Amount')).toBeFalsy();
|
|
333
323
|
|
|
334
|
-
fireEvent(wrapper.getByTestId(
|
|
335
|
-
expect(wrapper.queryByPlaceholderText(
|
|
324
|
+
fireEvent(wrapper.getByTestId('text-input'), 'focus');
|
|
325
|
+
expect(wrapper.queryByPlaceholderText('Enter Amount')).toBeTruthy();
|
|
336
326
|
|
|
337
|
-
fireEvent(wrapper.getByTestId(
|
|
338
|
-
expect(wrapper.queryByPlaceholderText(
|
|
327
|
+
fireEvent(wrapper.getByTestId('text-input'), 'blur');
|
|
328
|
+
expect(wrapper.queryByPlaceholderText('Enter Amount')).toBeFalsy();
|
|
339
329
|
});
|
|
340
330
|
});
|
|
341
331
|
});
|
|
342
332
|
|
|
343
|
-
describe(
|
|
344
|
-
describe(
|
|
345
|
-
it(
|
|
333
|
+
describe('defaultValue', () => {
|
|
334
|
+
describe('TextInput is idle', () => {
|
|
335
|
+
it('renders correctly', () => {
|
|
346
336
|
const wrapper = renderWithTheme(
|
|
347
337
|
<TextInput
|
|
348
338
|
label="Amount (AUD)"
|
|
@@ -356,13 +346,13 @@ describe("TextInput", () => {
|
|
|
356
346
|
);
|
|
357
347
|
|
|
358
348
|
expect(wrapper.toJSON()).toMatchSnapshot();
|
|
359
|
-
expect(wrapper.queryByDisplayValue(
|
|
360
|
-
expect(wrapper.queryByText(
|
|
349
|
+
expect(wrapper.queryByDisplayValue('1000')).toBeTruthy();
|
|
350
|
+
expect(wrapper.queryByText('4/255')).toBeTruthy();
|
|
361
351
|
});
|
|
362
352
|
});
|
|
363
353
|
|
|
364
|
-
describe(
|
|
365
|
-
it(
|
|
354
|
+
describe('default Value and Value', () => {
|
|
355
|
+
it('renders correctly with 2000', () => {
|
|
366
356
|
const wrapper = renderWithTheme(
|
|
367
357
|
<TextInput
|
|
368
358
|
label="Amount (AUD)"
|
|
@@ -377,9 +367,9 @@ describe("TextInput", () => {
|
|
|
377
367
|
);
|
|
378
368
|
|
|
379
369
|
expect(wrapper.toJSON()).toMatchSnapshot();
|
|
380
|
-
expect(wrapper.queryByDisplayValue(
|
|
381
|
-
expect(wrapper.queryByDisplayValue(
|
|
382
|
-
expect(wrapper.queryByText(
|
|
370
|
+
expect(wrapper.queryByDisplayValue('2000')).toBeTruthy();
|
|
371
|
+
expect(wrapper.queryByDisplayValue('1000')).toBeFalsy();
|
|
372
|
+
expect(wrapper.queryByText('4/255')).toBeTruthy();
|
|
383
373
|
});
|
|
384
374
|
});
|
|
385
375
|
});
|
|
@@ -104,7 +104,6 @@ export const getVariant = ({
|
|
|
104
104
|
error,
|
|
105
105
|
editable,
|
|
106
106
|
loading,
|
|
107
|
-
isFocused,
|
|
108
107
|
isEmptyValue,
|
|
109
108
|
}: {
|
|
110
109
|
disabled?: boolean;
|
|
@@ -123,9 +122,6 @@ export const getVariant = ({
|
|
|
123
122
|
if (!editable || loading) {
|
|
124
123
|
return 'readonly';
|
|
125
124
|
}
|
|
126
|
-
if (isFocused) {
|
|
127
|
-
return 'focused';
|
|
128
|
-
}
|
|
129
125
|
if (!isEmptyValue) {
|
|
130
126
|
return 'filled';
|
|
131
127
|
}
|
|
@@ -195,6 +191,7 @@ const TextInput = ({
|
|
|
195
191
|
accessibilityState: {
|
|
196
192
|
disabled: variant === 'disabled' || variant === 'readonly',
|
|
197
193
|
},
|
|
194
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
198
195
|
// @ts-ignore
|
|
199
196
|
accessibilityLabelledBy,
|
|
200
197
|
...nativeProps,
|
|
@@ -213,7 +210,8 @@ const TextInput = ({
|
|
|
213
210
|
nativeProps.onChangeText?.(text);
|
|
214
211
|
},
|
|
215
212
|
defaultValue,
|
|
216
|
-
placeholder:
|
|
213
|
+
placeholder:
|
|
214
|
+
isFocused || label === undefined ? nativeProps.placeholder : undefined,
|
|
217
215
|
};
|
|
218
216
|
|
|
219
217
|
return (
|
|
@@ -225,7 +223,11 @@ const TextInput = ({
|
|
|
225
223
|
testID={testID}
|
|
226
224
|
>
|
|
227
225
|
<StyledTextInputContainer>
|
|
228
|
-
<StyledBorderBackDrop
|
|
226
|
+
<StyledBorderBackDrop
|
|
227
|
+
themeFocused={isFocused}
|
|
228
|
+
themeVariant={variant}
|
|
229
|
+
style={borderStyle}
|
|
230
|
+
/>
|
|
229
231
|
{(isFocused || (label && !isEmptyValue)) && (
|
|
230
232
|
<StyledLabelContainer pointerEvents="none">
|
|
231
233
|
{required && (
|
|
@@ -61,6 +61,7 @@ exports[`TimePickerAndroid renders correctly 1`] = `
|
|
|
61
61
|
undefined,
|
|
62
62
|
]
|
|
63
63
|
}
|
|
64
|
+
themeFocused={false}
|
|
64
65
|
themeVariant="filled"
|
|
65
66
|
/>
|
|
66
67
|
<View
|
|
@@ -138,6 +139,7 @@ exports[`TimePickerAndroid renders correctly 1`] = `
|
|
|
138
139
|
"flexGrow": 2,
|
|
139
140
|
"fontSize": 14,
|
|
140
141
|
"marginHorizontal": 8,
|
|
142
|
+
"paddingVertical": 0,
|
|
141
143
|
"textAlignVertical": "center",
|
|
142
144
|
},
|
|
143
145
|
Object {
|
|
@@ -61,6 +61,7 @@ exports[`TimePickerIOS renders correctly 1`] = `
|
|
|
61
61
|
undefined,
|
|
62
62
|
]
|
|
63
63
|
}
|
|
64
|
+
themeFocused={false}
|
|
64
65
|
themeVariant="filled"
|
|
65
66
|
/>
|
|
66
67
|
<View
|
|
@@ -138,6 +139,7 @@ exports[`TimePickerIOS renders correctly 1`] = `
|
|
|
138
139
|
"flexGrow": 2,
|
|
139
140
|
"fontSize": 14,
|
|
140
141
|
"marginHorizontal": 8,
|
|
142
|
+
"paddingVertical": 0,
|
|
141
143
|
"textAlignVertical": "center",
|
|
142
144
|
},
|
|
143
145
|
Object {
|
|
@@ -251,32 +253,6 @@ exports[`TimePickerIOS renders correctly 1`] = `
|
|
|
251
253
|
]
|
|
252
254
|
}
|
|
253
255
|
>
|
|
254
|
-
<View
|
|
255
|
-
accessible={true}
|
|
256
|
-
collapsable={false}
|
|
257
|
-
focusable={true}
|
|
258
|
-
nativeID="animatedComponent"
|
|
259
|
-
onBlur={[Function]}
|
|
260
|
-
onClick={[Function]}
|
|
261
|
-
onFocus={[Function]}
|
|
262
|
-
onResponderGrant={[Function]}
|
|
263
|
-
onResponderMove={[Function]}
|
|
264
|
-
onResponderRelease={[Function]}
|
|
265
|
-
onResponderTerminate={[Function]}
|
|
266
|
-
onResponderTerminationRequest={[Function]}
|
|
267
|
-
onStartShouldSetResponder={[Function]}
|
|
268
|
-
style={
|
|
269
|
-
Object {
|
|
270
|
-
"backgroundColor": "#001f23",
|
|
271
|
-
"bottom": 0,
|
|
272
|
-
"left": 0,
|
|
273
|
-
"opacity": 0.48,
|
|
274
|
-
"position": "absolute",
|
|
275
|
-
"right": 0,
|
|
276
|
-
"top": 0,
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
/>
|
|
280
256
|
<View
|
|
281
257
|
onLayout={[Function]}
|
|
282
258
|
style={
|
|
@@ -294,6 +270,32 @@ exports[`TimePickerIOS renders correctly 1`] = `
|
|
|
294
270
|
]
|
|
295
271
|
}
|
|
296
272
|
>
|
|
273
|
+
<View
|
|
274
|
+
accessible={true}
|
|
275
|
+
collapsable={false}
|
|
276
|
+
focusable={true}
|
|
277
|
+
nativeID="animatedComponent"
|
|
278
|
+
onBlur={[Function]}
|
|
279
|
+
onClick={[Function]}
|
|
280
|
+
onFocus={[Function]}
|
|
281
|
+
onResponderGrant={[Function]}
|
|
282
|
+
onResponderMove={[Function]}
|
|
283
|
+
onResponderRelease={[Function]}
|
|
284
|
+
onResponderTerminate={[Function]}
|
|
285
|
+
onResponderTerminationRequest={[Function]}
|
|
286
|
+
onStartShouldSetResponder={[Function]}
|
|
287
|
+
style={
|
|
288
|
+
Object {
|
|
289
|
+
"backgroundColor": "#001f23",
|
|
290
|
+
"bottom": 0,
|
|
291
|
+
"left": 0,
|
|
292
|
+
"opacity": 0.48,
|
|
293
|
+
"position": "absolute",
|
|
294
|
+
"right": 0,
|
|
295
|
+
"top": 0,
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
/>
|
|
297
299
|
<RCTSafeAreaView
|
|
298
300
|
collapsable={false}
|
|
299
301
|
emulateUnlessSupported={true}
|
|
@@ -502,7 +504,7 @@ exports[`TimePickerIOS renders correctly 1`] = `
|
|
|
502
504
|
style={
|
|
503
505
|
Array [
|
|
504
506
|
Object {
|
|
505
|
-
"color": "#
|
|
507
|
+
"color": "#401960",
|
|
506
508
|
"fontFamily": "BeVietnamPro-SemiBold",
|
|
507
509
|
"fontSize": 16,
|
|
508
510
|
"letterSpacing": 0.48,
|
|
@@ -20,6 +20,7 @@ const ToastProvider = ({
|
|
|
20
20
|
position = 'top',
|
|
21
21
|
}: ToastProviderProps) => {
|
|
22
22
|
const toastRef = useRef<ToastControllerContextType>(null);
|
|
23
|
+
// @ts-expect-error: TODO: @tungv Fix this type error
|
|
23
24
|
const [refState, setRefState] = useState<ToastControllerContextType>(null);
|
|
24
25
|
|
|
25
26
|
useEffect(() => {
|
|
@@ -70,7 +70,7 @@ describe('Toast', () => {
|
|
|
70
70
|
it(`"hide" method works correctly`, () => {
|
|
71
71
|
const Component = () => {
|
|
72
72
|
const toast = Toast.useToast();
|
|
73
|
-
const [id, setId] = useState(
|
|
73
|
+
const [id, setId] = useState('');
|
|
74
74
|
|
|
75
75
|
useEffect(() => {
|
|
76
76
|
const toastId = toast.show({
|