@hero-design/rn 7.18.1 → 7.20.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/.eslintrc.json +6 -1
- package/.turbo/turbo-build.log +2 -2
- package/es/index.js +726 -336
- package/lib/index.js +727 -336
- package/package.json +4 -4
- package/src/components/Accordion/AccordionItem.tsx +5 -4
- package/src/components/Accordion/__tests__/index.spec.tsx +2 -1
- package/src/components/Accordion/index.tsx +3 -2
- package/src/components/Alert/StyledAlert.tsx +8 -7
- package/src/components/Alert/__tests__/__snapshots__/index.spec.tsx.snap +140 -19
- package/src/components/Alert/__tests__/index.spec.tsx +21 -0
- package/src/components/Alert/index.tsx +18 -9
- package/src/components/Avatar/StyledAvatar.tsx +2 -1
- package/src/components/Avatar/index.tsx +4 -3
- package/src/components/Badge/Status.tsx +4 -2
- package/src/components/Badge/index.tsx +2 -1
- package/src/components/BottomNavigation/__tests__/index.spec.tsx +4 -2
- package/src/components/BottomNavigation/index.tsx +6 -8
- package/src/components/BottomSheet/Footer.tsx +2 -1
- package/src/components/BottomSheet/Header.tsx +2 -1
- package/src/components/BottomSheet/StyledBottomSheet.tsx +2 -2
- package/src/components/BottomSheet/index.tsx +4 -8
- package/src/components/Box/StyledBox.tsx +54 -0
- package/src/components/Box/__tests__/__snapshots__/index.spec.tsx.snap +605 -0
- package/src/components/Box/__tests__/helpers.spec.ts +14 -0
- package/src/components/Box/__tests__/index.spec.tsx +155 -0
- package/src/components/Box/config.ts +201 -0
- package/src/components/Box/helpers.ts +10 -0
- package/src/components/Box/index.tsx +13 -0
- package/src/components/Box/types.ts +38 -0
- package/src/components/Button/Button.tsx +5 -6
- package/src/components/Button/IconButton.tsx +4 -7
- package/src/components/Button/LoadingIndicator/StyledLoadingIndicator.tsx +5 -3
- package/src/components/Button/LoadingIndicator/index.tsx +2 -8
- package/src/components/Button/StyledButton.tsx +4 -5
- package/src/components/Button/UtilityButton/index.tsx +5 -4
- package/src/components/Button/index.tsx +3 -2
- package/src/components/Calendar/StyledCalendar.tsx +2 -1
- package/src/components/Calendar/__tests__/index.spec.tsx +13 -17
- package/src/components/Card/DataCard/StyledDataCard.tsx +8 -2
- package/src/components/Card/DataCard/__tests__/StyledDataCard.spec.tsx +1 -0
- package/src/components/Card/DataCard/__tests__/__snapshots__/StyledDataCard.spec.tsx.snap +16 -0
- package/src/components/Card/DataCard/index.tsx +4 -3
- package/src/components/Card/StyledCard.tsx +12 -19
- package/src/components/Card/__tests__/__snapshots__/index.spec.tsx.snap +147 -0
- package/src/components/Card/__tests__/index.spec.tsx +18 -0
- package/src/components/Card/index.tsx +9 -3
- package/src/components/Checkbox/StyledCheckbox.tsx +44 -14
- package/src/components/Checkbox/__tests__/StyledCheckbox.spec.tsx +28 -3
- package/src/components/Checkbox/__tests__/__snapshots__/StyledCheckbox.spec.tsx.snap +95 -9
- package/src/components/Checkbox/__tests__/__snapshots__/index.spec.tsx.snap +337 -23
- package/src/components/Checkbox/__tests__/index.spec.tsx +38 -7
- package/src/components/Checkbox/index.tsx +35 -18
- package/src/components/Collapse/index.tsx +4 -8
- package/src/components/ContentNavigator/index.tsx +1 -1
- package/src/components/DatePicker/DatePickerAndroid.tsx +1 -1
- package/src/components/DatePicker/DatePickerIOS.tsx +1 -1
- package/src/components/DatePicker/StyledDatePicker.tsx +2 -1
- package/src/components/DatePicker/__tests__/DatePickerIOS.spec.tsx +1 -2
- package/src/components/DatePicker/index.tsx +1 -1
- package/src/components/DatePicker/types.ts +1 -1
- package/src/components/Divider/index.tsx +1 -1
- package/src/components/Drawer/DragableDrawer/helpers.ts +3 -4
- package/src/components/Drawer/DragableDrawer/index.tsx +3 -2
- package/src/components/Drawer/StyledDrawer.tsx +3 -2
- package/src/components/Drawer/index.tsx +2 -1
- package/src/components/Empty/index.tsx +1 -2
- package/src/components/FAB/ActionGroup/ActionItem.tsx +3 -2
- package/src/components/FAB/ActionGroup/StyledActionGroup.tsx +4 -3
- package/src/components/FAB/ActionGroup/StyledActionItem.tsx +4 -2
- package/src/components/FAB/ActionGroup/index.tsx +11 -11
- package/src/components/FAB/AnimatedFABIcon.tsx +1 -1
- package/src/components/FAB/FAB.tsx +2 -2
- package/src/components/FAB/StyledFAB.tsx +4 -7
- package/src/components/Icon/AnimatedIcon.tsx +2 -1
- package/src/components/Icon/index.tsx +1 -1
- package/src/components/List/BasicListItem.tsx +3 -3
- package/src/components/List/ListItem.tsx +6 -3
- package/src/components/List/StyledListItem.tsx +2 -1
- package/src/components/List/__tests__/__snapshots__/ListItem.spec.tsx.snap +13 -27
- package/src/components/List/__tests__/__snapshots__/StyledListItem.spec.tsx.snap +2 -0
- package/src/components/PinInput/PinCell.tsx +1 -1
- package/src/components/PinInput/index.tsx +3 -7
- package/src/components/Progress/ProgressBar.tsx +2 -1
- package/src/components/Progress/ProgressCircle.tsx +3 -9
- package/src/components/Progress/StyledProgressBar.tsx +3 -3
- package/src/components/Progress/StyledProgressCircle.tsx +3 -3
- package/src/components/Radio/Radio.tsx +20 -14
- package/src/components/Radio/RadioGroup.tsx +5 -3
- package/src/components/Radio/StyledRadio.tsx +12 -29
- package/src/components/Radio/__tests__/__snapshots__/Radio.spec.tsx.snap +84 -50
- package/src/components/Radio/__tests__/__snapshots__/RadioGroup.spec.tsx.snap +124 -73
- package/src/components/RichTextEditor/EditorToolbar.tsx +4 -8
- package/src/components/RichTextEditor/RichTextEditor.tsx +5 -14
- package/src/components/RichTextEditor/__tests__/EditorToolbar.spec.tsx +2 -6
- package/src/components/RichTextEditor/__tests__/MentionList.spec.tsx +2 -6
- package/src/components/RichTextEditor/__tests__/RichTextEditor.spec.tsx +8 -15
- package/src/components/RichTextEditor/index.tsx +6 -6
- package/src/components/SectionHeading/__tests__/__snapshots__/StyledHeading.spec.tsx.snap +1 -1
- package/src/components/SectionHeading/__tests__/__snapshots__/index.spec.tsx.snap +4 -4
- package/src/components/SectionHeading/index.tsx +5 -4
- package/src/components/Select/MultiSelect/Option.tsx +2 -1
- package/src/components/Select/MultiSelect/OptionList.tsx +3 -3
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +22 -20
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +609 -589
- package/src/components/Select/MultiSelect/__tests__/index.spec.tsx +1 -1
- package/src/components/Select/MultiSelect/index.tsx +20 -16
- package/src/components/Select/SingleSelect/Option.tsx +2 -1
- package/src/components/Select/SingleSelect/OptionList.tsx +3 -3
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +22 -20
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +606 -586
- package/src/components/Select/SingleSelect/__tests__/index.spec.tsx +1 -1
- package/src/components/Select/SingleSelect/index.tsx +20 -16
- package/src/components/Select/StyledOptionList.tsx +11 -9
- package/src/components/Select/helpers.tsx +1 -1
- package/src/components/Select/index.tsx +6 -4
- package/src/components/Select/types.ts +3 -3
- package/src/components/Spinner/AnimatedSpinner.tsx +7 -7
- package/src/components/Spinner/StyledSpinner.tsx +26 -20
- package/src/components/Spinner/__tests__/AnimatedSpinner.spec.tsx +1 -1
- package/src/components/Spinner/__tests__/StyledSpinner.spec.tsx +32 -16
- package/src/components/Spinner/__tests__/__snapshots__/AnimatedSpinner.spec.tsx.snap +14 -12
- package/src/components/Spinner/__tests__/__snapshots__/StyledSpinner.spec.tsx.snap +273 -31
- package/src/components/Spinner/__tests__/__snapshots__/index.spec.tsx.snap +14 -12
- package/src/components/Spinner/index.tsx +13 -5
- package/src/components/Switch/StyledSwitch.tsx +10 -26
- package/src/components/Switch/__tests__/StyledSwitch.spec.tsx +25 -0
- package/src/components/Switch/__tests__/__snapshots__/{StyledHeading.spec.tsx.snap → StyledSwitch.spec.tsx.snap} +45 -18
- package/src/components/Switch/__tests__/__snapshots__/index.spec.tsx.snap +26 -52
- package/src/components/Switch/index.tsx +23 -20
- package/src/components/Tabs/ScrollableTabs.tsx +10 -5
- package/src/components/Tabs/StyledScrollableTabs.tsx +6 -5
- package/src/components/Tabs/StyledTabs.tsx +6 -0
- package/src/components/Tabs/TabWithBadge.tsx +68 -0
- package/src/components/Tabs/__tests__/ScrollableTabs.spec.tsx +17 -2
- package/src/components/Tabs/__tests__/TabWithBadge.spec.tsx +48 -0
- package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabs.spec.tsx.snap +205 -43
- package/src/components/Tabs/__tests__/__snapshots__/TabWithBadge.spec.tsx.snap +165 -0
- package/src/components/Tabs/__tests__/__snapshots__/index.spec.tsx.snap +135 -34
- package/src/components/Tabs/__tests__/index.spec.tsx +16 -2
- package/src/components/Tabs/index.tsx +17 -16
- package/src/components/Tag/StyledTag.tsx +1 -11
- package/src/components/Tag/__tests__/__snapshots__/Tag.spec.tsx.snap +4 -4
- package/src/components/Tag/index.tsx +3 -3
- package/src/components/TextInput/__tests__/index.spec.tsx +10 -14
- package/src/components/TextInput/index.tsx +5 -5
- package/src/components/TimePicker/StyledTimePicker.tsx +2 -1
- package/src/components/TimePicker/TimePickerAndroid.tsx +1 -1
- package/src/components/TimePicker/TimePickerIOS.tsx +1 -1
- package/src/components/TimePicker/__tests__/TimePickerIOS.spec.tsx +1 -2
- package/src/components/TimePicker/index.tsx +1 -1
- package/src/components/TimePicker/types.ts +1 -1
- package/src/components/Toast/StyledToast.tsx +16 -15
- package/src/components/Toast/Toast.tsx +36 -10
- package/src/components/Toast/ToastContainer.tsx +2 -2
- package/src/components/Toast/ToastContext.ts +1 -1
- package/src/components/Toast/ToastProvider.tsx +20 -19
- package/src/components/Toast/__tests__/Toast.spec.tsx +17 -0
- package/src/components/Toast/__tests__/ToastContainer.spec.tsx +1 -1
- package/src/components/Toast/__tests__/__snapshots__/Toast.spec.tsx.snap +299 -19
- package/src/components/Toast/types.ts +18 -4
- package/src/components/Toolbar/StyledToolbar.tsx +2 -1
- package/src/components/Toolbar/ToolbarGroup.tsx +2 -1
- package/src/components/Toolbar/ToolbarItem.tsx +2 -1
- package/src/components/Toolbar/index.tsx +2 -1
- package/src/components/Typography/Text/StyledText.tsx +7 -1
- package/src/components/Typography/Text/__tests__/StyledText.spec.tsx +1 -0
- package/src/components/Typography/Text/__tests__/__snapshots__/StyledText.spec.tsx.snap +22 -0
- package/src/components/Typography/Text/index.tsx +10 -3
- package/src/index.ts +2 -0
- package/src/testHelpers/renderWithTheme.tsx +2 -1
- package/src/theme/ThemeProvider.ts +1 -1
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +100 -49
- package/src/theme/components/.eslintrc.json +10 -0
- package/src/theme/components/accordion.ts +1 -1
- package/src/theme/components/alert.ts +6 -2
- package/src/theme/components/avatar.ts +3 -1
- package/src/theme/components/badge.ts +1 -1
- package/src/theme/components/bottomNavigation.ts +1 -1
- package/src/theme/components/bottomSheet.ts +1 -1
- package/src/theme/components/button.ts +1 -1
- package/src/theme/components/calendar.ts +1 -1
- package/src/theme/components/card.ts +7 -8
- package/src/theme/components/checkbox.ts +12 -8
- package/src/theme/components/contentNavigator.ts +1 -1
- package/src/theme/components/divider.ts +1 -1
- package/src/theme/components/drawer.ts +1 -1
- package/src/theme/components/empty.ts +1 -1
- package/src/theme/components/fab.ts +1 -1
- package/src/theme/components/icon.ts +1 -1
- package/src/theme/components/list.ts +5 -4
- package/src/theme/components/pinInput.ts +1 -1
- package/src/theme/components/progress.ts +1 -1
- package/src/theme/components/radio.ts +3 -11
- package/src/theme/components/richTextEditor.ts +1 -1
- package/src/theme/components/sectionHeading.ts +2 -2
- package/src/theme/components/select.ts +1 -1
- package/src/theme/components/spinner.ts +20 -8
- package/src/theme/components/switch.ts +7 -8
- package/src/theme/components/tabs.ts +4 -3
- package/src/theme/components/tag.ts +14 -14
- package/src/theme/components/textInput.ts +1 -1
- package/src/theme/components/toast.ts +18 -4
- package/src/theme/components/toolbar.ts +1 -1
- package/src/theme/components/typography.ts +3 -1
- package/src/theme/getTheme.ts +4 -11
- package/src/theme/global/borders.ts +2 -1
- package/src/theme/global/colors/swag.ts +25 -3
- package/src/theme/global/colors/types.ts +23 -0
- package/src/theme/global/colors/work.ts +6 -2
- package/src/theme/global/index.ts +6 -11
- package/src/theme/global/scale.ts +2 -1
- package/src/theme/global/space.ts +2 -1
- package/src/theme/global/typography.ts +2 -8
- package/src/theme/index.ts +5 -2
- package/src/types.ts +9 -10
- package/testUtils/setup.tsx +2 -0
- package/tsconfig.json +5 -21
- package/types/components/Accordion/AccordionItem.d.ts +3 -3
- package/types/components/Accordion/StyledAccordion.d.ts +14 -14
- package/types/components/Accordion/index.d.ts +3 -2
- package/types/components/Alert/StyledAlert.d.ts +18 -17
- package/types/components/Alert/index.d.ts +4 -4
- package/types/components/Avatar/StyledAvatar.d.ts +16 -16
- package/types/components/Avatar/index.d.ts +3 -3
- package/types/components/Badge/Status.d.ts +2 -2
- package/types/components/Badge/StyledBadge.d.ts +7 -7
- package/types/components/Badge/index.d.ts +2 -1
- package/types/components/BottomNavigation/StyledBottomNavigation.d.ts +21 -21
- package/types/components/BottomNavigation/index.d.ts +3 -3
- package/types/components/BottomSheet/Footer.d.ts +1 -1
- package/types/components/BottomSheet/Header.d.ts +2 -2
- package/types/components/BottomSheet/StyledBottomSheet.d.ts +21 -20
- package/types/components/BottomSheet/index.d.ts +2 -2
- package/types/components/Box/StyledBox.d.ts +15 -0
- package/types/components/{Radio/__tests__/StyledRadio.spec.d.ts → Box/__tests__/helpers.spec.d.ts} +0 -0
- package/types/components/{Switch/__tests__/StyledHeading.spec.d.ts → Box/__tests__/index.spec.d.ts} +0 -0
- package/types/components/Box/config.d.ts +170 -0
- package/types/components/Box/helpers.d.ts +1 -0
- package/types/components/Box/index.d.ts +5 -0
- package/types/components/Box/types.d.ts +31 -0
- package/types/components/Button/Button.d.ts +4 -4
- package/types/components/Button/IconButton.d.ts +2 -2
- package/types/components/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +10 -9
- package/types/components/Button/LoadingIndicator/index.d.ts +1 -1
- package/types/components/Button/StyledButton.d.ts +19 -18
- package/types/components/Button/UtilityButton/StyledUtilityButton.d.ts +8 -8
- package/types/components/Button/UtilityButton/index.d.ts +3 -3
- package/types/components/Button/index.d.ts +2 -2
- package/types/components/Calendar/StyledCalendar.d.ts +27 -26
- package/types/components/Calendar/helpers.d.ts +2 -2
- package/types/components/Card/DataCard/StyledDataCard.d.ts +7 -7
- package/types/components/Card/DataCard/index.d.ts +3 -3
- package/types/components/Card/StyledCard.d.ts +7 -6
- package/types/components/Card/index.d.ts +7 -3
- package/types/components/Checkbox/StyledCheckbox.d.ts +24 -6
- package/types/components/Checkbox/index.d.ts +11 -3
- package/types/components/Collapse/StyledCollapse.d.ts +8 -8
- package/types/components/Collapse/index.d.ts +2 -2
- package/types/components/ContentNavigator/StyledContentNavigator.d.ts +5 -5
- package/types/components/ContentNavigator/index.d.ts +1 -1
- package/types/components/DatePicker/DatePickerAndroid.d.ts +1 -1
- package/types/components/DatePicker/DatePickerIOS.d.ts +1 -1
- package/types/components/DatePicker/StyledDatePicker.d.ts +5 -4
- package/types/components/DatePicker/index.d.ts +1 -1
- package/types/components/DatePicker/types.d.ts +1 -1
- package/types/components/Divider/StyledDivider.d.ts +5 -5
- package/types/components/Divider/index.d.ts +1 -1
- package/types/components/Drawer/DragableDrawer/index.d.ts +1 -1
- package/types/components/Drawer/StyledDrawer.d.ts +21 -20
- package/types/components/Drawer/index.d.ts +1 -1
- package/types/components/Empty/StyledEmpty.d.ts +12 -12
- package/types/components/Empty/index.d.ts +1 -1
- package/types/components/FAB/ActionGroup/ActionItem.d.ts +2 -2
- package/types/components/FAB/ActionGroup/StyledActionGroup.d.ts +14 -13
- package/types/components/FAB/ActionGroup/StyledActionItem.d.ts +10 -9
- package/types/components/FAB/ActionGroup/index.d.ts +3 -3
- package/types/components/FAB/AnimatedFABIcon.d.ts +1 -1
- package/types/components/FAB/FAB.d.ts +2 -2
- package/types/components/FAB/StyledFAB.d.ts +11 -10
- package/types/components/Icon/AnimatedIcon.d.ts +1 -1
- package/types/components/Icon/HeroIcon/index.d.ts +3 -3
- package/types/components/Icon/index.d.ts +1 -1
- package/types/components/List/BasicListItem.d.ts +2 -2
- package/types/components/List/ListItem.d.ts +4 -3
- package/types/components/List/StyledBasicListItem.d.ts +14 -14
- package/types/components/List/StyledListItem.d.ts +23 -23
- package/types/components/PinInput/PinCell.d.ts +1 -1
- package/types/components/PinInput/StyledPinInput.d.ts +30 -30
- package/types/components/PinInput/index.d.ts +2 -2
- 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 +8 -7
- package/types/components/Progress/StyledProgressCircle.d.ts +21 -20
- package/types/components/Radio/Radio.d.ts +2 -2
- package/types/components/Radio/RadioGroup.d.ts +3 -3
- package/types/components/Radio/StyledRadio.d.ts +11 -21
- package/types/components/RichTextEditor/EditorToolbar.d.ts +1 -1
- package/types/components/RichTextEditor/MentionList.d.ts +1 -1
- package/types/components/RichTextEditor/RichTextEditor.d.ts +3 -2
- 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 +5 -4
- package/types/components/SectionHeading/StyledHeading.d.ts +9 -9
- package/types/components/SectionHeading/index.d.ts +3 -3
- package/types/components/Select/MultiSelect/Option.d.ts +2 -2
- package/types/components/Select/MultiSelect/OptionList.d.ts +2 -2
- package/types/components/Select/MultiSelect/index.d.ts +1 -1
- package/types/components/Select/SingleSelect/Option.d.ts +2 -2
- package/types/components/Select/SingleSelect/OptionList.d.ts +2 -2
- package/types/components/Select/SingleSelect/index.d.ts +1 -1
- package/types/components/Select/StyledOptionList.d.ts +4 -4
- package/types/components/Select/StyledSelect.d.ts +11 -11
- package/types/components/Select/helpers.d.ts +2 -2
- package/types/components/Select/index.d.ts +4 -3
- package/types/components/Select/types.d.ts +3 -3
- package/types/components/Spinner/AnimatedSpinner.d.ts +3 -1
- package/types/components/Spinner/StyledSpinner.d.ts +16 -13
- package/types/components/Spinner/index.d.ts +7 -3
- package/types/components/Switch/StyledSwitch.d.ts +8 -23
- package/types/components/Switch/__tests__/StyledSwitch.spec.d.ts +1 -0
- package/types/components/Switch/index.d.ts +3 -2
- package/types/components/Tabs/ScrollableTabs.d.ts +1 -1
- package/types/components/Tabs/StyledScrollableTabs.d.ts +24 -22
- package/types/components/Tabs/StyledTabs.d.ts +26 -20
- package/types/components/Tabs/TabWithBadge.d.ts +17 -0
- package/types/components/Tabs/__tests__/TabWithBadge.spec.d.ts +1 -0
- package/types/components/Tabs/index.d.ts +4 -2
- package/types/components/Tag/StyledTag.d.ts +6 -6
- package/types/components/Tag/index.d.ts +2 -2
- package/types/components/TextInput/StyledTextInput.d.ts +44 -44
- package/types/components/TextInput/index.d.ts +8 -8
- package/types/components/TimePicker/StyledTimePicker.d.ts +5 -4
- package/types/components/TimePicker/TimePickerAndroid.d.ts +1 -1
- package/types/components/TimePicker/TimePickerIOS.d.ts +1 -1
- package/types/components/TimePicker/index.d.ts +1 -1
- package/types/components/TimePicker/types.d.ts +1 -1
- package/types/components/Toast/StyledToast.d.ts +21 -19
- package/types/components/Toast/Toast.d.ts +1 -1
- package/types/components/Toast/ToastContainer.d.ts +2 -2
- package/types/components/Toast/ToastContext.d.ts +1 -1
- package/types/components/Toast/ToastProvider.d.ts +2 -2
- package/types/components/Toast/types.d.ts +5 -4
- package/types/components/Toolbar/StyledToolbar.d.ts +11 -10
- package/types/components/Toolbar/ToolbarGroup.d.ts +1 -1
- package/types/components/Toolbar/ToolbarItem.d.ts +1 -1
- package/types/components/Toolbar/index.d.ts +1 -1
- package/types/components/Typography/Text/StyledText.d.ts +4 -4
- package/types/components/Typography/Text/index.d.ts +3 -3
- package/types/index.d.ts +2 -1
- package/types/testHelpers/renderWithTheme.d.ts +2 -2
- package/types/theme/ThemeProvider.d.ts +1 -1
- package/types/theme/ThemeSwitcher.d.ts +1 -1
- package/types/theme/components/accordion.d.ts +1 -1
- package/types/theme/components/alert.d.ts +6 -2
- package/types/theme/components/avatar.d.ts +3 -1
- package/types/theme/components/badge.d.ts +1 -1
- package/types/theme/components/bottomNavigation.d.ts +1 -1
- package/types/theme/components/bottomSheet.d.ts +1 -1
- package/types/theme/components/button.d.ts +1 -1
- package/types/theme/components/calendar.d.ts +1 -1
- package/types/theme/components/card.d.ts +7 -8
- package/types/theme/components/checkbox.d.ts +10 -7
- package/types/theme/components/contentNavigator.d.ts +1 -1
- package/types/theme/components/divider.d.ts +1 -1
- package/types/theme/components/drawer.d.ts +1 -1
- package/types/theme/components/empty.d.ts +1 -1
- package/types/theme/components/fab.d.ts +1 -1
- package/types/theme/components/icon.d.ts +1 -1
- package/types/theme/components/list.d.ts +8 -7
- package/types/theme/components/pinInput.d.ts +1 -1
- package/types/theme/components/progress.d.ts +1 -1
- package/types/theme/components/radio.d.ts +1 -8
- package/types/theme/components/richTextEditor.d.ts +1 -1
- package/types/theme/components/sectionHeading.d.ts +1 -1
- package/types/theme/components/select.d.ts +1 -1
- package/types/theme/components/spinner.d.ts +18 -6
- package/types/theme/components/switch.d.ts +7 -6
- package/types/theme/components/tabs.d.ts +2 -1
- package/types/theme/components/tag.d.ts +3 -3
- package/types/theme/components/textInput.d.ts +1 -1
- package/types/theme/components/toast.d.ts +19 -3
- package/types/theme/components/toolbar.d.ts +1 -1
- package/types/theme/components/typography.d.ts +3 -1
- package/types/theme/getTheme.d.ts +2 -2
- package/types/theme/global/borders.d.ts +2 -1
- package/types/theme/global/colors/swag.d.ts +1 -1
- package/types/theme/global/colors/types.d.ts +17 -0
- package/types/theme/global/colors/work.d.ts +1 -1
- package/types/theme/global/index.d.ts +22 -3
- package/types/theme/global/scale.d.ts +2 -1
- package/types/theme/global/space.d.ts +2 -1
- package/types/theme/global/typography.d.ts +2 -1
- package/types/theme/index.d.ts +4 -2
- package/types/types.d.ts +9 -8
- package/types/utils/hooks.d.ts +1 -1
- package/src/components/Radio/__tests__/StyledRadio.spec.tsx +0 -43
- package/src/components/Radio/__tests__/__snapshots__/StyledRadio.spec.tsx.snap +0 -124
- package/src/components/Switch/__tests__/StyledHeading.spec.tsx +0 -42
|
@@ -2,10 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`rendering renders correctly when checked 1`] = `
|
|
4
4
|
<View
|
|
5
|
+
accessibilityState={
|
|
6
|
+
Object {
|
|
7
|
+
"disabled": false,
|
|
8
|
+
}
|
|
9
|
+
}
|
|
5
10
|
accessible={true}
|
|
6
|
-
collapsable={false}
|
|
7
11
|
focusable={true}
|
|
8
|
-
nativeID="animatedComponent"
|
|
9
12
|
onClick={[Function]}
|
|
10
13
|
onResponderGrant={[Function]}
|
|
11
14
|
onResponderMove={[Function]}
|
|
@@ -14,22 +17,26 @@ exports[`rendering renders correctly when checked 1`] = `
|
|
|
14
17
|
onResponderTerminationRequest={[Function]}
|
|
15
18
|
onStartShouldSetResponder={[Function]}
|
|
16
19
|
style={
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
Array [
|
|
21
|
+
Object {
|
|
22
|
+
"alignItems": "center",
|
|
23
|
+
"backgroundColor": "#f3e6f6",
|
|
24
|
+
"flexDirection": "row",
|
|
25
|
+
"opacity": 1,
|
|
26
|
+
"padding": 16,
|
|
27
|
+
},
|
|
28
|
+
undefined,
|
|
29
|
+
]
|
|
26
30
|
}
|
|
27
31
|
>
|
|
28
32
|
<View
|
|
29
33
|
style={
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
34
|
+
Array [
|
|
35
|
+
Object {
|
|
36
|
+
"flex": 1,
|
|
37
|
+
},
|
|
38
|
+
undefined,
|
|
39
|
+
]
|
|
33
40
|
}
|
|
34
41
|
>
|
|
35
42
|
<Text
|
|
@@ -56,43 +63,56 @@ exports[`rendering renders correctly when checked 1`] = `
|
|
|
56
63
|
style={
|
|
57
64
|
Array [
|
|
58
65
|
Object {
|
|
59
|
-
"
|
|
60
|
-
"borderColor": "#8505a2",
|
|
61
|
-
"borderRadius": 999,
|
|
62
|
-
"borderWidth": 2,
|
|
63
|
-
"height": 20,
|
|
64
|
-
"justifyContent": "center",
|
|
65
|
-
"width": 20,
|
|
66
|
+
"marginLeft": 8,
|
|
66
67
|
},
|
|
67
68
|
undefined,
|
|
68
69
|
]
|
|
69
70
|
}
|
|
70
|
-
themeChecked={true}
|
|
71
71
|
>
|
|
72
72
|
<View
|
|
73
73
|
style={
|
|
74
74
|
Array [
|
|
75
75
|
Object {
|
|
76
|
-
"
|
|
76
|
+
"alignItems": "center",
|
|
77
|
+
"borderColor": "#001f23",
|
|
77
78
|
"borderRadius": 999,
|
|
78
|
-
"
|
|
79
|
-
"
|
|
79
|
+
"borderWidth": 2,
|
|
80
|
+
"height": 20,
|
|
81
|
+
"justifyContent": "center",
|
|
82
|
+
"width": 20,
|
|
80
83
|
},
|
|
81
84
|
undefined,
|
|
82
85
|
]
|
|
83
86
|
}
|
|
84
|
-
|
|
85
|
-
|
|
87
|
+
>
|
|
88
|
+
<View
|
|
89
|
+
style={
|
|
90
|
+
Array [
|
|
91
|
+
Object {
|
|
92
|
+
"backgroundColor": "#001f23",
|
|
93
|
+
"borderRadius": 999,
|
|
94
|
+
"height": 10,
|
|
95
|
+
"width": 10,
|
|
96
|
+
},
|
|
97
|
+
undefined,
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
testID="Option A-selected-circle"
|
|
101
|
+
/>
|
|
102
|
+
</View>
|
|
86
103
|
</View>
|
|
87
104
|
</View>
|
|
88
105
|
`;
|
|
89
106
|
|
|
90
107
|
exports[`rendering renders correctly when not checked 1`] = `
|
|
91
108
|
<View
|
|
109
|
+
accessibilityState={
|
|
110
|
+
Object {
|
|
111
|
+
"disabled": false,
|
|
112
|
+
}
|
|
113
|
+
}
|
|
92
114
|
accessible={true}
|
|
93
|
-
collapsable={false}
|
|
94
115
|
focusable={true}
|
|
95
|
-
nativeID="animatedComponent"
|
|
96
116
|
onClick={[Function]}
|
|
97
117
|
onResponderGrant={[Function]}
|
|
98
118
|
onResponderMove={[Function]}
|
|
@@ -101,22 +121,26 @@ exports[`rendering renders correctly when not checked 1`] = `
|
|
|
101
121
|
onResponderTerminationRequest={[Function]}
|
|
102
122
|
onStartShouldSetResponder={[Function]}
|
|
103
123
|
style={
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
124
|
+
Array [
|
|
125
|
+
Object {
|
|
126
|
+
"alignItems": "center",
|
|
127
|
+
"backgroundColor": "#ffffff",
|
|
128
|
+
"flexDirection": "row",
|
|
129
|
+
"opacity": 1,
|
|
130
|
+
"padding": 16,
|
|
131
|
+
},
|
|
132
|
+
undefined,
|
|
133
|
+
]
|
|
113
134
|
}
|
|
114
135
|
>
|
|
115
136
|
<View
|
|
116
137
|
style={
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
138
|
+
Array [
|
|
139
|
+
Object {
|
|
140
|
+
"flex": 1,
|
|
141
|
+
},
|
|
142
|
+
undefined,
|
|
143
|
+
]
|
|
120
144
|
}
|
|
121
145
|
>
|
|
122
146
|
<Text
|
|
@@ -143,18 +167,28 @@ exports[`rendering renders correctly when not checked 1`] = `
|
|
|
143
167
|
style={
|
|
144
168
|
Array [
|
|
145
169
|
Object {
|
|
146
|
-
"
|
|
147
|
-
"borderColor": "#000000",
|
|
148
|
-
"borderRadius": 999,
|
|
149
|
-
"borderWidth": 2,
|
|
150
|
-
"height": 20,
|
|
151
|
-
"justifyContent": "center",
|
|
152
|
-
"width": 20,
|
|
170
|
+
"marginLeft": 8,
|
|
153
171
|
},
|
|
154
172
|
undefined,
|
|
155
173
|
]
|
|
156
174
|
}
|
|
157
|
-
|
|
158
|
-
|
|
175
|
+
>
|
|
176
|
+
<View
|
|
177
|
+
style={
|
|
178
|
+
Array [
|
|
179
|
+
Object {
|
|
180
|
+
"alignItems": "center",
|
|
181
|
+
"borderColor": "#001f23",
|
|
182
|
+
"borderRadius": 999,
|
|
183
|
+
"borderWidth": 2,
|
|
184
|
+
"height": 20,
|
|
185
|
+
"justifyContent": "center",
|
|
186
|
+
"width": 20,
|
|
187
|
+
},
|
|
188
|
+
undefined,
|
|
189
|
+
]
|
|
190
|
+
}
|
|
191
|
+
/>
|
|
192
|
+
</View>
|
|
159
193
|
</View>
|
|
160
194
|
`;
|
|
@@ -3,10 +3,13 @@
|
|
|
3
3
|
exports[`rendering renders correctly 1`] = `
|
|
4
4
|
<View>
|
|
5
5
|
<View
|
|
6
|
+
accessibilityState={
|
|
7
|
+
Object {
|
|
8
|
+
"disabled": false,
|
|
9
|
+
}
|
|
10
|
+
}
|
|
6
11
|
accessible={true}
|
|
7
|
-
collapsable={false}
|
|
8
12
|
focusable={true}
|
|
9
|
-
nativeID="animatedComponent"
|
|
10
13
|
onClick={[Function]}
|
|
11
14
|
onResponderGrant={[Function]}
|
|
12
15
|
onResponderMove={[Function]}
|
|
@@ -15,22 +18,26 @@ exports[`rendering renders correctly 1`] = `
|
|
|
15
18
|
onResponderTerminationRequest={[Function]}
|
|
16
19
|
onStartShouldSetResponder={[Function]}
|
|
17
20
|
style={
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
Array [
|
|
22
|
+
Object {
|
|
23
|
+
"alignItems": "center",
|
|
24
|
+
"backgroundColor": "#ffffff",
|
|
25
|
+
"flexDirection": "row",
|
|
26
|
+
"opacity": 1,
|
|
27
|
+
"padding": 16,
|
|
28
|
+
},
|
|
29
|
+
undefined,
|
|
30
|
+
]
|
|
27
31
|
}
|
|
28
32
|
>
|
|
29
33
|
<View
|
|
30
34
|
style={
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
35
|
+
Array [
|
|
36
|
+
Object {
|
|
37
|
+
"flex": 1,
|
|
38
|
+
},
|
|
39
|
+
undefined,
|
|
40
|
+
]
|
|
34
41
|
}
|
|
35
42
|
>
|
|
36
43
|
<Text
|
|
@@ -57,19 +64,29 @@ exports[`rendering renders correctly 1`] = `
|
|
|
57
64
|
style={
|
|
58
65
|
Array [
|
|
59
66
|
Object {
|
|
60
|
-
"
|
|
61
|
-
"borderColor": "#000000",
|
|
62
|
-
"borderRadius": 999,
|
|
63
|
-
"borderWidth": 2,
|
|
64
|
-
"height": 20,
|
|
65
|
-
"justifyContent": "center",
|
|
66
|
-
"width": 20,
|
|
67
|
+
"marginLeft": 8,
|
|
67
68
|
},
|
|
68
69
|
undefined,
|
|
69
70
|
]
|
|
70
71
|
}
|
|
71
|
-
|
|
72
|
-
|
|
72
|
+
>
|
|
73
|
+
<View
|
|
74
|
+
style={
|
|
75
|
+
Array [
|
|
76
|
+
Object {
|
|
77
|
+
"alignItems": "center",
|
|
78
|
+
"borderColor": "#001f23",
|
|
79
|
+
"borderRadius": 999,
|
|
80
|
+
"borderWidth": 2,
|
|
81
|
+
"height": 20,
|
|
82
|
+
"justifyContent": "center",
|
|
83
|
+
"width": 20,
|
|
84
|
+
},
|
|
85
|
+
undefined,
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
/>
|
|
89
|
+
</View>
|
|
73
90
|
</View>
|
|
74
91
|
<View
|
|
75
92
|
style={
|
|
@@ -82,10 +99,13 @@ exports[`rendering renders correctly 1`] = `
|
|
|
82
99
|
}
|
|
83
100
|
/>
|
|
84
101
|
<View
|
|
102
|
+
accessibilityState={
|
|
103
|
+
Object {
|
|
104
|
+
"disabled": false,
|
|
105
|
+
}
|
|
106
|
+
}
|
|
85
107
|
accessible={true}
|
|
86
|
-
collapsable={false}
|
|
87
108
|
focusable={true}
|
|
88
|
-
nativeID="animatedComponent"
|
|
89
109
|
onClick={[Function]}
|
|
90
110
|
onResponderGrant={[Function]}
|
|
91
111
|
onResponderMove={[Function]}
|
|
@@ -94,22 +114,26 @@ exports[`rendering renders correctly 1`] = `
|
|
|
94
114
|
onResponderTerminationRequest={[Function]}
|
|
95
115
|
onStartShouldSetResponder={[Function]}
|
|
96
116
|
style={
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
117
|
+
Array [
|
|
118
|
+
Object {
|
|
119
|
+
"alignItems": "center",
|
|
120
|
+
"backgroundColor": "#ffffff",
|
|
121
|
+
"flexDirection": "row",
|
|
122
|
+
"opacity": 1,
|
|
123
|
+
"padding": 16,
|
|
124
|
+
},
|
|
125
|
+
undefined,
|
|
126
|
+
]
|
|
106
127
|
}
|
|
107
128
|
>
|
|
108
129
|
<View
|
|
109
130
|
style={
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
131
|
+
Array [
|
|
132
|
+
Object {
|
|
133
|
+
"flex": 1,
|
|
134
|
+
},
|
|
135
|
+
undefined,
|
|
136
|
+
]
|
|
113
137
|
}
|
|
114
138
|
>
|
|
115
139
|
<Text
|
|
@@ -136,19 +160,29 @@ exports[`rendering renders correctly 1`] = `
|
|
|
136
160
|
style={
|
|
137
161
|
Array [
|
|
138
162
|
Object {
|
|
139
|
-
"
|
|
140
|
-
"borderColor": "#000000",
|
|
141
|
-
"borderRadius": 999,
|
|
142
|
-
"borderWidth": 2,
|
|
143
|
-
"height": 20,
|
|
144
|
-
"justifyContent": "center",
|
|
145
|
-
"width": 20,
|
|
163
|
+
"marginLeft": 8,
|
|
146
164
|
},
|
|
147
165
|
undefined,
|
|
148
166
|
]
|
|
149
167
|
}
|
|
150
|
-
|
|
151
|
-
|
|
168
|
+
>
|
|
169
|
+
<View
|
|
170
|
+
style={
|
|
171
|
+
Array [
|
|
172
|
+
Object {
|
|
173
|
+
"alignItems": "center",
|
|
174
|
+
"borderColor": "#001f23",
|
|
175
|
+
"borderRadius": 999,
|
|
176
|
+
"borderWidth": 2,
|
|
177
|
+
"height": 20,
|
|
178
|
+
"justifyContent": "center",
|
|
179
|
+
"width": 20,
|
|
180
|
+
},
|
|
181
|
+
undefined,
|
|
182
|
+
]
|
|
183
|
+
}
|
|
184
|
+
/>
|
|
185
|
+
</View>
|
|
152
186
|
</View>
|
|
153
187
|
<View
|
|
154
188
|
style={
|
|
@@ -161,10 +195,13 @@ exports[`rendering renders correctly 1`] = `
|
|
|
161
195
|
}
|
|
162
196
|
/>
|
|
163
197
|
<View
|
|
198
|
+
accessibilityState={
|
|
199
|
+
Object {
|
|
200
|
+
"disabled": false,
|
|
201
|
+
}
|
|
202
|
+
}
|
|
164
203
|
accessible={true}
|
|
165
|
-
collapsable={false}
|
|
166
204
|
focusable={true}
|
|
167
|
-
nativeID="animatedComponent"
|
|
168
205
|
onClick={[Function]}
|
|
169
206
|
onResponderGrant={[Function]}
|
|
170
207
|
onResponderMove={[Function]}
|
|
@@ -173,22 +210,26 @@ exports[`rendering renders correctly 1`] = `
|
|
|
173
210
|
onResponderTerminationRequest={[Function]}
|
|
174
211
|
onStartShouldSetResponder={[Function]}
|
|
175
212
|
style={
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
213
|
+
Array [
|
|
214
|
+
Object {
|
|
215
|
+
"alignItems": "center",
|
|
216
|
+
"backgroundColor": "#f3e6f6",
|
|
217
|
+
"flexDirection": "row",
|
|
218
|
+
"opacity": 1,
|
|
219
|
+
"padding": 16,
|
|
220
|
+
},
|
|
221
|
+
undefined,
|
|
222
|
+
]
|
|
185
223
|
}
|
|
186
224
|
>
|
|
187
225
|
<View
|
|
188
226
|
style={
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
227
|
+
Array [
|
|
228
|
+
Object {
|
|
229
|
+
"flex": 1,
|
|
230
|
+
},
|
|
231
|
+
undefined,
|
|
232
|
+
]
|
|
192
233
|
}
|
|
193
234
|
>
|
|
194
235
|
<Text
|
|
@@ -215,33 +256,43 @@ exports[`rendering renders correctly 1`] = `
|
|
|
215
256
|
style={
|
|
216
257
|
Array [
|
|
217
258
|
Object {
|
|
218
|
-
"
|
|
219
|
-
"borderColor": "#8505a2",
|
|
220
|
-
"borderRadius": 999,
|
|
221
|
-
"borderWidth": 2,
|
|
222
|
-
"height": 20,
|
|
223
|
-
"justifyContent": "center",
|
|
224
|
-
"width": 20,
|
|
259
|
+
"marginLeft": 8,
|
|
225
260
|
},
|
|
226
261
|
undefined,
|
|
227
262
|
]
|
|
228
263
|
}
|
|
229
|
-
themeChecked={true}
|
|
230
264
|
>
|
|
231
265
|
<View
|
|
232
266
|
style={
|
|
233
267
|
Array [
|
|
234
268
|
Object {
|
|
235
|
-
"
|
|
269
|
+
"alignItems": "center",
|
|
270
|
+
"borderColor": "#001f23",
|
|
236
271
|
"borderRadius": 999,
|
|
237
|
-
"
|
|
238
|
-
"
|
|
272
|
+
"borderWidth": 2,
|
|
273
|
+
"height": 20,
|
|
274
|
+
"justifyContent": "center",
|
|
275
|
+
"width": 20,
|
|
239
276
|
},
|
|
240
277
|
undefined,
|
|
241
278
|
]
|
|
242
279
|
}
|
|
243
|
-
|
|
244
|
-
|
|
280
|
+
>
|
|
281
|
+
<View
|
|
282
|
+
style={
|
|
283
|
+
Array [
|
|
284
|
+
Object {
|
|
285
|
+
"backgroundColor": "#001f23",
|
|
286
|
+
"borderRadius": 999,
|
|
287
|
+
"height": 10,
|
|
288
|
+
"width": 10,
|
|
289
|
+
},
|
|
290
|
+
undefined,
|
|
291
|
+
]
|
|
292
|
+
}
|
|
293
|
+
testID="Nothing-selected-circle"
|
|
294
|
+
/>
|
|
295
|
+
</View>
|
|
245
296
|
</View>
|
|
246
297
|
</View>
|
|
247
298
|
</View>
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
useEffect,
|
|
5
|
-
useMemo,
|
|
6
|
-
useState,
|
|
7
|
-
} from 'react';
|
|
8
|
-
import Icon, { IconProps } from '../Icon';
|
|
1
|
+
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
2
|
+
import type { ComponentType } from 'react';
|
|
3
|
+
import Icon from '../Icon';
|
|
9
4
|
import { ToolbarButtonName, ToolbarEvents } from './constants';
|
|
10
5
|
import { emitter } from './EditorEvent';
|
|
11
6
|
import {
|
|
@@ -14,6 +9,7 @@ import {
|
|
|
14
9
|
StyledToolbarButton,
|
|
15
10
|
} from './StyledToolbar';
|
|
16
11
|
import * as Events from './utils/events';
|
|
12
|
+
import type { IconProps } from '../Icon';
|
|
17
13
|
|
|
18
14
|
type ToolbarButtonProps = {
|
|
19
15
|
icon: IconProps['icon'];
|
|
@@ -2,10 +2,7 @@ import { useTheme } from '@emotion/react';
|
|
|
2
2
|
import { isEmptyContent } from 'hero-editor';
|
|
3
3
|
import * as heroEditorApp from 'hero-editor/dist/app.js';
|
|
4
4
|
import React, {
|
|
5
|
-
ComponentType,
|
|
6
5
|
forwardRef,
|
|
7
|
-
ReactElement,
|
|
8
|
-
Ref,
|
|
9
6
|
useCallback,
|
|
10
7
|
useEffect,
|
|
11
8
|
useImperativeHandle,
|
|
@@ -14,13 +11,10 @@ import React, {
|
|
|
14
11
|
useState,
|
|
15
12
|
} from 'react';
|
|
16
13
|
|
|
17
|
-
import {
|
|
18
|
-
Keyboard,
|
|
19
|
-
StyleProp,
|
|
20
|
-
TouchableWithoutFeedback,
|
|
21
|
-
ViewStyle,
|
|
22
|
-
} from 'react-native';
|
|
14
|
+
import { Keyboard, TouchableWithoutFeedback } from 'react-native';
|
|
23
15
|
import { WebView } from 'react-native-webview';
|
|
16
|
+
import type { ComponentType, ReactElement, Ref } from 'react';
|
|
17
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
24
18
|
import { isAndroid } from '../../utils/helpers';
|
|
25
19
|
import Icon from '../Icon';
|
|
26
20
|
import {
|
|
@@ -44,11 +38,8 @@ import { ToolbarEvents } from './constants';
|
|
|
44
38
|
import { emitter } from './EditorEvent';
|
|
45
39
|
import { StyledWebView } from './StyledRichTextEditor';
|
|
46
40
|
import * as Events from './utils/events';
|
|
47
|
-
import {
|
|
48
|
-
|
|
49
|
-
requestBlurEditor,
|
|
50
|
-
WebViewEventMessage,
|
|
51
|
-
} from './utils/rnWebView';
|
|
41
|
+
import { postMessage, requestBlurEditor } from './utils/rnWebView';
|
|
42
|
+
import type { WebViewEventMessage } from './utils/rnWebView';
|
|
52
43
|
|
|
53
44
|
export interface RichTextEditorRef {
|
|
54
45
|
requestBlur: VoidFunction;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
fireEvent,
|
|
5
|
-
RenderAPI,
|
|
6
|
-
waitFor,
|
|
7
|
-
} from '@testing-library/react-native';
|
|
2
|
+
import { act, fireEvent, waitFor } from '@testing-library/react-native';
|
|
3
|
+
import type { RenderAPI } from '@testing-library/react-native';
|
|
8
4
|
import renderWithTheme from '../../../testHelpers/renderWithTheme';
|
|
9
5
|
import EditorToolbar from '../EditorToolbar';
|
|
10
6
|
import { emitter as editorEventEmmitor } from '../EditorEvent';
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import { FlatList, Text } from 'react-native';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
fireEvent,
|
|
7
|
-
render,
|
|
8
|
-
RenderAPI,
|
|
9
|
-
} from '@testing-library/react-native';
|
|
4
|
+
import { act, fireEvent, render } from '@testing-library/react-native';
|
|
5
|
+
import type { RenderAPI } from '@testing-library/react-native';
|
|
10
6
|
import MentionList from '../MentionList';
|
|
11
7
|
import { emitter as editorEventEmitter } from '../EditorEvent';
|
|
12
8
|
import * as Events from '../utils/events';
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
ComponentType,
|
|
3
|
-
forwardRef,
|
|
4
|
-
ReactElement,
|
|
5
|
-
useEffect,
|
|
6
|
-
} from 'react';
|
|
1
|
+
import React, { forwardRef, useEffect } from 'react';
|
|
7
2
|
|
|
8
|
-
import { act
|
|
3
|
+
import { act } from '@testing-library/react-native';
|
|
9
4
|
|
|
10
5
|
import { View } from 'react-native';
|
|
11
6
|
import { ThemeProvider } from '@emotion/react';
|
|
7
|
+
import type { ComponentType, ReactElement } from 'react';
|
|
8
|
+
import type { RenderAPI } from '@testing-library/react-native';
|
|
12
9
|
import * as Events from '../utils/events';
|
|
13
10
|
import { emitter as EditorEventEmitter } from '../EditorEvent';
|
|
14
11
|
import RichTextEditor from '../RichTextEditor';
|
|
@@ -129,8 +126,7 @@ describe('RichTextEditor', () => {
|
|
|
129
126
|
});
|
|
130
127
|
onMessageOfLatestRendering({
|
|
131
128
|
nativeEvent: {
|
|
132
|
-
data:
|
|
133
|
-
'{"type": "@hero-editor/webview/mention-search", "data" : {}}',
|
|
129
|
+
data: '{"type": "@hero-editor/webview/mention-search", "data" : {}}',
|
|
134
130
|
},
|
|
135
131
|
});
|
|
136
132
|
expect(emittedEvents).toMatchObject(['called']);
|
|
@@ -145,8 +141,7 @@ describe('RichTextEditor', () => {
|
|
|
145
141
|
it('should call onChange', () => {
|
|
146
142
|
onMessageOfLatestRendering({
|
|
147
143
|
nativeEvent: {
|
|
148
|
-
data:
|
|
149
|
-
'{"type": "@hero-editor/webview/editor-change", "data" : { "value": "text"}}',
|
|
144
|
+
data: '{"type": "@hero-editor/webview/editor-change", "data" : { "value": "text"}}',
|
|
150
145
|
},
|
|
151
146
|
});
|
|
152
147
|
expect(onChangeMock).lastCalledWith('text');
|
|
@@ -161,8 +156,7 @@ describe('RichTextEditor', () => {
|
|
|
161
156
|
it('should call onCursorChange', () => {
|
|
162
157
|
onMessageOfLatestRendering({
|
|
163
158
|
nativeEvent: {
|
|
164
|
-
data:
|
|
165
|
-
'{"type": "@hero-editor/webview/cursor-change", "data" : { "position": 32}}',
|
|
159
|
+
data: '{"type": "@hero-editor/webview/cursor-change", "data" : { "position": 32}}',
|
|
166
160
|
},
|
|
167
161
|
});
|
|
168
162
|
expect(onCursorChangeMock).lastCalledWith({ position: 32 });
|
|
@@ -174,8 +168,7 @@ describe('RichTextEditor', () => {
|
|
|
174
168
|
act(() => {
|
|
175
169
|
onMessageOfLatestRendering({
|
|
176
170
|
nativeEvent: {
|
|
177
|
-
data:
|
|
178
|
-
'{"type": "@hero-editor/webview/editor-layout", "data" : { "width": 320, "height": 480}}',
|
|
171
|
+
data: '{"type": "@hero-editor/webview/editor-layout", "data" : { "width": 320, "height": 480}}',
|
|
179
172
|
},
|
|
180
173
|
});
|
|
181
174
|
});
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { ToolbarButtonName } from './constants';
|
|
2
2
|
import Toolbar from './EditorToolbar';
|
|
3
3
|
import MentionList from './MentionList';
|
|
4
|
-
import RichTextEditor
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
import RichTextEditor from './RichTextEditor';
|
|
5
|
+
import type { RichTextEditorProps, RichTextEditorRef } from './RichTextEditor';
|
|
6
|
+
|
|
7
|
+
export type { RichTextEditorProps, RichTextEditorRef };
|
|
8
|
+
|
|
9
|
+
export { ToolbarButtonName };
|
|
8
10
|
|
|
9
11
|
export default Object.assign(RichTextEditor, {
|
|
10
12
|
MentionList,
|
|
11
13
|
Toolbar,
|
|
12
14
|
});
|
|
13
|
-
|
|
14
|
-
export { RichTextEditorProps, RichTextEditorRef, ToolbarButtonName };
|