@hero-design/rn 8.2.3 → 8.3.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.
@@ -0,0 +1,58 @@
1
+ import React from 'react';
2
+ import { Animated, useWindowDimensions } from 'react-native';
3
+
4
+ import {
5
+ StyledCarouselPaginatorAnimatedView,
6
+ StyledCarouselPaginator,
7
+ } from './StyledCarouselPaginator';
8
+ import { useTheme } from '../../../theme';
9
+
10
+ interface CarouselPaginatorProps {
11
+ numberOfSlides: number;
12
+ scrollX: Animated.Value;
13
+ }
14
+ const CarouselPaginator = ({
15
+ numberOfSlides,
16
+ scrollX,
17
+ }: CarouselPaginatorProps) => {
18
+ const { width } = useWindowDimensions();
19
+ const theme = useTheme();
20
+
21
+ return (
22
+ <StyledCarouselPaginator>
23
+ {new Array(numberOfSlides).fill('').map((_, index) => {
24
+ const inputRange = [
25
+ (index - 1) * width,
26
+ index * width,
27
+ (index + 1) * width,
28
+ ];
29
+
30
+ const indicatorWidth = scrollX.interpolate({
31
+ inputRange,
32
+ outputRange: [
33
+ theme.space.small,
34
+ theme.space.large,
35
+ theme.space.small,
36
+ ],
37
+ extrapolate: 'clamp',
38
+ });
39
+
40
+ const opacity = scrollX.interpolate({
41
+ inputRange,
42
+ outputRange: [0.5, 1, 0.5],
43
+ extrapolate: 'clamp',
44
+ });
45
+
46
+ return (
47
+ <StyledCarouselPaginatorAnimatedView
48
+ indicatorWidth={indicatorWidth}
49
+ style={[{ width: indicatorWidth, opacity }]}
50
+ key={index.toString()}
51
+ />
52
+ );
53
+ })}
54
+ </StyledCarouselPaginator>
55
+ );
56
+ };
57
+
58
+ export default CarouselPaginator;
@@ -0,0 +1,55 @@
1
+ import { View } from 'react-native';
2
+ import styled from '@emotion/native';
3
+ import Typography from '../Typography';
4
+ import Image from '../Image';
5
+ import Box from '../Box';
6
+
7
+ const StyledCarousel = styled(View)<{
8
+ themeSlideBackground: string;
9
+ }>(({ themeSlideBackground }) => ({
10
+ zIndex: 99999,
11
+ position: 'absolute',
12
+ backgroundColor: themeSlideBackground,
13
+ top: 0,
14
+ bottom: 0,
15
+ right: 0,
16
+ left: 0,
17
+ }));
18
+
19
+ const StyledCarouselView = styled(View)(() => ({
20
+ justifyContent: 'space-between',
21
+ height: '100%',
22
+ }));
23
+
24
+ const StyledCarouselHeading = styled(Typography.Text)(({ theme }) => ({
25
+ marginTop: theme.__hd__.carousel.space.headingMarginTop,
26
+ marginBottom: theme.__hd__.carousel.space.headingMarginBottom,
27
+ fontFamily: theme.__hd__.carousel.fonts.heading,
28
+ fontSize: theme.__hd__.carousel.fontSizes.heading,
29
+ lineHeight: theme.__hd__.carousel.lineHeights.heading,
30
+ }));
31
+
32
+ const StyledCarouselImage = styled(Image)(() => ({
33
+ flex: 1,
34
+ width: '100%',
35
+ resizeMode: 'contain',
36
+ }));
37
+
38
+ const StyledCarouselContentWrapper = styled(Box)<{
39
+ width: number;
40
+ }>(({ width }) => ({
41
+ width,
42
+ }));
43
+
44
+ const StyledCarouselFooterWrapper = styled(Box)(() => ({
45
+ width: '100%',
46
+ }));
47
+
48
+ export {
49
+ StyledCarousel,
50
+ StyledCarouselView,
51
+ StyledCarouselHeading,
52
+ StyledCarouselImage,
53
+ StyledCarouselContentWrapper,
54
+ StyledCarouselFooterWrapper,
55
+ };
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import renderWithTheme from '../../../testHelpers/renderWithTheme';
3
+ import { StyledCarousel } from '../StyledCarousel';
4
+ import theme from '../../../theme';
5
+
6
+ describe('StyledCard', () => {
7
+ it('renders correct basic style', () => {
8
+ const { toJSON } = renderWithTheme(
9
+ <StyledCarousel themeSlideBackground={theme.colors.highlightedSurface} />
10
+ );
11
+ expect(toJSON()).toMatchSnapshot();
12
+ });
13
+ });
@@ -0,0 +1,21 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`StyledCard renders correct basic style 1`] = `
4
+ <View
5
+ style={
6
+ Array [
7
+ Object {
8
+ "backgroundColor": "#ece8ef",
9
+ "bottom": 0,
10
+ "left": 0,
11
+ "position": "absolute",
12
+ "right": 0,
13
+ "top": 0,
14
+ "zIndex": 99999,
15
+ },
16
+ undefined,
17
+ ]
18
+ }
19
+ themeSlideBackground="#ece8ef"
20
+ />
21
+ `;
@@ -0,0 +1,86 @@
1
+ import React from 'react';
2
+ import { fireEvent } from '@testing-library/react-native';
3
+
4
+ import renderWithTheme from '../../../testHelpers/renderWithTheme';
5
+ import Carousel from '..';
6
+ import Image from '../../Image';
7
+ import { theme } from '../../..';
8
+
9
+ const carouselData = [
10
+ {
11
+ image: 'https://picsum.photos/800/1200',
12
+ heading: 'Welcome to the new Employment Hero app',
13
+ body: 'Access your Work, Money and Benefits in the palm of your hand.',
14
+ background: theme.colors.highlightedSurface,
15
+ },
16
+ {
17
+ image: 'https://picsum.photos/800/1200',
18
+ content: <Image source={{ uri: 'https://picsum.photos/30' }} />,
19
+ heading: 'Same app with a new look!',
20
+ body: 'Our app now has a new bright clean modern look and feel with the same great features.',
21
+ background: theme.colors.decorativePrimarySurface,
22
+ },
23
+ {
24
+ image: 'https://picsum.photos/800/1200',
25
+ heading: 'Easier to get around',
26
+ body: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus vitae pulvinar quam, ac facilisis massa. Aliquam facilisis nisi eu justo dignissim, vel tempus justo iaculis.',
27
+ background: theme.colors.decorativePrimarySurface,
28
+ },
29
+ ];
30
+
31
+ describe('Carousel', () => {
32
+ it('renders basic carousel', async () => {
33
+ const onSkip = jest.fn();
34
+ const onFinish = jest.fn();
35
+
36
+ const { getByTestId, queryByText } = renderWithTheme(
37
+ <Carousel
38
+ testID="carousel"
39
+ items={carouselData}
40
+ onSkipPress={onSkip}
41
+ onFinishPress={onFinish}
42
+ />
43
+ );
44
+
45
+ expect(getByTestId('carousel')).toBeTruthy();
46
+
47
+ expect(queryByText('Skip')).toBeTruthy();
48
+
49
+ // Slide 1
50
+ expect(queryByText('Welcome to the new Employment Hero app')).toBeTruthy();
51
+ expect(
52
+ queryByText(
53
+ 'Access your Work, Money and Benefits in the palm of your hand.'
54
+ )
55
+ ).toBeTruthy();
56
+
57
+ // Slide 2
58
+ expect(queryByText('Same app with a new look!')).toBeTruthy();
59
+ expect(
60
+ queryByText(
61
+ 'Our app now has a new bright clean modern look and feel with the same great features.'
62
+ )
63
+ ).toBeTruthy();
64
+
65
+ // Slide 3
66
+ expect(queryByText('Easier to get around')).toBeTruthy();
67
+ expect(
68
+ queryByText(
69
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus vitae pulvinar quam, ac facilisis massa. Aliquam facilisis nisi eu justo dignissim, vel tempus justo iaculis.'
70
+ )
71
+ ).toBeTruthy();
72
+ });
73
+
74
+ it('should call skip call back when press skip', () => {
75
+ const onSkip = jest.fn();
76
+
77
+ const { queryByText } = renderWithTheme(
78
+ <Carousel testID="carousel" items={carouselData} onSkipPress={onSkip} />
79
+ );
80
+
81
+ expect(queryByText('Skip')).toBeTruthy();
82
+
83
+ fireEvent.press(queryByText('Skip'));
84
+ expect(onSkip).toBeCalled();
85
+ });
86
+ });
@@ -0,0 +1,176 @@
1
+ import React, { useCallback, useRef, useState } from 'react';
2
+ import {
3
+ Animated,
4
+ FlatList,
5
+ StyleProp,
6
+ useWindowDimensions,
7
+ ViewProps,
8
+ ViewStyle,
9
+ } from 'react-native';
10
+
11
+ import { CarouselData } from './types';
12
+ import CarouselPaginator from './CarouselPaginator';
13
+ import {
14
+ StyledCarousel,
15
+ StyledCarouselFooterWrapper,
16
+ StyledCarouselView,
17
+ } from './StyledCarousel';
18
+ import Button from '../Button';
19
+ import CarouselItem from './CarouselItem';
20
+
21
+ interface CarouselProps extends ViewProps {
22
+ /**
23
+ * Additional style.
24
+ */
25
+ style?: StyleProp<ViewStyle>;
26
+ /**
27
+ * Testing id of the component.
28
+ */
29
+ testID?: string;
30
+
31
+ /**
32
+ * Callback to be called when the user slides to the next slide.
33
+ */
34
+ onSlideChange?: (currentSlide?: CarouselData) => void;
35
+
36
+ /**
37
+ * Callback to be called when the user skips the intro carousel.
38
+ */
39
+ onSkipPress?: (currentSlide?: CarouselData) => void;
40
+
41
+ /**
42
+ * Callback to be called when the user finishes the intro carousel.
43
+ */
44
+ onFinishPress?: (currentSlide?: CarouselData) => void;
45
+
46
+ /**
47
+ * Carousel data.
48
+ */
49
+ items: CarouselData[];
50
+
51
+ /**
52
+ * Finish button label.
53
+ */
54
+ finishButtonLabel?: string;
55
+
56
+ /**
57
+ * Skip button label.
58
+ */
59
+ skipButtonLabel?: string;
60
+
61
+ /**
62
+ * Footer height.
63
+ */
64
+ footerHeight?: number;
65
+
66
+ /**
67
+ * Min content height.
68
+ */
69
+ minContentHeight?: number;
70
+ }
71
+
72
+ const Carousel = ({
73
+ items,
74
+ onFinishPress,
75
+ onSkipPress,
76
+ onSlideChange,
77
+ finishButtonLabel = `Let's go!`,
78
+ skipButtonLabel = 'Skip',
79
+ footerHeight = 70,
80
+ minContentHeight = 250,
81
+ ...nativeProps
82
+ }: CarouselProps) => {
83
+ const carouselRef = useRef(null);
84
+ const [currentSlideIndex, setCurrentSlideIndex] = useState(0);
85
+ const { width } = useWindowDimensions();
86
+
87
+ const scrollX = useRef(new Animated.Value(0)).current;
88
+
89
+ const visibleSlideChanged = useCallback(
90
+ ({ viewableItems }) => {
91
+ if (!viewableItems || (viewableItems && !viewableItems.length)) return;
92
+ const currentIndex = viewableItems[0].index;
93
+ setCurrentSlideIndex(viewableItems[0].index);
94
+ const currentSlide = items[currentIndex];
95
+ if (onSlideChange) {
96
+ onSlideChange(currentSlide);
97
+ }
98
+ },
99
+ [items, onSlideChange]
100
+ );
101
+
102
+ const skipCarousel = useCallback(() => {
103
+ const currentSlide = items[currentSlideIndex];
104
+ if (onSkipPress) {
105
+ onSkipPress(currentSlide);
106
+ }
107
+ }, [currentSlideIndex, onSkipPress, items]);
108
+
109
+ const finishCarousel = useCallback(() => {
110
+ const currentSlide = items[currentSlideIndex];
111
+ if (onFinishPress) {
112
+ onFinishPress(currentSlide);
113
+ }
114
+ }, [onFinishPress, items, currentSlideIndex]);
115
+
116
+ const viewConfig = useRef({ viewAreaCoveragePercentThreshold: 50 }).current;
117
+
118
+ const isLastSlide = currentSlideIndex === items.length - 1;
119
+
120
+ return (
121
+ <StyledCarousel
122
+ themeSlideBackground={items[currentSlideIndex].background}
123
+ {...nativeProps}
124
+ >
125
+ <StyledCarouselView>
126
+ <FlatList
127
+ horizontal
128
+ showsHorizontalScrollIndicator={false}
129
+ pagingEnabled
130
+ bounces={false}
131
+ data={items}
132
+ onViewableItemsChanged={visibleSlideChanged}
133
+ viewabilityConfig={viewConfig}
134
+ scrollEventThrottle={32}
135
+ ref={carouselRef}
136
+ onScroll={Animated.event(
137
+ [{ nativeEvent: { contentOffset: { x: scrollX } } }],
138
+ { useNativeDriver: false }
139
+ )}
140
+ renderItem={({ item }) => {
141
+ if (!item) return null;
142
+
143
+ const { image, heading, body, content } = item;
144
+
145
+ return (
146
+ <CarouselItem
147
+ image={image}
148
+ heading={heading}
149
+ body={body}
150
+ content={content}
151
+ minHeight={minContentHeight}
152
+ width={width}
153
+ />
154
+ );
155
+ }}
156
+ />
157
+ <StyledCarouselFooterWrapper
158
+ paddingHorizontal="large"
159
+ flexDirection="row"
160
+ justifyContent="space-between"
161
+ style={{ height: footerHeight }}
162
+ >
163
+ <Button
164
+ variant={isLastSlide ? 'filled' : 'text'}
165
+ intent="primary"
166
+ onPress={isLastSlide ? finishCarousel : skipCarousel}
167
+ text={isLastSlide ? finishButtonLabel : skipButtonLabel}
168
+ />
169
+ <CarouselPaginator numberOfSlides={items.length} scrollX={scrollX} />
170
+ </StyledCarouselFooterWrapper>
171
+ </StyledCarouselView>
172
+ </StyledCarousel>
173
+ );
174
+ };
175
+
176
+ export default Carousel;
@@ -0,0 +1,10 @@
1
+ import { ReactNode } from 'react';
2
+ import { ImageSourcePropType } from 'react-native';
3
+
4
+ export type CarouselData = {
5
+ image: ImageSourcePropType | string;
6
+ content?: ReactNode;
7
+ heading: string;
8
+ body?: string;
9
+ background: string;
10
+ };
package/src/index.ts CHANGED
@@ -21,6 +21,7 @@ import BottomSheet from './components/BottomSheet';
21
21
  import Box from './components/Box';
22
22
  import Button from './components/Button';
23
23
  import Calendar from './components/Calendar';
24
+ import Carousel from './components/Carousel';
24
25
  import Card from './components/Card';
25
26
  import Collapse from './components/Collapse';
26
27
  import Checkbox from './components/Checkbox';
@@ -76,6 +77,7 @@ export {
76
77
  Button,
77
78
  Calendar,
78
79
  Card,
80
+ Carousel,
79
81
  Collapse,
80
82
  Checkbox,
81
83
  ContentNavigator,
@@ -253,6 +253,33 @@ Object {
253
253
  "indicatorWidth": 16,
254
254
  },
255
255
  },
256
+ "carousel": Object {
257
+ "colors": Object {
258
+ "paginatorBackgroundColor": "#401960",
259
+ },
260
+ "fontSizes": Object {
261
+ "heading": 32,
262
+ },
263
+ "fonts": Object {
264
+ "heading": "RebondGrotesque-SemiBold",
265
+ },
266
+ "lineHeights": Object {
267
+ "heading": 32,
268
+ },
269
+ "radii": Object {
270
+ "paginatorBorderRadius": 999,
271
+ },
272
+ "sizes": Object {
273
+ "indicatorWidth": 16,
274
+ "paginatorHeight": 8,
275
+ "paginatorWidth": 8,
276
+ },
277
+ "space": Object {
278
+ "headingMarginBottom": 16,
279
+ "headingMarginTop": 8,
280
+ "paginatorMarginHorizontal": 8,
281
+ },
282
+ },
256
283
  "checkbox": Object {
257
284
  "borderWidths": Object {
258
285
  "icon": 2,
@@ -0,0 +1,39 @@
1
+ import type { GlobalTheme } from '../global';
2
+
3
+ const getCarouselTheme = (theme: GlobalTheme) => {
4
+ const colors = {
5
+ paginatorBackgroundColor: theme.colors.primary,
6
+ };
7
+
8
+ const space = {
9
+ headingMarginTop: theme.space.small,
10
+ headingMarginBottom: theme.space.medium,
11
+ paginatorMarginHorizontal: theme.space.small,
12
+ };
13
+
14
+ const sizes = {
15
+ indicatorWidth: theme.sizes.medium,
16
+ paginatorHeight: theme.sizes.small,
17
+ paginatorWidth: theme.sizes.small,
18
+ };
19
+
20
+ const radii = {
21
+ paginatorBorderRadius: theme.radii.rounded,
22
+ };
23
+
24
+ const fontSizes = {
25
+ heading: theme.fontSizes.xxxxxlarge,
26
+ };
27
+
28
+ const fonts = {
29
+ heading: theme.fonts.playful.semiBold,
30
+ };
31
+
32
+ const lineHeights = {
33
+ heading: theme.lineHeights.xxxlarge,
34
+ };
35
+
36
+ return { colors, sizes, radii, space, fonts, fontSizes, lineHeights };
37
+ };
38
+
39
+ export default getCarouselTheme;
@@ -10,6 +10,7 @@ import getBottomSheetTheme from './components/bottomSheet';
10
10
  import getButtonTheme from './components/button';
11
11
  import getCalendarTheme from './components/calendar';
12
12
  import getCardTheme from './components/card';
13
+ import getCarouselTheme from './components/carousel';
13
14
  import getCheckboxTheme from './components/checkbox';
14
15
  import getContentNavigatorTheme from './components/contentNavigator';
15
16
  import getDatePickerTheme from './components/datePicker';
@@ -53,6 +54,7 @@ type Theme = GlobalTheme & {
53
54
  button: ReturnType<typeof getButtonTheme>;
54
55
  calendar: ReturnType<typeof getCalendarTheme>;
55
56
  card: ReturnType<typeof getCardTheme>;
57
+ carousel: ReturnType<typeof getCarouselTheme>;
56
58
  checkbox: ReturnType<typeof getCheckboxTheme>;
57
59
  contentNavigator: ReturnType<typeof getContentNavigatorTheme>;
58
60
  datePicker: ReturnType<typeof getDatePickerTheme>;
@@ -102,6 +104,7 @@ const getTheme = (
102
104
  button: getButtonTheme(globalTheme),
103
105
  calendar: getCalendarTheme(globalTheme),
104
106
  card: getCardTheme(globalTheme),
107
+ carousel: getCarouselTheme(globalTheme),
105
108
  checkbox: getCheckboxTheme(globalTheme),
106
109
  contentNavigator: getContentNavigatorTheme(globalTheme),
107
110
  datePicker: getDatePickerTheme(globalTheme),
@@ -0,0 +1,7 @@
1
+ import { CarouselData } from './types';
2
+ interface CarouselItemProps extends Omit<CarouselData, 'background'> {
3
+ width: number;
4
+ minHeight: number;
5
+ }
6
+ declare const CarouselItem: ({ width, image, content, heading, body, minHeight, }: CarouselItemProps) => JSX.Element;
7
+ export default CarouselItem;
@@ -0,0 +1,16 @@
1
+ import { Animated, View } from 'react-native';
2
+ declare const StyledCarouselPaginator: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ as?: import("react").ElementType<any> | undefined;
5
+ }, {}, {
6
+ ref?: import("react").Ref<View> | undefined;
7
+ }>;
8
+ declare const StyledCarouselPaginatorAnimatedView: import("@emotion/native").StyledComponent<Animated.AnimatedProps<import("react-native").ViewProps & import("react").RefAttributes<View>> & {
9
+ children?: import("react").ReactNode;
10
+ } & {
11
+ theme?: import("@emotion/react").Theme | undefined;
12
+ as?: import("react").ElementType<any> | undefined;
13
+ } & {
14
+ indicatorWidth: Animated.AnimatedInterpolation;
15
+ }, {}, {}>;
16
+ export { StyledCarouselPaginator, StyledCarouselPaginatorAnimatedView };
@@ -0,0 +1,7 @@
1
+ import { Animated } from 'react-native';
2
+ interface CarouselPaginatorProps {
3
+ numberOfSlides: number;
4
+ scrollX: Animated.Value;
5
+ }
6
+ declare const CarouselPaginator: ({ numberOfSlides, scrollX, }: CarouselPaginatorProps) => JSX.Element;
7
+ export default CarouselPaginator;
@@ -0,0 +1,34 @@
1
+ import { View } from 'react-native';
2
+ declare const StyledCarousel: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ as?: import("react").ElementType<any> | undefined;
5
+ } & {
6
+ themeSlideBackground: string;
7
+ }, {}, {
8
+ ref?: import("react").Ref<View> | undefined;
9
+ }>;
10
+ declare const StyledCarouselView: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
11
+ theme?: import("@emotion/react").Theme | undefined;
12
+ as?: import("react").ElementType<any> | undefined;
13
+ }, {}, {
14
+ ref?: import("react").Ref<View> | undefined;
15
+ }>;
16
+ declare const StyledCarouselHeading: import("@emotion/native").StyledComponent<import("../..").TextProps & {
17
+ theme?: import("@emotion/react").Theme | undefined;
18
+ as?: import("react").ElementType<any> | undefined;
19
+ }, {}, {}>;
20
+ declare const StyledCarouselImage: import("@emotion/native").StyledComponent<import("../Image").ImageProps & {
21
+ theme?: import("@emotion/react").Theme | undefined;
22
+ as?: import("react").ElementType<any> | undefined;
23
+ }, {}, {}>;
24
+ declare const StyledCarouselContentWrapper: import("@emotion/native").StyledComponent<import("../Box").BoxProps & {
25
+ theme?: import("@emotion/react").Theme | undefined;
26
+ as?: import("react").ElementType<any> | undefined;
27
+ } & {
28
+ width: number;
29
+ }, {}, {}>;
30
+ declare const StyledCarouselFooterWrapper: import("@emotion/native").StyledComponent<import("../Box").BoxProps & {
31
+ theme?: import("@emotion/react").Theme | undefined;
32
+ as?: import("react").ElementType<any> | undefined;
33
+ }, {}, {}>;
34
+ export { StyledCarousel, StyledCarouselView, StyledCarouselHeading, StyledCarouselImage, StyledCarouselContentWrapper, StyledCarouselFooterWrapper, };
@@ -0,0 +1,46 @@
1
+ import { StyleProp, ViewProps, ViewStyle } from 'react-native';
2
+ import { CarouselData } from './types';
3
+ interface CarouselProps extends ViewProps {
4
+ /**
5
+ * Additional style.
6
+ */
7
+ style?: StyleProp<ViewStyle>;
8
+ /**
9
+ * Testing id of the component.
10
+ */
11
+ testID?: string;
12
+ /**
13
+ * Callback to be called when the user slides to the next slide.
14
+ */
15
+ onSlideChange?: (currentSlide?: CarouselData) => void;
16
+ /**
17
+ * Callback to be called when the user skips the intro carousel.
18
+ */
19
+ onSkipPress?: (currentSlide?: CarouselData) => void;
20
+ /**
21
+ * Callback to be called when the user finishes the intro carousel.
22
+ */
23
+ onFinishPress?: (currentSlide?: CarouselData) => void;
24
+ /**
25
+ * Carousel data.
26
+ */
27
+ items: CarouselData[];
28
+ /**
29
+ * Finish button label.
30
+ */
31
+ finishButtonLabel?: string;
32
+ /**
33
+ * Skip button label.
34
+ */
35
+ skipButtonLabel?: string;
36
+ /**
37
+ * Footer height.
38
+ */
39
+ footerHeight?: number;
40
+ /**
41
+ * Min content height.
42
+ */
43
+ minContentHeight?: number;
44
+ }
45
+ declare const Carousel: ({ items, onFinishPress, onSkipPress, onSlideChange, finishButtonLabel, skipButtonLabel, footerHeight, minContentHeight, ...nativeProps }: CarouselProps) => JSX.Element;
46
+ export default Carousel;
@@ -0,0 +1,9 @@
1
+ import { ReactNode } from 'react';
2
+ import { ImageSourcePropType } from 'react-native';
3
+ export declare type CarouselData = {
4
+ image: ImageSourcePropType | string;
5
+ content?: ReactNode;
6
+ heading: string;
7
+ body?: string;
8
+ background: string;
9
+ };
package/types/index.d.ts CHANGED
@@ -10,6 +10,7 @@ import BottomSheet from './components/BottomSheet';
10
10
  import Box from './components/Box';
11
11
  import Button from './components/Button';
12
12
  import Calendar from './components/Calendar';
13
+ import Carousel from './components/Carousel';
13
14
  import Card from './components/Card';
14
15
  import Collapse from './components/Collapse';
15
16
  import Checkbox from './components/Checkbox';
@@ -40,5 +41,5 @@ import Toolbar from './components/Toolbar';
40
41
  import Typography from './components/Typography';
41
42
  import RefreshControl from './components/RefreshControl';
42
43
  import RichTextEditor from './components/RichTextEditor';
43
- export { theme, getTheme, useTheme, scale, ThemeProvider, ThemeSwitcher, swagSystemPalette, workSystemPalette, jobsSystemPalette, walletSystemPalette, eBensSystemPalette, Accordion, Alert, Attachment, Avatar, useAvatarColors, Badge, BottomNavigation, BottomSheet, Box, Button, Calendar, Card, Collapse, Checkbox, ContentNavigator, DatePicker, Divider, Drawer, Empty, FAB, Icon, Image, List, PinInput, Progress, Slider, Spinner, Swipeable, Radio, SectionHeading, Select, Switch, Tabs, Tag, TextInput, TimePicker, Toast, Toolbar, Typography, RefreshControl, RichTextEditor, };
44
+ export { theme, getTheme, useTheme, scale, ThemeProvider, ThemeSwitcher, swagSystemPalette, workSystemPalette, jobsSystemPalette, walletSystemPalette, eBensSystemPalette, Accordion, Alert, Attachment, Avatar, useAvatarColors, Badge, BottomNavigation, BottomSheet, Box, Button, Calendar, Card, Carousel, Collapse, Checkbox, ContentNavigator, DatePicker, Divider, Drawer, Empty, FAB, Icon, Image, List, PinInput, Progress, Slider, Spinner, Swipeable, Radio, SectionHeading, Select, Switch, Tabs, Tag, TextInput, TimePicker, Toast, Toolbar, Typography, RefreshControl, RichTextEditor, };
44
45
  export * from './types';