@rocapine/react-native-onboarding 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.
- package/dist/onboarding-example.d.ts +171 -0
- package/dist/onboarding-example.d.ts.map +1 -1
- package/dist/onboarding-example.js +37 -0
- package/dist/onboarding-example.js.map +1 -1
- package/dist/steps/ComposableScreen/elements/BaseBoxProps.d.ts +30 -0
- package/dist/steps/ComposableScreen/elements/BaseBoxProps.d.ts.map +1 -0
- package/dist/steps/ComposableScreen/elements/BaseBoxProps.js +19 -0
- package/dist/steps/ComposableScreen/elements/BaseBoxProps.js.map +1 -0
- package/dist/steps/ComposableScreen/elements/ButtonElement.d.ts +55 -0
- package/dist/steps/ComposableScreen/elements/ButtonElement.d.ts.map +1 -0
- package/dist/steps/ComposableScreen/elements/ButtonElement.js +18 -0
- package/dist/steps/ComposableScreen/elements/ButtonElement.js.map +1 -0
- package/dist/steps/ComposableScreen/elements/IconElement.d.ts +29 -0
- package/dist/steps/ComposableScreen/elements/IconElement.d.ts.map +1 -0
- package/dist/steps/ComposableScreen/elements/IconElement.js +13 -0
- package/dist/steps/ComposableScreen/elements/IconElement.js.map +1 -0
- package/dist/steps/ComposableScreen/elements/ImageElement.d.ts +30 -0
- package/dist/steps/ComposableScreen/elements/ImageElement.d.ts.map +1 -0
- package/dist/steps/ComposableScreen/elements/ImageElement.js +11 -0
- package/dist/steps/ComposableScreen/elements/ImageElement.js.map +1 -0
- package/dist/steps/ComposableScreen/elements/InputElement.d.ts +90 -0
- package/dist/steps/ComposableScreen/elements/InputElement.d.ts.map +1 -0
- package/dist/steps/ComposableScreen/elements/InputElement.js +25 -0
- package/dist/steps/ComposableScreen/elements/InputElement.js.map +1 -0
- package/dist/steps/ComposableScreen/elements/LottieElement.d.ts +27 -0
- package/dist/steps/ComposableScreen/elements/LottieElement.d.ts.map +1 -0
- package/dist/steps/ComposableScreen/elements/LottieElement.js +12 -0
- package/dist/steps/ComposableScreen/elements/LottieElement.js.map +1 -0
- package/dist/steps/ComposableScreen/elements/RadioGroupElement.d.ts +66 -0
- package/dist/steps/ComposableScreen/elements/RadioGroupElement.d.ts.map +1 -0
- package/dist/steps/ComposableScreen/elements/RadioGroupElement.js +36 -0
- package/dist/steps/ComposableScreen/elements/RadioGroupElement.js.map +1 -0
- package/dist/steps/ComposableScreen/elements/RiveElement.d.ts +50 -0
- package/dist/steps/ComposableScreen/elements/RiveElement.d.ts.map +1 -0
- package/dist/steps/ComposableScreen/elements/RiveElement.js +14 -0
- package/dist/steps/ComposableScreen/elements/RiveElement.js.map +1 -0
- package/dist/steps/ComposableScreen/elements/StackElement.d.ts +72 -0
- package/dist/steps/ComposableScreen/elements/StackElement.d.ts.map +1 -0
- package/dist/steps/ComposableScreen/elements/StackElement.js +31 -0
- package/dist/steps/ComposableScreen/elements/StackElement.js.map +1 -0
- package/dist/steps/ComposableScreen/elements/TextElement.d.ts +53 -0
- package/dist/steps/ComposableScreen/elements/TextElement.d.ts.map +1 -0
- package/dist/steps/ComposableScreen/elements/TextElement.js +27 -0
- package/dist/steps/ComposableScreen/elements/TextElement.js.map +1 -0
- package/dist/steps/ComposableScreen/elements/VideoElement.d.ts +29 -0
- package/dist/steps/ComposableScreen/elements/VideoElement.d.ts.map +1 -0
- package/dist/steps/ComposableScreen/elements/VideoElement.js +13 -0
- package/dist/steps/ComposableScreen/elements/VideoElement.js.map +1 -0
- package/dist/steps/ComposableScreen/types.d.ts +40 -113
- package/dist/steps/ComposableScreen/types.d.ts.map +1 -1
- package/dist/steps/ComposableScreen/types.js +33 -121
- package/dist/steps/ComposableScreen/types.js.map +1 -1
- package/package.json +1 -1
- package/src/onboarding-example.ts +37 -0
- package/src/steps/ComposableScreen/elements/BaseBoxProps.ts +31 -0
- package/src/steps/ComposableScreen/elements/ButtonElement.ts +28 -0
- package/src/steps/ComposableScreen/elements/IconElement.ts +18 -0
- package/src/steps/ComposableScreen/elements/ImageElement.ts +14 -0
- package/src/steps/ComposableScreen/elements/InputElement.ts +42 -0
- package/src/steps/ComposableScreen/elements/LottieElement.ts +16 -0
- package/src/steps/ComposableScreen/elements/RadioGroupElement.ts +55 -0
- package/src/steps/ComposableScreen/elements/RiveElement.ts +20 -0
- package/src/steps/ComposableScreen/elements/StackElement.ts +55 -0
- package/src/steps/ComposableScreen/elements/TextElement.ts +47 -0
- package/src/steps/ComposableScreen/elements/VideoElement.ts +18 -0
- package/src/steps/ComposableScreen/types.ts +56 -233
|
@@ -1,149 +1,77 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
type
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
};
|
|
2
|
+
import { type StackElementProps } from "./elements/StackElement";
|
|
3
|
+
import { type TextElementProps } from "./elements/TextElement";
|
|
4
|
+
import { type ImageElementProps } from "./elements/ImageElement";
|
|
5
|
+
import { type LottieElementProps } from "./elements/LottieElement";
|
|
6
|
+
import { type RiveElementProps } from "./elements/RiveElement";
|
|
7
|
+
import { type IconElementProps } from "./elements/IconElement";
|
|
8
|
+
import { type VideoElementProps } from "./elements/VideoElement";
|
|
9
|
+
import { type InputElementProps } from "./elements/InputElement";
|
|
10
|
+
import { type ButtonElementProps } from "./elements/ButtonElement";
|
|
11
|
+
import { type RadioGroupElementProps } from "./elements/RadioGroupElement";
|
|
12
|
+
export type { BaseBoxProps } from "./elements/BaseBoxProps";
|
|
13
|
+
export { BaseBoxPropsSchema } from "./elements/BaseBoxProps";
|
|
14
|
+
export type { StackElementProps } from "./elements/StackElement";
|
|
15
|
+
export type { TextElementProps } from "./elements/TextElement";
|
|
16
|
+
export type { ImageElementProps } from "./elements/ImageElement";
|
|
17
|
+
export type { LottieElementProps } from "./elements/LottieElement";
|
|
18
|
+
export type { RiveElementProps } from "./elements/RiveElement";
|
|
19
|
+
export type { IconElementProps } from "./elements/IconElement";
|
|
20
|
+
export type { VideoElementProps } from "./elements/VideoElement";
|
|
21
|
+
export type { InputElementProps } from "./elements/InputElement";
|
|
22
|
+
export type { ButtonElementProps } from "./elements/ButtonElement";
|
|
23
|
+
export type { RadioGroupElementProps } from "./elements/RadioGroupElement";
|
|
16
24
|
type UIElement = {
|
|
17
25
|
id: string;
|
|
18
26
|
name?: string;
|
|
19
27
|
type: "YStack" | "XStack";
|
|
20
|
-
props:
|
|
21
|
-
gap?: number;
|
|
22
|
-
padding?: number;
|
|
23
|
-
paddingHorizontal?: number;
|
|
24
|
-
paddingVertical?: number;
|
|
25
|
-
margin?: number;
|
|
26
|
-
marginHorizontal?: number;
|
|
27
|
-
marginVertical?: number;
|
|
28
|
-
flex?: number;
|
|
29
|
-
width?: number;
|
|
30
|
-
height?: number;
|
|
31
|
-
minWidth?: number;
|
|
32
|
-
maxWidth?: number;
|
|
33
|
-
minHeight?: number;
|
|
34
|
-
maxHeight?: number;
|
|
35
|
-
alignItems?: "flex-start" | "center" | "flex-end" | "stretch";
|
|
36
|
-
justifyContent?: "flex-start" | "center" | "flex-end" | "space-between" | "space-around";
|
|
37
|
-
backgroundColor?: string;
|
|
38
|
-
flexWrap?: "wrap" | "nowrap";
|
|
39
|
-
flexShrink?: number;
|
|
40
|
-
borderWidth?: number;
|
|
41
|
-
borderRadius?: number;
|
|
42
|
-
borderColor?: string;
|
|
43
|
-
overflow?: "hidden" | "visible" | "scroll";
|
|
44
|
-
opacity?: number;
|
|
45
|
-
};
|
|
28
|
+
props: StackElementProps;
|
|
46
29
|
children: UIElement[];
|
|
47
30
|
} | {
|
|
48
31
|
id: string;
|
|
49
32
|
name?: string;
|
|
50
33
|
type: "Text";
|
|
51
|
-
props:
|
|
52
|
-
content: string;
|
|
53
|
-
mode?: "plain" | "expression";
|
|
54
|
-
fontSize?: number;
|
|
55
|
-
fontWeight?: string;
|
|
56
|
-
color?: string;
|
|
57
|
-
textAlign?: "left" | "center" | "right";
|
|
58
|
-
letterSpacing?: number;
|
|
59
|
-
lineHeight?: number;
|
|
60
|
-
backgroundColor?: string;
|
|
61
|
-
padding?: number;
|
|
62
|
-
paddingHorizontal?: number;
|
|
63
|
-
paddingVertical?: number;
|
|
64
|
-
margin?: number;
|
|
65
|
-
marginHorizontal?: number;
|
|
66
|
-
marginVertical?: number;
|
|
67
|
-
borderWidth?: number;
|
|
68
|
-
borderRadius?: number;
|
|
69
|
-
borderColor?: string;
|
|
70
|
-
opacity?: number;
|
|
71
|
-
};
|
|
34
|
+
props: TextElementProps;
|
|
72
35
|
} | {
|
|
73
36
|
id: string;
|
|
74
37
|
name?: string;
|
|
75
38
|
type: "Image";
|
|
76
|
-
props:
|
|
77
|
-
url: string;
|
|
78
|
-
aspectRatio?: number;
|
|
79
|
-
resizeMode?: "cover" | "contain" | "stretch" | "center";
|
|
80
|
-
};
|
|
39
|
+
props: ImageElementProps;
|
|
81
40
|
} | {
|
|
82
41
|
id: string;
|
|
83
42
|
name?: string;
|
|
84
43
|
type: "Lottie";
|
|
85
|
-
props:
|
|
86
|
-
source: string;
|
|
87
|
-
autoPlay?: boolean;
|
|
88
|
-
loop?: boolean;
|
|
89
|
-
speed?: number;
|
|
90
|
-
};
|
|
44
|
+
props: LottieElementProps;
|
|
91
45
|
} | {
|
|
92
46
|
id: string;
|
|
93
47
|
name?: string;
|
|
94
48
|
type: "Rive";
|
|
95
|
-
props:
|
|
96
|
-
url: string;
|
|
97
|
-
autoplay?: boolean;
|
|
98
|
-
fit?: "Contain" | "Cover" | "Fill" | "FitWidth" | "FitHeight" | "None" | "ScaleDown" | "Layout";
|
|
99
|
-
alignment?: "TopLeft" | "TopCenter" | "TopRight" | "CenterLeft" | "Center" | "CenterRight" | "BottomLeft" | "BottomCenter" | "BottomRight";
|
|
100
|
-
artboardName?: string;
|
|
101
|
-
stateMachineName?: string;
|
|
102
|
-
};
|
|
49
|
+
props: RiveElementProps;
|
|
103
50
|
} | {
|
|
104
51
|
id: string;
|
|
105
52
|
name?: string;
|
|
106
53
|
type: "Icon";
|
|
107
|
-
props:
|
|
108
|
-
name: string;
|
|
109
|
-
size?: number;
|
|
110
|
-
color?: string;
|
|
111
|
-
strokeWidth?: number;
|
|
112
|
-
};
|
|
54
|
+
props: IconElementProps;
|
|
113
55
|
} | {
|
|
114
56
|
id: string;
|
|
115
57
|
name?: string;
|
|
116
58
|
type: "Video";
|
|
117
|
-
props:
|
|
118
|
-
url: string;
|
|
119
|
-
autoPlay?: boolean;
|
|
120
|
-
loop?: boolean;
|
|
121
|
-
muted?: boolean;
|
|
122
|
-
controls?: boolean;
|
|
123
|
-
};
|
|
59
|
+
props: VideoElementProps;
|
|
124
60
|
} | {
|
|
125
61
|
id: string;
|
|
126
62
|
name?: string;
|
|
127
63
|
type: "Input";
|
|
128
|
-
props:
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
editable?: boolean;
|
|
140
|
-
color?: string;
|
|
141
|
-
backgroundColor?: string;
|
|
142
|
-
fontSize?: number;
|
|
143
|
-
fontWeight?: string;
|
|
144
|
-
textAlign?: "left" | "center" | "right";
|
|
145
|
-
placeholderColor?: string;
|
|
146
|
-
};
|
|
64
|
+
props: InputElementProps;
|
|
65
|
+
} | {
|
|
66
|
+
id: string;
|
|
67
|
+
name?: string;
|
|
68
|
+
type: "Button";
|
|
69
|
+
props: ButtonElementProps;
|
|
70
|
+
} | {
|
|
71
|
+
id: string;
|
|
72
|
+
name?: string;
|
|
73
|
+
type: "RadioGroup";
|
|
74
|
+
props: RadioGroupElementProps;
|
|
147
75
|
};
|
|
148
76
|
export declare const ComposableScreenStepPayloadSchema: z.ZodObject<{
|
|
149
77
|
elements: z.ZodArray<z.ZodType<UIElement, unknown, z.core.$ZodTypeInternals<UIElement, unknown>>>;
|
|
@@ -161,5 +89,4 @@ export declare const ComposableScreenStepTypeSchema: z.ZodObject<{
|
|
|
161
89
|
figmaUrl: z.ZodNullable<z.ZodString>;
|
|
162
90
|
}, z.core.$strip>;
|
|
163
91
|
export type ComposableScreenStepType = z.infer<typeof ComposableScreenStepTypeSchema>;
|
|
164
|
-
export {};
|
|
165
92
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/steps/ComposableScreen/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/steps/ComposableScreen/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,KAAK,iBAAiB,EAA2B,MAAM,yBAAyB,CAAC;AAC1F,OAAO,EAAE,KAAK,gBAAgB,EAA0B,MAAM,wBAAwB,CAAC;AACvF,OAAO,EAAE,KAAK,iBAAiB,EAA2B,MAAM,yBAAyB,CAAC;AAC1F,OAAO,EAAE,KAAK,kBAAkB,EAA4B,MAAM,0BAA0B,CAAC;AAC7F,OAAO,EAAE,KAAK,gBAAgB,EAA0B,MAAM,wBAAwB,CAAC;AACvF,OAAO,EAAE,KAAK,gBAAgB,EAA0B,MAAM,wBAAwB,CAAC;AACvF,OAAO,EAAE,KAAK,iBAAiB,EAA2B,MAAM,yBAAyB,CAAC;AAC1F,OAAO,EAAE,KAAK,iBAAiB,EAA2B,MAAM,yBAAyB,CAAC;AAC1F,OAAO,EAAE,KAAK,kBAAkB,EAA4B,MAAM,0BAA0B,CAAC;AAC7F,OAAO,EAAE,KAAK,sBAAsB,EAAgC,MAAM,8BAA8B,CAAC;AAEzG,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D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AM,CAAC;IACb,KAAK,EAAE,gBAAgB,CAAC;CACzB,GACD;IACE,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,gBAAgB,CAAC;CACzB,GACD;IACE,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,iBAAiB,CAAC;CAC1B,GACD;IACE,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,iBAAiB,CAAC;CAC1B,GACD;IACE,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,kBAAkB,CAAC;CAC3B,GACD;IACE,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,YAAY,CAAC;IACnB,KAAK,EAAE,sBAAsB,CAAC;CAC/B,CAAC;AAoEN,eAAO,MAAM,iCAAiC;;iBAE5C,CAAC;AAEH,eAAO,MAAM,8BAA8B;;;;;;;;;;;iBASzC,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC"}
|
|
@@ -1,169 +1,81 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ComposableScreenStepTypeSchema = exports.ComposableScreenStepPayloadSchema = void 0;
|
|
3
|
+
exports.ComposableScreenStepTypeSchema = exports.ComposableScreenStepPayloadSchema = exports.BaseBoxPropsSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const common_types_1 = require("../common.types");
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
borderColor: zod_1.z.string().optional(),
|
|
19
|
-
});
|
|
20
|
-
const StackElementPropsSchema = zod_1.z.object({
|
|
21
|
-
gap: zod_1.z.number().optional(),
|
|
22
|
-
padding: zod_1.z.number().optional(),
|
|
23
|
-
paddingHorizontal: zod_1.z.number().optional(),
|
|
24
|
-
paddingVertical: zod_1.z.number().optional(),
|
|
25
|
-
margin: zod_1.z.number().optional(),
|
|
26
|
-
marginHorizontal: zod_1.z.number().optional(),
|
|
27
|
-
marginVertical: zod_1.z.number().optional(),
|
|
28
|
-
flex: zod_1.z.number().optional(),
|
|
29
|
-
width: zod_1.z.number().optional(),
|
|
30
|
-
height: zod_1.z.number().optional(),
|
|
31
|
-
minWidth: zod_1.z.number().optional(),
|
|
32
|
-
maxWidth: zod_1.z.number().optional(),
|
|
33
|
-
minHeight: zod_1.z.number().optional(),
|
|
34
|
-
maxHeight: zod_1.z.number().optional(),
|
|
35
|
-
alignItems: zod_1.z.enum(["flex-start", "center", "flex-end", "stretch"]).optional(),
|
|
36
|
-
justifyContent: zod_1.z.enum(["flex-start", "center", "flex-end", "space-between", "space-around"]).optional(),
|
|
37
|
-
backgroundColor: zod_1.z.string().optional(),
|
|
38
|
-
flexWrap: zod_1.z.enum(["wrap", "nowrap"]).optional(),
|
|
39
|
-
flexShrink: zod_1.z.number().optional(),
|
|
40
|
-
borderWidth: zod_1.z.number().optional(),
|
|
41
|
-
borderRadius: zod_1.z.number().optional(),
|
|
42
|
-
borderColor: zod_1.z.string().optional(),
|
|
43
|
-
overflow: zod_1.z.enum(["hidden", "visible", "scroll"]).optional(),
|
|
44
|
-
opacity: zod_1.z.number().min(0).max(1).optional(),
|
|
45
|
-
});
|
|
46
|
-
const TextElementPropsSchema = zod_1.z.object({
|
|
47
|
-
content: zod_1.z.string(),
|
|
48
|
-
mode: zod_1.z.enum(["plain", "expression"]).optional(),
|
|
49
|
-
fontSize: zod_1.z.number().optional(),
|
|
50
|
-
fontWeight: zod_1.z.string().optional(),
|
|
51
|
-
color: zod_1.z.string().optional(),
|
|
52
|
-
textAlign: zod_1.z.enum(["left", "center", "right"]).optional(),
|
|
53
|
-
letterSpacing: zod_1.z.number().optional(),
|
|
54
|
-
lineHeight: zod_1.z.number().optional(),
|
|
55
|
-
backgroundColor: zod_1.z.string().optional(),
|
|
56
|
-
padding: zod_1.z.number().optional(),
|
|
57
|
-
paddingHorizontal: zod_1.z.number().optional(),
|
|
58
|
-
paddingVertical: zod_1.z.number().optional(),
|
|
59
|
-
margin: zod_1.z.number().optional(),
|
|
60
|
-
marginHorizontal: zod_1.z.number().optional(),
|
|
61
|
-
marginVertical: zod_1.z.number().optional(),
|
|
62
|
-
borderWidth: zod_1.z.number().optional(),
|
|
63
|
-
borderRadius: zod_1.z.number().optional(),
|
|
64
|
-
borderColor: zod_1.z.string().optional(),
|
|
65
|
-
opacity: zod_1.z.number().min(0).max(1).optional(),
|
|
66
|
-
});
|
|
67
|
-
const ImageElementPropsSchema = BaseBoxPropsSchema.extend({
|
|
68
|
-
url: zod_1.z.string(),
|
|
69
|
-
aspectRatio: zod_1.z.number().optional(),
|
|
70
|
-
resizeMode: zod_1.z.enum(["cover", "contain", "stretch", "center"]).optional(),
|
|
71
|
-
});
|
|
72
|
-
const LottieElementPropsSchema = BaseBoxPropsSchema.extend({
|
|
73
|
-
source: zod_1.z.string(),
|
|
74
|
-
autoPlay: zod_1.z.boolean().optional(),
|
|
75
|
-
loop: zod_1.z.boolean().optional(),
|
|
76
|
-
speed: zod_1.z.number().optional(),
|
|
77
|
-
});
|
|
78
|
-
const RiveElementPropsSchema = BaseBoxPropsSchema.extend({
|
|
79
|
-
url: zod_1.z.string(),
|
|
80
|
-
autoplay: zod_1.z.boolean().optional(),
|
|
81
|
-
fit: zod_1.z.enum(["Contain", "Cover", "Fill", "FitWidth", "FitHeight", "None", "ScaleDown", "Layout"]).optional(),
|
|
82
|
-
alignment: zod_1.z.enum(["TopLeft", "TopCenter", "TopRight", "CenterLeft", "Center", "CenterRight", "BottomLeft", "BottomCenter", "BottomRight"]).optional(),
|
|
83
|
-
artboardName: zod_1.z.string().optional(),
|
|
84
|
-
stateMachineName: zod_1.z.string().optional(),
|
|
85
|
-
});
|
|
86
|
-
const IconElementPropsSchema = BaseBoxPropsSchema.extend({
|
|
87
|
-
name: zod_1.z.string(),
|
|
88
|
-
size: zod_1.z.number().optional(),
|
|
89
|
-
color: zod_1.z.string().optional(),
|
|
90
|
-
strokeWidth: zod_1.z.number().optional(),
|
|
91
|
-
});
|
|
92
|
-
const VideoElementPropsSchema = BaseBoxPropsSchema.extend({
|
|
93
|
-
url: zod_1.z.string(),
|
|
94
|
-
autoPlay: zod_1.z.boolean().optional(),
|
|
95
|
-
loop: zod_1.z.boolean().optional(),
|
|
96
|
-
muted: zod_1.z.boolean().optional(),
|
|
97
|
-
controls: zod_1.z.boolean().optional(),
|
|
98
|
-
});
|
|
99
|
-
const InputElementPropsSchema = BaseBoxPropsSchema.extend({
|
|
100
|
-
variableName: zod_1.z.string().optional(),
|
|
101
|
-
placeholder: zod_1.z.string().optional(),
|
|
102
|
-
defaultValue: zod_1.z.string().optional(),
|
|
103
|
-
keyboardType: zod_1.z.enum(["default", "email-address", "numeric", "phone-pad", "decimal-pad", "url", "number-pad", "ascii-capable", "numbers-and-punctuation", "name-phone-pad", "twitter", "web-search", "visible-password"]).optional(),
|
|
104
|
-
returnKeyType: zod_1.z.enum(["done", "next", "go", "search", "send", "default", "emergency-call", "google", "join", "route", "yahoo", "none", "previous"]).optional(),
|
|
105
|
-
autoCapitalize: zod_1.z.enum(["none", "sentences", "words", "characters"]).optional(),
|
|
106
|
-
secureTextEntry: zod_1.z.boolean().optional(),
|
|
107
|
-
maxLength: zod_1.z.number().int().nonnegative().optional(),
|
|
108
|
-
multiline: zod_1.z.boolean().optional(),
|
|
109
|
-
numberOfLines: zod_1.z.number().int().nonnegative().optional(),
|
|
110
|
-
editable: zod_1.z.boolean().optional(),
|
|
111
|
-
color: zod_1.z.string().optional(),
|
|
112
|
-
backgroundColor: zod_1.z.string().optional(),
|
|
113
|
-
fontSize: zod_1.z.number().optional(),
|
|
114
|
-
fontWeight: zod_1.z.string().optional(),
|
|
115
|
-
textAlign: zod_1.z.enum(["left", "center", "right"]).optional(),
|
|
116
|
-
placeholderColor: zod_1.z.string().optional(),
|
|
117
|
-
});
|
|
6
|
+
const StackElement_1 = require("./elements/StackElement");
|
|
7
|
+
const TextElement_1 = require("./elements/TextElement");
|
|
8
|
+
const ImageElement_1 = require("./elements/ImageElement");
|
|
9
|
+
const LottieElement_1 = require("./elements/LottieElement");
|
|
10
|
+
const RiveElement_1 = require("./elements/RiveElement");
|
|
11
|
+
const IconElement_1 = require("./elements/IconElement");
|
|
12
|
+
const VideoElement_1 = require("./elements/VideoElement");
|
|
13
|
+
const InputElement_1 = require("./elements/InputElement");
|
|
14
|
+
const ButtonElement_1 = require("./elements/ButtonElement");
|
|
15
|
+
const RadioGroupElement_1 = require("./elements/RadioGroupElement");
|
|
16
|
+
var BaseBoxProps_1 = require("./elements/BaseBoxProps");
|
|
17
|
+
Object.defineProperty(exports, "BaseBoxPropsSchema", { enumerable: true, get: function () { return BaseBoxProps_1.BaseBoxPropsSchema; } });
|
|
118
18
|
const UIElementSchema = zod_1.z.lazy(() => zod_1.z.union([
|
|
119
19
|
zod_1.z.object({
|
|
120
20
|
id: zod_1.z.string(),
|
|
121
21
|
name: zod_1.z.string().optional(),
|
|
122
22
|
type: zod_1.z.union([zod_1.z.literal("YStack"), zod_1.z.literal("XStack")]),
|
|
123
|
-
props: StackElementPropsSchema,
|
|
23
|
+
props: StackElement_1.StackElementPropsSchema,
|
|
124
24
|
children: zod_1.z.array(UIElementSchema),
|
|
125
25
|
}),
|
|
126
26
|
zod_1.z.object({
|
|
127
27
|
id: zod_1.z.string(),
|
|
128
28
|
name: zod_1.z.string().optional(),
|
|
129
29
|
type: zod_1.z.literal("Text"),
|
|
130
|
-
props: TextElementPropsSchema,
|
|
30
|
+
props: TextElement_1.TextElementPropsSchema,
|
|
131
31
|
}),
|
|
132
32
|
zod_1.z.object({
|
|
133
33
|
id: zod_1.z.string(),
|
|
134
34
|
name: zod_1.z.string().optional(),
|
|
135
35
|
type: zod_1.z.literal("Image"),
|
|
136
|
-
props: ImageElementPropsSchema,
|
|
36
|
+
props: ImageElement_1.ImageElementPropsSchema,
|
|
137
37
|
}),
|
|
138
38
|
zod_1.z.object({
|
|
139
39
|
id: zod_1.z.string(),
|
|
140
40
|
name: zod_1.z.string().optional(),
|
|
141
41
|
type: zod_1.z.literal("Lottie"),
|
|
142
|
-
props: LottieElementPropsSchema,
|
|
42
|
+
props: LottieElement_1.LottieElementPropsSchema,
|
|
143
43
|
}),
|
|
144
44
|
zod_1.z.object({
|
|
145
45
|
id: zod_1.z.string(),
|
|
146
46
|
name: zod_1.z.string().optional(),
|
|
147
47
|
type: zod_1.z.literal("Rive"),
|
|
148
|
-
props: RiveElementPropsSchema,
|
|
48
|
+
props: RiveElement_1.RiveElementPropsSchema,
|
|
149
49
|
}),
|
|
150
50
|
zod_1.z.object({
|
|
151
51
|
id: zod_1.z.string(),
|
|
152
52
|
name: zod_1.z.string().optional(),
|
|
153
53
|
type: zod_1.z.literal("Icon"),
|
|
154
|
-
props: IconElementPropsSchema,
|
|
54
|
+
props: IconElement_1.IconElementPropsSchema,
|
|
155
55
|
}),
|
|
156
56
|
zod_1.z.object({
|
|
157
57
|
id: zod_1.z.string(),
|
|
158
58
|
name: zod_1.z.string().optional(),
|
|
159
59
|
type: zod_1.z.literal("Video"),
|
|
160
|
-
props: VideoElementPropsSchema,
|
|
60
|
+
props: VideoElement_1.VideoElementPropsSchema,
|
|
161
61
|
}),
|
|
162
62
|
zod_1.z.object({
|
|
163
63
|
id: zod_1.z.string(),
|
|
164
64
|
name: zod_1.z.string().optional(),
|
|
165
65
|
type: zod_1.z.literal("Input"),
|
|
166
|
-
props: InputElementPropsSchema,
|
|
66
|
+
props: InputElement_1.InputElementPropsSchema,
|
|
67
|
+
}),
|
|
68
|
+
zod_1.z.object({
|
|
69
|
+
id: zod_1.z.string(),
|
|
70
|
+
name: zod_1.z.string().optional(),
|
|
71
|
+
type: zod_1.z.literal("Button"),
|
|
72
|
+
props: ButtonElement_1.ButtonElementPropsSchema,
|
|
73
|
+
}),
|
|
74
|
+
zod_1.z.object({
|
|
75
|
+
id: zod_1.z.string(),
|
|
76
|
+
name: zod_1.z.string().optional(),
|
|
77
|
+
type: zod_1.z.literal("RadioGroup"),
|
|
78
|
+
props: RadioGroupElement_1.RadioGroupElementPropsSchema,
|
|
167
79
|
}),
|
|
168
80
|
]));
|
|
169
81
|
exports.ComposableScreenStepPayloadSchema = zod_1.z.object({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/steps/ComposableScreen/types.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,kDAAsD;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/steps/ComposableScreen/types.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,kDAAsD;AACtD,0DAA0F;AAC1F,wDAAuF;AACvF,0DAA0F;AAC1F,4DAA6F;AAC7F,wDAAuF;AACvF,wDAAuF;AACvF,0DAA0F;AAC1F,0DAA0F;AAC1F,4DAA6F;AAC7F,oEAAyG;AAGzG,wDAA6D;AAApD,kHAAA,kBAAkB,OAAA;AA6E3B,MAAM,eAAe,GAAyB,OAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CACxD,OAAC,CAAC,KAAK,CAAC;IACN,OAAC,CAAC,MAAM,CAAC;QACP,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;QACd,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC3B,IAAI,EAAE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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,kCAAmB;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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rocapine/react-native-onboarding",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "Headless React Native SDK for Rocapine Onboarding Studio - Data fetching, state management, and hooks",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -182,6 +182,7 @@ export const onboardingExample = {
|
|
|
182
182
|
content: "Built from the CMS",
|
|
183
183
|
fontSize: 28,
|
|
184
184
|
fontWeight: "700",
|
|
185
|
+
fontFamily: "System",
|
|
185
186
|
textAlign: "center",
|
|
186
187
|
},
|
|
187
188
|
},
|
|
@@ -197,6 +198,42 @@ export const onboardingExample = {
|
|
|
197
198
|
opacity: 0.6,
|
|
198
199
|
},
|
|
199
200
|
},
|
|
201
|
+
{
|
|
202
|
+
id: "hero-radio",
|
|
203
|
+
type: "RadioGroup",
|
|
204
|
+
props: {
|
|
205
|
+
variableName: "plan",
|
|
206
|
+
defaultValue: "monthly",
|
|
207
|
+
gap: 8,
|
|
208
|
+
marginVertical: 8,
|
|
209
|
+
items: [
|
|
210
|
+
{ label: "Monthly", value: "monthly" },
|
|
211
|
+
{ label: "Yearly", value: "yearly" },
|
|
212
|
+
{ label: "Lifetime", value: "lifetime" },
|
|
213
|
+
],
|
|
214
|
+
},
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
id: "plan-display",
|
|
218
|
+
type: "Text",
|
|
219
|
+
props: {
|
|
220
|
+
content: "Selected: {{plan}}",
|
|
221
|
+
mode: "expression",
|
|
222
|
+
fontSize: 14,
|
|
223
|
+
textAlign: "center",
|
|
224
|
+
opacity: 0.6,
|
|
225
|
+
marginVertical: 4,
|
|
226
|
+
},
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
id: "hero-button",
|
|
230
|
+
type: "Button",
|
|
231
|
+
props: {
|
|
232
|
+
label: "Get Started",
|
|
233
|
+
variant: "filled",
|
|
234
|
+
marginVertical: 8,
|
|
235
|
+
},
|
|
236
|
+
},
|
|
200
237
|
],
|
|
201
238
|
},
|
|
202
239
|
],
|
|
@@ -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
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { BaseBoxProps, BaseBoxPropsSchema } from "./BaseBoxProps";
|
|
3
|
+
|
|
4
|
+
export type ButtonElementProps = BaseBoxProps & {
|
|
5
|
+
label: string;
|
|
6
|
+
action?: "continue";
|
|
7
|
+
variant?: "filled" | "outlined" | "ghost";
|
|
8
|
+
backgroundColor?: string;
|
|
9
|
+
color?: string;
|
|
10
|
+
fontSize?: number;
|
|
11
|
+
fontWeight?: string;
|
|
12
|
+
fontFamily?: string;
|
|
13
|
+
textAlign?: "left" | "center" | "right";
|
|
14
|
+
alignSelf?: "auto" | "flex-start" | "center" | "flex-end" | "stretch";
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const ButtonElementPropsSchema = BaseBoxPropsSchema.extend({
|
|
18
|
+
label: z.string().min(1, "label must not be empty"),
|
|
19
|
+
action: z.enum(["continue"]).optional(),
|
|
20
|
+
variant: z.enum(["filled", "outlined", "ghost"]).optional(),
|
|
21
|
+
backgroundColor: z.string().optional(),
|
|
22
|
+
color: z.string().optional(),
|
|
23
|
+
fontSize: z.number().optional(),
|
|
24
|
+
fontWeight: z.string().optional(),
|
|
25
|
+
fontFamily: z.string().optional(),
|
|
26
|
+
textAlign: z.enum(["left", "center", "right"]).optional(),
|
|
27
|
+
alignSelf: z.enum(["auto", "flex-start", "center", "flex-end", "stretch"]).optional(),
|
|
28
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { BaseBoxProps, BaseBoxPropsSchema } from "./BaseBoxProps";
|
|
3
|
+
|
|
4
|
+
export type IconElementProps = BaseBoxProps & {
|
|
5
|
+
name: string;
|
|
6
|
+
size?: number;
|
|
7
|
+
color?: string;
|
|
8
|
+
strokeWidth?: number;
|
|
9
|
+
backgroundColor?: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const IconElementPropsSchema = BaseBoxPropsSchema.extend({
|
|
13
|
+
name: z.string().min(1, "icon name must not be empty"),
|
|
14
|
+
size: z.number().nonnegative().optional(),
|
|
15
|
+
color: z.string().optional(),
|
|
16
|
+
strokeWidth: z.number().nonnegative().optional(),
|
|
17
|
+
backgroundColor: z.string().optional(),
|
|
18
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { BaseBoxProps, BaseBoxPropsSchema } from "./BaseBoxProps";
|
|
3
|
+
|
|
4
|
+
export type ImageElementProps = BaseBoxProps & {
|
|
5
|
+
url: string;
|
|
6
|
+
aspectRatio?: number;
|
|
7
|
+
resizeMode?: "cover" | "contain" | "stretch" | "center";
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const ImageElementPropsSchema = BaseBoxPropsSchema.extend({
|
|
11
|
+
url: z.string().min(1, "url must not be empty"),
|
|
12
|
+
aspectRatio: z.number().optional(),
|
|
13
|
+
resizeMode: z.enum(["cover", "contain", "stretch", "center"]).optional(),
|
|
14
|
+
});
|