@rocapine/react-native-onboarding-ui 1.6.0 → 1.8.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 (84) hide show
  1. package/dist/UI/OnboardingPage.js +1 -1
  2. package/dist/UI/OnboardingPage.js.map +1 -1
  3. package/dist/UI/Pages/ComposableScreen/Renderer.d.ts +0 -2
  4. package/dist/UI/Pages/ComposableScreen/Renderer.d.ts.map +1 -1
  5. package/dist/UI/Pages/ComposableScreen/Renderer.js +13 -273
  6. package/dist/UI/Pages/ComposableScreen/Renderer.js.map +1 -1
  7. package/dist/UI/Pages/ComposableScreen/elements/BaseBoxProps.d.ts +30 -0
  8. package/dist/UI/Pages/ComposableScreen/elements/BaseBoxProps.d.ts.map +1 -0
  9. package/dist/UI/Pages/ComposableScreen/elements/BaseBoxProps.js +19 -0
  10. package/dist/UI/Pages/ComposableScreen/elements/BaseBoxProps.js.map +1 -0
  11. package/dist/UI/Pages/ComposableScreen/elements/ButtonElement.d.ts +67 -0
  12. package/dist/UI/Pages/ComposableScreen/elements/ButtonElement.d.ts.map +1 -0
  13. package/dist/UI/Pages/ComposableScreen/elements/ButtonElement.js +65 -0
  14. package/dist/UI/Pages/ComposableScreen/elements/ButtonElement.js.map +1 -0
  15. package/dist/UI/Pages/ComposableScreen/elements/IconElement.d.ts +41 -0
  16. package/dist/UI/Pages/ComposableScreen/elements/IconElement.d.ts.map +1 -0
  17. package/dist/UI/Pages/ComposableScreen/elements/IconElement.js +37 -0
  18. package/dist/UI/Pages/ComposableScreen/elements/IconElement.js.map +1 -0
  19. package/dist/UI/Pages/ComposableScreen/elements/ImageElement.d.ts +42 -0
  20. package/dist/UI/Pages/ComposableScreen/elements/ImageElement.d.ts.map +1 -0
  21. package/dist/UI/Pages/ComposableScreen/elements/ImageElement.js +34 -0
  22. package/dist/UI/Pages/ComposableScreen/elements/ImageElement.js.map +1 -0
  23. package/dist/UI/Pages/ComposableScreen/elements/InputElement.d.ts +102 -0
  24. package/dist/UI/Pages/ComposableScreen/elements/InputElement.d.ts.map +1 -0
  25. package/dist/UI/Pages/ComposableScreen/elements/InputElement.js +68 -0
  26. package/dist/UI/Pages/ComposableScreen/elements/InputElement.js.map +1 -0
  27. package/dist/UI/Pages/ComposableScreen/elements/LottieElement.d.ts +39 -0
  28. package/dist/UI/Pages/ComposableScreen/elements/LottieElement.d.ts.map +1 -0
  29. package/dist/UI/Pages/ComposableScreen/elements/LottieElement.js +60 -0
  30. package/dist/UI/Pages/ComposableScreen/elements/LottieElement.js.map +1 -0
  31. package/dist/UI/Pages/ComposableScreen/elements/RadioGroupElement.d.ts +78 -0
  32. package/dist/UI/Pages/ComposableScreen/elements/RadioGroupElement.d.ts.map +1 -0
  33. package/dist/UI/Pages/ComposableScreen/elements/RadioGroupElement.js +119 -0
  34. package/dist/UI/Pages/ComposableScreen/elements/RadioGroupElement.js.map +1 -0
  35. package/dist/UI/Pages/ComposableScreen/elements/RiveElement.d.ts +62 -0
  36. package/dist/UI/Pages/ComposableScreen/elements/RiveElement.d.ts.map +1 -0
  37. package/dist/UI/Pages/ComposableScreen/elements/RiveElement.js +68 -0
  38. package/dist/UI/Pages/ComposableScreen/elements/RiveElement.js.map +1 -0
  39. package/dist/UI/Pages/ComposableScreen/elements/StackElement.d.ts +85 -0
  40. package/dist/UI/Pages/ComposableScreen/elements/StackElement.d.ts.map +1 -0
  41. package/dist/UI/Pages/ComposableScreen/elements/StackElement.js +64 -0
  42. package/dist/UI/Pages/ComposableScreen/elements/StackElement.js.map +1 -0
  43. package/dist/UI/Pages/ComposableScreen/elements/TextElement.d.ts +66 -0
  44. package/dist/UI/Pages/ComposableScreen/elements/TextElement.d.ts.map +1 -0
  45. package/dist/UI/Pages/ComposableScreen/elements/TextElement.js +59 -0
  46. package/dist/UI/Pages/ComposableScreen/elements/TextElement.js.map +1 -0
  47. package/dist/UI/Pages/ComposableScreen/elements/VideoElement.d.ts +41 -0
  48. package/dist/UI/Pages/ComposableScreen/elements/VideoElement.d.ts.map +1 -0
  49. package/dist/UI/Pages/ComposableScreen/elements/VideoElement.js +84 -0
  50. package/dist/UI/Pages/ComposableScreen/elements/VideoElement.js.map +1 -0
  51. package/dist/UI/Pages/ComposableScreen/elements/renderElement.d.ts +5 -0
  52. package/dist/UI/Pages/ComposableScreen/elements/renderElement.d.ts.map +1 -0
  53. package/dist/UI/Pages/ComposableScreen/elements/renderElement.js +49 -0
  54. package/dist/UI/Pages/ComposableScreen/elements/renderElement.js.map +1 -0
  55. package/dist/UI/Pages/ComposableScreen/elements/shared.d.ts +13 -0
  56. package/dist/UI/Pages/ComposableScreen/elements/shared.d.ts.map +1 -0
  57. package/dist/UI/Pages/ComposableScreen/elements/shared.js +6 -0
  58. package/dist/UI/Pages/ComposableScreen/elements/shared.js.map +1 -0
  59. package/dist/UI/Pages/ComposableScreen/types.d.ts +40 -113
  60. package/dist/UI/Pages/ComposableScreen/types.d.ts.map +1 -1
  61. package/dist/UI/Pages/ComposableScreen/types.js +33 -121
  62. package/dist/UI/Pages/ComposableScreen/types.js.map +1 -1
  63. package/dist/UI/Provider/OnboardingProgressProvider.d.ts +6 -2
  64. package/dist/UI/Provider/OnboardingProgressProvider.d.ts.map +1 -1
  65. package/dist/UI/Provider/OnboardingProgressProvider.js +4 -3
  66. package/dist/UI/Provider/OnboardingProgressProvider.js.map +1 -1
  67. package/package.json +2 -2
  68. package/src/UI/OnboardingPage.tsx +1 -1
  69. package/src/UI/Pages/ComposableScreen/Renderer.tsx +22 -430
  70. package/src/UI/Pages/ComposableScreen/elements/BaseBoxProps.ts +31 -0
  71. package/src/UI/Pages/ComposableScreen/elements/ButtonElement.tsx +96 -0
  72. package/src/UI/Pages/ComposableScreen/elements/IconElement.tsx +67 -0
  73. package/src/UI/Pages/ComposableScreen/elements/ImageElement.tsx +52 -0
  74. package/src/UI/Pages/ComposableScreen/elements/InputElement.tsx +115 -0
  75. package/src/UI/Pages/ComposableScreen/elements/LottieElement.tsx +97 -0
  76. package/src/UI/Pages/ComposableScreen/elements/RadioGroupElement.tsx +181 -0
  77. package/src/UI/Pages/ComposableScreen/elements/RiveElement.tsx +105 -0
  78. package/src/UI/Pages/ComposableScreen/elements/StackElement.tsx +103 -0
  79. package/src/UI/Pages/ComposableScreen/elements/TextElement.tsx +95 -0
  80. package/src/UI/Pages/ComposableScreen/elements/VideoElement.tsx +113 -0
  81. package/src/UI/Pages/ComposableScreen/elements/renderElement.tsx +61 -0
  82. package/src/UI/Pages/ComposableScreen/elements/shared.ts +15 -0
  83. package/src/UI/Pages/ComposableScreen/types.ts +56 -233
  84. package/src/UI/Provider/OnboardingProgressProvider.tsx +8 -5
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/UI/Pages/ComposableScreen/types.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,oCAA+C;AA8J/C,MAAM,kBAAkB,GAAG,OAAC,CAAC,MAAM,CAAC;IAClC,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC5C,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,gBAAgB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACvC,cAAc,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACrC,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,iBAAiB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACxC,eAAe,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACtC,WAAW,EAA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,EAAE;QAC3B,IAAI,EAAE,OAAC,CAAC,OAAO,CAAC,YAAY,CAAC;QAC7B,KAAK,EAAE,gDAA4B;KACpC,CAAC;CACH,CAAC,CACH,CAAC;AAEW,QAAA,iCAAiC,GAAG,OAAC,CAAC,MAAM,CAAC;IACxD,QAAQ,EAAE,OAAC,CAAC,KAAK,CAAC,uBAAe,CAAC;CACnC,CAAC,CAAC;AAEU,QAAA,8BAA8B,GAAG,OAAC,CAAC,MAAM,CAAC;IACrD,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;IACd,IAAI,EAAE,OAAC,CAAC,OAAO,CAAC,kBAAkB,CAAC;IACnC,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,qBAAqB,EAAE,OAAC,CAAC,OAAO,EAAE;IAClC,OAAO,EAAE,yCAAiC;IAC1C,aAAa,EAAE,2BAAmB;IAClC,mBAAmB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC;IAC9D,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAChC,CAAC,CAAC"}
@@ -3,6 +3,10 @@ export declare const OnboardingProgressProvider: ({ children, initialColorScheme
3
3
  children: React.ReactNode;
4
4
  initialColorScheme?: ColorScheme;
5
5
  }) => import("react/jsx-runtime").JSX.Element;
6
+ export type ComposableVariableEntry = {
7
+ value: string;
8
+ label?: string;
9
+ };
6
10
  export declare const OnboardingProgressContext: import("react").Context<{
7
11
  activeStep: {
8
12
  number: number;
@@ -14,7 +18,7 @@ export declare const OnboardingProgressContext: import("react").Context<{
14
18
  }) => void;
15
19
  totalSteps: number;
16
20
  setTotalSteps: (_steps: number) => void;
17
- composableVariables: Record<string, string>;
18
- setComposableVariable: (_key: string, _value: string) => void;
21
+ composableVariables: Record<string, ComposableVariableEntry>;
22
+ setComposableVariable: (_key: string, _entry: ComposableVariableEntry | string) => void;
19
23
  }>;
20
24
  //# sourceMappingURL=OnboardingProgressProvider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"OnboardingProgressProvider.d.ts","sourceRoot":"","sources":["../../../src/UI/Provider/OnboardingProgressProvider.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,eAAO,MAAM,0BAA0B,GAAI,mCAGxC;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,kBAAkB,CAAC,EAAE,WAAW,CAAC;CAClC,4CAuBA,CAAC;AAEF,eAAO,MAAM,yBAAyB;;;;;2BAEb;QACrB,MAAM,EAAE,MAAM,CAAC;QACf,qBAAqB,EAAE,OAAO,CAAC;KAChC;;4BAEuB,MAAM;yBACH,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;kCACnB,MAAM,UAAU,MAAM;EACpD,CAAC"}
1
+ {"version":3,"file":"OnboardingProgressProvider.d.ts","sourceRoot":"","sources":["../../../src/UI/Provider/OnboardingProgressProvider.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,eAAO,MAAM,0BAA0B,GAAI,mCAGxC;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,kBAAkB,CAAC,EAAE,WAAW,CAAC;CAClC,4CAwBA,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAExE,eAAO,MAAM,yBAAyB;;;;;2BAEb;QACrB,MAAM,EAAE,MAAM,CAAC;QACf,qBAAqB,EAAE,OAAO,CAAC;KAChC;;4BAEuB,MAAM;yBACH,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC;kCACpC,MAAM,UAAU,uBAAuB,GAAG,MAAM;EAC9E,CAAC"}
@@ -12,8 +12,9 @@ const OnboardingProgressProvider = ({ children, initialColorScheme = "light", })
12
12
  });
13
13
  const [totalSteps, setTotalSteps] = (0, react_1.useState)(0);
14
14
  const [composableVariables, setComposableVariables] = (0, react_1.useState)({});
15
- const setComposableVariable = (0, react_1.useCallback)((key, value) => {
16
- setComposableVariables((prev) => (Object.assign(Object.assign({}, prev), { [key]: value })));
15
+ const setComposableVariable = (0, react_1.useCallback)((key, entry) => {
16
+ const normalizedEntry = typeof entry === "string" ? { value: entry } : entry;
17
+ setComposableVariables((prev) => (Object.assign(Object.assign({}, prev), { [key]: normalizedEntry })));
17
18
  }, []);
18
19
  return ((0, jsx_runtime_1.jsx)(react_native_safe_area_context_1.SafeAreaProvider, { children: (0, jsx_runtime_1.jsx)(ThemeProvider_1.ThemeProvider, { initialColorScheme: initialColorScheme, children: (0, jsx_runtime_1.jsx)(exports.OnboardingProgressContext.Provider, { value: { activeStep, setActiveStep, totalSteps, setTotalSteps, composableVariables, setComposableVariable }, children: children }) }) }));
19
20
  };
@@ -24,6 +25,6 @@ exports.OnboardingProgressContext = (0, react_1.createContext)({
24
25
  totalSteps: 0,
25
26
  setTotalSteps: (_steps) => { },
26
27
  composableVariables: {},
27
- setComposableVariable: (_key, _value) => { },
28
+ setComposableVariable: (_key, _entry) => { },
28
29
  });
29
30
  //# sourceMappingURL=OnboardingProgressProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OnboardingProgressProvider.js","sourceRoot":"","sources":["../../../src/UI/Provider/OnboardingProgressProvider.tsx"],"names":[],"mappings":";;;;AAAA,iCAA6D;AAC7D,mFAAkE;AAClE,0DAAuD;AAGhD,MAAM,0BAA0B,GAAG,CAAC,EACzC,QAAQ,EACR,kBAAkB,GAAG,OAAO,GAI7B,EAAE,EAAE;IACH,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,IAAA,gBAAQ,EAAC;QAC3C,MAAM,EAAE,CAAC;QACT,qBAAqB,EAAE,KAAK;KAC7B,CAAC,CAAC;IACH,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,IAAA,gB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C;IACb,aAAa,EAAE,CAAC,MAAc,EAAE,EAAE,GAAG,CAAC;IACtC,mBAAmB,EAAE,EAA6C;IAClE,qBAAqB,EAAE,CAAC,IAAY,EAAE,MAAwC,EAAE,EAAE,GAAG,CAAC;CACvF,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rocapine/react-native-onboarding-ui",
3
- "version": "1.6.0",
3
+ "version": "1.8.0",
4
4
  "description": "UI components and renderers for Rocapine Onboarding Studio - Built on top of the headless SDK",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -43,7 +43,7 @@
43
43
  },
44
44
  "peerDependencies": {
45
45
  "@react-native-picker/picker": "*",
46
- "@rocapine/react-native-onboarding": "^1.6.0",
46
+ "@rocapine/react-native-onboarding": "^1.8.0",
47
47
  "@shopify/react-native-skia": ">=1.0.0",
48
48
  "@tanstack/react-query": ">=5.0.0",
49
49
  "@types/react": "*",
@@ -35,7 +35,7 @@ export const OnboardingPage = ({ step, onContinue, isSandbox }: OnboardingPagePr
35
35
  case 'Question':
36
36
  return <QuestionRenderer step={step} onContinue={onContinue} theme={theme} />;
37
37
  case 'ComposableScreen':
38
- return <ComposableScreenRenderer step={step} onContinue={onContinue} theme={theme} />;
38
+ return <ComposableScreenRenderer step={step} onContinue={onContinue} />;
39
39
  default:
40
40
  if (isSandbox) {
41
41
  // @ts-ignore
@@ -1,404 +1,38 @@
1
- import React, { useState, useEffect, useContext, useMemo } from "react";
2
- import { View, Text, Image, ScrollView, StyleSheet, TouchableOpacity, TextInput } from "react-native";
1
+ import { useContext, useMemo } from "react";
2
+ import { ScrollView, StyleSheet } from "react-native";
3
3
  import { ComposableScreenStepType, ComposableScreenStepTypeSchema, UIElement } from "./types";
4
- import { Theme } from "../../Theme/types";
5
- import { defaultTheme } from "../../Theme/defaultTheme";
6
- import { getTextStyle } from "../../Theme/helpers";
7
4
  import { withErrorBoundary } from "../../ErrorBoundary";
8
5
  import { OnboardingTemplate } from "../../Templates/OnboardingTemplate";
9
6
  import { OnboardingProgressContext } from "../../Provider/OnboardingProgressProvider";
10
-
11
- let LottieView: React.ComponentType<{
12
- source: string | object;
13
- autoPlay?: boolean;
14
- loop?: boolean;
15
- speed?: number;
16
- style?: object;
17
- }> | null = null;
18
- try {
19
- LottieView = require("lottie-react-native").default;
20
- } catch {
21
- // lottie-react-native not installed
22
- }
23
-
24
- // Metro cannot tree-shake optional peer deps at runtime; the try/catch pattern
25
- // below is the standard React Native approach for optional native modules.
26
- type VideoUIElement = Extract<UIElement, { type: "Video" }>;
27
- let VideoElementComponent: React.ComponentType<{ element: VideoUIElement; style: object }> | null = null;
28
- try {
29
- const { VideoView, useVideoPlayer } = require("expo-video");
30
- VideoElementComponent = ({ element, style }: { element: VideoUIElement; style: object }) => {
31
- const player = useVideoPlayer(element.props.url, (p: any) => {
32
- p.loop = element.props.loop ?? false;
33
- p.muted = element.props.muted ?? true;
34
- if (element.props.autoPlay) p.play();
35
- });
36
- return (
37
- <VideoView
38
- player={player}
39
- style={style}
40
- allowsFullscreen={false}
41
- nativeControls={element.props.controls ?? false}
42
- />
43
- );
44
- };
45
- } catch {
46
- // expo-video not installed
47
- }
48
-
49
- type InputUIElement = Extract<UIElement, { type: "Input" }>;
50
- const InputElementComponent = ({ element, theme, variables, onVariableChange }: { element: InputUIElement; theme: Theme; variables: Record<string, string>; onVariableChange: (key: string, value: string) => void }) => {
51
- const persistedValue = element.props.variableName ? variables[element.props.variableName] : undefined;
52
- const [value, setValue] = useState(persistedValue ?? element.props.defaultValue ?? "");
53
-
54
- useEffect(() => {
55
- if (element.props.variableName && element.props.defaultValue && persistedValue === undefined) {
56
- onVariableChange(element.props.variableName, element.props.defaultValue);
57
- }
58
- }, []);
59
-
60
- const handleChange = (text: string) => {
61
- setValue(text);
62
- if (element.props.variableName) {
63
- onVariableChange(element.props.variableName, text);
64
- }
65
- };
66
-
67
- return (
68
- <View
69
- style={{
70
- backgroundColor: element.props.backgroundColor ?? theme.colors.neutral.lowest,
71
- borderWidth: element.props.borderWidth ?? 1,
72
- borderRadius: element.props.borderRadius ?? 8,
73
- borderColor: element.props.borderColor ?? theme.colors.neutral.low,
74
- width: element.props.width,
75
- height: element.props.height,
76
- opacity: element.props.opacity,
77
- margin: element.props.margin,
78
- marginHorizontal: element.props.marginHorizontal,
79
- marginVertical: element.props.marginVertical,
80
- overflow: "hidden",
81
- }}
82
- >
83
- <TextInput
84
- value={value}
85
- onChangeText={handleChange}
86
- placeholder={element.props.placeholder}
87
- placeholderTextColor={element.props.placeholderColor ?? theme.colors.text.tertiary}
88
- keyboardType={element.props.keyboardType ?? "default"}
89
- returnKeyType={element.props.returnKeyType ?? "done"}
90
- autoCapitalize={element.props.autoCapitalize ?? "sentences"}
91
- secureTextEntry={element.props.secureTextEntry ?? false}
92
- maxLength={element.props.maxLength}
93
- multiline={element.props.multiline ?? false}
94
- numberOfLines={element.props.numberOfLines}
95
- editable={element.props.editable ?? true}
96
- style={{
97
- flex: 1,
98
- color: element.props.color ?? theme.colors.text.primary,
99
- fontSize: element.props.fontSize ?? theme.typography.textStyles.body.fontSize,
100
- fontWeight: element.props.fontWeight as any,
101
- textAlign: element.props.textAlign,
102
- padding: element.props.padding ?? 12,
103
- paddingHorizontal: element.props.paddingHorizontal,
104
- paddingVertical: element.props.paddingVertical,
105
- }}
106
- />
107
- </View>
108
- );
109
- };
110
-
111
- type RiveUIElement = Extract<UIElement, { type: "Rive" }>;
112
- let RiveElementComponent: React.ComponentType<{ element: RiveUIElement; riveStyle: object }> | null = null;
113
- try {
114
- const riveModule = require("rive-react-native");
115
- const Rive = riveModule.default;
116
- const { Fit, Alignment } = riveModule;
117
- RiveElementComponent = ({ element, riveStyle }: { element: RiveUIElement; riveStyle: object }) => {
118
- return (
119
- <Rive
120
- url={element.props.url}
121
- autoplay={element.props.autoplay ?? true}
122
- fit={element.props.fit ? Fit[element.props.fit] : Fit.Contain}
123
- alignment={element.props.alignment ? Alignment[element.props.alignment] : Alignment.Center}
124
- artboardName={element.props.artboardName}
125
- stateMachineName={element.props.stateMachineName}
126
- style={riveStyle}
127
- onError={console.error}
128
- />
129
- );
130
- };
131
- } catch {
132
- // rive-react-native not installed - will show fallback if Rive is used
133
- }
134
-
135
- const interpolate = (template: string, variables: Record<string, string>): string =>
136
- template.replace(/\{\{([^}]+?)\}\}/g, (_, key) => variables[key] ?? "");
7
+ import { useTheme } from "../../Theme/useTheme";
8
+ import { RenderContext } from "./elements/shared";
9
+ import { renderElement } from "./elements/renderElement";
137
10
 
138
11
  type ContentProps = {
139
12
  step: ComposableScreenStepType;
140
13
  onContinue: () => void;
141
- theme?: Theme;
142
14
  };
143
15
 
144
- const renderElement = (element: UIElement, theme: Theme, variables: Record<string, string>, setVariable: (key: string, value: string) => void, parentType?: "XStack" | "YStack"): React.ReactNode => {
145
- if (element.type === "YStack" || element.type === "XStack") {
146
- return (
147
- <View
148
- key={element.id}
149
- style={{
150
- flexDirection: element.type === "XStack" ? "row" : "column",
151
- gap: element.props.gap,
152
- padding: element.props.padding,
153
- paddingHorizontal: element.props.paddingHorizontal,
154
- paddingVertical: element.props.paddingVertical,
155
- margin: element.props.margin,
156
- marginHorizontal: element.props.marginHorizontal,
157
- marginVertical: element.props.marginVertical,
158
- flex: element.props.flex,
159
- width: element.props.width,
160
- height: element.props.height,
161
- minWidth: element.props.minWidth,
162
- maxWidth: element.props.maxWidth,
163
- minHeight: element.props.minHeight,
164
- maxHeight: element.props.maxHeight,
165
- flexShrink: element.props.flexShrink ?? (parentType === "XStack" ? 1 : undefined),
166
- flexWrap: element.props.flexWrap,
167
- alignItems: element.props.alignItems,
168
- justifyContent: element.props.justifyContent,
169
- backgroundColor: element.props.backgroundColor,
170
- borderWidth: element.props.borderWidth,
171
- borderRadius: element.props.borderRadius,
172
- borderColor: element.props.borderColor,
173
- overflow: element.props.overflow,
174
- opacity: element.props.opacity,
175
- }}
176
- >
177
- {element.children.map((child) => renderElement(child, theme, variables, setVariable, element.type))}
178
- </View>
179
- );
180
- }
181
-
182
- if (element.type === "Text") {
183
- const content = element.props.mode === "expression"
184
- ? interpolate(element.props.content, variables)
185
- : element.props.content;
186
- return (
187
- <Text
188
- key={element.id}
189
- style={{
190
- fontSize: element.props.fontSize,
191
- fontWeight: element.props.fontWeight as any,
192
- color: element.props.color ?? theme.colors.text.primary,
193
- textAlign: element.props.textAlign,
194
- letterSpacing: element.props.letterSpacing,
195
- lineHeight: element.props.lineHeight,
196
- backgroundColor: element.props.backgroundColor,
197
- padding: element.props.padding,
198
- paddingHorizontal: element.props.paddingHorizontal,
199
- paddingVertical: element.props.paddingVertical,
200
- margin: element.props.margin,
201
- marginHorizontal: element.props.marginHorizontal,
202
- marginVertical: element.props.marginVertical,
203
- borderWidth: element.props.borderWidth,
204
- borderRadius: element.props.borderRadius,
205
- borderColor: element.props.borderColor,
206
- opacity: element.props.opacity,
207
- flexShrink: parentType === "XStack" ? 1 : undefined,
208
- }}
209
- >
210
- {content}
211
- </Text>
212
- );
213
- }
214
-
215
- if (element.type === "Image") {
216
- const hasExplicitHeight = element.props.height !== undefined;
217
- const aspectRatio = hasExplicitHeight
218
- ? undefined
219
- : (element.props.aspectRatio ?? 16 / 9);
220
- return (
221
- <Image
222
- key={element.id}
223
- source={{ uri: element.props.url }}
224
- resizeMode={element.props.resizeMode ?? "cover"}
225
- style={{
226
- width: element.props.width ?? "100%",
227
- height: element.props.height,
228
- aspectRatio,
229
- borderRadius: element.props.borderRadius,
230
- borderWidth: element.props.borderWidth,
231
- borderColor: element.props.borderColor,
232
- opacity: element.props.opacity,
233
- margin: element.props.margin,
234
- marginHorizontal: element.props.marginHorizontal,
235
- marginVertical: element.props.marginVertical,
236
- padding: element.props.padding,
237
- paddingHorizontal: element.props.paddingHorizontal,
238
- paddingVertical: element.props.paddingVertical,
239
- }}
240
- />
241
- );
242
- }
243
-
244
- if (element.type === "Lottie") {
245
- const wrapperStyle = {
246
- width: element.props.width ?? ("100%" as `${number}%`),
247
- height: element.props.height ?? 200,
248
- opacity: element.props.opacity,
249
- margin: element.props.margin,
250
- marginHorizontal: element.props.marginHorizontal,
251
- marginVertical: element.props.marginVertical,
252
- padding: element.props.padding,
253
- paddingHorizontal: element.props.paddingHorizontal,
254
- paddingVertical: element.props.paddingVertical,
255
- borderWidth: element.props.borderWidth,
256
- borderRadius: element.props.borderRadius,
257
- borderColor: element.props.borderColor,
258
- overflow: "hidden" as const,
259
- };
260
-
261
- if (!LottieView) {
262
- return (
263
- <View key={element.id} style={[wrapperStyle, styles.mediaFallback, { backgroundColor: theme.colors.neutral.lowest }]}>
264
- <Text style={[styles.mediaFallbackText, getTextStyle(theme, "caption"), { color: theme.colors.text.tertiary }]}>
265
- Install lottie-react-native to render Lottie animations.
266
- </Text>
267
- </View>
268
- );
269
- }
270
-
271
- return (
272
- <View key={element.id} style={wrapperStyle}>
273
- <LottieView
274
- source={{ uri: element.props.source }}
275
- autoPlay={element.props.autoPlay ?? true}
276
- loop={element.props.loop ?? true}
277
- speed={element.props.speed}
278
- style={styles.fill}
279
- />
280
- </View>
281
- );
282
- }
283
-
284
- if (element.type === "Rive") {
285
- const wrapperStyle = {
286
- width: element.props.width ?? ("100%" as `${number}%`),
287
- height: element.props.height ?? 200,
288
- opacity: element.props.opacity,
289
- margin: element.props.margin,
290
- marginHorizontal: element.props.marginHorizontal,
291
- marginVertical: element.props.marginVertical,
292
- padding: element.props.padding,
293
- paddingHorizontal: element.props.paddingHorizontal,
294
- paddingVertical: element.props.paddingVertical,
295
- borderWidth: element.props.borderWidth,
296
- borderRadius: element.props.borderRadius,
297
- borderColor: element.props.borderColor,
298
- overflow: "hidden" as const,
299
- };
300
-
301
- if (!RiveElementComponent) {
302
- return (
303
- <View key={element.id} style={[wrapperStyle, styles.mediaFallback, { backgroundColor: theme.colors.neutral.lowest }]}>
304
- <Text style={[styles.mediaFallbackText, getTextStyle(theme, "caption"), { color: theme.colors.text.tertiary }]}>
305
- Install rive-react-native to render Rive animations.
306
- </Text>
307
- </View>
308
- );
309
- }
310
-
311
- return (
312
- <View key={element.id} style={wrapperStyle}>
313
- <RiveElementComponent element={element} riveStyle={styles.fill} />
314
- </View>
315
- );
316
- }
317
-
318
- if (element.type === "Icon") {
319
- const icons = require("lucide-react-native");
320
- const IconComp = icons[element.props.name] as React.ComponentType<{
321
- size?: number;
322
- color?: string;
323
- strokeWidth?: number;
324
- }> | undefined;
325
- return (
326
- <View
327
- key={element.id}
328
- style={{
329
- width: element.props.width,
330
- height: element.props.height,
331
- margin: element.props.margin,
332
- marginHorizontal: element.props.marginHorizontal,
333
- marginVertical: element.props.marginVertical,
334
- padding: element.props.padding,
335
- paddingHorizontal: element.props.paddingHorizontal,
336
- paddingVertical: element.props.paddingVertical,
337
- borderWidth: element.props.borderWidth,
338
- borderRadius: element.props.borderRadius,
339
- borderColor: element.props.borderColor,
340
- opacity: element.props.opacity,
341
- }}
342
- >
343
- {IconComp ? (
344
- <IconComp
345
- size={element.props.size ?? 24}
346
- color={element.props.color ?? theme.colors.text.primary}
347
- strokeWidth={element.props.strokeWidth ?? 2}
348
- />
349
- ) : null}
350
- </View>
351
- );
352
- }
353
-
354
- if (element.type === "Video") {
355
- const wrapperStyle = {
356
- width: element.props.width ?? ("100%" as `${number}%`),
357
- height: element.props.height ?? 200,
358
- opacity: element.props.opacity,
359
- margin: element.props.margin,
360
- marginHorizontal: element.props.marginHorizontal,
361
- marginVertical: element.props.marginVertical,
362
- padding: element.props.padding,
363
- paddingHorizontal: element.props.paddingHorizontal,
364
- paddingVertical: element.props.paddingVertical,
365
- borderWidth: element.props.borderWidth,
366
- borderRadius: element.props.borderRadius,
367
- borderColor: element.props.borderColor,
368
- overflow: "hidden" as const,
369
- };
370
-
371
- if (!VideoElementComponent) {
372
- return (
373
- <View key={element.id} style={[wrapperStyle, styles.mediaFallback, { backgroundColor: theme.colors.neutral.lowest }]}>
374
- <Text style={[styles.mediaFallbackText, getTextStyle(theme, "caption"), { color: theme.colors.text.tertiary }]}>
375
- Install expo-video to render videos.
376
- </Text>
377
- </View>
378
- );
379
- }
380
-
381
- return (
382
- <View key={element.id} style={wrapperStyle}>
383
- <VideoElementComponent element={element} style={styles.fill} />
384
- </View>
385
- );
386
- }
387
-
388
- if (element.type === "Input") {
389
- return <InputElementComponent key={element.id} element={element} theme={theme} variables={variables} onVariableChange={setVariable} />;
390
- }
391
-
392
- return null;
393
- };
394
-
395
- const ComposableScreenRendererBase = ({ step, onContinue, theme = defaultTheme }: ContentProps) => {
16
+ const ComposableScreenRendererBase = ({ step, onContinue }: ContentProps) => {
17
+ const { theme } = useTheme();
396
18
  const validatedData = useMemo(() => ComposableScreenStepTypeSchema.parse(step), [step]);
397
19
  const { elements } = validatedData.payload;
398
20
  const { composableVariables, setComposableVariable } = useContext(OnboardingProgressContext);
21
+
22
+ const renderChildren = (children: UIElement[], parentType: "XStack" | "YStack") =>
23
+ children.map((child) => renderElement(child, ctx, parentType));
24
+
25
+ const ctx: RenderContext = {
26
+ theme,
27
+ variables: composableVariables,
28
+ setVariable: setComposableVariable,
29
+ onContinue,
30
+ renderChildren,
31
+ };
32
+
399
33
  return (
400
34
  <OnboardingTemplate
401
- step={step}
35
+ step={validatedData}
402
36
  onContinue={onContinue}
403
37
  theme={theme}
404
38
  >
@@ -408,58 +42,16 @@ const ComposableScreenRendererBase = ({ step, onContinue, theme = defaultTheme }
408
42
  alwaysBounceVertical={false}
409
43
  keyboardShouldPersistTaps="handled"
410
44
  >
411
- {elements.map((element) => renderElement(element, theme, composableVariables, setComposableVariable))}
412
- <View style={styles.bottomSection}>
413
- <TouchableOpacity
414
- style={[styles.ctaButton, { backgroundColor: theme.colors.primary }]}
415
- onPress={onContinue}
416
- activeOpacity={0.8}
417
- >
418
- <Text
419
- style={[
420
- getTextStyle(theme, "button"),
421
- { color: theme.colors.text.opposite },
422
- ]}
423
- >
424
- {validatedData.continueButtonLabel}
425
- </Text>
426
- </TouchableOpacity>
427
- </View>
45
+ {elements.map((element) => renderElement(element, ctx))}
428
46
  </ScrollView>
429
47
  </OnboardingTemplate>
430
- )
48
+ );
431
49
  };
432
50
 
433
51
  const styles = StyleSheet.create({
434
- container: {
435
- flex: 1,
436
- },
437
- fill: {
438
- width: "100%",
439
- height: "100%",
440
- },
441
52
  scrollContent: {
442
53
  flexGrow: 1,
443
54
  },
444
- bottomSection: {
445
- paddingHorizontal: 32,
446
- alignItems: "center",
447
- },
448
- ctaButton: {
449
- borderRadius: 90,
450
- paddingVertical: 18,
451
- paddingHorizontal: 24,
452
- minWidth: 234,
453
- alignItems: "center",
454
- },
455
- mediaFallback: {
456
- alignItems: "center",
457
- justifyContent: "center",
458
- },
459
- mediaFallbackText: {
460
- textAlign: "center",
461
- paddingHorizontal: 16,
462
- },
463
55
  });
464
56
 
465
57
  export const ComposableScreenRenderer = withErrorBoundary(ComposableScreenRendererBase, "ComposableScreen");
@@ -0,0 +1,31 @@
1
+ import { z } from "zod";
2
+
3
+ export type BaseBoxProps = {
4
+ width?: number;
5
+ height?: number;
6
+ opacity?: number;
7
+ margin?: number;
8
+ marginHorizontal?: number;
9
+ marginVertical?: number;
10
+ padding?: number;
11
+ paddingHorizontal?: number;
12
+ paddingVertical?: number;
13
+ borderWidth?: number;
14
+ borderRadius?: number;
15
+ borderColor?: string;
16
+ };
17
+
18
+ export const BaseBoxPropsSchema = z.object({
19
+ width: z.number().min(0).optional(),
20
+ height: z.number().min(0).optional(),
21
+ opacity: z.number().min(0).max(1).optional(),
22
+ margin: z.number().optional(),
23
+ marginHorizontal: z.number().optional(),
24
+ marginVertical: z.number().optional(),
25
+ padding: z.number().min(0).optional(),
26
+ paddingHorizontal: z.number().min(0).optional(),
27
+ paddingVertical: z.number().min(0).optional(),
28
+ borderWidth: z.number().min(0).optional(),
29
+ borderRadius: z.number().min(0).optional(),
30
+ borderColor: z.string().optional(),
31
+ });