@hero-design/rn 8.52.0 → 8.52.2-rc2.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 +1 -1
- package/CHANGELOG.md +26 -0
- package/es/index.js +399 -709
- package/lib/index.js +397 -708
- package/package.json +7 -7
- package/src/components/Accordion/__tests__/__snapshots__/AccordionItem.spec.tsx.snap +0 -4
- package/src/components/Accordion/__tests__/__snapshots__/StyledAccordion.spec.tsx.snap +0 -2
- package/src/components/Accordion/__tests__/__snapshots__/index.spec.tsx.snap +0 -3
- package/src/components/Alert/__tests__/__snapshots__/index.spec.tsx.snap +0 -7
- package/src/components/Attachment/__tests__/__snapshots__/index.spec.tsx.snap +0 -1
- package/src/components/Avatar/AvatarStack/__tests__/__snapshots__/StyledAvatarStack.spec.tsx.snap +0 -2
- package/src/components/Avatar/AvatarStack/__tests__/__snapshots__/index.spec.tsx.snap +0 -2
- package/src/components/Avatar/__tests__/__snapshots__/StyledAvatar.spec.tsx.snap +0 -3
- package/src/components/Avatar/__tests__/__snapshots__/index.spec.tsx.snap +0 -3
- package/src/components/Badge/__tests__/__snapshots__/Badge.spec.tsx.snap +0 -6
- package/src/components/Badge/__tests__/__snapshots__/Status.spec.tsx.snap +0 -2
- package/src/components/BottomSheet/__tests__/__snapshots__/index.spec.tsx.snap +32 -21
- package/src/components/BottomSheet/index.tsx +1 -1
- package/src/components/Box/__tests__/__snapshots__/index.spec.tsx.snap +0 -21
- package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/StyledLoadingIndicator.spec.tsx.snap +0 -10
- package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/index.spec.tsx.snap +0 -10
- package/src/components/Button/UtilityButton/__tests__/__snapshots__/index.spec.tsx.snap +0 -2
- package/src/components/Button/__tests__/__snapshots__/Button.spec.tsx.snap +0 -16
- package/src/components/Button/__tests__/__snapshots__/IconButton.spec.tsx.snap +0 -1
- package/src/components/Button/__tests__/__snapshots__/StyledButton.spec.tsx.snap +0 -32
- package/src/components/Calendar/__tests__/__snapshots__/CalendarRowItem.spec.tsx.snap +0 -5
- package/src/components/Card/DataCard/__tests__/__snapshots__/StyledDataCard.spec.tsx.snap +0 -7
- package/src/components/Card/DataCard/__tests__/__snapshots__/index.spec.tsx.snap +0 -5
- package/src/components/Card/__tests__/__snapshots__/StyledCard.spec.tsx.snap +0 -1
- package/src/components/Card/__tests__/__snapshots__/index.spec.tsx.snap +0 -6
- package/src/components/Carousel/CardCarousel.tsx +1 -5
- package/src/components/Carousel/StyledCardCarousel.tsx +1 -16
- package/src/components/Carousel/__tests__/__snapshots__/CardCarousel.spec.tsx.snap +92 -174
- package/src/components/Carousel/__tests__/__snapshots__/StyledCardCarousel.spec.tsx.snap +0 -4
- package/src/components/Carousel/__tests__/__snapshots__/StyledCarousel.spec.tsx.snap +0 -1
- package/src/components/Carousel/__tests__/__snapshots__/index.spec.tsx.snap +1 -803
- package/src/components/Carousel/__tests__/index.spec.tsx +37 -47
- package/src/components/Checkbox/__tests__/__snapshots__/StyledCheckbox.spec.tsx.snap +0 -8
- package/src/components/Checkbox/__tests__/__snapshots__/index.spec.tsx.snap +0 -6
- package/src/components/Checkbox/index.tsx +1 -13
- package/src/components/Chip/__tests__/__snapshots__/index.spec.tsx.snap +0 -12
- package/src/components/Collapse/__tests__/__snapshots__/StyledCollapse.spec.tsx.snap +0 -2
- package/src/components/Collapse/__tests__/__snapshots__/index.spec.tsx.snap +0 -2
- package/src/components/ContentNavigator/__tests__/__snapshots__/StyledContentNavigator.spec.tsx.snap +0 -1
- package/src/components/ContentNavigator/__tests__/__snapshots__/index.spec.tsx.snap +0 -3
- package/src/components/DatePicker/__tests__/__snapshots__/DatePicker.spec.tsx.snap +0 -15
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerAndroid.spec.tsx.snap +0 -1
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerCalendar.spec.tsx.snap +0 -1
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerIOS.spec.tsx.snap +309 -329
- package/src/components/Divider/__tests__/__snapshots__/StyledDivider.spec.tsx.snap +0 -12
- package/src/components/Drawer/DragableDrawer/__tests__/__snapshots__/index.spec.tsx.snap +0 -1
- package/src/components/Drawer/__tests__/__snapshots__/index.spec.tsx.snap +0 -3
- package/src/components/Empty/__tests__/__snapshots__/index.spec.tsx.snap +0 -2
- package/src/components/Error/__tests__/__snapshots__/index.spec.tsx.snap +0 -4
- package/src/components/Error/index.tsx +3 -20
- package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +0 -2
- package/src/components/FAB/ActionGroup/index.tsx +1 -14
- package/src/components/FAB/__tests__/__snapshots__/AnimatedFABIcon.spec.tsx.snap +0 -2
- package/src/components/FAB/__tests__/__snapshots__/StyledFAB.spec.tsx.snap +0 -3
- package/src/components/FAB/__tests__/__snapshots__/index.spec.tsx.snap +0 -3
- package/src/components/HeroDesignProvider/__tests__/__snapshots__/index.spec.tsx.snap +0 -2
- package/src/components/Icon/__tests__/__snapshots__/index.spec.tsx.snap +0 -4
- package/src/components/Image/__tests__/__snapshots__/index.spec.tsx.snap +0 -4
- package/src/components/List/__tests__/__snapshots__/BasicListItem.spec.tsx.snap +0 -2
- package/src/components/List/__tests__/__snapshots__/ListItem.spec.tsx.snap +0 -4
- package/src/components/List/__tests__/__snapshots__/StyledBasicListItem.spec.tsx.snap +0 -4
- package/src/components/List/__tests__/__snapshots__/StyledListItem.spec.tsx.snap +0 -9
- package/src/components/Modal/__tests__/__snapshots__/index.spec.tsx.snap +0 -2
- package/src/components/PageControl/__tests__/__snapshots__/index.spec.tsx.snap +0 -1
- package/src/components/PinInput/__tests__/__snapshots__/PinCell.spec.tsx.snap +0 -5
- package/src/components/PinInput/__tests__/__snapshots__/index.spec.tsx.snap +0 -4
- package/src/components/Portal/__tests__/__snapshots__/index.spec.tsx.snap +0 -1
- package/src/components/Progress/__tests__/__snapshots__/index.spec.js.snap +0 -5
- package/src/components/Radio/__tests__/__snapshots__/Radio.spec.tsx.snap +0 -2
- package/src/components/Radio/__tests__/__snapshots__/RadioGroup.spec.tsx.snap +0 -1
- package/src/components/Rate/__tests__/__snapshots__/index.spec.tsx.snap +0 -3
- package/src/components/RefreshControl/__tests__/__snapshots__/index.spec.tsx.snap +0 -3
- package/src/components/RichTextEditor/__tests__/__snapshots__/EditorToolbar.spec.tsx.snap +0 -1
- package/src/components/RichTextEditor/__tests__/__snapshots__/MentionList.spec.tsx.snap +0 -1
- package/src/components/RichTextEditor/__tests__/__snapshots__/RichTextEditor.spec.tsx.snap +0 -2
- package/src/components/SectionHeading/__tests__/__snapshots__/StyledHeading.spec.tsx.snap +0 -4
- package/src/components/SectionHeading/__tests__/__snapshots__/index.spec.tsx.snap +0 -6
- package/src/components/SectionHeading/__tests__/index.spec.tsx +0 -1
- package/src/components/SectionHeading/index.tsx +32 -57
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/Option.spec.tsx.snap +0 -1
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +0 -4
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +128 -42
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/Option.spec.tsx.snap +0 -1
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +0 -4
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +96 -35
- package/src/components/Skeleton/__tests__/__snapshots__/index.spec.tsx.snap +0 -7
- package/src/components/Slider/__tests__/__snapshots__/index.spec.tsx.snap +0 -3
- package/src/components/Spinner/__tests__/__snapshots__/AnimatedSpinner.spec.tsx.snap +0 -1
- package/src/components/Spinner/__tests__/__snapshots__/StyledSpinner.spec.tsx.snap +0 -24
- package/src/components/Spinner/__tests__/__snapshots__/index.spec.tsx.snap +0 -1
- package/src/components/Success/__tests__/__snapshots__/index.spec.tsx.snap +0 -4
- package/src/components/Swipeable/__tests__/__snapshots__/SwipeableAction.spec.tsx.snap +0 -3
- package/src/components/Swipeable/__tests__/__snapshots__/index.spec.tsx.snap +0 -1
- package/src/components/Switch/SelectorSwitch/__tests__/__snapshots__/Option.spec.tsx.snap +0 -4
- package/src/components/Switch/SelectorSwitch/__tests__/__snapshots__/index.spec.tsx.snap +0 -1
- package/src/components/Switch/__tests__/__snapshots__/StyledSwitch.spec.tsx.snap +0 -5
- package/src/components/Switch/__tests__/__snapshots__/index.spec.tsx.snap +0 -2
- package/src/components/Tabs/__tests__/SceneView.spec.tsx +1 -1
- package/src/components/Tabs/__tests__/__snapshots__/SceneView.spec.tsx.snap +0 -4
- package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabs.spec.tsx.snap +0 -3
- package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabsHeader.spec.tsx.snap +0 -1
- package/src/components/Tabs/__tests__/__snapshots__/TabWithBadge.spec.tsx.snap +0 -2
- package/src/components/Tabs/__tests__/__snapshots__/index.spec.tsx.snap +0 -3
- package/src/components/Tag/__tests__/__snapshots__/Tag.spec.tsx.snap +0 -10
- package/src/components/Tag/index.tsx +0 -12
- package/src/components/TextInput/__tests__/__snapshots__/StyledTextInput.spec.tsx.snap +0 -21
- package/src/components/TextInput/__tests__/__snapshots__/index.spec.tsx.snap +0 -17
- package/src/components/TimePicker/__tests__/__snapshots__/TimePickerAndroid.spec.tsx.snap +0 -2
- package/src/components/TimePicker/__tests__/__snapshots__/TimePickerIOS.spec.tsx.snap +309 -330
- package/src/components/Toast/StyledToast.tsx +7 -9
- package/src/components/Toast/Toast.tsx +1 -4
- package/src/components/Toast/ToastContainer.tsx +2 -6
- package/src/components/Toast/ToastContext.ts +2 -5
- package/src/components/Toast/ToastProvider.tsx +2 -19
- package/src/components/Toast/__tests__/ToastContainer.spec.tsx +12 -15
- package/src/components/Toast/__tests__/__snapshots__/Toast.spec.tsx.snap +0 -7
- package/src/components/Toast/__tests__/__snapshots__/ToastContainer.spec.tsx.snap +6 -14
- package/src/components/Toast/types.ts +1 -5
- package/src/components/Toolbar/__tests__/__snapshots__/ToolbarGroup.spec.tsx.snap +0 -3
- package/src/components/Toolbar/__tests__/__snapshots__/ToolbarItem.spec.tsx.snap +0 -8
- package/src/components/Typography/Body/__tests__/__snapshots__/StyledBody.tsx.snap +0 -16
- package/src/components/Typography/Body/__tests__/__snapshots__/index.spec.tsx.snap +0 -19
- package/src/components/Typography/Caption/__tests__/__snapshots__/StyledCaption.spec.tsx.snap +0 -10
- package/src/components/Typography/Caption/__tests__/__snapshots__/index.spec.tsx.snap +0 -13
- package/src/components/Typography/Label/__tests__/__snapshots__/StyledLabel.tsx.snap +0 -8
- package/src/components/Typography/Label/__tests__/__snapshots__/index.spec.tsx.snap +0 -11
- package/src/components/Typography/Text/__tests__/__snapshots__/StyledText.spec.tsx.snap +0 -20
- package/src/components/Typography/Title/__tests__/__snapshots__/StyledTitle.tsx.snap +0 -20
- package/src/components/Typography/Title/__tests__/__snapshots__/index.spec.tsx.snap +0 -23
- package/src/index.ts +0 -2
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +0 -112
- package/src/theme/components/badge.ts +1 -28
- package/src/theme/components/button.ts +0 -24
- package/src/theme/components/cardCarousel.ts +1 -8
- package/src/theme/components/carousel.ts +1 -28
- package/src/theme/components/empty.ts +1 -23
- package/src/theme/components/error.ts +1 -32
- package/src/theme/components/fab.ts +2 -13
- package/src/theme/components/pinInput.ts +0 -32
- package/src/theme/components/success.ts +1 -23
- package/src/theme/components/tag.ts +1 -28
- package/src/theme/components/textInput.ts +0 -5
- package/src/theme/getTheme.ts +18 -21
- package/src/types.ts +0 -2
- package/types/components/Carousel/StyledCardCarousel.d.ts +1 -7
- package/types/components/Checkbox/index.d.ts +1 -6
- package/types/components/Error/index.d.ts +3 -9
- package/types/components/FAB/ActionGroup/index.d.ts +0 -5
- package/types/components/SectionHeading/index.d.ts +1 -11
- package/types/components/Tag/index.d.ts +1 -6
- package/types/components/Toast/StyledToast.d.ts +0 -2
- package/types/components/Toast/ToastContext.d.ts +2 -2
- package/types/components/Toast/ToastProvider.d.ts +1 -1
- package/types/components/Toast/index.d.ts +1 -1
- package/types/components/Toast/types.d.ts +1 -5
- package/types/index.d.ts +1 -2
- package/types/theme/components/badge.d.ts +0 -24
- package/types/theme/components/button.d.ts +0 -20
- package/types/theme/components/cardCarousel.d.ts +0 -10
- package/types/theme/components/carousel.d.ts +0 -24
- package/types/theme/components/empty.d.ts +0 -19
- package/types/theme/components/error.d.ts +0 -27
- package/types/theme/components/fab.d.ts +8 -19
- package/types/theme/components/pinInput.d.ts +0 -27
- package/types/theme/components/success.d.ts +0 -19
- package/types/theme/components/tag.d.ts +0 -24
- package/types/theme/components/textInput.d.ts +0 -5
- package/types/theme/getTheme.d.ts +18 -20
- package/types/types.d.ts +1 -2
- package/src/components/BottomNavigation/StyledBottomNavigation.tsx +0 -60
- package/src/components/BottomNavigation/__tests__/__snapshots__/index.spec.tsx.snap +0 -413
- package/src/components/BottomNavigation/__tests__/index.spec.tsx +0 -97
- package/src/components/BottomNavigation/index.tsx +0 -166
- package/src/theme/components/bottomNavigation.ts +0 -27
- package/types/components/BottomNavigation/StyledBottomNavigation.d.ts +0 -52
- package/types/components/BottomNavigation/index.d.ts +0 -45
- package/types/theme/components/bottomNavigation.d.ts +0 -23
|
@@ -4,15 +4,13 @@ import type { ComponentProps } from 'react';
|
|
|
4
4
|
import type { ViewProps } from 'react-native';
|
|
5
5
|
import { IntentType } from './types';
|
|
6
6
|
|
|
7
|
-
const ToastContainerWrapper = styled(View)
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
})
|
|
15
|
-
);
|
|
7
|
+
const ToastContainerWrapper = styled(View)(({ theme }) => ({
|
|
8
|
+
...StyleSheet.absoluteFillObject,
|
|
9
|
+
paddingHorizontal: theme.__hd__.toast.space.wrapperVerticalPadding,
|
|
10
|
+
paddingVertical: theme.__hd__.toast.space.wrapperHorizontalPadding,
|
|
11
|
+
flexDirection: 'column-reverse',
|
|
12
|
+
elevation: 9999,
|
|
13
|
+
}));
|
|
16
14
|
|
|
17
15
|
const Container = styled(Animated.View)<{
|
|
18
16
|
themeVariant: 'default' | 'round';
|
|
@@ -9,7 +9,6 @@ import {
|
|
|
9
9
|
CTAWrapper,
|
|
10
10
|
TextContainer,
|
|
11
11
|
} from './StyledToast';
|
|
12
|
-
import { useToastConfig } from './ToastContext';
|
|
13
12
|
import type { IconName } from '../Icon';
|
|
14
13
|
import type { IntentType, ToastProps } from './types';
|
|
15
14
|
|
|
@@ -59,7 +58,6 @@ const Toast = ({
|
|
|
59
58
|
distance = 0,
|
|
60
59
|
}: ToastProps): JSX.Element => {
|
|
61
60
|
const animatedValue = useRef(new Animated.Value(0)).current;
|
|
62
|
-
const toastConfig = useToastConfig();
|
|
63
61
|
|
|
64
62
|
useEffect(() => {
|
|
65
63
|
if (autoDismiss && duration >= 0) {
|
|
@@ -86,8 +84,7 @@ const Toast = ({
|
|
|
86
84
|
|
|
87
85
|
const interpolateY = animatedValue.interpolate({
|
|
88
86
|
inputRange: [0, 1],
|
|
89
|
-
outputRange:
|
|
90
|
-
toastConfig.position === 'top' ? [-20, distance] : [20, -distance],
|
|
87
|
+
outputRange: [20, -distance],
|
|
91
88
|
});
|
|
92
89
|
|
|
93
90
|
return (
|
|
@@ -38,7 +38,7 @@ const SingleToastDisplay = ({
|
|
|
38
38
|
const ToastContainer = React.forwardRef<
|
|
39
39
|
ToastControllerContextType,
|
|
40
40
|
ToastContainerProps
|
|
41
|
-
>(({ displayType = 'single',
|
|
41
|
+
>(({ displayType = 'single', style }, ref) => {
|
|
42
42
|
const theme = useTheme();
|
|
43
43
|
const [toastList, setToastList] = useState<ToastItemProps[]>([]);
|
|
44
44
|
|
|
@@ -61,11 +61,7 @@ const ToastContainer = React.forwardRef<
|
|
|
61
61
|
}));
|
|
62
62
|
|
|
63
63
|
return (
|
|
64
|
-
<ToastContainerWrapper
|
|
65
|
-
pointerEvents="box-none"
|
|
66
|
-
position={position}
|
|
67
|
-
style={style}
|
|
68
|
-
>
|
|
64
|
+
<ToastContainerWrapper pointerEvents="box-none" style={style}>
|
|
69
65
|
{displayType === 'single' ? (
|
|
70
66
|
<SingleToastDisplay toastList={toastList} setToastList={setToastList} />
|
|
71
67
|
) : (
|
|
@@ -2,7 +2,7 @@ import { createContext, useContext } from 'react';
|
|
|
2
2
|
import type { ToastContainerProps, ToastProps } from './types';
|
|
3
3
|
|
|
4
4
|
export type ToastControllerContextType = {
|
|
5
|
-
show: (props:
|
|
5
|
+
show: (props: ToastProps) => string;
|
|
6
6
|
hide: (id: string) => void;
|
|
7
7
|
clearAll: () => void;
|
|
8
8
|
};
|
|
@@ -11,10 +11,7 @@ export const ToastContext = createContext<ToastControllerContextType>(
|
|
|
11
11
|
{} as ToastControllerContextType
|
|
12
12
|
);
|
|
13
13
|
|
|
14
|
-
export type ToastConfigContextType = Pick<
|
|
15
|
-
ToastContainerProps,
|
|
16
|
-
'position' | 'displayType'
|
|
17
|
-
>;
|
|
14
|
+
export type ToastConfigContextType = Pick<ToastContainerProps, 'displayType'>;
|
|
18
15
|
|
|
19
16
|
export const ToastConfigContext = createContext<ToastConfigContextType>(
|
|
20
17
|
{} as ToastConfigContextType
|
|
@@ -6,7 +6,6 @@ import ToastContainer from './ToastContainer';
|
|
|
6
6
|
import { ToastConfigContext, ToastContext } from './ToastContext';
|
|
7
7
|
import type { ToastControllerContextType } from './ToastContext';
|
|
8
8
|
import type { ToastContainerProps } from './types';
|
|
9
|
-
import { useDeprecation } from '../../utils/hooks';
|
|
10
9
|
|
|
11
10
|
type ToastProviderProps = {
|
|
12
11
|
/**
|
|
@@ -18,16 +17,7 @@ type ToastProviderProps = {
|
|
|
18
17
|
const ToastProvider = ({
|
|
19
18
|
children,
|
|
20
19
|
displayType = 'single',
|
|
21
|
-
position: _position,
|
|
22
20
|
}: ToastProviderProps) => {
|
|
23
|
-
const position: ToastContainerProps['position'] =
|
|
24
|
-
_position === undefined ? 'bottom' : _position;
|
|
25
|
-
|
|
26
|
-
useDeprecation(
|
|
27
|
-
"Toast's position prop is deprecated and will be removed in the next major release.\nPlease remove it.",
|
|
28
|
-
_position !== undefined
|
|
29
|
-
);
|
|
30
|
-
|
|
31
21
|
const toastRef = useRef<ToastControllerContextType>(null);
|
|
32
22
|
// @ts-expect-error: TODO: @tungv Fix this type error
|
|
33
23
|
const [refState, setRefState] = useState<ToastControllerContextType>(null);
|
|
@@ -38,21 +28,14 @@ const ToastProvider = ({
|
|
|
38
28
|
}
|
|
39
29
|
}, []);
|
|
40
30
|
|
|
41
|
-
const config = useMemo(
|
|
42
|
-
() => ({ displayType, position }),
|
|
43
|
-
[displayType, position]
|
|
44
|
-
);
|
|
31
|
+
const config = useMemo(() => ({ displayType }), [displayType]);
|
|
45
32
|
|
|
46
33
|
return (
|
|
47
34
|
<ToastContext.Provider value={refState}>
|
|
48
35
|
<View style={{ flex: 1 }}>
|
|
49
36
|
{refState ? children : null}
|
|
50
37
|
<ToastConfigContext.Provider value={config}>
|
|
51
|
-
<ToastContainer
|
|
52
|
-
ref={toastRef}
|
|
53
|
-
displayType={displayType}
|
|
54
|
-
position={position}
|
|
55
|
-
/>
|
|
38
|
+
<ToastContainer ref={toastRef} displayType={displayType} />
|
|
56
39
|
</ToastConfigContext.Provider>
|
|
57
40
|
</View>
|
|
58
41
|
</ToastContext.Provider>
|
|
@@ -10,21 +10,18 @@ describe('ToastContainer', () => {
|
|
|
10
10
|
});
|
|
11
11
|
|
|
12
12
|
it.each`
|
|
13
|
-
displayType
|
|
14
|
-
${'single'}
|
|
15
|
-
${'stack'}
|
|
16
|
-
${'single'}
|
|
17
|
-
${'stack'}
|
|
18
|
-
`(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
expect(toJSON()).toMatchSnapshot();
|
|
26
|
-
}
|
|
27
|
-
);
|
|
13
|
+
displayType
|
|
14
|
+
${'single'}
|
|
15
|
+
${'stack'}
|
|
16
|
+
${'single'}
|
|
17
|
+
${'stack'}
|
|
18
|
+
`('renders correctly with displayType: $displayType', ({ displayType }) => {
|
|
19
|
+
const { toJSON } = renderWithTheme(
|
|
20
|
+
<ToastContainer displayType={displayType} />
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
expect(toJSON()).toMatchSnapshot();
|
|
24
|
+
});
|
|
28
25
|
|
|
29
26
|
it('show multiple toasts correctly when displayType is stack', () => {
|
|
30
27
|
const toastRef = createRef<ToastControllerContextType>();
|
|
@@ -113,7 +113,6 @@ exports[`Toast Icon render custom icon correctly 1`] = `
|
|
|
113
113
|
</View>
|
|
114
114
|
<View
|
|
115
115
|
pointerEvents="box-none"
|
|
116
|
-
position="bottom"
|
|
117
116
|
style={
|
|
118
117
|
[
|
|
119
118
|
{
|
|
@@ -305,7 +304,6 @@ exports[`Toast renders correctly when intent is error 1`] = `
|
|
|
305
304
|
</View>
|
|
306
305
|
<View
|
|
307
306
|
pointerEvents="box-none"
|
|
308
|
-
position="bottom"
|
|
309
307
|
style={
|
|
310
308
|
[
|
|
311
309
|
{
|
|
@@ -497,7 +495,6 @@ exports[`Toast renders correctly when intent is info 1`] = `
|
|
|
497
495
|
</View>
|
|
498
496
|
<View
|
|
499
497
|
pointerEvents="box-none"
|
|
500
|
-
position="bottom"
|
|
501
498
|
style={
|
|
502
499
|
[
|
|
503
500
|
{
|
|
@@ -662,7 +659,6 @@ exports[`Toast renders correctly when intent is notification 1`] = `
|
|
|
662
659
|
</View>
|
|
663
660
|
<View
|
|
664
661
|
pointerEvents="box-none"
|
|
665
|
-
position="bottom"
|
|
666
662
|
style={
|
|
667
663
|
[
|
|
668
664
|
{
|
|
@@ -827,7 +823,6 @@ exports[`Toast renders correctly when intent is snackbar 1`] = `
|
|
|
827
823
|
</View>
|
|
828
824
|
<View
|
|
829
825
|
pointerEvents="box-none"
|
|
830
|
-
position="bottom"
|
|
831
826
|
style={
|
|
832
827
|
[
|
|
833
828
|
{
|
|
@@ -1019,7 +1014,6 @@ exports[`Toast renders correctly when intent is success 1`] = `
|
|
|
1019
1014
|
</View>
|
|
1020
1015
|
<View
|
|
1021
1016
|
pointerEvents="box-none"
|
|
1022
|
-
position="bottom"
|
|
1023
1017
|
style={
|
|
1024
1018
|
[
|
|
1025
1019
|
{
|
|
@@ -1211,7 +1205,6 @@ exports[`Toast renders correctly when intent is warning 1`] = `
|
|
|
1211
1205
|
</View>
|
|
1212
1206
|
<View
|
|
1213
1207
|
pointerEvents="box-none"
|
|
1214
|
-
position="bottom"
|
|
1215
1208
|
style={
|
|
1216
1209
|
[
|
|
1217
1210
|
{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`ToastContainer renders correctly with displayType: single
|
|
3
|
+
exports[`ToastContainer renders correctly with displayType: single 1`] = `
|
|
4
4
|
<View
|
|
5
5
|
style={
|
|
6
6
|
{
|
|
@@ -10,7 +10,6 @@ exports[`ToastContainer renders correctly with displayType: single, position: bo
|
|
|
10
10
|
>
|
|
11
11
|
<View
|
|
12
12
|
pointerEvents="box-none"
|
|
13
|
-
position="bottom"
|
|
14
13
|
style={
|
|
15
14
|
[
|
|
16
15
|
{
|
|
@@ -30,7 +29,6 @@ exports[`ToastContainer renders correctly with displayType: single, position: bo
|
|
|
30
29
|
/>
|
|
31
30
|
<View
|
|
32
31
|
pointerEvents="box-none"
|
|
33
|
-
position="bottom"
|
|
34
32
|
style={
|
|
35
33
|
[
|
|
36
34
|
{
|
|
@@ -51,7 +49,7 @@ exports[`ToastContainer renders correctly with displayType: single, position: bo
|
|
|
51
49
|
</View>
|
|
52
50
|
`;
|
|
53
51
|
|
|
54
|
-
exports[`ToastContainer renders correctly with displayType: single
|
|
52
|
+
exports[`ToastContainer renders correctly with displayType: single 2`] = `
|
|
55
53
|
<View
|
|
56
54
|
style={
|
|
57
55
|
{
|
|
@@ -61,13 +59,12 @@ exports[`ToastContainer renders correctly with displayType: single, position: to
|
|
|
61
59
|
>
|
|
62
60
|
<View
|
|
63
61
|
pointerEvents="box-none"
|
|
64
|
-
position="top"
|
|
65
62
|
style={
|
|
66
63
|
[
|
|
67
64
|
{
|
|
68
65
|
"bottom": 0,
|
|
69
66
|
"elevation": 9999,
|
|
70
|
-
"flexDirection": "column",
|
|
67
|
+
"flexDirection": "column-reverse",
|
|
71
68
|
"left": 0,
|
|
72
69
|
"paddingHorizontal": 24,
|
|
73
70
|
"paddingVertical": 16,
|
|
@@ -81,7 +78,6 @@ exports[`ToastContainer renders correctly with displayType: single, position: to
|
|
|
81
78
|
/>
|
|
82
79
|
<View
|
|
83
80
|
pointerEvents="box-none"
|
|
84
|
-
position="bottom"
|
|
85
81
|
style={
|
|
86
82
|
[
|
|
87
83
|
{
|
|
@@ -102,7 +98,7 @@ exports[`ToastContainer renders correctly with displayType: single, position: to
|
|
|
102
98
|
</View>
|
|
103
99
|
`;
|
|
104
100
|
|
|
105
|
-
exports[`ToastContainer renders correctly with displayType: stack
|
|
101
|
+
exports[`ToastContainer renders correctly with displayType: stack 1`] = `
|
|
106
102
|
<View
|
|
107
103
|
style={
|
|
108
104
|
{
|
|
@@ -112,7 +108,6 @@ exports[`ToastContainer renders correctly with displayType: stack, position: bot
|
|
|
112
108
|
>
|
|
113
109
|
<View
|
|
114
110
|
pointerEvents="box-none"
|
|
115
|
-
position="bottom"
|
|
116
111
|
style={
|
|
117
112
|
[
|
|
118
113
|
{
|
|
@@ -132,7 +127,6 @@ exports[`ToastContainer renders correctly with displayType: stack, position: bot
|
|
|
132
127
|
/>
|
|
133
128
|
<View
|
|
134
129
|
pointerEvents="box-none"
|
|
135
|
-
position="bottom"
|
|
136
130
|
style={
|
|
137
131
|
[
|
|
138
132
|
{
|
|
@@ -153,7 +147,7 @@ exports[`ToastContainer renders correctly with displayType: stack, position: bot
|
|
|
153
147
|
</View>
|
|
154
148
|
`;
|
|
155
149
|
|
|
156
|
-
exports[`ToastContainer renders correctly with displayType: stack
|
|
150
|
+
exports[`ToastContainer renders correctly with displayType: stack 2`] = `
|
|
157
151
|
<View
|
|
158
152
|
style={
|
|
159
153
|
{
|
|
@@ -163,13 +157,12 @@ exports[`ToastContainer renders correctly with displayType: stack, position: top
|
|
|
163
157
|
>
|
|
164
158
|
<View
|
|
165
159
|
pointerEvents="box-none"
|
|
166
|
-
position="top"
|
|
167
160
|
style={
|
|
168
161
|
[
|
|
169
162
|
{
|
|
170
163
|
"bottom": 0,
|
|
171
164
|
"elevation": 9999,
|
|
172
|
-
"flexDirection": "column",
|
|
165
|
+
"flexDirection": "column-reverse",
|
|
173
166
|
"left": 0,
|
|
174
167
|
"paddingHorizontal": 24,
|
|
175
168
|
"paddingVertical": 16,
|
|
@@ -183,7 +176,6 @@ exports[`ToastContainer renders correctly with displayType: stack, position: top
|
|
|
183
176
|
/>
|
|
184
177
|
<View
|
|
185
178
|
pointerEvents="box-none"
|
|
186
|
-
position="bottom"
|
|
187
179
|
style={
|
|
188
180
|
[
|
|
189
181
|
{
|
|
@@ -72,10 +72,6 @@ export interface ToastContainerProps {
|
|
|
72
72
|
* Displays multiple toasts at a time or one by one.
|
|
73
73
|
*/
|
|
74
74
|
displayType?: 'single' | 'stack';
|
|
75
|
-
/**
|
|
76
|
-
* Position that the toast message will appear on the screen.
|
|
77
|
-
*/
|
|
78
|
-
position?: 'top' | 'bottom';
|
|
79
75
|
/**
|
|
80
76
|
* Additional style for toasts container.
|
|
81
77
|
*/
|
|
@@ -84,5 +80,5 @@ export interface ToastContainerProps {
|
|
|
84
80
|
|
|
85
81
|
export type ToastItemProps = {
|
|
86
82
|
id: string;
|
|
87
|
-
props:
|
|
83
|
+
props: ToastProps;
|
|
88
84
|
};
|
|
@@ -219,7 +219,6 @@ exports[`ToolbarGroup renders correctly with when align is center 1`] = `
|
|
|
219
219
|
</View>
|
|
220
220
|
<View
|
|
221
221
|
pointerEvents="box-none"
|
|
222
|
-
position="bottom"
|
|
223
222
|
style={
|
|
224
223
|
[
|
|
225
224
|
{
|
|
@@ -459,7 +458,6 @@ exports[`ToolbarGroup renders correctly with when align is left 1`] = `
|
|
|
459
458
|
</View>
|
|
460
459
|
<View
|
|
461
460
|
pointerEvents="box-none"
|
|
462
|
-
position="bottom"
|
|
463
461
|
style={
|
|
464
462
|
[
|
|
465
463
|
{
|
|
@@ -699,7 +697,6 @@ exports[`ToolbarGroup renders correctly with when align is right 1`] = `
|
|
|
699
697
|
</View>
|
|
700
698
|
<View
|
|
701
699
|
pointerEvents="box-none"
|
|
702
|
-
position="bottom"
|
|
703
700
|
style={
|
|
704
701
|
[
|
|
705
702
|
{
|
|
@@ -107,7 +107,6 @@ exports[`ToolbarItems renders correctly when disabled 1`] = `
|
|
|
107
107
|
</View>
|
|
108
108
|
<View
|
|
109
109
|
pointerEvents="box-none"
|
|
110
|
-
position="bottom"
|
|
111
110
|
style={
|
|
112
111
|
[
|
|
113
112
|
{
|
|
@@ -199,7 +198,6 @@ exports[`ToolbarItems renders correctly when intent is danger, icon is undefined
|
|
|
199
198
|
</View>
|
|
200
199
|
<View
|
|
201
200
|
pointerEvents="box-none"
|
|
202
|
-
position="bottom"
|
|
203
201
|
style={
|
|
204
202
|
[
|
|
205
203
|
{
|
|
@@ -291,7 +289,6 @@ exports[`ToolbarItems renders correctly when intent is info, icon is undefined,
|
|
|
291
289
|
</View>
|
|
292
290
|
<View
|
|
293
291
|
pointerEvents="box-none"
|
|
294
|
-
position="bottom"
|
|
295
292
|
style={
|
|
296
293
|
[
|
|
297
294
|
{
|
|
@@ -419,7 +416,6 @@ exports[`ToolbarItems renders correctly when intent is primary, icon is ai-outli
|
|
|
419
416
|
</View>
|
|
420
417
|
<View
|
|
421
418
|
pointerEvents="box-none"
|
|
422
|
-
position="bottom"
|
|
423
419
|
style={
|
|
424
420
|
[
|
|
425
421
|
{
|
|
@@ -547,7 +543,6 @@ exports[`ToolbarItems renders correctly when intent is primary, icon is ai-outli
|
|
|
547
543
|
</View>
|
|
548
544
|
<View
|
|
549
545
|
pointerEvents="box-none"
|
|
550
|
-
position="bottom"
|
|
551
546
|
style={
|
|
552
547
|
[
|
|
553
548
|
{
|
|
@@ -649,7 +644,6 @@ exports[`ToolbarItems renders correctly when intent is primary, icon is ai-outli
|
|
|
649
644
|
</View>
|
|
650
645
|
<View
|
|
651
646
|
pointerEvents="box-none"
|
|
652
|
-
position="bottom"
|
|
653
647
|
style={
|
|
654
648
|
[
|
|
655
649
|
{
|
|
@@ -741,7 +735,6 @@ exports[`ToolbarItems renders correctly when intent is success, icon is undefine
|
|
|
741
735
|
</View>
|
|
742
736
|
<View
|
|
743
737
|
pointerEvents="box-none"
|
|
744
|
-
position="bottom"
|
|
745
738
|
style={
|
|
746
739
|
[
|
|
747
740
|
{
|
|
@@ -833,7 +826,6 @@ exports[`ToolbarItems renders correctly when intent is warning, icon is undefine
|
|
|
833
826
|
</View>
|
|
834
827
|
<View
|
|
835
828
|
pointerEvents="box-none"
|
|
836
|
-
position="bottom"
|
|
837
829
|
style={
|
|
838
830
|
[
|
|
839
831
|
{
|
|
@@ -29,7 +29,6 @@ exports[`StyledBody has body intent style 1`] = `
|
|
|
29
29
|
</Text>
|
|
30
30
|
<View
|
|
31
31
|
pointerEvents="box-none"
|
|
32
|
-
position="bottom"
|
|
33
32
|
style={
|
|
34
33
|
[
|
|
35
34
|
{
|
|
@@ -79,7 +78,6 @@ exports[`StyledBody has danger intent style 1`] = `
|
|
|
79
78
|
</Text>
|
|
80
79
|
<View
|
|
81
80
|
pointerEvents="box-none"
|
|
82
|
-
position="bottom"
|
|
83
81
|
style={
|
|
84
82
|
[
|
|
85
83
|
{
|
|
@@ -129,7 +127,6 @@ exports[`StyledBody has info intent style 1`] = `
|
|
|
129
127
|
</Text>
|
|
130
128
|
<View
|
|
131
129
|
pointerEvents="box-none"
|
|
132
|
-
position="bottom"
|
|
133
130
|
style={
|
|
134
131
|
[
|
|
135
132
|
{
|
|
@@ -179,7 +176,6 @@ exports[`StyledBody has inverted intent style 1`] = `
|
|
|
179
176
|
</Text>
|
|
180
177
|
<View
|
|
181
178
|
pointerEvents="box-none"
|
|
182
|
-
position="bottom"
|
|
183
179
|
style={
|
|
184
180
|
[
|
|
185
181
|
{
|
|
@@ -229,7 +225,6 @@ exports[`StyledBody has primary intent style 1`] = `
|
|
|
229
225
|
</Text>
|
|
230
226
|
<View
|
|
231
227
|
pointerEvents="box-none"
|
|
232
|
-
position="bottom"
|
|
233
228
|
style={
|
|
234
229
|
[
|
|
235
230
|
{
|
|
@@ -279,7 +274,6 @@ exports[`StyledBody has regular variant and neutral typeface and $fontWeight fon
|
|
|
279
274
|
</Text>
|
|
280
275
|
<View
|
|
281
276
|
pointerEvents="box-none"
|
|
282
|
-
position="bottom"
|
|
283
277
|
style={
|
|
284
278
|
[
|
|
285
279
|
{
|
|
@@ -329,7 +323,6 @@ exports[`StyledBody has regular variant and playful typeface and $fontWeight fon
|
|
|
329
323
|
</Text>
|
|
330
324
|
<View
|
|
331
325
|
pointerEvents="box-none"
|
|
332
|
-
position="bottom"
|
|
333
326
|
style={
|
|
334
327
|
[
|
|
335
328
|
{
|
|
@@ -379,7 +372,6 @@ exports[`StyledBody has regular-bold variant and neutral typeface and $fontWeigh
|
|
|
379
372
|
</Text>
|
|
380
373
|
<View
|
|
381
374
|
pointerEvents="box-none"
|
|
382
|
-
position="bottom"
|
|
383
375
|
style={
|
|
384
376
|
[
|
|
385
377
|
{
|
|
@@ -429,7 +421,6 @@ exports[`StyledBody has regular-bold variant and playful typeface and $fontWeigh
|
|
|
429
421
|
</Text>
|
|
430
422
|
<View
|
|
431
423
|
pointerEvents="box-none"
|
|
432
|
-
position="bottom"
|
|
433
424
|
style={
|
|
434
425
|
[
|
|
435
426
|
{
|
|
@@ -479,7 +470,6 @@ exports[`StyledBody has small variant and neutral typeface and $fontWeight fontW
|
|
|
479
470
|
</Text>
|
|
480
471
|
<View
|
|
481
472
|
pointerEvents="box-none"
|
|
482
|
-
position="bottom"
|
|
483
473
|
style={
|
|
484
474
|
[
|
|
485
475
|
{
|
|
@@ -529,7 +519,6 @@ exports[`StyledBody has small variant and playful typeface and $fontWeight fontW
|
|
|
529
519
|
</Text>
|
|
530
520
|
<View
|
|
531
521
|
pointerEvents="box-none"
|
|
532
|
-
position="bottom"
|
|
533
522
|
style={
|
|
534
523
|
[
|
|
535
524
|
{
|
|
@@ -579,7 +568,6 @@ exports[`StyledBody has small-bold variant and neutral typeface and $fontWeight
|
|
|
579
568
|
</Text>
|
|
580
569
|
<View
|
|
581
570
|
pointerEvents="box-none"
|
|
582
|
-
position="bottom"
|
|
583
571
|
style={
|
|
584
572
|
[
|
|
585
573
|
{
|
|
@@ -629,7 +617,6 @@ exports[`StyledBody has small-bold variant and playful typeface and $fontWeight
|
|
|
629
617
|
</Text>
|
|
630
618
|
<View
|
|
631
619
|
pointerEvents="box-none"
|
|
632
|
-
position="bottom"
|
|
633
620
|
style={
|
|
634
621
|
[
|
|
635
622
|
{
|
|
@@ -679,7 +666,6 @@ exports[`StyledBody has subdued intent style 1`] = `
|
|
|
679
666
|
</Text>
|
|
680
667
|
<View
|
|
681
668
|
pointerEvents="box-none"
|
|
682
|
-
position="bottom"
|
|
683
669
|
style={
|
|
684
670
|
[
|
|
685
671
|
{
|
|
@@ -729,7 +715,6 @@ exports[`StyledBody has success intent style 1`] = `
|
|
|
729
715
|
</Text>
|
|
730
716
|
<View
|
|
731
717
|
pointerEvents="box-none"
|
|
732
|
-
position="bottom"
|
|
733
718
|
style={
|
|
734
719
|
[
|
|
735
720
|
{
|
|
@@ -779,7 +764,6 @@ exports[`StyledBody has warning intent style 1`] = `
|
|
|
779
764
|
</Text>
|
|
780
765
|
<View
|
|
781
766
|
pointerEvents="box-none"
|
|
782
|
-
position="bottom"
|
|
783
767
|
style={
|
|
784
768
|
[
|
|
785
769
|
{
|