@rocapine/react-native-onboarding 1.7.0 → 1.8.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.
- package/dist/onboarding-example.d.ts +162 -0
- package/dist/onboarding-example.d.ts.map +1 -1
- package/dist/onboarding-example.js +36 -0
- package/dist/onboarding-example.js.map +1 -1
- package/dist/steps/ComposableScreen/elements/BaseBoxProps.d.ts +39 -0
- package/dist/steps/ComposableScreen/elements/BaseBoxProps.d.ts.map +1 -0
- package/dist/steps/ComposableScreen/elements/BaseBoxProps.js +20 -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 +37 -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 +38 -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 +98 -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 +35 -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 +74 -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 +58 -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 +81 -0
- package/dist/steps/ComposableScreen/elements/StackElement.d.ts.map +1 -0
- package/dist/steps/ComposableScreen/elements/StackElement.js +32 -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 +37 -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 -114
- package/dist/steps/ComposableScreen/types.d.ts.map +1 -1
- package/dist/steps/ComposableScreen/types.js +33 -122
- package/dist/steps/ComposableScreen/types.js.map +1 -1
- package/package.json +1 -1
- package/src/onboarding-example.ts +36 -0
- package/src/steps/ComposableScreen/elements/BaseBoxProps.ts +33 -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 +57 -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 -235
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { BaseBoxProps } from "./BaseBoxProps";
|
|
3
|
+
export type VideoElementProps = BaseBoxProps & {
|
|
4
|
+
url: string;
|
|
5
|
+
autoPlay?: boolean;
|
|
6
|
+
loop?: boolean;
|
|
7
|
+
muted?: boolean;
|
|
8
|
+
controls?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare const VideoElementPropsSchema: z.ZodObject<{
|
|
11
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
12
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
alignSelf: z.ZodOptional<z.ZodEnum<{
|
|
14
|
+
"flex-start": "flex-start";
|
|
15
|
+
center: "center";
|
|
16
|
+
"flex-end": "flex-end";
|
|
17
|
+
stretch: "stretch";
|
|
18
|
+
auto: "auto";
|
|
19
|
+
baseline: "baseline";
|
|
20
|
+
}>>;
|
|
21
|
+
opacity: z.ZodOptional<z.ZodNumber>;
|
|
22
|
+
margin: z.ZodOptional<z.ZodNumber>;
|
|
23
|
+
marginHorizontal: z.ZodOptional<z.ZodNumber>;
|
|
24
|
+
marginVertical: z.ZodOptional<z.ZodNumber>;
|
|
25
|
+
padding: z.ZodOptional<z.ZodNumber>;
|
|
26
|
+
paddingHorizontal: z.ZodOptional<z.ZodNumber>;
|
|
27
|
+
paddingVertical: z.ZodOptional<z.ZodNumber>;
|
|
28
|
+
borderWidth: z.ZodOptional<z.ZodNumber>;
|
|
29
|
+
borderRadius: z.ZodOptional<z.ZodNumber>;
|
|
30
|
+
borderColor: z.ZodOptional<z.ZodString>;
|
|
31
|
+
url: z.ZodString;
|
|
32
|
+
autoPlay: z.ZodOptional<z.ZodBoolean>;
|
|
33
|
+
loop: z.ZodOptional<z.ZodBoolean>;
|
|
34
|
+
muted: z.ZodOptional<z.ZodBoolean>;
|
|
35
|
+
controls: z.ZodOptional<z.ZodBoolean>;
|
|
36
|
+
}, z.core.$strip>;
|
|
37
|
+
//# sourceMappingURL=VideoElement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VideoElement.d.ts","sourceRoot":"","sources":["../../../../src/steps/ComposableScreen/elements/VideoElement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAsB,MAAM,gBAAgB,CAAC;AAElE,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG;IAC7C,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;iBAMlC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VideoElementPropsSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const BaseBoxProps_1 = require("./BaseBoxProps");
|
|
6
|
+
exports.VideoElementPropsSchema = BaseBoxProps_1.BaseBoxPropsSchema.extend({
|
|
7
|
+
url: zod_1.z.string().min(1, "url must not be empty"),
|
|
8
|
+
autoPlay: zod_1.z.boolean().optional(),
|
|
9
|
+
loop: zod_1.z.boolean().optional(),
|
|
10
|
+
muted: zod_1.z.boolean().optional(),
|
|
11
|
+
controls: zod_1.z.boolean().optional(),
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=VideoElement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VideoElement.js","sourceRoot":"","sources":["../../../../src/steps/ComposableScreen/elements/VideoElement.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,iDAAkE;AAUrD,QAAA,uBAAuB,GAAG,iCAAkB,CAAC,MAAM,CAAC;IAC/D,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,uBAAuB,CAAC;IAC/C,QAAQ,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAChC,IAAI,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC5B,KAAK,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC7B,QAAQ,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CACjC,CAAC,CAAC"}
|
|
@@ -1,150 +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
|
-
fontFamily?: string;
|
|
57
|
-
color?: string;
|
|
58
|
-
textAlign?: "left" | "center" | "right";
|
|
59
|
-
letterSpacing?: number;
|
|
60
|
-
lineHeight?: number;
|
|
61
|
-
backgroundColor?: string;
|
|
62
|
-
padding?: number;
|
|
63
|
-
paddingHorizontal?: number;
|
|
64
|
-
paddingVertical?: number;
|
|
65
|
-
margin?: number;
|
|
66
|
-
marginHorizontal?: number;
|
|
67
|
-
marginVertical?: number;
|
|
68
|
-
borderWidth?: number;
|
|
69
|
-
borderRadius?: number;
|
|
70
|
-
borderColor?: string;
|
|
71
|
-
opacity?: number;
|
|
72
|
-
};
|
|
34
|
+
props: TextElementProps;
|
|
73
35
|
} | {
|
|
74
36
|
id: string;
|
|
75
37
|
name?: string;
|
|
76
38
|
type: "Image";
|
|
77
|
-
props:
|
|
78
|
-
url: string;
|
|
79
|
-
aspectRatio?: number;
|
|
80
|
-
resizeMode?: "cover" | "contain" | "stretch" | "center";
|
|
81
|
-
};
|
|
39
|
+
props: ImageElementProps;
|
|
82
40
|
} | {
|
|
83
41
|
id: string;
|
|
84
42
|
name?: string;
|
|
85
43
|
type: "Lottie";
|
|
86
|
-
props:
|
|
87
|
-
source: string;
|
|
88
|
-
autoPlay?: boolean;
|
|
89
|
-
loop?: boolean;
|
|
90
|
-
speed?: number;
|
|
91
|
-
};
|
|
44
|
+
props: LottieElementProps;
|
|
92
45
|
} | {
|
|
93
46
|
id: string;
|
|
94
47
|
name?: string;
|
|
95
48
|
type: "Rive";
|
|
96
|
-
props:
|
|
97
|
-
url: string;
|
|
98
|
-
autoplay?: boolean;
|
|
99
|
-
fit?: "Contain" | "Cover" | "Fill" | "FitWidth" | "FitHeight" | "None" | "ScaleDown" | "Layout";
|
|
100
|
-
alignment?: "TopLeft" | "TopCenter" | "TopRight" | "CenterLeft" | "Center" | "CenterRight" | "BottomLeft" | "BottomCenter" | "BottomRight";
|
|
101
|
-
artboardName?: string;
|
|
102
|
-
stateMachineName?: string;
|
|
103
|
-
};
|
|
49
|
+
props: RiveElementProps;
|
|
104
50
|
} | {
|
|
105
51
|
id: string;
|
|
106
52
|
name?: string;
|
|
107
53
|
type: "Icon";
|
|
108
|
-
props:
|
|
109
|
-
name: string;
|
|
110
|
-
size?: number;
|
|
111
|
-
color?: string;
|
|
112
|
-
strokeWidth?: number;
|
|
113
|
-
};
|
|
54
|
+
props: IconElementProps;
|
|
114
55
|
} | {
|
|
115
56
|
id: string;
|
|
116
57
|
name?: string;
|
|
117
58
|
type: "Video";
|
|
118
|
-
props:
|
|
119
|
-
url: string;
|
|
120
|
-
autoPlay?: boolean;
|
|
121
|
-
loop?: boolean;
|
|
122
|
-
muted?: boolean;
|
|
123
|
-
controls?: boolean;
|
|
124
|
-
};
|
|
59
|
+
props: VideoElementProps;
|
|
125
60
|
} | {
|
|
126
61
|
id: string;
|
|
127
62
|
name?: string;
|
|
128
63
|
type: "Input";
|
|
129
|
-
props:
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
editable?: boolean;
|
|
141
|
-
color?: string;
|
|
142
|
-
backgroundColor?: string;
|
|
143
|
-
fontSize?: number;
|
|
144
|
-
fontWeight?: string;
|
|
145
|
-
textAlign?: "left" | "center" | "right";
|
|
146
|
-
placeholderColor?: string;
|
|
147
|
-
};
|
|
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;
|
|
148
75
|
};
|
|
149
76
|
export declare const ComposableScreenStepPayloadSchema: z.ZodObject<{
|
|
150
77
|
elements: z.ZodArray<z.ZodType<UIElement, unknown, z.core.$ZodTypeInternals<UIElement, unknown>>>;
|
|
@@ -162,5 +89,4 @@ export declare const ComposableScreenStepTypeSchema: z.ZodObject<{
|
|
|
162
89
|
figmaUrl: z.ZodNullable<z.ZodString>;
|
|
163
90
|
}, z.core.$strip>;
|
|
164
91
|
export type ComposableScreenStepType = z.infer<typeof ComposableScreenStepTypeSchema>;
|
|
165
|
-
export {};
|
|
166
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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;;;;;;iBASzC,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC"}
|
|
@@ -1,170 +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
|
-
fontFamily: zod_1.z.string().optional(),
|
|
52
|
-
color: zod_1.z.string().optional(),
|
|
53
|
-
textAlign: zod_1.z.enum(["left", "center", "right"]).optional(),
|
|
54
|
-
letterSpacing: zod_1.z.number().optional(),
|
|
55
|
-
lineHeight: zod_1.z.number().optional(),
|
|
56
|
-
backgroundColor: zod_1.z.string().optional(),
|
|
57
|
-
padding: zod_1.z.number().optional(),
|
|
58
|
-
paddingHorizontal: zod_1.z.number().optional(),
|
|
59
|
-
paddingVertical: zod_1.z.number().optional(),
|
|
60
|
-
margin: zod_1.z.number().optional(),
|
|
61
|
-
marginHorizontal: zod_1.z.number().optional(),
|
|
62
|
-
marginVertical: zod_1.z.number().optional(),
|
|
63
|
-
borderWidth: zod_1.z.number().optional(),
|
|
64
|
-
borderRadius: zod_1.z.number().optional(),
|
|
65
|
-
borderColor: zod_1.z.string().optional(),
|
|
66
|
-
opacity: zod_1.z.number().min(0).max(1).optional(),
|
|
67
|
-
});
|
|
68
|
-
const ImageElementPropsSchema = BaseBoxPropsSchema.extend({
|
|
69
|
-
url: zod_1.z.string(),
|
|
70
|
-
aspectRatio: zod_1.z.number().optional(),
|
|
71
|
-
resizeMode: zod_1.z.enum(["cover", "contain", "stretch", "center"]).optional(),
|
|
72
|
-
});
|
|
73
|
-
const LottieElementPropsSchema = BaseBoxPropsSchema.extend({
|
|
74
|
-
source: zod_1.z.string(),
|
|
75
|
-
autoPlay: zod_1.z.boolean().optional(),
|
|
76
|
-
loop: zod_1.z.boolean().optional(),
|
|
77
|
-
speed: zod_1.z.number().optional(),
|
|
78
|
-
});
|
|
79
|
-
const RiveElementPropsSchema = BaseBoxPropsSchema.extend({
|
|
80
|
-
url: zod_1.z.string(),
|
|
81
|
-
autoplay: zod_1.z.boolean().optional(),
|
|
82
|
-
fit: zod_1.z.enum(["Contain", "Cover", "Fill", "FitWidth", "FitHeight", "None", "ScaleDown", "Layout"]).optional(),
|
|
83
|
-
alignment: zod_1.z.enum(["TopLeft", "TopCenter", "TopRight", "CenterLeft", "Center", "CenterRight", "BottomLeft", "BottomCenter", "BottomRight"]).optional(),
|
|
84
|
-
artboardName: zod_1.z.string().optional(),
|
|
85
|
-
stateMachineName: zod_1.z.string().optional(),
|
|
86
|
-
});
|
|
87
|
-
const IconElementPropsSchema = BaseBoxPropsSchema.extend({
|
|
88
|
-
name: zod_1.z.string(),
|
|
89
|
-
size: zod_1.z.number().optional(),
|
|
90
|
-
color: zod_1.z.string().optional(),
|
|
91
|
-
strokeWidth: zod_1.z.number().optional(),
|
|
92
|
-
});
|
|
93
|
-
const VideoElementPropsSchema = BaseBoxPropsSchema.extend({
|
|
94
|
-
url: zod_1.z.string(),
|
|
95
|
-
autoPlay: zod_1.z.boolean().optional(),
|
|
96
|
-
loop: zod_1.z.boolean().optional(),
|
|
97
|
-
muted: zod_1.z.boolean().optional(),
|
|
98
|
-
controls: zod_1.z.boolean().optional(),
|
|
99
|
-
});
|
|
100
|
-
const InputElementPropsSchema = BaseBoxPropsSchema.extend({
|
|
101
|
-
variableName: zod_1.z.string().optional(),
|
|
102
|
-
placeholder: zod_1.z.string().optional(),
|
|
103
|
-
defaultValue: zod_1.z.string().optional(),
|
|
104
|
-
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(),
|
|
105
|
-
returnKeyType: zod_1.z.enum(["done", "next", "go", "search", "send", "default", "emergency-call", "google", "join", "route", "yahoo", "none", "previous"]).optional(),
|
|
106
|
-
autoCapitalize: zod_1.z.enum(["none", "sentences", "words", "characters"]).optional(),
|
|
107
|
-
secureTextEntry: zod_1.z.boolean().optional(),
|
|
108
|
-
maxLength: zod_1.z.number().int().nonnegative().optional(),
|
|
109
|
-
multiline: zod_1.z.boolean().optional(),
|
|
110
|
-
numberOfLines: zod_1.z.number().int().nonnegative().optional(),
|
|
111
|
-
editable: zod_1.z.boolean().optional(),
|
|
112
|
-
color: zod_1.z.string().optional(),
|
|
113
|
-
backgroundColor: zod_1.z.string().optional(),
|
|
114
|
-
fontSize: zod_1.z.number().optional(),
|
|
115
|
-
fontWeight: zod_1.z.string().optional(),
|
|
116
|
-
textAlign: zod_1.z.enum(["left", "center", "right"]).optional(),
|
|
117
|
-
placeholderColor: zod_1.z.string().optional(),
|
|
118
|
-
});
|
|
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; } });
|
|
119
18
|
const UIElementSchema = zod_1.z.lazy(() => zod_1.z.union([
|
|
120
19
|
zod_1.z.object({
|
|
121
20
|
id: zod_1.z.string(),
|
|
122
21
|
name: zod_1.z.string().optional(),
|
|
123
22
|
type: zod_1.z.union([zod_1.z.literal("YStack"), zod_1.z.literal("XStack")]),
|
|
124
|
-
props: StackElementPropsSchema,
|
|
23
|
+
props: StackElement_1.StackElementPropsSchema,
|
|
125
24
|
children: zod_1.z.array(UIElementSchema),
|
|
126
25
|
}),
|
|
127
26
|
zod_1.z.object({
|
|
128
27
|
id: zod_1.z.string(),
|
|
129
28
|
name: zod_1.z.string().optional(),
|
|
130
29
|
type: zod_1.z.literal("Text"),
|
|
131
|
-
props: TextElementPropsSchema,
|
|
30
|
+
props: TextElement_1.TextElementPropsSchema,
|
|
132
31
|
}),
|
|
133
32
|
zod_1.z.object({
|
|
134
33
|
id: zod_1.z.string(),
|
|
135
34
|
name: zod_1.z.string().optional(),
|
|
136
35
|
type: zod_1.z.literal("Image"),
|
|
137
|
-
props: ImageElementPropsSchema,
|
|
36
|
+
props: ImageElement_1.ImageElementPropsSchema,
|
|
138
37
|
}),
|
|
139
38
|
zod_1.z.object({
|
|
140
39
|
id: zod_1.z.string(),
|
|
141
40
|
name: zod_1.z.string().optional(),
|
|
142
41
|
type: zod_1.z.literal("Lottie"),
|
|
143
|
-
props: LottieElementPropsSchema,
|
|
42
|
+
props: LottieElement_1.LottieElementPropsSchema,
|
|
144
43
|
}),
|
|
145
44
|
zod_1.z.object({
|
|
146
45
|
id: zod_1.z.string(),
|
|
147
46
|
name: zod_1.z.string().optional(),
|
|
148
47
|
type: zod_1.z.literal("Rive"),
|
|
149
|
-
props: RiveElementPropsSchema,
|
|
48
|
+
props: RiveElement_1.RiveElementPropsSchema,
|
|
150
49
|
}),
|
|
151
50
|
zod_1.z.object({
|
|
152
51
|
id: zod_1.z.string(),
|
|
153
52
|
name: zod_1.z.string().optional(),
|
|
154
53
|
type: zod_1.z.literal("Icon"),
|
|
155
|
-
props: IconElementPropsSchema,
|
|
54
|
+
props: IconElement_1.IconElementPropsSchema,
|
|
156
55
|
}),
|
|
157
56
|
zod_1.z.object({
|
|
158
57
|
id: zod_1.z.string(),
|
|
159
58
|
name: zod_1.z.string().optional(),
|
|
160
59
|
type: zod_1.z.literal("Video"),
|
|
161
|
-
props: VideoElementPropsSchema,
|
|
60
|
+
props: VideoElement_1.VideoElementPropsSchema,
|
|
162
61
|
}),
|
|
163
62
|
zod_1.z.object({
|
|
164
63
|
id: zod_1.z.string(),
|
|
165
64
|
name: zod_1.z.string().optional(),
|
|
166
65
|
type: zod_1.z.literal("Input"),
|
|
167
|
-
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,
|
|
168
79
|
}),
|
|
169
80
|
]));
|
|
170
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,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B;KAChC,CAAC;IACF,OAAC,CAAC,MAAM,CAAC;QACP,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;QACd,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,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,eAAe,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,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.1",
|
|
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",
|
|
@@ -198,6 +198,42 @@ export const onboardingExample = {
|
|
|
198
198
|
opacity: 0.6,
|
|
199
199
|
},
|
|
200
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
|
+
},
|
|
201
237
|
],
|
|
202
238
|
},
|
|
203
239
|
],
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
export type BaseBoxProps = {
|
|
4
|
+
width?: number;
|
|
5
|
+
height?: number;
|
|
6
|
+
alignSelf?: "auto" | "flex-start" | "flex-end" | "center" | "stretch" | "baseline";
|
|
7
|
+
opacity?: number;
|
|
8
|
+
margin?: number;
|
|
9
|
+
marginHorizontal?: number;
|
|
10
|
+
marginVertical?: number;
|
|
11
|
+
padding?: number;
|
|
12
|
+
paddingHorizontal?: number;
|
|
13
|
+
paddingVertical?: number;
|
|
14
|
+
borderWidth?: number;
|
|
15
|
+
borderRadius?: number;
|
|
16
|
+
borderColor?: string;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const BaseBoxPropsSchema = z.object({
|
|
20
|
+
width: z.number().min(0).optional(),
|
|
21
|
+
height: z.number().min(0).optional(),
|
|
22
|
+
alignSelf: z.enum(["auto", "flex-start", "flex-end", "center", "stretch", "baseline"]).optional(),
|
|
23
|
+
opacity: z.number().min(0).max(1).optional(),
|
|
24
|
+
margin: z.number().optional(),
|
|
25
|
+
marginHorizontal: z.number().optional(),
|
|
26
|
+
marginVertical: z.number().optional(),
|
|
27
|
+
padding: z.number().min(0).optional(),
|
|
28
|
+
paddingHorizontal: z.number().min(0).optional(),
|
|
29
|
+
paddingVertical: z.number().min(0).optional(),
|
|
30
|
+
borderWidth: z.number().min(0).optional(),
|
|
31
|
+
borderRadius: z.number().min(0).optional(),
|
|
32
|
+
borderColor: z.string().optional(),
|
|
33
|
+
});
|
|
@@ -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
|
+
});
|