react-native-app-onboard 0.1.1

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.
Files changed (80) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +187 -0
  3. package/lib/commonjs/components/CustomPages.js +134 -0
  4. package/lib/commonjs/components/CustomPages.js.map +1 -0
  5. package/lib/commonjs/components/OnboardingPages.js +157 -0
  6. package/lib/commonjs/components/OnboardingPages.js.map +1 -0
  7. package/lib/commonjs/components/Page.js +60 -0
  8. package/lib/commonjs/components/Page.js.map +1 -0
  9. package/lib/commonjs/components/Pagination.js +94 -0
  10. package/lib/commonjs/components/Pagination.js.map +1 -0
  11. package/lib/commonjs/components/Swiper.js +56 -0
  12. package/lib/commonjs/components/Swiper.js.map +1 -0
  13. package/lib/commonjs/components/button.js +57 -0
  14. package/lib/commonjs/components/button.js.map +1 -0
  15. package/lib/commonjs/components/index.js +17 -0
  16. package/lib/commonjs/components/index.js.map +1 -0
  17. package/lib/commonjs/context/OnboardingContext.js +65 -0
  18. package/lib/commonjs/context/OnboardingContext.js.map +1 -0
  19. package/lib/commonjs/hooks/useOnboarding.js +18 -0
  20. package/lib/commonjs/hooks/useOnboarding.js.map +1 -0
  21. package/lib/commonjs/index.js +26 -0
  22. package/lib/commonjs/index.js.map +1 -0
  23. package/lib/commonjs/types/index.js +6 -0
  24. package/lib/commonjs/types/index.js.map +1 -0
  25. package/lib/module/components/CustomPages.js +126 -0
  26. package/lib/module/components/CustomPages.js.map +1 -0
  27. package/lib/module/components/OnboardingPages.js +147 -0
  28. package/lib/module/components/OnboardingPages.js.map +1 -0
  29. package/lib/module/components/Page.js +53 -0
  30. package/lib/module/components/Page.js.map +1 -0
  31. package/lib/module/components/Pagination.js +87 -0
  32. package/lib/module/components/Pagination.js.map +1 -0
  33. package/lib/module/components/Swiper.js +48 -0
  34. package/lib/module/components/Swiper.js.map +1 -0
  35. package/lib/module/components/button.js +49 -0
  36. package/lib/module/components/button.js.map +1 -0
  37. package/lib/module/components/index.js +2 -0
  38. package/lib/module/components/index.js.map +1 -0
  39. package/lib/module/context/OnboardingContext.js +57 -0
  40. package/lib/module/context/OnboardingContext.js.map +1 -0
  41. package/lib/module/hooks/useOnboarding.js +10 -0
  42. package/lib/module/hooks/useOnboarding.js.map +1 -0
  43. package/lib/module/index.js +13 -0
  44. package/lib/module/index.js.map +1 -0
  45. package/lib/module/types/index.js +2 -0
  46. package/lib/module/types/index.js.map +1 -0
  47. package/lib/typescript/src/components/CustomPages.d.ts +21 -0
  48. package/lib/typescript/src/components/CustomPages.d.ts.map +1 -0
  49. package/lib/typescript/src/components/OnboardingPages.d.ts +15 -0
  50. package/lib/typescript/src/components/OnboardingPages.d.ts.map +1 -0
  51. package/lib/typescript/src/components/Page.d.ts +17 -0
  52. package/lib/typescript/src/components/Page.d.ts.map +1 -0
  53. package/lib/typescript/src/components/Pagination.d.ts +29 -0
  54. package/lib/typescript/src/components/Pagination.d.ts.map +1 -0
  55. package/lib/typescript/src/components/Swiper.d.ts +4 -0
  56. package/lib/typescript/src/components/Swiper.d.ts.map +1 -0
  57. package/lib/typescript/src/components/button.d.ts +12 -0
  58. package/lib/typescript/src/components/button.d.ts.map +1 -0
  59. package/lib/typescript/src/components/index.d.ts +2 -0
  60. package/lib/typescript/src/components/index.d.ts.map +1 -0
  61. package/lib/typescript/src/context/OnboardingContext.d.ts +28 -0
  62. package/lib/typescript/src/context/OnboardingContext.d.ts.map +1 -0
  63. package/lib/typescript/src/hooks/useOnboarding.d.ts +12 -0
  64. package/lib/typescript/src/hooks/useOnboarding.d.ts.map +1 -0
  65. package/lib/typescript/src/index.d.ts +5 -0
  66. package/lib/typescript/src/index.d.ts.map +1 -0
  67. package/lib/typescript/src/types/index.d.ts +42 -0
  68. package/lib/typescript/src/types/index.d.ts.map +1 -0
  69. package/package.json +160 -0
  70. package/src/components/CustomPages.tsx +160 -0
  71. package/src/components/OnboardingPages.tsx +173 -0
  72. package/src/components/Page.tsx +90 -0
  73. package/src/components/Pagination.tsx +151 -0
  74. package/src/components/Swiper.tsx +56 -0
  75. package/src/components/button.tsx +74 -0
  76. package/src/components/index.ts +1 -0
  77. package/src/context/OnboardingContext.tsx +95 -0
  78. package/src/hooks/useOnboarding.tsx +12 -0
  79. package/src/index.tsx +18 -0
  80. package/src/types/index.ts +40 -0
package/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Junius Lekgwara
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is
9
+ furnished to do so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all
12
+ copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,187 @@
1
+ # react-native-app-onboard
2
+ [![npm](https://img.shields.io/npm/v/react-native-app-onboard.svg)](https://www.npmjs.com/package/react-native-app-onboard) [![GitHub stars](https://img.shields.io/github/stars/julekgwa/react-native-app-onboard.svg?style=social&label=Stars)](https://github.com/julekgwa/react-native-app-onboard) [![gzip size](http://img.badgesize.io/https://unpkg.com/react-native-app-onboard/src/index.tsx?compression=gzip)](https://unpkg.com/react-native-app-onboard/dist/index.js) ![npm](https://img.shields.io/npm/dw/react-native-app-onboard)
3
+
4
+ React Native App Onboard is a customizable, easy-to-use, and efficient library for creating compelling onboarding experiences for your React Native applications. It provides smooth, fluid transitions and animations, with a focus on simplicity and usability.
5
+
6
+ | ![](example/assets/IMG_2179.PNG) | ![](example/assets/IMG_2180.PNG) | ![](example/assets/IMG_2181.PNG) |
7
+ | --------------------- | --------------------- | ------------------ |
8
+
9
+ ## Installation
10
+
11
+ ```sh
12
+ yarn add react-native-app-onboard
13
+ ```
14
+
15
+ ## Usage
16
+
17
+ ```jsx
18
+ import React from 'react';
19
+ import { Onboarding } from 'react-native-app-onboard';
20
+
21
+ const App = () => {
22
+ return (
23
+ <Onboarding
24
+ pages={[
25
+ {
26
+ backgroundColor: '#140E17',
27
+ image: <Image source={require('./images/image1.png')} />,
28
+ title: 'Find petcare around your location',
29
+ subtitle:
30
+ 'Just turn on your location and you will find the nearest pet care you wish.',
31
+ },
32
+ {
33
+ backgroundColor: '#140E17',
34
+ image: <Image source={require('./images/image2.png')} />,
35
+ title: 'Let us give the best treatment',
36
+ subtitle: 'Get the best treatment for your animal with us',
37
+ },
38
+ {
39
+ backgroundColor: '#140E17',
40
+ image: <Image source={require('./images/image3.png')} />,
41
+ title: 'Book appointment with us!',
42
+ subtitle: 'What do you think? book our veterinarians now',
43
+ },
44
+ ]}
45
+ onDone={() => console.log('Onboarding completed')}
46
+ />
47
+ );
48
+ };
49
+
50
+ export default App;
51
+ ```
52
+
53
+ ## Props
54
+
55
+ ## Props
56
+
57
+ | Prop | Type | Default | Description |
58
+ |-----------------------------|-----------------------------------|---------|-----------------------------------------------------------------------------|
59
+ | `children` | `React.ReactNode[]` | | Optional. An array of child components to render within the onboarding component. |
60
+ | `nextLabel` | `string` \| `React.ReactNode` | | Optional. Custom label for the "Next" button. Can be a string or a React Node. |
61
+ | `skipLabel` | `string` \| `React.ReactNode` | | Optional. Custom label for the "Skip" button. Can be a string or a React Node. |
62
+ | `doneLabel` | `string` \| `React.ReactNode` | | Optional. Custom label for the "Done" button. Can be a string or a React Node. |
63
+ | `showSkip` | `boolean` | `false` | Optional. Determines whether the "Skip" button is shown. |
64
+ | `showNext` | `boolean` | `true` | Optional. Determines whether the "Next" button is shown. |
65
+ | `showDone` | `boolean` | `true` | Optional. Determines whether the "Done" button is shown. |
66
+ | `scrollAnimationDuration` | `number` | `500` | Optional. Duration of the scroll animation in milliseconds. Default is 500. |
67
+ | `useNativeDriver` | `boolean` | | Optional. Determines whether animations should use the native driver. |
68
+ | `onDone` | `() => void` | | Optional. Callback function that is called when the "Done" button is pressed. |
69
+ | `onSkip` | `() => void` | | Optional. Callback function that is called when the "Skip" button is pressed. |
70
+ | `showPagination` | `boolean` | `true` | Optional. Determines whether pagination indicators are shown. |
71
+ | `scrollEnabled` | `boolean` | `true` | Optional. Determines whether the onboarding screens are scrollable. |
72
+ | `customFooter` | `(props: { nextPage: () => void }) => React.ReactNode` | | Optional. Function that returns a custom footer component. Receives a `nextPage` function as a prop. |
73
+ | `paginationContainerStyle` | `StyleProp<ViewStyle>` | | Optional. Custom style for the pagination container. |
74
+ | `buttonRightContainerStyle` | `StyleProp<ViewStyle>` | | Optional. Custom style for the container of the button positioned on the right. |
75
+ | `buttonLeftContainerStyle` | `StyleProp<ViewStyle>` | | Optional. Custom style for the container of the button positioned on the left. |
76
+ | `dotsContainerStyle` | `StyleProp<ViewStyle>` | | Optional. Custom style for the dots container in the pagination. |
77
+ | `doneLabelStyle` | `StyleProp<TextStyle>` | | Optional. Custom style for the "Done" label. |
78
+ | `skipLabelStyle` | `StyleProp<TextStyle>` | | Optional. Custom style for the "Skip" label. |
79
+ | `nextLabelStyle` | `StyleProp<TextStyle>` | | Optional. Custom style for the "Next" label. |
80
+ | `containerStyle` | `StyleProp<ViewStyle>` | | Optional. Custom style for the main container of the onboarding component. |
81
+ | `imageContainerStyle` | `StyleProp<ViewStyle>` | | Optional. Custom style for the image container. |
82
+ | `titleContainerStyle` | `StyleProp<ViewStyle>` | | Optional. Custom style for the title container. |
83
+ | `titleStyle` | `StyleProp<TextStyle>` | | Optional. Custom style for the title text. |
84
+ | `subtitleStyle` | `StyleProp<TextStyle>` | | Optional. Custom style for the subtitle text. |
85
+ | `paginationPosition` | `'top'` \| `'bottom'` | | Optional. Determines the position of the pagination indicators. Can be either 'top' or 'bottom'. |
86
+ | `width` | `number` | | Optional. Custom width for the onboarding component. |
87
+ | `color` | `string` | | Optional. Color of the pagination dots. |
88
+ | `pages` | `Page[]` | | Optional. An array of [`Page`](#page-type) objects to render as the onboarding screens. |
89
+
90
+ ## Page Type
91
+
92
+ Each `Page` object in the `pages` prop should conform to the following structure:
93
+
94
+ | Property | Type | Required | Description |
95
+ |------------------------|---------------------------|----------|-----------------------------------------------------------------------------|
96
+ | `title` | `string` | Yes | The main title text for the page. |
97
+ | `subtitle` | `string` | Yes | The subtitle text for the page, providing additional information. |
98
+ | `image` | `React.ReactNode` | Yes | A React Node representing the image to be displayed on the page. |
99
+ | `backgroundColor` | `string` | Yes | The background color for the page. |
100
+ | `color` | `string` | No | Optional. The text color for the title and subtitle. |
101
+ | `width` | `number` | No | Optional. The width of the page. Can be used to adjust the page width. |
102
+ | `containerStyle` | `StyleProp<ViewStyle>` | No | Optional. Custom styles to be applied to the page's container view. |
103
+ | `imageContainerStyle` | `StyleProp<ViewStyle>` | No | Optional. Custom styles for the container of the image. |
104
+ | `titleContainerStyle` | `StyleProp<ViewStyle>` | No | Optional. Custom styles for the container of the title. |
105
+ | `titleStyle` | `StyleProp<TextStyle>` | No | Optional. Custom styles for the title text. |
106
+ | `subtitleStyle` | `StyleProp<TextStyle>` | No | Optional. Custom styles for the subtitle text. |
107
+
108
+ ### Example Page Object
109
+
110
+ ```json
111
+ {
112
+ "title": "Welcome to Our App",
113
+ "subtitle": "This is where your journey begins.",
114
+ "image": <ImageComponent />,
115
+ "backgroundColor": "#FFFFFF",
116
+ "color": "#000000",
117
+ "width": 300,
118
+ "containerStyle": {},
119
+ "imageContainerStyle": {},
120
+ "titleContainerStyle": {},
121
+ "titleStyle": {},
122
+ "subtitleStyle": {}
123
+ }
124
+ ```
125
+
126
+ ## Using the Onboarding Hook
127
+
128
+ To manage the state and navigation of the onboarding flow more effectively, you can utilize the custom `useOnboarding` hook. This hook provides a convenient way to access and modify the onboarding state, including the current page, whether scrolling is enabled, and functions to navigate through the onboarding screens.
129
+
130
+ ### Features Provided by the `useOnboarding` Hook
131
+
132
+ - **`currentPage`**: A state variable that tracks the current onboarding screen the user is viewing.
133
+ - **`setCurrentPage`**: A function to update the current page state.
134
+ - **`scrollEnabled`**: A boolean state that indicates whether the user can scroll through the onboarding screens.
135
+ - **`enableScroll`**: A function to enable or disable scrolling.
136
+ - **`flatListRef`**: A ref object for the underlying FlatList component, allowing for programmatic control of the scroll position.
137
+ - **`numberOfScreens`**: The total number of screens in the onboarding sequence.
138
+ - **`nextPage`**: A function to navigate to the next page in the onboarding sequence.
139
+ - **`scrollTo`**: A function that scrolls to a specific page in the onboarding flow.
140
+ - **`progress`**: A value representing the user's progress through the onboarding screens.
141
+ - **`isDone`**: A boolean state that indicates whether the user has completed the onboarding process.
142
+
143
+ ### Example Usage
144
+
145
+ Here's how you can use the `useOnboarding` hook within an onboarding screen component:
146
+
147
+ ```jsx
148
+ import React from 'react';
149
+ import { View, Button } from 'react-native';
150
+ import { useOnboarding } from './OnboardingContext';
151
+
152
+ const OnboardingScreen = () => {
153
+ const { nextPage, isDone } = useOnboarding();
154
+
155
+ return (
156
+ <View>
157
+ {/* Your screen content goes here */}
158
+ <Button
159
+ title={isDone ? 'Finish' : 'Next'}
160
+ onPress={nextPage}
161
+ />
162
+ </View>
163
+ );
164
+ };
165
+
166
+ export default OnboardingScreen;
167
+ ```
168
+
169
+ ## Acknowledgements
170
+
171
+ This component library draws inspiration from the [`react-native-onboarding-swiper`](https://www.npmjs.com/package/react-native-onboarding-swiper) package.
172
+
173
+ We thank the creators and contributors of `react-native-onboarding-swiper` for their work, which has been a valuable reference in the development of this library.
174
+
175
+
176
+ ## Contributing
177
+
178
+ See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
179
+
180
+ ## License
181
+
182
+ MIT
183
+
184
+ ---
185
+
186
+ Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)
187
+ ```
@@ -0,0 +1,134 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.CustomPages = void 0;
7
+ var _reactNative = require("react-native");
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _Pagination = require("./Pagination");
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
+ const {
12
+ width
13
+ } = _reactNative.Dimensions.get('window');
14
+ const CustomPages = ({
15
+ showPagination = true,
16
+ ...props
17
+ }) => {
18
+ return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
19
+ style: [styles.container]
20
+ }, showPagination && props.paginationPosition === 'top' && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, showPagination && props.customFooter && props.customFooter({
21
+ nextPage: props.nextPage
22
+ }), !props.customFooter && /*#__PURE__*/_react.default.createElement(_Pagination.Pagination, {
23
+ color: '#fff',
24
+ backgroundColor: '#333',
25
+ width: width,
26
+ onNext: props.nextPage,
27
+ onSkip: props.onSkip,
28
+ onDone: props.onDone,
29
+ showDone: props.showDone,
30
+ animatedValue: props.scrollX,
31
+ showSkip: props.showSkip,
32
+ numberOfScreens: props.numberOfScreens,
33
+ skipLabel: props.skipLabel,
34
+ nextLabel: props.nextLabel,
35
+ doneLabel: props.doneLabel,
36
+ paginationContainerStyle: props.paginationContainerStyle,
37
+ buttonRightContainerStyle: props.buttonRightContainerStyle,
38
+ buttonLeftContainerStyle: props.buttonLeftContainerStyle,
39
+ dotsContainerStyle: props.dotsContainerStyle,
40
+ doneLabelStyle: props.doneLabelStyle,
41
+ skipLabelStyle: props.skipLabelStyle,
42
+ nextLabelStyle: props.nextLabelStyle
43
+ })), /*#__PURE__*/_react.default.createElement(_reactNative.Animated.FlatList, {
44
+ ref: props.flatListRef,
45
+ data: _react.default.Children.toArray(props.children),
46
+ horizontal: true,
47
+ pagingEnabled: true,
48
+ showsHorizontalScrollIndicator: false,
49
+ scrollEnabled: props.scrollEnabled,
50
+ onScroll: _reactNative.Animated.event([{
51
+ nativeEvent: {
52
+ contentOffset: {
53
+ x: props.scrollX
54
+ }
55
+ }
56
+ }], {
57
+ useNativeDriver: false
58
+ }),
59
+ scrollEventThrottle: 1,
60
+ onMomentumScrollEnd: event => {
61
+ const pageIndex = Math.round(event.nativeEvent.contentOffset.x / width);
62
+ props.setPage(pageIndex || 0);
63
+ },
64
+ keyExtractor: (_, index) => index.toString(),
65
+ renderItem: ({
66
+ item,
67
+ index
68
+ }) => {
69
+ return /*#__PURE__*/_react.default.cloneElement(item, {
70
+ currentPage: props.currentPage,
71
+ numberOfScreens: props.numberOfScreens,
72
+ nextPage: props.nextPage,
73
+ index
74
+ });
75
+ }
76
+ }), showPagination && props.paginationPosition !== 'top' && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, showPagination && props.customFooter && props.customFooter({
77
+ nextPage: props.nextPage
78
+ }), !props.customFooter && /*#__PURE__*/_react.default.createElement(_Pagination.Pagination, {
79
+ color: '#fff',
80
+ backgroundColor: '#333',
81
+ width: width,
82
+ onNext: props.nextPage,
83
+ onSkip: props.onSkip,
84
+ onDone: props.onDone,
85
+ showDone: props.showDone,
86
+ animatedValue: props.scrollX,
87
+ showSkip: props.showSkip,
88
+ numberOfScreens: props.numberOfScreens,
89
+ skipLabel: props.skipLabel,
90
+ nextLabel: props.nextLabel,
91
+ doneLabel: props.doneLabel,
92
+ paginationContainerStyle: props.paginationContainerStyle,
93
+ buttonRightContainerStyle: props.buttonRightContainerStyle,
94
+ buttonLeftContainerStyle: props.buttonLeftContainerStyle,
95
+ dotsContainerStyle: props.dotsContainerStyle,
96
+ doneLabelStyle: props.doneLabelStyle,
97
+ skipLabelStyle: props.skipLabelStyle,
98
+ nextLabelStyle: props.nextLabelStyle
99
+ })));
100
+ };
101
+ exports.CustomPages = CustomPages;
102
+ const styles = _reactNative.StyleSheet.create({
103
+ container: {
104
+ flex: 1,
105
+ justifyContent: 'center',
106
+ alignItems: 'center'
107
+ },
108
+ screen: {
109
+ width,
110
+ justifyContent: 'center',
111
+ alignItems: 'center',
112
+ backgroundColor: 'blue'
113
+ },
114
+ pagination: {
115
+ flexDirection: 'row',
116
+ alignItems: 'center',
117
+ paddingVertical: 10,
118
+ paddingHorizontal: 20,
119
+ width
120
+ },
121
+ dot: {
122
+ height: 10,
123
+ width: 10,
124
+ borderRadius: 5,
125
+ backgroundColor: '#333',
126
+ margin: 5
127
+ },
128
+ dotsContainer: {
129
+ flexDirection: 'row',
130
+ flex: 1,
131
+ justifyContent: 'center'
132
+ }
133
+ });
134
+ //# sourceMappingURL=CustomPages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_react","_interopRequireDefault","_Pagination","e","__esModule","default","width","Dimensions","get","CustomPages","showPagination","props","createElement","View","style","styles","container","paginationPosition","Fragment","customFooter","nextPage","Pagination","color","backgroundColor","onNext","onSkip","onDone","showDone","animatedValue","scrollX","showSkip","numberOfScreens","skipLabel","nextLabel","doneLabel","paginationContainerStyle","buttonRightContainerStyle","buttonLeftContainerStyle","dotsContainerStyle","doneLabelStyle","skipLabelStyle","nextLabelStyle","Animated","FlatList","ref","flatListRef","data","React","Children","toArray","children","horizontal","pagingEnabled","showsHorizontalScrollIndicator","scrollEnabled","onScroll","event","nativeEvent","contentOffset","x","useNativeDriver","scrollEventThrottle","onMomentumScrollEnd","pageIndex","Math","round","setPage","keyExtractor","_","index","toString","renderItem","item","cloneElement","currentPage","exports","StyleSheet","create","flex","justifyContent","alignItems","screen","pagination","flexDirection","paddingVertical","paddingHorizontal","dot","height","borderRadius","margin","dotsContainer"],"sourceRoot":"../../../src","sources":["components/CustomPages.tsx"],"mappings":";;;;;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;IACzDC,yBAAyB,EAAEzB,KAAK,CAACyB,yBAA0B;IAC3DC,wBAAwB,EAAE1B,KAAK,CAAC0B,wBAAyB;IACzDC,kBAAkB,EAAE3B,KAAK,CAAC2B,kBAAmB;IAC7CC,cAAc,EAAE5B,KAAK,CAAC4B,cAAe;IACrCC,cAAc,EAAE7B,KAAK,CAAC6B,cAAe;IACrCC,cAAc,EAAE9B,KAAK,CAAC8B;EAAe,CACtC,CAEH,CAEA,CAAC;AAEX,CAAC;AAACkC,OAAA,CAAAlE,WAAA,GAAAA,WAAA;AAEF,MAAMM,MAAM,GAAG6D,uBAAU,CAACC,MAAM,CAAC;EAC/B7D,SAAS,EAAE;IACT8D,IAAI,EAAE,CAAC;IACPC,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE;EACd,CAAC;EACDC,MAAM,EAAE;IACN3E,KAAK;IACLyE,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE,QAAQ;IACpBzD,eAAe,EAAE;EACnB,CAAC;EACD2D,UAAU,EAAE;IACVC,aAAa,EAAE,KAAK;IACpBH,UAAU,EAAE,QAAQ;IACpBI,eAAe,EAAE,EAAE;IACnBC,iBAAiB,EAAE,EAAE;IACrB/E;EACF,CAAC;EACDgF,GAAG,EAAE;IACHC,MAAM,EAAE,EAAE;IACVjF,KAAK,EAAE,EAAE;IACTkF,YAAY,EAAE,CAAC;IACfjE,eAAe,EAAE,MAAM;IACvBkE,MAAM,EAAE;EACV,CAAC;EACDC,aAAa,EAAE;IACbP,aAAa,EAAE,KAAK;IACpBL,IAAI,EAAE,CAAC;IACPC,cAAc,EAAE;EAClB;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,157 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.OnboardingPages = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _tinycolor = _interopRequireDefault(require("tinycolor2"));
9
+ var _reactNative = require("react-native");
10
+ var _Pagination = require("./Pagination");
11
+ var _Page = require("./Page");
12
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
14
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
15
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
16
+ const {
17
+ width
18
+ } = _reactNative.Dimensions.get('window');
19
+ const OnboardingPages = ({
20
+ showPagination = true,
21
+ ...props
22
+ }) => {
23
+ var _props$pages$previous;
24
+ const backgroundColorAnim = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
25
+ const [previousPage, setPreviousPage] = _react.default.useState(0);
26
+ const currentPage_ = props.pages[props.currentPage];
27
+ const currentBackgroundColor = (currentPage_ === null || currentPage_ === void 0 ? void 0 : currentPage_.backgroundColor) || '';
28
+ const isLight = (0, _tinycolor.default)(currentBackgroundColor).getBrightness() > 180;
29
+ const footerBackgroundColor = isLight ? (0, _tinycolor.default)(currentBackgroundColor).darken(30).toString() : (0, _tinycolor.default)(currentBackgroundColor).lighten(30).toString();
30
+ const color = (0, _tinycolor.default)(footerBackgroundColor).getBrightness() > 180 ? (0, _tinycolor.default)(footerBackgroundColor).darken(60).toString() : (0, _tinycolor.default)(footerBackgroundColor).lighten(60).toString();
31
+ const previousBackgroundColor = ((_props$pages$previous = props.pages[previousPage]) === null || _props$pages$previous === void 0 ? void 0 : _props$pages$previous.backgroundColor) || 'white';
32
+ // Interpolating background color based on backgroundColorAnim value
33
+ const interpolatedBackgroundColor = backgroundColorAnim.interpolate({
34
+ inputRange: [0, 1],
35
+ outputRange: [currentBackgroundColor, previousBackgroundColor],
36
+ extrapolate: 'clamp'
37
+ });
38
+ const setPage_ = newPageIndex => {
39
+ setPreviousPage(props.currentPage);
40
+ props.setPage(newPageIndex);
41
+ };
42
+ return /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
43
+ style: [styles.container, {
44
+ backgroundColor: interpolatedBackgroundColor
45
+ }]
46
+ }, props.paginationPosition === 'top' && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, showPagination && props.customFooter && props.customFooter({
47
+ nextPage: props.nextPage
48
+ }), !props.customFooter && /*#__PURE__*/_react.default.createElement(_Pagination.Pagination, {
49
+ width: width,
50
+ onNext: props.nextPage,
51
+ onSkip: props.onSkip,
52
+ color: color,
53
+ onDone: props.onDone,
54
+ showDone: props.showDone,
55
+ backgroundColor: footerBackgroundColor,
56
+ animatedValue: props.scrollX,
57
+ showSkip: props.showSkip,
58
+ numberOfScreens: props.pages.length,
59
+ skipLabel: props.skipLabel,
60
+ nextLabel: props.nextLabel,
61
+ doneLabel: props.doneLabel,
62
+ paginationContainerStyle: props.paginationContainerStyle,
63
+ buttonRightContainerStyle: props.buttonRightContainerStyle,
64
+ buttonLeftContainerStyle: props.buttonLeftContainerStyle,
65
+ dotsContainerStyle: props.dotsContainerStyle,
66
+ doneLabelStyle: props.doneLabelStyle,
67
+ skipLabelStyle: props.skipLabelStyle,
68
+ nextLabelStyle: props.nextLabelStyle
69
+ })), /*#__PURE__*/_react.default.createElement(_reactNative.Animated.FlatList, {
70
+ ref: props.flatListRef,
71
+ data: props.pages,
72
+ horizontal: true,
73
+ pagingEnabled: true,
74
+ showsHorizontalScrollIndicator: false,
75
+ keyExtractor: (_, index) => index.toString(),
76
+ renderItem: ({
77
+ item,
78
+ index
79
+ }) => /*#__PURE__*/_react.default.createElement(_Page.OnboardingPage, _extends({
80
+ color: color,
81
+ width: width,
82
+ key: index
83
+ }, item)),
84
+ onScroll: _reactNative.Animated.event([{
85
+ nativeEvent: {
86
+ contentOffset: {
87
+ x: props.scrollX
88
+ }
89
+ }
90
+ }], {
91
+ useNativeDriver: false
92
+ }),
93
+ scrollEventThrottle: 16 // Adjusted for better performance
94
+ ,
95
+ onMomentumScrollEnd: event => {
96
+ const pageIndex = Math.round(event.nativeEvent.contentOffset.x / width);
97
+ setPage_(pageIndex || 0);
98
+ }
99
+ }), props.paginationPosition !== 'top' && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, showPagination && props.customFooter && props.customFooter({
100
+ nextPage: props.nextPage
101
+ }), /*#__PURE__*/_react.default.createElement(_Pagination.Pagination, {
102
+ width: width,
103
+ onNext: props.nextPage,
104
+ onSkip: props.onSkip,
105
+ color: color,
106
+ onDone: props.onDone,
107
+ showDone: props.showDone,
108
+ backgroundColor: footerBackgroundColor,
109
+ animatedValue: props.scrollX,
110
+ showSkip: props.showSkip,
111
+ numberOfScreens: props.pages.length,
112
+ skipLabel: props.skipLabel,
113
+ nextLabel: props.nextLabel,
114
+ doneLabel: props.doneLabel,
115
+ paginationContainerStyle: props.paginationContainerStyle,
116
+ buttonRightContainerStyle: props.buttonRightContainerStyle,
117
+ buttonLeftContainerStyle: props.buttonLeftContainerStyle,
118
+ dotsContainerStyle: props.dotsContainerStyle,
119
+ doneLabelStyle: props.doneLabelStyle,
120
+ skipLabelStyle: props.skipLabelStyle,
121
+ nextLabelStyle: props.nextLabelStyle
122
+ })));
123
+ };
124
+ exports.OnboardingPages = OnboardingPages;
125
+ const styles = _reactNative.StyleSheet.create({
126
+ container: {
127
+ flex: 1,
128
+ justifyContent: 'center',
129
+ alignItems: 'center'
130
+ },
131
+ screen: {
132
+ width,
133
+ justifyContent: 'center',
134
+ alignItems: 'center',
135
+ backgroundColor: 'blue'
136
+ },
137
+ pagination: {
138
+ flexDirection: 'row',
139
+ alignItems: 'center',
140
+ paddingVertical: 10,
141
+ paddingHorizontal: 20,
142
+ width
143
+ },
144
+ dot: {
145
+ height: 10,
146
+ width: 10,
147
+ borderRadius: 5,
148
+ backgroundColor: '#333',
149
+ margin: 5
150
+ },
151
+ dotsContainer: {
152
+ flexDirection: 'row',
153
+ flex: 1,
154
+ justifyContent: 'center'
155
+ }
156
+ });
157
+ //# sourceMappingURL=OnboardingPages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_tinycolor","_interopRequireDefault","_reactNative","_Pagination","_Page","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","width","Dimensions","OnboardingPages","showPagination","props","_props$pages$previous","backgroundColorAnim","useRef","Animated","Value","current","previousPage","setPreviousPage","React","useState","currentPage_","pages","currentPage","currentBackgroundColor","backgroundColor","isLight","tinycolor","getBrightness","footerBackgroundColor","darken","toString","lighten","color","previousBackgroundColor","interpolatedBackgroundColor","interpolate","inputRange","outputRange","extrapolate","setPage_","newPageIndex","setPage","createElement","View","style","styles","container","paginationPosition","Fragment","customFooter","nextPage","Pagination","onNext","onSkip","onDone","showDone","animatedValue","scrollX","showSkip","numberOfScreens","skipLabel","nextLabel","doneLabel","paginationContainerStyle","buttonRightContainerStyle","buttonLeftContainerStyle","dotsContainerStyle","doneLabelStyle","skipLabelStyle","nextLabelStyle","FlatList","ref","flatListRef","data","horizontal","pagingEnabled","showsHorizontalScrollIndicator","keyExtractor","_","index","renderItem","item","OnboardingPage","key","onScroll","event","nativeEvent","contentOffset","x","useNativeDriver","scrollEventThrottle","onMomentumScrollEnd","pageIndex","Math","round","exports","StyleSheet","create","flex","justifyContent","alignItems","screen","pagination","flexDirection","paddingVertical","paddingHorizontal","dot","height","borderRadius","margin","dotsContainer"],"sourceRoot":"../../../src","sources":["components/OnboardingPages.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AAAmD,SAAAE,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,yBAAAH,CAAA,6BAAAI,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAD,wBAAA,YAAAA,CAAAH,CAAA,WAAAA,CAAA,GAAAM,CAAA,GAAAD,CAAA,KAAAL,CAAA;AAAA,SAAAP,wBAAAO,CAAA,EAAAK,CAAA,SAAAA,CAAA,IAAAL,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAE,OAAA,EAAAF,CAAA,QAAAM,CAAA,GAAAH,wBAAA,CAAAE,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAC,GAAA,CAAAP,CAAA,UAAAM,CAAA,CAAAE,GAAA,CAAAR,CAAA,OAAAS,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAf,CAAA,oBAAAe,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAjB,CAAA,EAAAe,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAd,CAAA,EAAAe,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAA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,EAAE,QAAQ;IACxBC,UAAU,EAAE,QAAQ;IACpB5E,eAAe,EAAE;EACnB,CAAC;EACD8E,UAAU,EAAE;IACVC,aAAa,EAAE,KAAK;IACpBH,UAAU,EAAE,QAAQ;IACpBI,eAAe,EAAE,EAAE;IACnBC,iBAAiB,EAAE,EAAE;IACrBpG;EACF,CAAC;EACDqG,GAAG,EAAE;IACHC,MAAM,EAAE,EAAE;IACVtG,KAAK,EAAE,EAAE;IACTuG,YAAY,EAAE,CAAC;IACfpF,eAAe,EAAE,MAAM;IACvBqF,MAAM,EAAE;EACV,CAAC;EACDC,aAAa,EAAE;IACbP,aAAa,EAAE,KAAK;IACpBL,IAAI,EAAE,CAAC;IACPC,cAAc,EAAE;EAClB;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.OnboardingPage = OnboardingPage;
7
+ var _reactNative = require("react-native");
8
+ var _react = _interopRequireDefault(require("react"));
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
+ const {
11
+ width,
12
+ height
13
+ } = _reactNative.Dimensions.get('window');
14
+ const potrait = height > width;
15
+ function OnboardingPage(props) {
16
+ return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
17
+ style: [styles.container, {
18
+ width: props.width
19
+ }, props.containerStyle]
20
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
21
+ style: [styles.imageContainer, props.imageContainerStyle]
22
+ }, props.image), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
23
+ style: [styles.titleContainer, props.titleContainerStyle]
24
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
25
+ style: [styles.title, {
26
+ color: props.color
27
+ }, props.titleStyle]
28
+ }, props.title), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
29
+ style: [styles.subtitle, {
30
+ color: props.color
31
+ }, props.subtitleStyle]
32
+ }, props.subtitle)));
33
+ }
34
+ const styles = _reactNative.StyleSheet.create({
35
+ container: {
36
+ flex: 1,
37
+ justifyContent: 'center',
38
+ alignItems: 'center'
39
+ },
40
+ title: {
41
+ fontSize: 24,
42
+ fontWeight: 'bold',
43
+ paddingBottom: 15,
44
+ textAlign: 'center'
45
+ },
46
+ subtitle: {
47
+ fontSize: 18,
48
+ textAlign: 'center'
49
+ },
50
+ imageContainer: {
51
+ flex: 0,
52
+ paddingBottom: potrait ? 60 : 10,
53
+ alignItems: 'center',
54
+ width: '100%'
55
+ },
56
+ titleContainer: {
57
+ marginHorizontal: 30
58
+ }
59
+ });
60
+ //# sourceMappingURL=Page.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_react","_interopRequireDefault","e","__esModule","default","width","height","Dimensions","get","potrait","OnboardingPage","props","createElement","View","style","styles","container","containerStyle","imageContainer","imageContainerStyle","image","titleContainer","titleContainerStyle","Text","title","color","titleStyle","subtitle","subtitleStyle","StyleSheet","create","flex","justifyContent","alignItems","fontSize","fontWeight","paddingBottom","textAlign","marginHorizontal"],"sourceRoot":"../../../src","sources":["components/Page.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AASA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AAA0B,SAAAE,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAgB1B,MAAM;EAAEG,KAAK;EAAEC;AAAO,CAAC,GAAGC,uBAAU,CAACC,GAAG,CAAC,QAAQ,CAAC;AAClD,MAAMC,OAAO,GAAGH,MAAM,GAAGD,KAAK;AAEvB,SAASK,cAAcA,CAACC,KAAW,EAAE;EAC1C,oBACEX,MAAA,CAAAI,OAAA,CAAAQ,aAAA,CAACd,YAAA,CAAAe,IAAI;IACHC,KAAK,EAAE,CAACC,MAAM,CAACC,SAAS,EAAE;MAAEX,KAAK,EAAEM,KAAK,C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