@hero-design/rn 7.18.1 → 7.19.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/es/index.js +155 -143
- package/lib/index.js +155 -143
- package/package.json +2 -2
- 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 +3 -2
- package/src/components/Alert/index.tsx +5 -3
- package/src/components/Avatar/index.tsx +2 -2
- 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/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/Card/DataCard/index.tsx +3 -2
- package/src/components/Card/index.tsx +3 -2
- 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/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 +5 -3
- 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 +4 -7
- package/src/components/RichTextEditor/index.tsx +6 -6
- 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__/index.spec.tsx.snap +605 -585
- 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__/index.spec.tsx.snap +602 -582
- 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/StyledSpinner.tsx +2 -1
- package/src/components/Spinner/index.tsx +3 -3
- 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 +1 -1
- package/src/components/Tabs/__tests__/ScrollableTabs.spec.tsx +4 -2
- package/src/components/Tabs/__tests__/index.spec.tsx +4 -2
- package/src/components/Tabs/index.tsx +7 -13
- package/src/components/Tag/index.tsx +1 -1
- 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 +3 -8
- package/src/components/Toast/Toast.tsx +3 -2
- package/src/components/Toast/ToastContainer.tsx +2 -2
- package/src/components/Toast/ToastContext.ts +1 -1
- package/src/components/Toast/ToastProvider.tsx +5 -7
- package/src/components/Toast/__tests__/ToastContainer.spec.tsx +1 -1
- package/src/components/Toast/types.ts +3 -3
- 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/index.tsx +3 -2
- package/src/testHelpers/renderWithTheme.tsx +2 -1
- package/src/theme/ThemeProvider.ts +1 -1
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +24 -26
- package/src/theme/components/accordion.ts +1 -1
- package/src/theme/components/alert.ts +1 -1
- package/src/theme/components/avatar.ts +1 -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 +1 -1
- 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 +1 -1
- package/src/theme/components/select.ts +1 -1
- package/src/theme/components/spinner.ts +1 -1
- package/src/theme/components/switch.ts +7 -8
- package/src/theme/components/tabs.ts +1 -1
- package/src/theme/components/tag.ts +1 -1
- package/src/theme/components/textInput.ts +1 -1
- package/src/theme/components/toast.ts +1 -1
- package/src/theme/components/toolbar.ts +1 -1
- package/src/theme/components/typography.ts +1 -1
- package/src/theme/getTheme.ts +4 -11
- package/src/theme/global/borders.ts +2 -1
- package/src/theme/global/colors/swag.ts +2 -3
- package/src/theme/global/colors/work.ts +1 -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 +4 -9
- package/types/components/Accordion/AccordionItem.d.ts +3 -3
- package/types/components/Accordion/index.d.ts +3 -2
- package/types/components/Alert/StyledAlert.d.ts +2 -1
- package/types/components/Alert/index.d.ts +3 -3
- package/types/components/Avatar/index.d.ts +1 -1
- package/types/components/Badge/Status.d.ts +2 -2
- package/types/components/Badge/index.d.ts +2 -1
- 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 +1 -1
- package/types/components/BottomSheet/StyledBottomSheet.d.ts +2 -1
- package/types/components/BottomSheet/index.d.ts +2 -2
- 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 +3 -2
- package/types/components/Button/LoadingIndicator/index.d.ts +1 -1
- package/types/components/Button/StyledButton.d.ts +3 -2
- 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 +2 -1
- package/types/components/Card/DataCard/index.d.ts +2 -2
- package/types/components/Card/index.d.ts +2 -2
- package/types/components/Checkbox/StyledCheckbox.d.ts +21 -3
- package/types/components/Checkbox/index.d.ts +11 -3
- package/types/components/Collapse/index.d.ts +2 -2
- 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 +2 -1
- package/types/components/DatePicker/index.d.ts +1 -1
- package/types/components/DatePicker/types.d.ts +1 -1
- 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 +2 -1
- package/types/components/Drawer/index.d.ts +1 -1
- 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 +3 -2
- package/types/components/FAB/ActionGroup/StyledActionItem.d.ts +3 -2
- 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 +3 -2
- package/types/components/Icon/AnimatedIcon.d.ts +1 -1
- 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/PinInput/PinCell.d.ts +1 -1
- 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 +3 -2
- package/types/components/Progress/StyledProgressCircle.d.ts +3 -2
- 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 +2 -12
- package/types/components/RichTextEditor/RichTextEditor.d.ts +3 -2
- package/types/components/RichTextEditor/index.d.ts +3 -2
- package/types/components/SectionHeading/index.d.ts +3 -3
- package/types/components/Select/MultiSelect/Option.d.ts +1 -1
- 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 +1 -1
- 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/helpers.d.ts +1 -1
- package/types/components/Select/index.d.ts +4 -3
- package/types/components/Select/types.d.ts +3 -3
- package/types/components/Spinner/StyledSpinner.d.ts +2 -1
- package/types/components/Spinner/index.d.ts +2 -2
- package/types/components/Switch/StyledSwitch.d.ts +3 -18
- package/types/components/{Radio/__tests__/StyledRadio.spec.d.ts → Switch/__tests__/StyledSwitch.spec.d.ts} +0 -0
- package/types/components/Switch/index.d.ts +3 -2
- package/types/components/Tabs/ScrollableTabs.d.ts +1 -1
- package/types/components/Tabs/index.d.ts +3 -3
- package/types/components/Tag/index.d.ts +1 -1
- package/types/components/TextInput/index.d.ts +3 -3
- package/types/components/TimePicker/StyledTimePicker.d.ts +2 -1
- 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 +2 -1
- 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 +3 -3
- package/types/components/Toolbar/StyledToolbar.d.ts +2 -1
- 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/index.d.ts +2 -2
- package/types/testHelpers/renderWithTheme.d.ts +1 -1
- package/types/theme/ThemeProvider.d.ts +1 -1
- package/types/theme/components/accordion.d.ts +1 -1
- package/types/theme/components/alert.d.ts +1 -1
- package/types/theme/components/avatar.d.ts +1 -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 +1 -1
- 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 +1 -1
- package/types/theme/components/switch.d.ts +7 -6
- package/types/theme/components/tabs.d.ts +1 -1
- package/types/theme/components/tag.d.ts +1 -1
- package/types/theme/components/textInput.d.ts +1 -1
- package/types/theme/components/toast.d.ts +1 -1
- package/types/theme/components/toolbar.d.ts +1 -1
- package/types/theme/components/typography.d.ts +1 -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/work.d.ts +1 -1
- package/types/theme/global/index.d.ts +5 -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/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
- package/types/components/Switch/__tests__/StyledHeading.spec.d.ts +0 -1
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { Text } from 'react-native';
|
|
3
3
|
import { fireEvent } from '@testing-library/react-native';
|
|
4
4
|
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
|
5
|
+
import type { ComponentProps } from 'react';
|
|
5
6
|
import renderWithTheme from '../../../testHelpers/renderWithTheme';
|
|
6
|
-
import BottomNavigation
|
|
7
|
+
import BottomNavigation from '..';
|
|
8
|
+
import type { BottomNavigationTabType } from '..';
|
|
7
9
|
|
|
8
10
|
const TestComponent = (
|
|
9
11
|
props: Omit<
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import {
|
|
3
|
-
TouchableWithoutFeedback,
|
|
4
|
-
StyleProp,
|
|
5
|
-
ViewStyle,
|
|
6
|
-
ViewProps,
|
|
7
|
-
} from 'react-native';
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TouchableWithoutFeedback } from 'react-native';
|
|
8
3
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
9
|
-
import
|
|
4
|
+
import type { ReactNode } from 'react';
|
|
5
|
+
import type { StyleProp, ViewStyle, ViewProps } from 'react-native';
|
|
6
|
+
import Icon from '../Icon';
|
|
10
7
|
import { isHeroIcon } from '../Icon/utils';
|
|
11
8
|
import {
|
|
12
9
|
BottomBar,
|
|
@@ -18,6 +15,7 @@ import {
|
|
|
18
15
|
StyledBottomBarText,
|
|
19
16
|
} from './StyledBottomNavigation';
|
|
20
17
|
import { isIOS } from '../../utils/helpers';
|
|
18
|
+
import type { IconName } from '../Icon';
|
|
21
19
|
|
|
22
20
|
export type BottomNavigationTabType = {
|
|
23
21
|
key: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
|
+
import type { ReactElement } from 'react';
|
|
3
4
|
import Button from '../Button';
|
|
4
5
|
import Divider from '../Divider';
|
|
5
6
|
import Typography from '../Typography';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import styled from '@emotion/native';
|
|
2
|
-
import { ComponentProps } from 'react';
|
|
3
2
|
import {
|
|
4
3
|
Animated,
|
|
5
4
|
Pressable,
|
|
6
5
|
SafeAreaView,
|
|
7
6
|
StyleSheet,
|
|
8
7
|
View,
|
|
9
|
-
ViewProps,
|
|
10
8
|
} from 'react-native';
|
|
9
|
+
import type { ComponentProps } from 'react';
|
|
10
|
+
import type { ViewProps } from 'react-native';
|
|
11
11
|
|
|
12
12
|
const AnimatedPressable = Animated.createAnimatedComponent(Pressable);
|
|
13
13
|
const AnimatedSafeAreaView = Animated.createAnimatedComponent(SafeAreaView);
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
useRef,
|
|
6
|
-
useState,
|
|
7
|
-
} from 'react';
|
|
8
|
-
import { Animated, Easing, Modal, StyleProp, ViewStyle } from 'react-native';
|
|
1
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
2
|
+
import { Animated, Easing, Modal } from 'react-native';
|
|
3
|
+
import type { ReactElement, ReactNode } from 'react';
|
|
4
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
9
5
|
import Footer from './Footer';
|
|
10
6
|
import Header from './Header';
|
|
11
7
|
import {
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { useTheme } from '@emotion/react';
|
|
2
|
-
import React
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import { IconName } from '../Icon';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { ReactChild } from 'react';
|
|
4
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
6
5
|
import LoadingIndicator from './LoadingIndicator';
|
|
7
6
|
import {
|
|
8
|
-
Intent,
|
|
9
7
|
StyledButtonContainer,
|
|
10
8
|
StyledButtonText,
|
|
11
9
|
StyledButtonIconWrapper,
|
|
12
10
|
StyledButtonIcon,
|
|
13
|
-
ThemeVariant,
|
|
14
11
|
} from './StyledButton';
|
|
12
|
+
import type { IconName } from '../Icon';
|
|
13
|
+
import type { Intent, ThemeVariant } from './StyledButton';
|
|
15
14
|
|
|
16
15
|
export interface ButtonProps {
|
|
17
16
|
/**
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
StyleProp,
|
|
5
|
-
ViewStyle,
|
|
6
|
-
TouchableOpacity,
|
|
7
|
-
TouchableOpacityProps,
|
|
8
|
-
} from 'react-native';
|
|
3
|
+
import { TouchableOpacity } from 'react-native';
|
|
9
4
|
|
|
10
|
-
import
|
|
5
|
+
import type { StyleProp, ViewStyle, TouchableOpacityProps } from 'react-native';
|
|
6
|
+
import Icon from '../Icon';
|
|
7
|
+
import type { IconProps, IconName } from '../Icon';
|
|
11
8
|
|
|
12
9
|
export interface IconButtonProps {
|
|
13
10
|
/**
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { View
|
|
2
|
-
import styled
|
|
3
|
-
import {
|
|
1
|
+
import { View } from 'react-native';
|
|
2
|
+
import styled from '@emotion/native';
|
|
3
|
+
import type { ViewProps } from 'react-native';
|
|
4
|
+
import type { ReactNativeStyle } from '@emotion/native';
|
|
5
|
+
import type { Theme } from '@emotion/react';
|
|
4
6
|
|
|
5
7
|
type Intent = 'primary' | 'secondary' | 'danger';
|
|
6
8
|
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useRef } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
Easing,
|
|
5
|
-
StyleSheet,
|
|
6
|
-
StyleProp,
|
|
7
|
-
ViewStyle,
|
|
8
|
-
ViewProps,
|
|
9
|
-
} from 'react-native';
|
|
2
|
+
import { Animated, Easing, StyleSheet } from 'react-native';
|
|
3
|
+
import type { StyleProp, ViewStyle, ViewProps } from 'react-native';
|
|
10
4
|
import {
|
|
11
5
|
StyledLoadingDot,
|
|
12
6
|
StyledLoadingIndicatorWrapper,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TouchableHighlight, View } from 'react-native';
|
|
2
|
-
import styled
|
|
3
|
-
import {
|
|
4
|
-
|
|
2
|
+
import styled from '@emotion/native';
|
|
3
|
+
import type { ReactNativeStyle } from '@emotion/native';
|
|
4
|
+
import type { Theme } from '@emotion/react';
|
|
5
5
|
import Icon from '../Icon';
|
|
6
6
|
import Typography from '../Typography';
|
|
7
7
|
|
|
@@ -316,6 +316,5 @@ export {
|
|
|
316
316
|
StyledButtonText,
|
|
317
317
|
StyledButtonIconWrapper,
|
|
318
318
|
StyledButtonIcon,
|
|
319
|
-
Intent,
|
|
320
|
-
ThemeVariant,
|
|
321
319
|
};
|
|
320
|
+
export type { Intent, ThemeVariant };
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import Icon
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ReactChild } from 'react';
|
|
3
|
+
import type { ViewProps } from 'react-native';
|
|
4
|
+
import Icon from '../../Icon';
|
|
5
5
|
import {
|
|
6
6
|
ButtonContainer,
|
|
7
7
|
IconWrapper,
|
|
8
8
|
ButtonText,
|
|
9
9
|
} from './StyledUtilityButton';
|
|
10
|
+
import type { IconName } from '../../Icon';
|
|
10
11
|
|
|
11
12
|
export interface UtilityButtonProps extends ViewProps {
|
|
12
13
|
/**
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { FunctionComponent } from 'react';
|
|
2
|
-
import Button
|
|
1
|
+
import type { FunctionComponent } from 'react';
|
|
2
|
+
import Button from './Button';
|
|
3
3
|
import IconButton from './IconButton';
|
|
4
4
|
import UtilityButton from './UtilityButton';
|
|
5
|
+
import type { ButtonProps } from './Button';
|
|
5
6
|
|
|
6
7
|
interface CompoundButtonProps extends FunctionComponent<ButtonProps> {
|
|
7
8
|
Icon: typeof IconButton;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import styled from '@emotion/native';
|
|
2
|
-
import { TouchableOpacity, View
|
|
2
|
+
import { TouchableOpacity, View } from 'react-native';
|
|
3
|
+
import type { ViewProps } from 'react-native';
|
|
3
4
|
|
|
4
5
|
const StyledContainer = styled(View)(({ theme }) => ({
|
|
5
6
|
backgroundColor: theme.__hd__.calendar.colors.background,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
import type { StyleProp, ViewStyle, ViewProps } from 'react-native';
|
|
3
4
|
import { StyledDataCard, Indicator } from './StyledDataCard';
|
|
4
5
|
|
|
5
6
|
export interface DataCardProps extends ViewProps {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
import type { StyleProp, ViewStyle, ViewProps } from 'react-native';
|
|
3
4
|
import DataCard from './DataCard';
|
|
4
5
|
import { StyledCard, LeftDataCard } from './StyledCard';
|
|
5
6
|
|
|
@@ -1,18 +1,48 @@
|
|
|
1
1
|
import styled from '@emotion/native';
|
|
2
|
-
import { TouchableOpacity } from 'react-native';
|
|
2
|
+
import { TouchableOpacity, View } from 'react-native';
|
|
3
|
+
import Icon from '../Icon';
|
|
4
|
+
import Typography from '../Typography';
|
|
3
5
|
|
|
4
|
-
const StyledWrapper = styled(TouchableOpacity)
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
6
|
+
export const StyledWrapper = styled(TouchableOpacity)<{
|
|
7
|
+
themeWithBorder: boolean;
|
|
8
|
+
themeDisabled: boolean;
|
|
9
|
+
}>(({ theme, themeWithBorder, themeDisabled }) => {
|
|
10
|
+
const borderStyle = {
|
|
11
|
+
borderRadius: theme.__hd__.checkbox.radii.wrapper,
|
|
12
|
+
borderWidth: theme.__hd__.checkbox.borderWidths.wrapper,
|
|
13
|
+
padding: theme.__hd__.checkbox.space.wrapperPadding,
|
|
14
|
+
borderColor: themeDisabled
|
|
15
|
+
? theme.__hd__.checkbox.colors.disabledBorder
|
|
16
|
+
: theme.__hd__.checkbox.colors.default,
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
return {
|
|
20
|
+
flexDirection: 'row',
|
|
21
|
+
...(themeWithBorder && borderStyle),
|
|
22
|
+
};
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export const StyledDescription = styled(Typography.Text)(({ theme }) => ({
|
|
26
|
+
paddingRight: theme.__hd__.checkbox.space.iconDescriptionPadding,
|
|
27
|
+
flex: 1,
|
|
16
28
|
}));
|
|
17
29
|
|
|
18
|
-
export {
|
|
30
|
+
export const StyledCheckbox = styled(View)<{ themeDisabled: boolean }>(
|
|
31
|
+
({ theme, themeDisabled }) => ({
|
|
32
|
+
flexDirection: 'row',
|
|
33
|
+
justifyContent: 'center',
|
|
34
|
+
height: theme.__hd__.checkbox.sizes.icon,
|
|
35
|
+
width: theme.__hd__.checkbox.sizes.icon,
|
|
36
|
+
borderRadius: theme.__hd__.checkbox.radii.icon,
|
|
37
|
+
borderWidth: theme.__hd__.checkbox.borderWidths.icon,
|
|
38
|
+
borderColor: themeDisabled
|
|
39
|
+
? theme.__hd__.checkbox.colors.disabledBorder
|
|
40
|
+
: theme.__hd__.checkbox.colors.default,
|
|
41
|
+
overflow: 'hidden',
|
|
42
|
+
})
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
export const StyledCheckMark = styled(Icon)(({ theme }) => ({
|
|
46
|
+
position: 'absolute',
|
|
47
|
+
top: theme.__hd__.checkbox.space.iconTop,
|
|
48
|
+
}));
|
|
@@ -1,10 +1,35 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import renderWithTheme from '../../../testHelpers/renderWithTheme';
|
|
3
|
-
import { StyledWrapper } from '../StyledCheckbox';
|
|
3
|
+
import { StyledWrapper, StyledCheckbox } from '../StyledCheckbox';
|
|
4
4
|
|
|
5
5
|
describe('StyledWrapper', () => {
|
|
6
|
-
it
|
|
7
|
-
|
|
6
|
+
it.each`
|
|
7
|
+
withBorder | disabled
|
|
8
|
+
${false} | ${false}
|
|
9
|
+
${true} | ${false}
|
|
10
|
+
${true} | ${true}
|
|
11
|
+
`(
|
|
12
|
+
'renders correctly when disabled is $disabled, withBorder is $withBorder',
|
|
13
|
+
({ disabled, withBorder }) => {
|
|
14
|
+
const { toJSON } = renderWithTheme(
|
|
15
|
+
<StyledWrapper themeDisabled={disabled} themeWithBorder={withBorder} />
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
expect(toJSON()).toMatchSnapshot();
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
describe('StyledCheckbox', () => {
|
|
24
|
+
it.each`
|
|
25
|
+
disabled
|
|
26
|
+
${true}
|
|
27
|
+
${false}
|
|
28
|
+
`('renders correctly when disabled is $disabled', ({ disabled }) => {
|
|
29
|
+
const { toJSON } = renderWithTheme(
|
|
30
|
+
<StyledCheckbox themeDisabled={disabled} />
|
|
31
|
+
);
|
|
32
|
+
|
|
8
33
|
expect(toJSON()).toMatchSnapshot();
|
|
9
34
|
});
|
|
10
35
|
});
|
|
@@ -1,6 +1,96 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`
|
|
3
|
+
exports[`StyledCheckbox renders correctly when disabled is false 1`] = `
|
|
4
|
+
<View
|
|
5
|
+
style={
|
|
6
|
+
Array [
|
|
7
|
+
Object {
|
|
8
|
+
"borderColor": "#001f23",
|
|
9
|
+
"borderRadius": 4,
|
|
10
|
+
"borderWidth": 2,
|
|
11
|
+
"flexDirection": "row",
|
|
12
|
+
"height": 20,
|
|
13
|
+
"justifyContent": "center",
|
|
14
|
+
"overflow": "hidden",
|
|
15
|
+
"width": 20,
|
|
16
|
+
},
|
|
17
|
+
undefined,
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
themeDisabled={false}
|
|
21
|
+
/>
|
|
22
|
+
`;
|
|
23
|
+
|
|
24
|
+
exports[`StyledCheckbox renders correctly when disabled is true 1`] = `
|
|
25
|
+
<View
|
|
26
|
+
style={
|
|
27
|
+
Array [
|
|
28
|
+
Object {
|
|
29
|
+
"borderColor": "#808f91",
|
|
30
|
+
"borderRadius": 4,
|
|
31
|
+
"borderWidth": 2,
|
|
32
|
+
"flexDirection": "row",
|
|
33
|
+
"height": 20,
|
|
34
|
+
"justifyContent": "center",
|
|
35
|
+
"overflow": "hidden",
|
|
36
|
+
"width": 20,
|
|
37
|
+
},
|
|
38
|
+
undefined,
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
themeDisabled={true}
|
|
42
|
+
/>
|
|
43
|
+
`;
|
|
44
|
+
|
|
45
|
+
exports[`StyledWrapper renders correctly when disabled is false, withBorder is false 1`] = `
|
|
46
|
+
<View
|
|
47
|
+
accessible={true}
|
|
48
|
+
collapsable={false}
|
|
49
|
+
focusable={false}
|
|
50
|
+
nativeID="animatedComponent"
|
|
51
|
+
onClick={[Function]}
|
|
52
|
+
onResponderGrant={[Function]}
|
|
53
|
+
onResponderMove={[Function]}
|
|
54
|
+
onResponderRelease={[Function]}
|
|
55
|
+
onResponderTerminate={[Function]}
|
|
56
|
+
onResponderTerminationRequest={[Function]}
|
|
57
|
+
onStartShouldSetResponder={[Function]}
|
|
58
|
+
style={
|
|
59
|
+
Object {
|
|
60
|
+
"flexDirection": "row",
|
|
61
|
+
"opacity": 1,
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/>
|
|
65
|
+
`;
|
|
66
|
+
|
|
67
|
+
exports[`StyledWrapper renders correctly when disabled is false, withBorder is true 1`] = `
|
|
68
|
+
<View
|
|
69
|
+
accessible={true}
|
|
70
|
+
collapsable={false}
|
|
71
|
+
focusable={false}
|
|
72
|
+
nativeID="animatedComponent"
|
|
73
|
+
onClick={[Function]}
|
|
74
|
+
onResponderGrant={[Function]}
|
|
75
|
+
onResponderMove={[Function]}
|
|
76
|
+
onResponderRelease={[Function]}
|
|
77
|
+
onResponderTerminate={[Function]}
|
|
78
|
+
onResponderTerminationRequest={[Function]}
|
|
79
|
+
onStartShouldSetResponder={[Function]}
|
|
80
|
+
style={
|
|
81
|
+
Object {
|
|
82
|
+
"borderColor": "#001f23",
|
|
83
|
+
"borderRadius": 8,
|
|
84
|
+
"borderWidth": 1,
|
|
85
|
+
"flexDirection": "row",
|
|
86
|
+
"opacity": 1,
|
|
87
|
+
"padding": 16,
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
/>
|
|
91
|
+
`;
|
|
92
|
+
|
|
93
|
+
exports[`StyledWrapper renders correctly when disabled is true, withBorder is true 1`] = `
|
|
4
94
|
<View
|
|
5
95
|
accessible={true}
|
|
6
96
|
collapsable={false}
|
|
@@ -15,16 +105,12 @@ exports[`StyledWrapper renders correct style 1`] = `
|
|
|
15
105
|
onStartShouldSetResponder={[Function]}
|
|
16
106
|
style={
|
|
17
107
|
Object {
|
|
18
|
-
"borderColor": "#
|
|
19
|
-
"borderRadius":
|
|
20
|
-
"borderWidth":
|
|
21
|
-
"display": "flex",
|
|
108
|
+
"borderColor": "#808f91",
|
|
109
|
+
"borderRadius": 8,
|
|
110
|
+
"borderWidth": 1,
|
|
22
111
|
"flexDirection": "row",
|
|
23
|
-
"height": 24,
|
|
24
|
-
"justifyContent": "center",
|
|
25
112
|
"opacity": 1,
|
|
26
|
-
"
|
|
27
|
-
"width": 24,
|
|
113
|
+
"padding": 16,
|
|
28
114
|
}
|
|
29
115
|
}
|
|
30
116
|
/>
|