@rocapine/react-native-onboarding-ui 1.13.0 → 1.15.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.
Files changed (69) hide show
  1. package/dist/UI/Pages/Carousel/Renderer.d.ts.map +1 -1
  2. package/dist/UI/Pages/Carousel/Renderer.js +13 -12
  3. package/dist/UI/Pages/Carousel/Renderer.js.map +1 -1
  4. package/dist/UI/Pages/Commitment/Renderer.d.ts.map +1 -1
  5. package/dist/UI/Pages/Commitment/Renderer.js +31 -30
  6. package/dist/UI/Pages/Commitment/Renderer.js.map +1 -1
  7. package/dist/UI/Pages/ComposableScreen/Renderer.js.map +1 -1
  8. package/dist/UI/Pages/ComposableScreen/elements/SafeAreaViewElement.d.ts +114 -0
  9. package/dist/UI/Pages/ComposableScreen/elements/SafeAreaViewElement.d.ts.map +1 -0
  10. package/dist/UI/Pages/ComposableScreen/elements/SafeAreaViewElement.js +62 -0
  11. package/dist/UI/Pages/ComposableScreen/elements/SafeAreaViewElement.js.map +1 -0
  12. package/dist/UI/Pages/ComposableScreen/elements/StackElement.d.ts +1 -1
  13. package/dist/UI/Pages/ComposableScreen/elements/StackElement.d.ts.map +1 -1
  14. package/dist/UI/Pages/ComposableScreen/elements/TextElement.d.ts +1 -1
  15. package/dist/UI/Pages/ComposableScreen/elements/TextElement.d.ts.map +1 -1
  16. package/dist/UI/Pages/ComposableScreen/elements/VideoElement.d.ts +6 -0
  17. package/dist/UI/Pages/ComposableScreen/elements/VideoElement.d.ts.map +1 -1
  18. package/dist/UI/Pages/ComposableScreen/elements/VideoElement.js +3 -2
  19. package/dist/UI/Pages/ComposableScreen/elements/VideoElement.js.map +1 -1
  20. package/dist/UI/Pages/ComposableScreen/elements/ZStackElement.d.ts +77 -0
  21. package/dist/UI/Pages/ComposableScreen/elements/ZStackElement.d.ts.map +1 -0
  22. package/dist/UI/Pages/ComposableScreen/elements/ZStackElement.js +39 -0
  23. package/dist/UI/Pages/ComposableScreen/elements/ZStackElement.js.map +1 -0
  24. package/dist/UI/Pages/ComposableScreen/elements/renderElement.d.ts +1 -1
  25. package/dist/UI/Pages/ComposableScreen/elements/renderElement.d.ts.map +1 -1
  26. package/dist/UI/Pages/ComposableScreen/elements/renderElement.js +8 -0
  27. package/dist/UI/Pages/ComposableScreen/elements/renderElement.js.map +1 -1
  28. package/dist/UI/Pages/ComposableScreen/elements/shared.d.ts +1 -1
  29. package/dist/UI/Pages/ComposableScreen/elements/shared.d.ts.map +1 -1
  30. package/dist/UI/Pages/ComposableScreen/types.d.ts +16 -0
  31. package/dist/UI/Pages/ComposableScreen/types.d.ts.map +1 -1
  32. package/dist/UI/Pages/ComposableScreen/types.js +16 -0
  33. package/dist/UI/Pages/ComposableScreen/types.js.map +1 -1
  34. package/dist/UI/Pages/Loader/Renderer.d.ts.map +1 -1
  35. package/dist/UI/Pages/Loader/Renderer.js +8 -7
  36. package/dist/UI/Pages/Loader/Renderer.js.map +1 -1
  37. package/dist/UI/Pages/MediaContent/Renderer.d.ts.map +1 -1
  38. package/dist/UI/Pages/MediaContent/Renderer.js +5 -4
  39. package/dist/UI/Pages/MediaContent/Renderer.js.map +1 -1
  40. package/dist/UI/Pages/Picker/Renderer.d.ts.map +1 -1
  41. package/dist/UI/Pages/Picker/Renderer.js +24 -23
  42. package/dist/UI/Pages/Picker/Renderer.js.map +1 -1
  43. package/dist/UI/Pages/Question/Renderer.d.ts.map +1 -1
  44. package/dist/UI/Pages/Question/Renderer.js +13 -12
  45. package/dist/UI/Pages/Question/Renderer.js.map +1 -1
  46. package/dist/UI/Pages/Ratings/Renderer.d.ts.map +1 -1
  47. package/dist/UI/Pages/Ratings/Renderer.js +15 -14
  48. package/dist/UI/Pages/Ratings/Renderer.js.map +1 -1
  49. package/dist/UI/Templates/OnboardingTemplate.d.ts.map +1 -1
  50. package/dist/UI/Templates/OnboardingTemplate.js +1 -4
  51. package/dist/UI/Templates/OnboardingTemplate.js.map +1 -1
  52. package/package.json +2 -2
  53. package/src/UI/Pages/Carousel/Renderer.tsx +3 -0
  54. package/src/UI/Pages/Commitment/Renderer.tsx +3 -0
  55. package/src/UI/Pages/ComposableScreen/Renderer.tsx +1 -1
  56. package/src/UI/Pages/ComposableScreen/elements/SafeAreaViewElement.tsx +93 -0
  57. package/src/UI/Pages/ComposableScreen/elements/StackElement.tsx +1 -1
  58. package/src/UI/Pages/ComposableScreen/elements/TextElement.tsx +1 -1
  59. package/src/UI/Pages/ComposableScreen/elements/VideoElement.tsx +3 -0
  60. package/src/UI/Pages/ComposableScreen/elements/ZStackElement.tsx +60 -0
  61. package/src/UI/Pages/ComposableScreen/elements/renderElement.tsx +11 -1
  62. package/src/UI/Pages/ComposableScreen/elements/shared.ts +1 -1
  63. package/src/UI/Pages/ComposableScreen/types.ts +32 -0
  64. package/src/UI/Pages/Loader/Renderer.tsx +7 -0
  65. package/src/UI/Pages/MediaContent/Renderer.tsx +3 -0
  66. package/src/UI/Pages/Picker/Renderer.tsx +11 -0
  67. package/src/UI/Pages/Question/Renderer.tsx +4 -0
  68. package/src/UI/Pages/Ratings/Renderer.tsx +4 -0
  69. package/src/UI/Templates/OnboardingTemplate.tsx +1 -5
@@ -13,6 +13,8 @@ import { type RadioGroupElementProps, RadioGroupElementPropsSchema } from "./ele
13
13
  import { type CheckboxGroupElementProps, CheckboxGroupElementPropsSchema } from "./elements/CheckboxGroupElement";
14
14
  import { type DatePickerElementProps, DatePickerElementPropsSchema } from "./elements/DatePickerElement";
15
15
  import { type CarouselElementProps, CarouselElementPropsSchema } from "./elements/CarouselElement";
16
+ import { type ZStackElementProps, ZStackElementPropsSchema } from "./elements/ZStackElement";
17
+ import { type SafeAreaViewElementProps, SafeAreaViewElementPropsSchema } from "./elements/SafeAreaViewElement";
16
18
 
17
19
  export type { BaseBoxProps } from "./elements/BaseBoxProps";
18
20
  export { BaseBoxPropsSchema } from "./elements/BaseBoxProps";
@@ -29,6 +31,8 @@ export type { RadioGroupElementProps } from "./elements/RadioGroupElement";
29
31
  export type { CheckboxGroupElementProps } from "./elements/CheckboxGroupElement";
30
32
  export type { DatePickerElementProps } from "./elements/DatePickerElement";
31
33
  export type { CarouselElementProps } from "./elements/CarouselElement";
34
+ export type { ZStackElementProps } from "./elements/ZStackElement";
35
+ export type { SafeAreaViewElementProps, SafeAreaEdge, SafeAreaEdgeMode } from "./elements/SafeAreaViewElement";
32
36
 
33
37
  // UIElement union — must live here (not in elements/) to avoid circular deps
34
38
  // because the Stack variant's children: UIElement[] references itself.
@@ -112,6 +116,20 @@ export type UIElement =
112
116
  type: "Carousel";
113
117
  props: CarouselElementProps;
114
118
  children: UIElement[];
119
+ }
120
+ | {
121
+ id: string;
122
+ name?: string;
123
+ type: "ZStack";
124
+ props: ZStackElementProps;
125
+ children: UIElement[];
126
+ }
127
+ | {
128
+ id: string;
129
+ name?: string;
130
+ type: "SafeAreaView";
131
+ props: SafeAreaViewElementProps;
132
+ children: UIElement[];
115
133
  };
116
134
 
117
135
  export const UIElementSchema: z.ZodType<UIElement> = z.lazy(() =>
@@ -196,6 +214,20 @@ export const UIElementSchema: z.ZodType<UIElement> = z.lazy(() =>
196
214
  props: CarouselElementPropsSchema,
197
215
  children: z.array(UIElementSchema),
198
216
  }),
217
+ z.object({
218
+ id: z.string(),
219
+ name: z.string().optional(),
220
+ type: z.literal("ZStack"),
221
+ props: ZStackElementPropsSchema,
222
+ children: z.array(UIElementSchema),
223
+ }),
224
+ z.object({
225
+ id: z.string(),
226
+ name: z.string().optional(),
227
+ type: z.literal("SafeAreaView"),
228
+ props: SafeAreaViewElementPropsSchema,
229
+ children: z.array(UIElementSchema),
230
+ }),
199
231
  ])
200
232
  );
201
233
 
@@ -1,4 +1,5 @@
1
1
  import { OnboardingTemplate } from "../../Templates/OnboardingTemplate";
2
+ import { SafeAreaView } from "react-native-safe-area-context";
2
3
  import { LoaderStepType, LoaderStepTypeSchema, LoaderStep } from "./types";
3
4
  import {
4
5
  View,
@@ -97,6 +98,7 @@ const BarsVariant = ({
97
98
  const styles = createStyles(theme);
98
99
 
99
100
  return (
101
+ <SafeAreaView style={{ flex: 1 }} edges={["top", "bottom"]}>
100
102
  <OnboardingTemplate
101
103
  step={step}
102
104
  onContinue={onContinue}
@@ -113,6 +115,7 @@ const BarsVariant = ({
113
115
  <ScrollView
114
116
  contentContainerStyle={styles.scrollContent}
115
117
  showsVerticalScrollIndicator={false}
118
+ alwaysBounceVertical={false}
116
119
  >
117
120
  <View style={styles.container}>
118
121
  {/* Title */}
@@ -147,6 +150,7 @@ const BarsVariant = ({
147
150
  />
148
151
  )}
149
152
  </OnboardingTemplate>
153
+ </SafeAreaView>
150
154
  );
151
155
  };
152
156
 
@@ -171,10 +175,12 @@ const CircleVariant = ({
171
175
  const styles = createStyles(theme);
172
176
 
173
177
  return (
178
+ <SafeAreaView style={{ flex: 1 }} edges={["top", "bottom"]}>
174
179
  <OnboardingTemplate step={step} onContinue={onContinue} theme={theme}>
175
180
  <ScrollView
176
181
  contentContainerStyle={styles.scrollContent}
177
182
  showsVerticalScrollIndicator={false}
183
+ alwaysBounceVertical={false}
178
184
  >
179
185
  <View style={styles.container}>
180
186
  {/* Circular Progress */}
@@ -201,6 +207,7 @@ const CircleVariant = ({
201
207
  </View>
202
208
  </ScrollView>
203
209
  </OnboardingTemplate>
210
+ </SafeAreaView>
204
211
  );
205
212
  };
206
213
 
@@ -1,4 +1,5 @@
1
1
  import { OnboardingTemplate } from "../../Templates/OnboardingTemplate";
2
+ import { SafeAreaView } from "react-native-safe-area-context";
2
3
  import { MediaContentStepType, MediaContentStepTypeSchema } from "./types";
3
4
  import { View, Text, StyleSheet, Image, ScrollView } from "react-native";
4
5
  import { Theme } from "../../Theme/types";
@@ -115,6 +116,7 @@ const MediaContentRendererBase = ({ step, onContinue, theme = defaultTheme }: Co
115
116
  };
116
117
 
117
118
  return (
119
+ <SafeAreaView style={{ flex: 1 }} edges={["top", "bottom"]}>
118
120
  <OnboardingTemplate
119
121
  step={step}
120
122
  onContinue={onContinue}
@@ -126,6 +128,7 @@ const MediaContentRendererBase = ({ step, onContinue, theme = defaultTheme }: Co
126
128
  >
127
129
  {renderContent()}
128
130
  </OnboardingTemplate>
131
+ </SafeAreaView>
129
132
  );
130
133
  };
131
134
 
@@ -1,4 +1,5 @@
1
1
  import { OnboardingTemplate } from "../../Templates/OnboardingTemplate";
2
+ import { SafeAreaView } from "react-native-safe-area-context";
2
3
  import { PickerStepType, PickerStepTypeSchema, WeightUnit, HeightUnit } from "./types";
3
4
  import { View, Text, StyleSheet, TextInput, KeyboardAvoidingView, Platform, TouchableWithoutFeedback, Keyboard } from "react-native";
4
5
  import { useState } from "react";
@@ -86,6 +87,7 @@ const PickerRendererBase = ({ step, onContinue, theme = defaultTheme }: ContentP
86
87
 
87
88
  // Fallback for other picker types (to be implemented)
88
89
  return (
90
+ <SafeAreaView style={{ flex: 1 }} edges={["top", "bottom", "left", "right"]}>
89
91
  <OnboardingTemplate
90
92
  step={step}
91
93
  onContinue={() => onContinue()}
@@ -102,6 +104,7 @@ const PickerRendererBase = ({ step, onContinue, theme = defaultTheme }: ContentP
102
104
  </View>
103
105
  </View>
104
106
  </OnboardingTemplate>
107
+ </SafeAreaView>
105
108
  );
106
109
  };
107
110
 
@@ -145,6 +148,7 @@ const WeightPicker = ({
145
148
  };
146
149
 
147
150
  return (
151
+ <SafeAreaView style={{ flex: 1 }} edges={["top", "bottom", "left", "right"]}>
148
152
  <OnboardingTemplate
149
153
  step={step}
150
154
  onContinue={handleContinue}
@@ -189,6 +193,7 @@ const WeightPicker = ({
189
193
  </View>
190
194
  </View>
191
195
  </OnboardingTemplate>
196
+ </SafeAreaView>
192
197
  );
193
198
  };
194
199
 
@@ -261,6 +266,7 @@ const HeightPicker = ({
261
266
  };
262
267
 
263
268
  return (
269
+ <SafeAreaView style={{ flex: 1 }} edges={["top", "bottom", "left", "right"]}>
264
270
  <OnboardingTemplate
265
271
  step={step}
266
272
  onContinue={handleContinue}
@@ -330,6 +336,7 @@ const HeightPicker = ({
330
336
  </View>
331
337
  </View>
332
338
  </OnboardingTemplate>
339
+ </SafeAreaView>
333
340
  );
334
341
  };
335
342
 
@@ -361,6 +368,7 @@ const NamePicker = ({
361
368
  };
362
369
 
363
370
  return (
371
+ <SafeAreaView style={{ flex: 1 }} edges={["top", "bottom", "left", "right"]}>
364
372
  <KeyboardAvoidingView
365
373
  behavior={Platform.OS === "ios" ? "padding" : "height"}
366
374
  style={{ flex: 1 }}
@@ -412,6 +420,7 @@ const NamePicker = ({
412
420
  </View>
413
421
  </TouchableWithoutFeedback>
414
422
  </KeyboardAvoidingView>
423
+ </SafeAreaView>
415
424
  );
416
425
  };
417
426
 
@@ -476,6 +485,7 @@ const DatePicker = ({
476
485
  };
477
486
 
478
487
  return (
488
+ <SafeAreaView style={{ flex: 1 }} edges={["top", "bottom", "left", "right"]}>
479
489
  <OnboardingTemplate
480
490
  step={step}
481
491
  onContinue={handleContinue}
@@ -531,6 +541,7 @@ const DatePicker = ({
531
541
  </View>
532
542
  </View>
533
543
  </OnboardingTemplate>
544
+ </SafeAreaView>
534
545
  );
535
546
  };
536
547
 
@@ -8,6 +8,7 @@ import {
8
8
  StyleSheet,
9
9
  } from "react-native";
10
10
  import { OnboardingTemplate } from "../../Templates/OnboardingTemplate";
11
+ import { SafeAreaView } from "react-native-safe-area-context";
11
12
  import { getTextStyle } from "../../Theme/helpers";
12
13
  import { Theme } from "../../Theme/types";
13
14
  import { defaultTheme } from "../../Theme/defaultTheme";
@@ -86,6 +87,7 @@ const QuestionRendererBase = ({ step, onContinue, theme = defaultTheme, customCo
86
87
  customComponents?.QuestionAnswerButton || DefaultQuestionAnswerButton;
87
88
 
88
89
  return (
90
+ <SafeAreaView style={{ flex: 1 }} edges={["top", "bottom"]}>
89
91
  <OnboardingTemplate
90
92
  step={step}
91
93
  onContinue={handleContinue || (() => { })}
@@ -127,6 +129,7 @@ const QuestionRendererBase = ({ step, onContinue, theme = defaultTheme, customCo
127
129
  style={styles.scrollView}
128
130
  contentContainerStyle={styles.scrollContent}
129
131
  showsVerticalScrollIndicator={false}
132
+ alwaysBounceVertical={false}
130
133
  >
131
134
  <AnswersList
132
135
  answers={answers}
@@ -139,6 +142,7 @@ const QuestionRendererBase = ({ step, onContinue, theme = defaultTheme, customCo
139
142
  </View>
140
143
  </View>
141
144
  </OnboardingTemplate>
145
+ </SafeAreaView>
142
146
  );
143
147
  };
144
148
 
@@ -1,6 +1,7 @@
1
1
  import { Image, ScrollView, StyleSheet, Text, View } from "react-native";
2
2
  import Svg, { Path } from "react-native-svg";
3
3
  import { OnboardingTemplate } from "../../Templates/OnboardingTemplate";
4
+ import { SafeAreaView } from "react-native-safe-area-context";
4
5
  import { RatingsStepType, RatingsStepTypeSchema } from "./types";
5
6
  import { useState } from "react";
6
7
  import { Theme } from "../../Theme/types";
@@ -76,6 +77,7 @@ const RatingsRendererBase = ({ step, onContinue, theme = defaultTheme }: Ratings
76
77
  };
77
78
 
78
79
  return (
80
+ <SafeAreaView style={{ flex: 1 }} edges={["top", "bottom"]}>
79
81
  <OnboardingTemplate
80
82
  step={step}
81
83
  onContinue={handlePress}
@@ -92,6 +94,7 @@ const RatingsRendererBase = ({ step, onContinue, theme = defaultTheme }: Ratings
92
94
  <ScrollView
93
95
  contentContainerStyle={styles.scrollContent}
94
96
  showsVerticalScrollIndicator={false}
97
+ alwaysBounceVertical={false}
95
98
  >
96
99
  {/* Award Section */}
97
100
  <View style={styles.awardSection}>
@@ -168,6 +171,7 @@ const RatingsRendererBase = ({ step, onContinue, theme = defaultTheme }: Ratings
168
171
  </ScrollView>
169
172
  </View>
170
173
  </OnboardingTemplate>
174
+ </SafeAreaView>
171
175
  );
172
176
  };
173
177
 
@@ -1,6 +1,5 @@
1
1
  import { StyleSheet, Text, TouchableOpacity, View } from "react-native";
2
2
  import { OnboardingStepType } from "../types";
3
- import { useSafeAreaInsets } from "react-native-safe-area-context";
4
3
  import { getTextStyle } from "../Theme/helpers";
5
4
  import { Theme } from "../Theme/types";
6
5
  import { defaultTheme } from "../Theme/defaultTheme";
@@ -60,16 +59,13 @@ export const OnboardingTemplate = ({
60
59
  button,
61
60
  theme = defaultTheme,
62
61
  }: OnboardingTemplateProps) => {
63
- const { top, bottom } = useSafeAreaInsets();
64
-
65
62
  return (
66
63
  <View
67
64
  style={[
68
65
  styles.container,
69
66
  {
70
67
  backgroundColor: theme.colors.neutral.lowest,
71
- paddingTop: step.displayProgressHeader ? top + 40 : top,
72
- paddingBottom: bottom
68
+ paddingTop: step.displayProgressHeader ? 40 : 0,
73
69
  },
74
70
  ]}
75
71
  >