react-native-app-onboard 0.1.9 → 0.2.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/README.md +89 -7
  2. package/lib/commonjs/components/CustomPages.js +31 -55
  3. package/lib/commonjs/components/CustomPages.js.map +1 -1
  4. package/lib/commonjs/components/OnboardingPages.js +63 -79
  5. package/lib/commonjs/components/OnboardingPages.js.map +1 -1
  6. package/lib/commonjs/components/Page.js +8 -3
  7. package/lib/commonjs/components/Page.js.map +1 -1
  8. package/lib/commonjs/components/Pagination.js +75 -13
  9. package/lib/commonjs/components/Pagination.js.map +1 -1
  10. package/lib/commonjs/components/Swiper.js +58 -85
  11. package/lib/commonjs/components/Swiper.js.map +1 -1
  12. package/lib/commonjs/components/button.js +3 -1
  13. package/lib/commonjs/components/button.js.map +1 -1
  14. package/lib/commonjs/context/OnboardingContext.js +101 -21
  15. package/lib/commonjs/context/OnboardingContext.js.map +1 -1
  16. package/lib/commonjs/hooks/useOnboarding.js +1 -1
  17. package/lib/commonjs/hooks/useOnboarding.js.map +1 -1
  18. package/lib/commonjs/index.js +33 -2
  19. package/lib/commonjs/index.js.map +1 -1
  20. package/lib/commonjs/utils/color.js +308 -0
  21. package/lib/commonjs/utils/color.js.map +1 -0
  22. package/lib/commonjs/utils/persistence.js +51 -0
  23. package/lib/commonjs/utils/persistence.js.map +1 -0
  24. package/lib/module/components/CustomPages.js +31 -55
  25. package/lib/module/components/CustomPages.js.map +1 -1
  26. package/lib/module/components/OnboardingPages.js +64 -79
  27. package/lib/module/components/OnboardingPages.js.map +1 -1
  28. package/lib/module/components/Page.js +8 -3
  29. package/lib/module/components/Page.js.map +1 -1
  30. package/lib/module/components/Pagination.js +76 -14
  31. package/lib/module/components/Pagination.js.map +1 -1
  32. package/lib/module/components/Swiper.js +59 -86
  33. package/lib/module/components/Swiper.js.map +1 -1
  34. package/lib/module/components/button.js +3 -1
  35. package/lib/module/components/button.js.map +1 -1
  36. package/lib/module/context/OnboardingContext.js +102 -22
  37. package/lib/module/context/OnboardingContext.js.map +1 -1
  38. package/lib/module/hooks/useOnboarding.js +1 -1
  39. package/lib/module/hooks/useOnboarding.js.map +1 -1
  40. package/lib/module/index.js +8 -1
  41. package/lib/module/index.js.map +1 -1
  42. package/lib/module/utils/color.js +299 -0
  43. package/lib/module/utils/color.js.map +1 -0
  44. package/lib/module/utils/persistence.js +42 -0
  45. package/lib/module/utils/persistence.js.map +1 -0
  46. package/lib/typescript/src/components/CustomPages.d.ts +6 -2
  47. package/lib/typescript/src/components/CustomPages.d.ts.map +1 -1
  48. package/lib/typescript/src/components/OnboardingPages.d.ts +6 -2
  49. package/lib/typescript/src/components/OnboardingPages.d.ts.map +1 -1
  50. package/lib/typescript/src/components/Page.d.ts +2 -0
  51. package/lib/typescript/src/components/Page.d.ts.map +1 -1
  52. package/lib/typescript/src/components/Pagination.d.ts +9 -0
  53. package/lib/typescript/src/components/Pagination.d.ts.map +1 -1
  54. package/lib/typescript/src/components/Swiper.d.ts.map +1 -1
  55. package/lib/typescript/src/components/button.d.ts.map +1 -1
  56. package/lib/typescript/src/context/OnboardingContext.d.ts +9 -0
  57. package/lib/typescript/src/context/OnboardingContext.d.ts.map +1 -1
  58. package/lib/typescript/src/hooks/useOnboarding.d.ts +3 -0
  59. package/lib/typescript/src/hooks/useOnboarding.d.ts.map +1 -1
  60. package/lib/typescript/src/index.d.ts +4 -0
  61. package/lib/typescript/src/index.d.ts.map +1 -1
  62. package/lib/typescript/src/types/index.d.ts +13 -0
  63. package/lib/typescript/src/types/index.d.ts.map +1 -1
  64. package/lib/typescript/src/utils/color.d.ts +18 -0
  65. package/lib/typescript/src/utils/color.d.ts.map +1 -0
  66. package/lib/typescript/src/utils/persistence.d.ts +31 -0
  67. package/lib/typescript/src/utils/persistence.d.ts.map +1 -0
  68. package/package.json +12 -6
  69. package/src/components/CustomPages.tsx +62 -69
  70. package/src/components/OnboardingPages.tsx +86 -89
  71. package/src/components/Page.tsx +8 -2
  72. package/src/components/Pagination.tsx +117 -29
  73. package/src/components/Swiper.tsx +65 -87
  74. package/src/components/button.tsx +6 -1
  75. package/src/context/OnboardingContext.tsx +145 -26
  76. package/src/hooks/useOnboarding.tsx +1 -3
  77. package/src/index.tsx +16 -1
  78. package/src/types/index.ts +13 -0
  79. package/src/utils/color.ts +284 -0
  80. package/src/utils/persistence.ts +58 -0
@@ -10,32 +10,29 @@ export const CustomPages = ({
10
10
  showNext = true,
11
11
  ...props
12
12
  }) => {
13
- return /*#__PURE__*/React.createElement(View, {
14
- style: [styles.container]
15
- }, props.skipButtonPosition && props.showSkip && /*#__PURE__*/React.createElement(SkipButton, {
16
- buttonTextStyle: props.skipLabelStyle,
17
- buttonStyle: props.skipButtonContainerStyle,
18
- position: props.skipButtonPosition,
19
- onPress: props.onSkip,
20
- label: props.skipLabel
21
- }), showPagination && props.paginationPosition === 'top' && /*#__PURE__*/React.createElement(React.Fragment, null, props.customFooter && props.customFooter({
22
- nextPage: props.nextPage
23
- }), !props.customFooter && /*#__PURE__*/React.createElement(Pagination, {
13
+ const pageWidth = props.width || width;
14
+ const paginationProps = {
24
15
  color: '#fff',
25
16
  backgroundColor: '#333',
26
- width: width,
17
+ width: pageWidth,
27
18
  onNext: props.nextPage,
28
19
  onSkip: props.onSkip,
29
20
  onDone: props.onDone,
30
21
  showDone: props.showDone,
31
- animatedValue: props.scrollX,
22
+ showPrevious: props.showPrevious,
23
+ animatedValue: props.dotsAnimatedValue,
32
24
  showSkip: props.showSkip,
33
25
  numberOfScreens: props.numberOfScreens,
34
26
  skipLabel: props.skipLabel,
35
- showNext: showNext,
27
+ showNext,
36
28
  nextLabel: props.nextLabel,
29
+ previousLabel: props.previousLabel,
37
30
  doneLabel: props.doneLabel,
38
31
  hasSkipPosition: !!props.skipButtonPosition,
32
+ paginationStyle: props.paginationStyle,
33
+ progressBarStyle: props.progressBarStyle,
34
+ progressBarFillStyle: props.progressBarFillStyle,
35
+ dotsAreTappable: props.dotsAreTappable,
39
36
  paginationContainerStyle: props.paginationContainerStyle,
40
37
  buttonRightContainerStyle: props.buttonRightContainerStyle,
41
38
  buttonLeftContainerStyle: props.buttonLeftContainerStyle,
@@ -44,28 +41,34 @@ export const CustomPages = ({
44
41
  skipButtonContainerStyle: props.skipButtonContainerStyle,
45
42
  nextButtonContainerStyle: props.nextButtonContainerStyle,
46
43
  doneButtonContainerStyle: props.doneButtonContainerStyle,
44
+ previousButtonContainerStyle: props.previousButtonContainerStyle,
47
45
  skipLabelStyle: props.skipLabelStyle,
46
+ previousLabelStyle: props.previousLabelStyle,
48
47
  nextLabelStyle: props.nextLabelStyle,
49
48
  paginationPosition: props.paginationPosition
50
- })), /*#__PURE__*/React.createElement(Animated.FlatList, {
51
- ref: props.flatListRef,
49
+ };
50
+ return /*#__PURE__*/React.createElement(View, {
51
+ style: [styles.container]
52
+ }, props.skipButtonPosition && props.showSkip && /*#__PURE__*/React.createElement(SkipButton, {
53
+ buttonTextStyle: props.skipLabelStyle,
54
+ buttonStyle: props.skipButtonContainerStyle,
55
+ position: props.skipButtonPosition,
56
+ onPress: props.onSkip,
57
+ label: props.skipLabel
58
+ }), showPagination && props.paginationPosition === 'top' && /*#__PURE__*/React.createElement(React.Fragment, null, props.customFooter && props.customFooter({
59
+ nextPage: props.nextPage
60
+ }), !props.customFooter && /*#__PURE__*/React.createElement(Pagination, paginationProps)), /*#__PURE__*/React.createElement(Animated.FlatList, {
61
+ ref: node => props.setFlatListRef(node),
52
62
  data: React.Children.toArray(props.children),
53
63
  horizontal: true,
54
64
  pagingEnabled: true,
55
65
  showsHorizontalScrollIndicator: false,
56
66
  scrollEnabled: props.scrollEnabled,
57
- onScroll: Animated.event([{
58
- nativeEvent: {
59
- contentOffset: {
60
- x: props.scrollX
61
- }
62
- }
63
- }], {
64
- useNativeDriver: false
65
- }),
66
- scrollEventThrottle: 1,
67
+ onScroll: props.onScroll,
68
+ onScrollBeginDrag: props.onScrollBeginDrag,
69
+ scrollEventThrottle: 16,
67
70
  onMomentumScrollEnd: event => {
68
- const pageIndex = Math.round(event.nativeEvent.contentOffset.x / width);
71
+ const pageIndex = Math.round(event.nativeEvent.contentOffset.x / pageWidth);
69
72
  props.setPage(pageIndex || 0);
70
73
  },
71
74
  keyExtractor: (_, index) => index.toString(),
@@ -82,34 +85,7 @@ export const CustomPages = ({
82
85
  }
83
86
  }), showPagination && props.paginationPosition !== 'top' && /*#__PURE__*/React.createElement(React.Fragment, null, props.customFooter && props.customFooter({
84
87
  nextPage: props.nextPage
85
- }), !props.customFooter && /*#__PURE__*/React.createElement(Pagination, {
86
- color: '#fff',
87
- backgroundColor: '#333',
88
- width: width,
89
- onNext: props.nextPage,
90
- onSkip: props.onSkip,
91
- onDone: props.onDone,
92
- showDone: props.showDone,
93
- animatedValue: props.scrollX,
94
- showSkip: props.showSkip,
95
- numberOfScreens: props.numberOfScreens,
96
- skipLabel: props.skipLabel,
97
- nextLabel: props.nextLabel,
98
- showNext: showNext,
99
- doneLabel: props.doneLabel,
100
- paginationContainerStyle: props.paginationContainerStyle,
101
- buttonRightContainerStyle: props.buttonRightContainerStyle,
102
- buttonLeftContainerStyle: props.buttonLeftContainerStyle,
103
- dotsContainerStyle: props.dotsContainerStyle,
104
- doneLabelStyle: props.doneLabelStyle,
105
- skipButtonContainerStyle: props.skipButtonContainerStyle,
106
- nextButtonContainerStyle: props.nextButtonContainerStyle,
107
- doneButtonContainerStyle: props.doneButtonContainerStyle,
108
- skipLabelStyle: props.skipLabelStyle,
109
- hasSkipPosition: !!props.skipButtonPosition,
110
- paginationPosition: props.paginationPosition,
111
- nextLabelStyle: props.nextLabelStyle
112
- })));
88
+ }), !props.customFooter && /*#__PURE__*/React.createElement(Pagination, paginationProps)));
113
89
  };
114
90
  const styles = StyleSheet.create({
115
91
  container: {
@@ -1 +1 @@
1
- {"version":3,"names":["View","Dimensions","Animated","StyleSheet","React","Pagination","SkipButton","width","get","CustomPages","showPagination","showNext","props","createElement","style","styles","container","skipButtonPosition","showSkip","buttonTextStyle","skipLabelStyle","buttonStyle","skipButtonContainerStyle","position","onPress","onSkip","label","skipLabel","paginationPosition","Fragment","customFooter","nextPage","color","backgroundColor","onNext","onDone","showDone","animatedValue","scrollX","numberOfScreens","nextLabel","doneLabel","hasSkipPosition","paginationContainerStyle","buttonRightContainerStyle","buttonLeftContainerStyle","dotsContainerStyle","doneLabelStyle","nextButtonContainerStyle","doneButtonContainerStyle","nextLabelStyle","FlatList","ref","flatListRef","data","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","create","flex","justifyContent","alignItems","screen","pagination","flexDirection","paddingVertical","paddingHorizontal","dot","height","borderRadius","margin","dotsContainer"],"sourceRoot":"../../../src","sources":["components/CustomPages.tsx"],"mappings":"AAAA,SAASA,IAAI,EAAEC,UAAU,EAAEC,QAAQ,EAAEC,UAAU,QAAkB,cAAc;AAC/E,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,cAAc;AAEzC,SAASC,UAAU,QAAQ,UAAU;AAErC,MAAM;EAAEC;AAAM,CAAC,GAAGN,UAAU,CAACO,GAAG,CAAC,QAAQ,CAAC;AAmB1C,OAAO,MAAMC,WAAW,GAAGA,CAAC;EAC1BC,cAAc,GAAG,IAAI;EACrBC,QAAQ,GAAG,IAAI;EACf,GAAGC;AACa,CAAC,KAAK;EACtB,oBACER,KAAA,CAAAS,aAAA,CAACb,IAAI;IAACc,KAAK,EAAE,CAACC,MAAM,CAACC,SAAS;EAAE,GAC7BJ,KAAK,CAACK,kBAAkB,IAAIL,KAAK,CAACM,QAAQ,iBACzCd,KAAA,CAAAS,aAAA,CAACP,UAAU;IACTa,eAAe,EAAEP,KAAK,CAACQ,cAAe;IACtCC,WAAW,EAAET,KAAK,CAACU,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rCzB,wBAAwB,EAAEV,KAAK,CAACU,wBAAyB;IACzD0B,wBAAwB,EAAEpC,KAAK,CAACoC,wBAAyB;IACzDC,wBAAwB,EAAErC,KAAK,CAACqC,wBAAyB;IACzD7B,cAAc,EAAER,KAAK,CAACQ,cAAe;IACrCsB,eAAe,EAAE,CAAC,CAAC9B,KAAK,CAACK,kBAAmB;IAC5CW,kBAAkB,EAAEhB,KAAK,CAACgB,kBAAmB;IAC7CsB,cAAc,EAAEtC,KAAK,CAACsC;EAAe,CACtC,CAEH,CAEA,CAAC;AAEX,CAAC;AAED,MAAMnC,MAAM,GAAGZ,UAAU,CAAC+E,MAAM,CAAC;EAC/BlE,SAAS,EAAE;IACTmE,IAAI,EAAE,CAAC;IACPC,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE;EACd,CAAC;EACDC,MAAM,EAAE;IACN/E,KAAK;IACL6E,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE,QAAQ;IACpBpD,eAAe,EAAE;EACnB,CAAC;EACDsD,UAAU,EAAE;IACVC,aAAa,EAAE,KAAK;IACpBH,UAAU,EAAE,QAAQ;IACpBI,eAAe,EAAE,EAAE;IACnBC,iBAAiB,EAAE,EAAE;IACrBnF;EACF,CAAC;EACDoF,GAAG,EAAE;IACHC,MAAM,EAAE,EAAE;IACVrF,KAAK,EAAE,EAAE;IACTsF,YAAY,EAAE,CAAC;IACf5D,eAAe,EAAE,MAAM;IACvB6D,MAAM,EAAE;EACV,CAAC;EACDC,aAAa,EAAE;IACbP,aAAa,EAAE,KAAK;IACpBL,IAAI,EAAE,CAAC;IACPC,cAAc,EAAE;EAClB;AACF,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["View","Dimensions","Animated","StyleSheet","React","Pagination","SkipButton","width","get","CustomPages","showPagination","showNext","props","pageWidth","paginationProps","color","backgroundColor","onNext","nextPage","onSkip","onDone","showDone","showPrevious","animatedValue","dotsAnimatedValue","showSkip","numberOfScreens","skipLabel","nextLabel","previousLabel","doneLabel","hasSkipPosition","skipButtonPosition","paginationStyle","progressBarStyle","progressBarFillStyle","dotsAreTappable","paginationContainerStyle","buttonRightContainerStyle","buttonLeftContainerStyle","dotsContainerStyle","doneLabelStyle","skipButtonContainerStyle","nextButtonContainerStyle","doneButtonContainerStyle","previousButtonContainerStyle","skipLabelStyle","previousLabelStyle","nextLabelStyle","paginationPosition","createElement","style","styles","container","buttonTextStyle","buttonStyle","position","onPress","label","Fragment","customFooter","FlatList","ref","node","setFlatListRef","data","Children","toArray","children","horizontal","pagingEnabled","showsHorizontalScrollIndicator","scrollEnabled","onScroll","onScrollBeginDrag","scrollEventThrottle","onMomentumScrollEnd","event","pageIndex","Math","round","nativeEvent","contentOffset","x","setPage","keyExtractor","_","index","toString","renderItem","item","cloneElement","currentPage","create","flex","justifyContent","alignItems","screen","pagination","flexDirection","paddingVertical","paddingHorizontal","dot","height","borderRadius","margin","dotsContainer"],"sourceRoot":"../../../src","sources":["components/CustomPages.tsx"],"mappings":"AAAA,SACEA,IAAI,EACJC,UAAU,EACVC,QAAQ,EACRC,UAAU,QAIL,cAAc;AACrB,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,cAAc;AAEzC,SAASC,UAAU,QAAQ,UAAU;AAErC,MAAM;EAAEC;AAAM,CAAC,GAAGN,UAAU,CAACO,GAAG,CAAC,QAAQ,CAAC;AAyB1C,OAAO,MAAMC,WAAW,GAAGA,CAAC;EAC1BC,cAAc,GAAG,IAAI;EACrBC,QAAQ,GAAG,IAAI;EACf,GAAGC;AACa,CAAC,KAAK;EACtB,MAAMC,SAAS,GAAGD,KAAK,CAACL,KAAK,IAAIA,KAAK;EAEtC,MAAMO,eAAe,GAAG;IACtBC,KAAK,EAAE,MAAM;IACbC,eAAe,EAAE,MAAM;IACvBT,KAAK,EAAEM,SAAS;IAChBI,MAAM,EAAEL,KAAK,CAACM,QAAQ;IACtBC,MAAM,EAAEP,KAAK,CAACO,MAAM;IACpBC,MAAM,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BI,eAAe,EAAE,EAAE;IACnBC,iBAAiB,EAAE,EAAE;IACrB9F;EACF,CAAC;EACD+F,GAAG,EAAE;IACHC,MAAM,EAAE,EAAE;IACVhG,KAAK,EAAE,EAAE;IACTiG,YAAY,EAAE,CAAC;IACfxF,eAAe,EAAE,MAAM;IACvByF,MAAM,EAAE;EACV,CAAC;EACDC,aAAa,EAAE;IACbP,aAAa,EAAE,KAAK;IACpBL,IAAI,EAAE,CAAC;IACPC,cAAc,EAAE;EAClB;AACF,CAAC,CAAC","ignoreList":[]}
@@ -1,6 +1,6 @@
1
1
  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); }
2
- import React, { useRef } from 'react';
3
- import tinycolor from 'tinycolor2';
2
+ import React, { useMemo } from 'react';
3
+ import { getBrightness, lighten, darken } from '../utils/color';
4
4
  import { Animated, StyleSheet, Dimensions } from 'react-native';
5
5
  import { Pagination } from './Pagination';
6
6
  import { OnboardingPage } from './Page';
@@ -13,122 +13,102 @@ export const OnboardingPages = ({
13
13
  showNext = true,
14
14
  ...props
15
15
  }) => {
16
- var _props$pages$previous;
17
- const backgroundColorAnim = useRef(new Animated.Value(0)).current;
18
- const [previousPage, setPreviousPage] = React.useState(0);
16
+ const pageWidth = props.width || width;
19
17
  const currentPage_ = props.pages[props.currentPage];
20
- const currentBackgroundColor = (currentPage_ === null || currentPage_ === void 0 ? void 0 : currentPage_.backgroundColor) || '';
21
- const isLight = tinycolor(currentBackgroundColor).getBrightness() > 180;
22
- const footerBackgroundColor = isLight ? tinycolor(currentBackgroundColor).darken(30).toString() : tinycolor(currentBackgroundColor).lighten(30).toString();
23
- const color = tinycolor(footerBackgroundColor).getBrightness() > 180 ? tinycolor(footerBackgroundColor).darken(60).toString() : tinycolor(footerBackgroundColor).lighten(60).toString();
24
- const previousBackgroundColor = ((_props$pages$previous = props.pages[previousPage]) === null || _props$pages$previous === void 0 ? void 0 : _props$pages$previous.backgroundColor) || 'white';
25
- // Interpolating background color based on backgroundColorAnim value
26
- const interpolatedBackgroundColor = backgroundColorAnim.interpolate({
27
- inputRange: [0, 1],
28
- outputRange: [currentBackgroundColor, previousBackgroundColor],
29
- extrapolate: 'clamp'
30
- });
31
- const setPage_ = newPageIndex => {
32
- setPreviousPage(props.currentPage);
33
- props.setPage(newPageIndex);
34
- };
35
- return /*#__PURE__*/React.createElement(Animated.View, {
36
- style: [styles.container, {
37
- backgroundColor: interpolatedBackgroundColor
38
- }]
39
- }, props.skipButtonPosition && props.showSkip && /*#__PURE__*/React.createElement(SkipButton, {
40
- buttonTextStyle: props.skipLabelStyle,
41
- buttonStyle: props.skipButtonContainerStyle,
42
- position: props.skipButtonPosition,
43
- label: props.skipLabel,
44
- onPress: props.onSkip
45
- }), props.paginationPosition === 'top' && /*#__PURE__*/React.createElement(React.Fragment, null, showPagination && props.customFooter && props.customFooter({
46
- nextPage: props.nextPage
47
- }), !props.customFooter && showPagination && /*#__PURE__*/React.createElement(Pagination, {
48
- width: props.width || width,
18
+ const currentBackgroundColor = (currentPage_ === null || currentPage_ === void 0 ? void 0 : currentPage_.backgroundColor) ?? 'white';
19
+ const isLight = getBrightness(currentBackgroundColor) > 180;
20
+ const footerBackgroundColor = isLight ? darken(currentBackgroundColor, 30) : lighten(currentBackgroundColor, 30);
21
+ const color = getBrightness(footerBackgroundColor) > 180 ? darken(footerBackgroundColor, 60) : lighten(footerBackgroundColor, 60);
22
+ const interpolatedBackgroundColor = useMemo(() => {
23
+ const pages = props.pages;
24
+ // interpolate() requires at least 2 stops; for 0 or 1 pages there is
25
+ // nothing to animate between, so use the solid current color.
26
+ if (pages.length < 2) return currentBackgroundColor;
27
+ const inputRange = pages.map((_, i) => i * pageWidth);
28
+ const outputRange = pages.map(p => p.backgroundColor ?? 'white');
29
+ return props.scrollX.interpolate({
30
+ inputRange,
31
+ outputRange,
32
+ extrapolate: 'clamp'
33
+ });
34
+ }, [props.pages, props.scrollX, pageWidth, currentBackgroundColor]);
35
+ const paginationProps = {
36
+ width: pageWidth,
49
37
  onNext: props.nextPage,
50
38
  onSkip: props.onSkip,
51
- color: color,
52
- showNext: showNext,
39
+ color,
40
+ showNext,
53
41
  onDone: props.onDone,
54
42
  showDone: props.showDone,
43
+ showPrevious: props.showPrevious,
55
44
  backgroundColor: footerBackgroundColor,
56
- animatedValue: props.scrollX,
45
+ animatedValue: props.dotsAnimatedValue,
57
46
  showSkip: props.showSkip,
58
47
  numberOfScreens: props.pages.length,
59
48
  skipLabel: props.skipLabel,
60
49
  nextLabel: props.nextLabel,
50
+ previousLabel: props.previousLabel,
61
51
  hasSkipPosition: !!props.skipButtonPosition,
62
52
  doneLabel: props.doneLabel,
53
+ paginationStyle: props.paginationStyle,
54
+ progressBarStyle: props.progressBarStyle,
55
+ progressBarFillStyle: props.progressBarFillStyle,
56
+ dotsAreTappable: props.dotsAreTappable,
57
+ mirror: props.mirror,
63
58
  paginationContainerStyle: props.paginationContainerStyle,
64
59
  buttonRightContainerStyle: props.buttonRightContainerStyle,
65
60
  buttonLeftContainerStyle: props.buttonLeftContainerStyle,
66
61
  dotsContainerStyle: props.dotsContainerStyle,
67
62
  doneLabelStyle: props.doneLabelStyle,
68
63
  skipLabelStyle: props.skipLabelStyle,
64
+ previousLabelStyle: props.previousLabelStyle,
69
65
  nextLabelStyle: props.nextLabelStyle,
70
66
  skipButtonContainerStyle: props.skipButtonContainerStyle,
71
67
  nextButtonContainerStyle: props.nextButtonContainerStyle,
72
- doneButtonContainerStyle: props.doneButtonContainerStyle
73
- })), /*#__PURE__*/React.createElement(Animated.FlatList, {
74
- ref: props.flatListRef,
68
+ doneButtonContainerStyle: props.doneButtonContainerStyle,
69
+ previousButtonContainerStyle: props.previousButtonContainerStyle
70
+ };
71
+ return /*#__PURE__*/React.createElement(Animated.View, {
72
+ style: [styles.container, {
73
+ backgroundColor: interpolatedBackgroundColor
74
+ }]
75
+ }, props.skipButtonPosition && props.showSkip && /*#__PURE__*/React.createElement(SkipButton, {
76
+ buttonTextStyle: props.skipLabelStyle,
77
+ buttonStyle: props.skipButtonContainerStyle,
78
+ position: props.skipButtonPosition,
79
+ label: props.skipLabel,
80
+ onPress: props.onSkip
81
+ }), props.paginationPosition === 'top' && /*#__PURE__*/React.createElement(React.Fragment, null, showPagination && props.customFooter && props.customFooter({
82
+ nextPage: props.nextPage
83
+ }), !props.customFooter && showPagination && /*#__PURE__*/React.createElement(Pagination, paginationProps)), /*#__PURE__*/React.createElement(Animated.FlatList, {
84
+ ref: node => props.setFlatListRef(node),
75
85
  data: props.pages,
76
86
  horizontal: true,
77
87
  pagingEnabled: true,
78
88
  showsHorizontalScrollIndicator: false,
89
+ scrollEnabled: props.scrollEnabled,
90
+ style: props.mirror ? styles.mirror : undefined,
79
91
  keyExtractor: (_, index) => index.toString(),
80
92
  renderItem: ({
81
93
  item,
82
94
  index
83
95
  }) => /*#__PURE__*/React.createElement(OnboardingPage, _extends({
84
96
  color: color,
85
- width: props.width || width,
97
+ width: pageWidth,
86
98
  swap: props.swap,
99
+ mirror: props.mirror,
87
100
  key: index
88
101
  }, item)),
89
- onScroll: Animated.event([{
90
- nativeEvent: {
91
- contentOffset: {
92
- x: props.scrollX
93
- }
94
- }
95
- }], {
96
- useNativeDriver: false
97
- }),
102
+ onScroll: props.onScroll,
103
+ onScrollBeginDrag: props.onScrollBeginDrag,
98
104
  scrollEventThrottle: 16,
99
105
  onMomentumScrollEnd: event => {
100
- const pageIndex = Math.round(event.nativeEvent.contentOffset.x / (props.width || width));
101
- setPage_(pageIndex || 0);
106
+ const pageIndex = Math.round(event.nativeEvent.contentOffset.x / pageWidth);
107
+ props.setPage(pageIndex || 0);
102
108
  }
103
109
  }), props.paginationPosition !== 'top' && /*#__PURE__*/React.createElement(React.Fragment, null, showPagination && props.customFooter && props.customFooter({
104
110
  nextPage: props.nextPage
105
- }), !props.customFooter && showPagination && /*#__PURE__*/React.createElement(Pagination, {
106
- width: props.width || width,
107
- onNext: props.nextPage,
108
- onSkip: props.onSkip,
109
- color: color,
110
- hasSkipPosition: !!props.skipButtonPosition,
111
- onDone: props.onDone,
112
- showDone: props.showDone,
113
- backgroundColor: footerBackgroundColor,
114
- animatedValue: props.scrollX,
115
- showSkip: props.showSkip,
116
- numberOfScreens: props.pages.length,
117
- skipLabel: props.skipLabel,
118
- nextLabel: props.nextLabel,
119
- doneLabel: props.doneLabel,
120
- paginationContainerStyle: props.paginationContainerStyle,
121
- buttonRightContainerStyle: props.buttonRightContainerStyle,
122
- buttonLeftContainerStyle: props.buttonLeftContainerStyle,
123
- dotsContainerStyle: props.dotsContainerStyle,
124
- doneLabelStyle: props.doneLabelStyle,
125
- skipLabelStyle: props.skipLabelStyle,
126
- skipButtonContainerStyle: props.skipButtonContainerStyle,
127
- nextButtonContainerStyle: props.nextButtonContainerStyle,
128
- doneButtonContainerStyle: props.doneButtonContainerStyle,
129
- showNext: showNext,
130
- nextLabelStyle: props.nextLabelStyle
131
- })));
111
+ }), !props.customFooter && showPagination && /*#__PURE__*/React.createElement(Pagination, paginationProps)));
132
112
  };
133
113
  const styles = StyleSheet.create({
134
114
  container: {
@@ -160,6 +140,11 @@ const styles = StyleSheet.create({
160
140
  flexDirection: 'row',
161
141
  flex: 1,
162
142
  justifyContent: 'center'
143
+ },
144
+ mirror: {
145
+ transform: [{
146
+ scaleX: -1
147
+ }]
163
148
  }
164
149
  });
165
150
  //# sourceMappingURL=OnboardingPages.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","useRef","tinycolor","Animated","StyleSheet","Dimensions","Pagination","OnboardingPage","SkipButton","width","get","OnboardingPages","showPagination","showNext","props","_props$pages$previous","backgroundColorAnim","Value","current","previousPage","setPreviousPage","useState","currentPage_","pages","currentPage","currentBackgroundColor","backgroundColor","isLight","getBrightness","footerBackgroundColor","darken","toString","lighten","color","previousBackgroundColor","interpolatedBackgroundColor","interpolate","inputRange","outputRange","extrapolate","setPage_","newPageIndex","setPage","createElement","View","style","styles","container","skipButtonPosition","showSkip","buttonTextStyle","skipLabelStyle","buttonStyle","skipButtonContainerStyle","position","label","skipLabel","onPress","onSkip","paginationPosition","Fragment","customFooter","nextPage","onNext","onDone","showDone","animatedValue","scrollX","numberOfScreens","length","nextLabel","hasSkipPosition","doneLabel","paginationContainerStyle","buttonRightContainerStyle","buttonLeftContainerStyle","dotsContainerStyle","doneLabelStyle","nextLabelStyle","nextButtonContainerStyle","doneButtonContainerStyle","FlatList","ref","flatListRef","data","horizontal","pagingEnabled","showsHorizontalScrollIndicator","keyExtractor","_","index","renderItem","item","_extends","swap","key","onScroll","event","nativeEvent","contentOffset","x","useNativeDriver","scrollEventThrottle","onMomentumScrollEnd","pageIndex","Math","round","create","flex","justifyContent","alignItems","screen","pagination","flexDirection","paddingVertical","paddingHorizontal","dot","height","borderRadius","margin","dotsContainer"],"sourceRoot":"../../../src","sources":["components/OnboardingPages.tsx"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,MAAM,QAAQ,OAAO;AACrC,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,QAAQ,EAAEC,UAAU,EAAEC,UAAU,QAAkB,cAAc;AACzE,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,cAAc,QAAmB,QAAQ;AAElD,SAASC,UAAU,QAAQ,UAAU;AAErC,MAAM;EAAEC;AAAM,CAAC,GAAGJ,UAAU,CAACK,GAAG,CAAC,QAAQ,CAAC;AAW1C,OAAO,MAAMC,eAAe,GAAGA,CAAC;EAC9BC,cAAc,GAAG,IAAI;EACrBC,QAAQ,GAAG,IAAI;EACf,GAAGC;AACE,CAAC,KAAK;EAAA,IAAAC,qBAAA;EACX,MAAMC,mBAAmB,GAAGf,MAAM,CAAC,IAAIE,QAAQ,CAACc,KAAK,CAAC,CAAC,CAAC,CAAC,CAACC,OAAO;EACjE,MAAM,CAACC,YAAY,EAAEC,eAAe,CAAC,GAAGpB,KAAK,CAACqB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,YAAY,EAAE,CAAC;IACf5F,eAAe,EAAE,MAAM;IACvB6F,MAAM,EAAE;EACV,CAAC;EACDC,aAAa,EAAE;IACbP,aAAa,EAAE,KAAK;IACpBL,IAAI,EAAE,CAAC;IACPC,cAAc,EAAE;EAClB;AACF,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","useMemo","getBrightness","lighten","darken","Animated","StyleSheet","Dimensions","Pagination","OnboardingPage","SkipButton","width","get","OnboardingPages","showPagination","showNext","props","pageWidth","currentPage_","pages","currentPage","currentBackgroundColor","backgroundColor","isLight","footerBackgroundColor","color","interpolatedBackgroundColor","length","inputRange","map","_","i","outputRange","p","scrollX","interpolate","extrapolate","paginationProps","onNext","nextPage","onSkip","onDone","showDone","showPrevious","animatedValue","dotsAnimatedValue","showSkip","numberOfScreens","skipLabel","nextLabel","previousLabel","hasSkipPosition","skipButtonPosition","doneLabel","paginationStyle","progressBarStyle","progressBarFillStyle","dotsAreTappable","mirror","paginationContainerStyle","buttonRightContainerStyle","buttonLeftContainerStyle","dotsContainerStyle","doneLabelStyle","skipLabelStyle","previousLabelStyle","nextLabelStyle","skipButtonContainerStyle","nextButtonContainerStyle","doneButtonContainerStyle","previousButtonContainerStyle","createElement","View","style","styles","container","buttonTextStyle","buttonStyle","position","label","onPress","paginationPosition","Fragment","customFooter","FlatList","ref","node","setFlatListRef","data","horizontal","pagingEnabled","showsHorizontalScrollIndicator","scrollEnabled","undefined","keyExtractor","index","toString","renderItem","item","_extends","swap","key","onScroll","onScrollBeginDrag","scrollEventThrottle","onMomentumScrollEnd","event","pageIndex","Math","round","nativeEvent","contentOffset","x","setPage","create","flex","justifyContent","alignItems","screen","pagination","flexDirection","paddingVertical","paddingHorizontal","dot","height","borderRadius","margin","dotsContainer","transform","scaleX"],"sourceRoot":"../../../src","sources":["components/OnboardingPages.tsx"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AACtC,SAASC,aAAa,EAAEC,OAAO,EAA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KAAK,CAACiE,kBAAkB,KAAK,KAAK,iBACjCjF,KAAA,CAAAuE,aAAA,CAAAvE,KAAA,CAAAkF,QAAA,QACGpE,cAAc,IACbE,KAAK,CAACmE,YAAY,IAClBnE,KAAK,CAACmE,YAAY,CAAC;IAAE5C,QAAQ,EAAEvB,KAAK,CAACuB;EAAS,CAAC,CAAC,EACjD,CAACvB,KAAK,CAACmE,YAAY,IAAIrE,cAAc,iBACpCd,KAAA,CAAAuE,aAAA,CAAC/D,UAAU,EAAK6B,eAAkB,CAEpC,CAES,CAAC;AAEpB,CAAC;AAED,MAAMqC,MAAM,GAAGpE,UAAU,CAAC4G,MAAM,CAAC;EAC/BvC,SAAS,EAAE;IACTwC,IAAI,EAAE,CAAC;IACPC,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE;EACd,CAAC;EACDC,MAAM,EAAE;IACN3G,KAAK;IACLyG,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE,QAAQ;IACpB/F,eAAe,EAAE;EACnB,CAAC;EACDiG,UAAU,EAAE;IACVC,aAAa,EAAE,KAAK;IACpBH,UAAU,EAAE,QAAQ;IACpBI,eAAe,EAAE,EAAE;IACnBC,iBAAiB,EAAE,EAAE;IACrB/G;EACF,CAAC;EACDgH,GAAG,EAAE;IACHC,MAAM,EAAE,EAAE;IACVjH,KAAK,EAAE,EAAE;IACTkH,YAAY,EAAE,CAAC;IACfvG,eAAe,EAAE,MAAM;IACvBwG,MAAM,EAAE;EACV,CAAC;EACDC,aAAa,EAAE;IACbP,aAAa,EAAE,KAAK;IACpBL,IAAI,EAAE,CAAC;IACPC,cAAc,EAAE;EAClB,CAAC;EACD1D,MAAM,EAAE;IACNsE,SAAS,EAAE,CAAC;MAAEC,MAAM,EAAE,CAAC;IAAE,CAAC;EAC5B;AACF,CAAC,CAAC","ignoreList":[]}
@@ -4,12 +4,12 @@ const {
4
4
  width,
5
5
  height
6
6
  } = Dimensions.get('window');
7
- const potrait = height > width;
7
+ const portrait = height > width;
8
8
  export function OnboardingPage(props) {
9
9
  return /*#__PURE__*/React.createElement(View, {
10
10
  style: [styles.container, {
11
11
  width: props.width
12
- }, props.containerStyle, props.swap && styles.swapStyle]
12
+ }, props.containerStyle, props.swap && styles.swapStyle, props.mirror && styles.mirror]
13
13
  }, /*#__PURE__*/React.createElement(View, {
14
14
  style: [styles.imageContainer, props.imageContainerStyle]
15
15
  }, props.image), /*#__PURE__*/React.createElement(View, {
@@ -43,7 +43,7 @@ const styles = StyleSheet.create({
43
43
  },
44
44
  imageContainer: {
45
45
  flex: 0,
46
- paddingBottom: potrait ? 60 : 10,
46
+ paddingBottom: portrait ? 60 : 10,
47
47
  alignItems: 'center',
48
48
  width: '100%'
49
49
  },
@@ -52,6 +52,11 @@ const styles = StyleSheet.create({
52
52
  },
53
53
  swapStyle: {
54
54
  flexDirection: 'column-reverse'
55
+ },
56
+ mirror: {
57
+ transform: [{
58
+ scaleX: -1
59
+ }]
55
60
  }
56
61
  });
57
62
  //# sourceMappingURL=Page.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["View","Text","StyleSheet","Dimensions","React","width","height","get","potrait","OnboardingPage","props","createElement","style","styles","container","containerStyle","swap","swapStyle","imageContainer","imageContainerStyle","image","titleContainer","titleContainerStyle","title","color","titleStyle","subtitle","subtitleStyle","create","flex","justifyContent","alignItems","flexDirection","fontSize","fontWeight","paddingBottom","textAlign","marginHorizontal"],"sourceRoot":"../../../src","sources":["components/Page.tsx"],"mappings":"AAAA,SACEA,IAAI,EACJC,IAAI,EACJC,UAAU,EACVC,UAAU,QAIL,cAAc;AACrB,OAAOC,KAAK,MAAM,OAAO;AAiBzB,MAAM;EAAEC,KAAK;EAAEC;AAAO,CAAC,GAAGH,UAAU,CAACI,GAAG,CAAC,QAAQ,CAAC;AAClD,MAAMC,OAAO,GAAGF,MAAM,GAAGD,KAAK;AAE9B,OAAO,SAASI,cAAcA,CAACC,KAAW,EAAE;EAC1C,oBACEN,KAAA,CAAAO,aAAA,CAACX,I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EAAE;IACdW,IAAI,EAAE,CAAC;IACPM,aAAa,EAAE3B,OAAO,GAAG,EAAE,GAAG,EAAE;IAChCuB,UAAU,EAAE,QAAQ;IACpB1B,KAAK,EAAE;EACT,CAAC;EACDgB,cAAc,EAAE;IACdgB,gBAAgB,EAAE;EACpB,CAAC;EACDpB,SAAS,EAAE;IACTe,aAAa,EAAE;EACjB;AACF,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["View","Text","StyleSheet","Dimensions","React","width","height","get","portrait","OnboardingPage","props","createElement","style","styles","container","containerStyle","swap","swapStyle","mirror","imageContainer","imageContainerStyle","image","titleContainer","titleContainerStyle","title","color","titleStyle","subtitle","subtitleStyle","create","flex","justifyContent","alignItems","flexDirection","fontSize","fontWeight","paddingBottom","textAlign","marginHorizontal","transform","scaleX"],"sourceRoot":"../../../src","sources":["components/Page.tsx"],"mappings":"AAAA,SACEA,IAAI,EACJC,IAAI,EACJC,UAAU,EACVC,UAAU,QAIL,cAAc;AACrB,OAAOC,KAAK,MAAM,OAAO;AAmBzB,MAAM;EAAEC,KAAK;EAAEC;AAAO,CAAC,GAAGH,UAAU,CAACI,GAAG,CAAC,QAAQ,CAAC;AAClD,MAAMC,QAAQ,GAAGF,MAAM,GAAGD,KAAK;AAE/B,OAAO,SAASI,cAAcA,CAACC,KAAW,EAAE;EAC1C,oBACEN,KAAA,CAAAO,aAAA,CAACX,IAAI;IACHY,KAAK,EAAE,CACLC,MAAM,CAACC,SAAS,EAChB;MAAET,KAAK,EAAEK,KAAK,CAACL;IAAM,CAAC,EACtBK,KAAK,CAACK,cAAc,EACpBL,KAAK,CAACM,IAAI,IAAIH,MAAM,CAACI,SAAS,EAC9BP,KAAK,CAACQ,MAAM,IAAIL,MAAM,CAACK,MAAM;EAC7B,gBAEFd,KAAA,CAAAO,aAAA,CAACX,IAAI;IAACY,KAAK,EAAE,CAACC,MAAM,CAACM,cAAc,EAAET,KAAK,CAACU,mBAAmB;EAAE,GAC7DV,KAAK,CA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CAAC;IAAE,CAAC;EAC5B;AACF,CAAC,CAAC","ignoreList":[]}
@@ -1,28 +1,61 @@
1
- import { View, Animated, StyleSheet } from 'react-native';
1
+ 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); }
2
+ import { View, Pressable, Animated, StyleSheet } from 'react-native';
2
3
  import React from 'react';
4
+ import { setAlpha } from '../utils/color';
3
5
  import { useOnboarding } from '../hooks/useOnboarding';
4
6
  import { Button } from './button';
5
7
  export function Pagination(props) {
6
8
  const {
7
- isDone
9
+ isDone,
10
+ currentPage,
11
+ progress,
12
+ scrollTo,
13
+ previousPage
8
14
  } = useOnboarding();
9
15
  const dots = Array.from({
10
16
  length: props.numberOfScreens
11
17
  }, (_, i) => i);
12
18
  const width = props.width;
19
+ const showPrevious = props.showPrevious && currentPage > 0;
13
20
  return /*#__PURE__*/React.createElement(View, {
14
21
  style: [styles.pagination, {
15
22
  backgroundColor: props.backgroundColor
16
23
  }, props.paginationContainerStyle]
17
24
  }, /*#__PURE__*/React.createElement(View, {
18
25
  style: [styles.buttons, styles.leftButton, props.buttonLeftContainerStyle]
19
- }, props.showSkip && !props.hasSkipPosition && /*#__PURE__*/React.createElement(Button, {
26
+ }, showPrevious && /*#__PURE__*/React.createElement(Button, {
27
+ onPress: () => previousPage(),
28
+ buttonTextStyle: props.previousLabelStyle,
29
+ buttonStyle: props.previousButtonContainerStyle,
30
+ label: props.previousLabel || 'Back'
31
+ }), !showPrevious && props.showSkip && !props.hasSkipPosition && /*#__PURE__*/React.createElement(Button, {
20
32
  onPress: props.onSkip,
21
33
  buttonTextStyle: props.skipLabelStyle,
22
34
  buttonStyle: props.skipButtonContainerStyle,
23
35
  label: props.skipLabel || 'Skip'
24
- })), /*#__PURE__*/React.createElement(View, {
25
- style: styles.dotsContainer
36
+ })), props.paginationStyle === 'progress' ? /*#__PURE__*/React.createElement(View, {
37
+ accessible: true,
38
+ accessibilityRole: "progressbar",
39
+ accessibilityValue: {
40
+ min: 0,
41
+ max: 100,
42
+ now: progress
43
+ },
44
+ style: [styles.progressTrack,
45
+ // Derive a faint track from the (background-aware) fill color so it
46
+ // stays visible on both light and dark pages.
47
+ {
48
+ backgroundColor: setAlpha(props.color, 0.25)
49
+ },
50
+ // Mirror the fill direction so it grows from the trailing edge.
51
+ props.mirror && styles.mirror, props.progressBarStyle]
52
+ }, /*#__PURE__*/React.createElement(View, {
53
+ style: [styles.progressFill, {
54
+ backgroundColor: props.color,
55
+ width: `${progress}%`
56
+ }, props.progressBarFillStyle]
57
+ })) : /*#__PURE__*/React.createElement(View, {
58
+ style: [styles.dotsContainer, props.mirror && styles.mirror, props.dotsContainerStyle]
26
59
  }, dots.map((_, i) => {
27
60
  const inputRange = [(i - 1) * width, i * width, (i + 1) * width];
28
61
  const dotOpacity = props.animatedValue.interpolate({
@@ -30,13 +63,27 @@ export function Pagination(props) {
30
63
  outputRange: [0.3, 1, 0.3],
31
64
  extrapolate: 'clamp'
32
65
  });
33
- return /*#__PURE__*/React.createElement(Animated.View, {
66
+ const dotProps = {
67
+ accessibilityRole: props.dotsAreTappable ? 'button' : 'image',
68
+ accessibilityLabel: `Page ${i + 1} of ${props.numberOfScreens}`,
69
+ accessibilityState: {
70
+ selected: i === currentPage
71
+ }
72
+ };
73
+ const dot = /*#__PURE__*/React.createElement(Animated.View, {
34
74
  key: i,
35
75
  style: [styles.dot, {
36
76
  backgroundColor: props.color,
37
77
  opacity: dotOpacity
38
- }, props.dotsContainerStyle]
78
+ }]
39
79
  });
80
+ return props.dotsAreTappable ? /*#__PURE__*/React.createElement(Pressable, _extends({
81
+ key: i,
82
+ onPress: () => scrollTo(i),
83
+ hitSlop: 8
84
+ }, dotProps), dot) : /*#__PURE__*/React.createElement(View, _extends({
85
+ key: i
86
+ }, dotProps), dot);
40
87
  })), /*#__PURE__*/React.createElement(View, {
41
88
  style: [styles.buttons, styles.rightButton, props.buttonRightContainerStyle]
42
89
  }, !isDone && props.showNext && /*#__PURE__*/React.createElement(Button, {
@@ -69,22 +116,37 @@ const styles = StyleSheet.create({
69
116
  },
70
117
  dotsContainer: {
71
118
  flexDirection: 'row',
72
- flex: 1,
73
- justifyContent: 'center'
119
+ flex: 2,
120
+ justifyContent: 'center',
121
+ alignItems: 'center'
122
+ },
123
+ progressTrack: {
124
+ flex: 2,
125
+ height: 6,
126
+ borderRadius: 3,
127
+ marginHorizontal: 16,
128
+ overflow: 'hidden'
129
+ },
130
+ progressFill: {
131
+ height: '100%',
132
+ borderRadius: 3
74
133
  },
75
134
  text: {
76
135
  fontSize: 16
77
136
  },
78
137
  buttons: {
79
- minWidth: 200
138
+ flex: 1
80
139
  },
81
140
  rightButton: {
82
- alignItems: 'flex-end',
83
- paddingRight: 30
141
+ alignItems: 'flex-end'
84
142
  },
85
143
  leftButton: {
86
- alignItems: 'flex-start',
87
- paddingLeft: 30
144
+ alignItems: 'flex-start'
145
+ },
146
+ mirror: {
147
+ transform: [{
148
+ scaleX: -1
149
+ }]
88
150
  }
89
151
  });
90
152
  //# sourceMappingURL=Pagination.js.map