@rocapine/react-native-onboarding 1.28.0 → 1.30.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/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/onboarding-example.d.ts +431 -25
- package/dist/onboarding-example.d.ts.map +1 -1
- package/dist/onboarding-example.js +33 -1
- package/dist/onboarding-example.js.map +1 -1
- package/dist/steps/ComposableScreen/elements/ButtonElement.d.ts +59 -1
- package/dist/steps/ComposableScreen/elements/ButtonElement.d.ts.map +1 -1
- package/dist/steps/ComposableScreen/elements/ButtonElement.js +10 -1
- package/dist/steps/ComposableScreen/elements/ButtonElement.js.map +1 -1
- package/dist/steps/ComposableScreen/elements/DatePickerElement.d.ts.map +1 -1
- package/dist/steps/ComposableScreen/elements/DatePickerElement.js +7 -3
- package/dist/steps/ComposableScreen/elements/DatePickerElement.js.map +1 -1
- package/dist/steps/ComposableScreen/elements/ProgressIndicatorElement.d.ts +139 -0
- package/dist/steps/ComposableScreen/elements/ProgressIndicatorElement.d.ts.map +1 -0
- package/dist/steps/ComposableScreen/elements/ProgressIndicatorElement.js +24 -0
- package/dist/steps/ComposableScreen/elements/ProgressIndicatorElement.js.map +1 -0
- package/dist/steps/ComposableScreen/types.d.ts +10 -2
- package/dist/steps/ComposableScreen/types.d.ts.map +1 -1
- package/dist/steps/ComposableScreen/types.js +10 -1
- package/dist/steps/ComposableScreen/types.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +4 -0
- package/src/onboarding-example.ts +33 -1
- package/src/steps/ComposableScreen/elements/ButtonElement.ts +27 -1
- package/src/steps/ComposableScreen/elements/DatePickerElement.ts +8 -3
- package/src/steps/ComposableScreen/elements/ProgressIndicatorElement.ts +66 -0
- package/src/steps/ComposableScreen/types.ts +18 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/steps/ComposableScreen/types.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,kDAMyB;AACzB,0DAA0F;AAC1F,wDAAuF;AACvF,0DAA0F;AAC1F,4DAA6F;AAC7F,wDAAuF;AACvF,wDAAuF;AACvF,0DAA0F;AAC1F,0DAA0F;AAC1F,4DAA6F;AAC7F,oEAAyG;AACzG,0EAAkH;AAClH,oEAAyG;AACzG,sEAA4G;AAC5G,gEAAmG;AACnG,4DAA6F;AAC7F,wEAA+G;AAC/G,oEAAyG;AACzG,wFAGgD;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/steps/ComposableScreen/types.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,kDAMyB;AACzB,0DAA0F;AAC1F,wDAAuF;AACvF,0DAA0F;AAC1F,4DAA6F;AAC7F,wDAAuF;AACvF,wDAAuF;AACvF,0DAA0F;AAC1F,0DAA0F;AAC1F,4DAA6F;AAC7F,oEAAyG;AACzG,0EAAkH;AAClH,oEAAyG;AACzG,sEAA4G;AAC5G,gEAAmG;AACnG,4DAA6F;AAC7F,wEAA+G;AAC/G,oEAAyG;AACzG,wFAGgD;AAChD,kFAA8H;AAG9H,wDAAuF;AAA9E,kHAAA,kBAAkB,OAAA;AAAE,wHAAA,wBAAwB,OAAA;AAUrD,0DAAuH;AAA9G,mHAAA,kBAAkB,OAAA;AAAE,yHAAA,wBAAwB,OAAA;AAAE,8HAAA,6BAA6B,OAAA;AAKpF,oEAAsI;AAA7H,mIAAA,6BAA6B,OAAA;AAAE,mIAAA,6BAA6B,OAAA;AAAE,6HAAA,uBAAuB,OAAA;AA2K9F,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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E,OAAC,CAAC,KAAK,CAAC,eAAe,CAAC;CACnC,CAAC;KACD,WAAW,CAAC,CAAC,OAAO,EAAE,GAAG,EAAE,EAAE;IAC5B,MAAM,SAAS,GAAa,EAAE,CAAC;IAC/B,kCAAkC,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;IACvE,KAAK,MAAM,EAAE,IAAI,SAAS,EAAE,CAAC;QAC3B,GAAG,CAAC,QAAQ,CAAC;YACX,IAAI,EAAE,OAAC,CAAC,YAAY,CAAC,MAAM;YAC3B,IAAI,EAAE,CAAC,UAAU,CAAC;YAClB,OAAO,EAAE,6BAA6B,EAAE,0DAA0D;SACnG,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC,CAAC;AAEQ,QAAA,8BAA8B,GAAG,iCAAkB,CAAC,MAAM,CAAC;IACtE,IAAI,EAAE,OAAC,CAAC,OAAO,CAAC,kBAAkB,CAAC;IACnC,OAAO,EAAE,yCAAiC;CAC3C,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.30.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",
|
package/src/index.ts
CHANGED
|
@@ -6,15 +6,19 @@ export * from "./onboarding-example";
|
|
|
6
6
|
export type {
|
|
7
7
|
ButtonAction,
|
|
8
8
|
CustomButtonAction,
|
|
9
|
+
SetVariableButtonAction,
|
|
9
10
|
ComposableVariableEntry,
|
|
10
11
|
ComposableVariableKind,
|
|
11
12
|
WheelPickerElementProps,
|
|
12
13
|
WheelPickerItem,
|
|
13
14
|
WheelPickerRange,
|
|
15
|
+
ProgressIndicatorElementProps,
|
|
16
|
+
ProgressEasing,
|
|
14
17
|
} from "./steps/ComposableScreen/types";
|
|
15
18
|
export {
|
|
16
19
|
ButtonActionSchema,
|
|
17
20
|
CustomButtonActionSchema,
|
|
21
|
+
SetVariableButtonActionSchema,
|
|
18
22
|
WheelPickerElementPropsSchema,
|
|
19
23
|
generateWheelPickerRangeItems,
|
|
20
24
|
resolveWheelPickerItems,
|
|
@@ -163,6 +163,38 @@ export const onboardingExample = {
|
|
|
163
163
|
marginVertical: 8,
|
|
164
164
|
},
|
|
165
165
|
},
|
|
166
|
+
{
|
|
167
|
+
id: "progress-linear",
|
|
168
|
+
type: "ProgressIndicator",
|
|
169
|
+
props: {
|
|
170
|
+
variant: "linear",
|
|
171
|
+
autoplay: true,
|
|
172
|
+
loop: true,
|
|
173
|
+
initialValue: 0,
|
|
174
|
+
duration: 2500,
|
|
175
|
+
easing: "ease-in-out",
|
|
176
|
+
thickness: 10,
|
|
177
|
+
showLabel: true,
|
|
178
|
+
marginVertical: 8,
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
id: "progress-circular",
|
|
183
|
+
type: "ProgressIndicator",
|
|
184
|
+
props: {
|
|
185
|
+
variant: "circular",
|
|
186
|
+
autoplay: true,
|
|
187
|
+
loop: false,
|
|
188
|
+
initialValue: 0,
|
|
189
|
+
duration: 1800,
|
|
190
|
+
delay: 500,
|
|
191
|
+
easing: "ease-out",
|
|
192
|
+
size: 120,
|
|
193
|
+
thickness: 12,
|
|
194
|
+
showLabel: true,
|
|
195
|
+
alignSelf: "center",
|
|
196
|
+
},
|
|
197
|
+
},
|
|
166
198
|
{
|
|
167
199
|
id: "hero-video",
|
|
168
200
|
type: "Video",
|
|
@@ -437,7 +469,7 @@ export const onboardingExample = {
|
|
|
437
469
|
defaultValue: "1990-01-01T00:00:00.000Z",
|
|
438
470
|
mode: "date",
|
|
439
471
|
display: "spinner",
|
|
440
|
-
maximumDate:
|
|
472
|
+
maximumDate: "now", // resolves to current date at render time
|
|
441
473
|
marginVertical: 8,
|
|
442
474
|
},
|
|
443
475
|
},
|
|
@@ -19,11 +19,37 @@ export const CustomButtonActionSchema = z.object({
|
|
|
19
19
|
variables: z.array(z.string()).optional(),
|
|
20
20
|
});
|
|
21
21
|
|
|
22
|
-
export type
|
|
22
|
+
export type SetVariableButtonAction = {
|
|
23
|
+
type: "setVariable";
|
|
24
|
+
name: string;
|
|
25
|
+
value: string;
|
|
26
|
+
label?: string;
|
|
27
|
+
/**
|
|
28
|
+
* When `"expression"`, `value` is parsed as an arithmetic expression with
|
|
29
|
+
* `{{var}}` references, numeric literals, and `+ - * /` (parens supported).
|
|
30
|
+
* On parse failure, falls back to plain interpolation (string).
|
|
31
|
+
* Defaults to `"literal"` — `value` stored verbatim.
|
|
32
|
+
*/
|
|
33
|
+
valueMode?: "literal" | "expression";
|
|
34
|
+
/** Tags the stored variable's underlying type. */
|
|
35
|
+
kind?: "int" | "float" | "string";
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const SetVariableButtonActionSchema = z.object({
|
|
39
|
+
type: z.literal("setVariable"),
|
|
40
|
+
name: z.string().min(1, "name must not be empty"),
|
|
41
|
+
value: z.string(),
|
|
42
|
+
label: z.string().optional(),
|
|
43
|
+
valueMode: z.enum(["literal", "expression"]).optional(),
|
|
44
|
+
kind: z.enum(["int", "float", "string"]).optional(),
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
export type ButtonAction = "continue" | CustomButtonAction | SetVariableButtonAction;
|
|
23
48
|
|
|
24
49
|
export const ButtonActionSchema = z.union([
|
|
25
50
|
z.literal("continue"),
|
|
26
51
|
CustomButtonActionSchema,
|
|
52
|
+
SetVariableButtonActionSchema,
|
|
27
53
|
]);
|
|
28
54
|
|
|
29
55
|
type ButtonOverridableProps = BaseBoxProps & {
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { BaseBoxProps, BaseBoxPropsSchema } from "./BaseBoxProps";
|
|
3
3
|
|
|
4
|
+
// The literal "now" resolves to the current date/time at render time.
|
|
5
|
+
// Use it for defaultValue/minimumDate/maximumDate when a static ISO string
|
|
6
|
+
// would go stale (e.g. a max date that should always be today).
|
|
7
|
+
const isDateStringOrNow = (s: string) => s === "now" || !isNaN(Date.parse(s));
|
|
8
|
+
|
|
4
9
|
export type DatePickerElementProps = BaseBoxProps & {
|
|
5
10
|
variableName?: string;
|
|
6
11
|
defaultValue?: string;
|
|
@@ -15,9 +20,9 @@ export type DatePickerElementProps = BaseBoxProps & {
|
|
|
15
20
|
|
|
16
21
|
export const DatePickerElementPropsSchema = BaseBoxPropsSchema.extend({
|
|
17
22
|
variableName: z.string().min(1).optional(),
|
|
18
|
-
defaultValue: z.string().refine(
|
|
19
|
-
minimumDate: z.string().refine(
|
|
20
|
-
maximumDate: z.string().refine(
|
|
23
|
+
defaultValue: z.string().refine(isDateStringOrNow, { message: "Invalid date string" }).optional(),
|
|
24
|
+
minimumDate: z.string().refine(isDateStringOrNow, { message: "Invalid date string" }).optional(),
|
|
25
|
+
maximumDate: z.string().refine(isDateStringOrNow, { message: "Invalid date string" }).optional(),
|
|
21
26
|
mode: z.enum(["date", "time", "datetime"]).optional().default("date"),
|
|
22
27
|
display: z.enum(["default", "spinner", "calendar", "clock", "compact", "inline"]).optional(),
|
|
23
28
|
textColor: z.string().optional(),
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { BaseBoxProps, BaseBoxPropsSchema } from "./BaseBoxProps";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Easing curve names selectable for the progress animation. Mapped to the
|
|
6
|
+
* matching CSS-style cubic-bezier curves in the renderer.
|
|
7
|
+
*/
|
|
8
|
+
export type ProgressEasing = "linear" | "ease-in" | "ease-out" | "ease-in-out";
|
|
9
|
+
|
|
10
|
+
export type ProgressIndicatorElementProps = BaseBoxProps & {
|
|
11
|
+
/** Visual style of the indicator. */
|
|
12
|
+
variant?: "linear" | "circular";
|
|
13
|
+
/**
|
|
14
|
+
* Variable bound to the indicator (int 0-100). When `autoplay` is on, the
|
|
15
|
+
* current rounded progress is written to this variable on each frame; when
|
|
16
|
+
* `autoplay` is off, the indicator reflects (and animates to) this variable's
|
|
17
|
+
* value.
|
|
18
|
+
*/
|
|
19
|
+
variableName?: string;
|
|
20
|
+
/** Static value (0-100) used when no `variableName` is provided. */
|
|
21
|
+
value?: number;
|
|
22
|
+
/** Animate from `initialValue` to 100 automatically on mount. */
|
|
23
|
+
autoplay?: boolean;
|
|
24
|
+
/** Repeat the autoplay animation indefinitely. */
|
|
25
|
+
loop?: boolean;
|
|
26
|
+
/** Starting value (0-100). Defaults to 0. */
|
|
27
|
+
initialValue?: number;
|
|
28
|
+
/** Animation duration in milliseconds. Defaults to 1000. */
|
|
29
|
+
duration?: number;
|
|
30
|
+
/** Delay in milliseconds before the animation starts. Defaults to 0. */
|
|
31
|
+
delay?: number;
|
|
32
|
+
/** Easing curve for the animation. Defaults to "ease-in-out". */
|
|
33
|
+
easing?: ProgressEasing;
|
|
34
|
+
/** Progress fill color. Defaults to theme primary. */
|
|
35
|
+
color?: string;
|
|
36
|
+
/** Track (unfilled) color. Defaults to theme neutral.lower. */
|
|
37
|
+
trackColor?: string;
|
|
38
|
+
/** Bar height (linear) / ring stroke width (circular). */
|
|
39
|
+
thickness?: number;
|
|
40
|
+
/** Diameter of the circular variant in px. Defaults to 120. */
|
|
41
|
+
size?: number;
|
|
42
|
+
/** Show the percentage label (centered for circular, alongside for linear). */
|
|
43
|
+
showLabel?: boolean;
|
|
44
|
+
/** Label text color. Defaults to theme text.primary. */
|
|
45
|
+
labelColor?: string;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const ProgressEasingSchema = z.enum(["linear", "ease-in", "ease-out", "ease-in-out"]);
|
|
49
|
+
|
|
50
|
+
export const ProgressIndicatorElementPropsSchema = BaseBoxPropsSchema.extend({
|
|
51
|
+
variant: z.enum(["linear", "circular"]).optional(),
|
|
52
|
+
variableName: z.string().min(1).optional(),
|
|
53
|
+
value: z.number().min(0).max(100).optional(),
|
|
54
|
+
autoplay: z.boolean().optional(),
|
|
55
|
+
loop: z.boolean().optional(),
|
|
56
|
+
initialValue: z.number().min(0).max(100).optional(),
|
|
57
|
+
duration: z.number().min(0).optional(),
|
|
58
|
+
delay: z.number().min(0).optional(),
|
|
59
|
+
easing: ProgressEasingSchema.optional(),
|
|
60
|
+
color: z.string().optional(),
|
|
61
|
+
trackColor: z.string().optional(),
|
|
62
|
+
thickness: z.number().min(0).optional(),
|
|
63
|
+
size: z.number().min(0).optional(),
|
|
64
|
+
showLabel: z.boolean().optional(),
|
|
65
|
+
labelColor: z.string().optional(),
|
|
66
|
+
});
|
|
@@ -27,6 +27,7 @@ import {
|
|
|
27
27
|
type KeyboardAvoidingViewElementProps,
|
|
28
28
|
KeyboardAvoidingViewElementPropsSchema,
|
|
29
29
|
} from "./elements/KeyboardAvoidingViewElement";
|
|
30
|
+
import { type ProgressIndicatorElementProps, ProgressIndicatorElementPropsSchema } from "./elements/ProgressIndicatorElement";
|
|
30
31
|
|
|
31
32
|
export type { BaseBoxProps, GradientBackground, GradientEdge, GradientStop, LinearGradientConfig } from "./elements/BaseBoxProps";
|
|
32
33
|
export { BaseBoxPropsSchema, GradientBackgroundSchema } from "./elements/BaseBoxProps";
|
|
@@ -38,8 +39,8 @@ export type { RiveElementProps } from "./elements/RiveElement";
|
|
|
38
39
|
export type { IconElementProps } from "./elements/IconElement";
|
|
39
40
|
export type { VideoElementProps } from "./elements/VideoElement";
|
|
40
41
|
export type { InputElementProps } from "./elements/InputElement";
|
|
41
|
-
export type { ButtonElementProps, ButtonAction, CustomButtonAction } from "./elements/ButtonElement";
|
|
42
|
-
export { ButtonActionSchema, CustomButtonActionSchema } from "./elements/ButtonElement";
|
|
42
|
+
export type { ButtonElementProps, ButtonAction, CustomButtonAction, SetVariableButtonAction } from "./elements/ButtonElement";
|
|
43
|
+
export { ButtonActionSchema, CustomButtonActionSchema, SetVariableButtonActionSchema } from "./elements/ButtonElement";
|
|
43
44
|
export type { RadioGroupElementProps } from "./elements/RadioGroupElement";
|
|
44
45
|
export type { CheckboxGroupElementProps } from "./elements/CheckboxGroupElement";
|
|
45
46
|
export type { DatePickerElementProps } from "./elements/DatePickerElement";
|
|
@@ -53,6 +54,7 @@ export type {
|
|
|
53
54
|
KeyboardAvoidingViewElementProps,
|
|
54
55
|
KeyboardAvoidingBehavior,
|
|
55
56
|
} from "./elements/KeyboardAvoidingViewElement";
|
|
57
|
+
export type { ProgressIndicatorElementProps, ProgressEasing } from "./elements/ProgressIndicatorElement";
|
|
56
58
|
|
|
57
59
|
/**
|
|
58
60
|
* Type tag for a ComposableScreen variable. Drives expression-mode coercion
|
|
@@ -205,6 +207,13 @@ type UIElement =
|
|
|
205
207
|
type: "KeyboardAvoidingView";
|
|
206
208
|
props: KeyboardAvoidingViewElementProps;
|
|
207
209
|
children: UIElement[];
|
|
210
|
+
}
|
|
211
|
+
| {
|
|
212
|
+
id: string;
|
|
213
|
+
name?: string;
|
|
214
|
+
renderWhen?: LeafCondition | ConditionGroup;
|
|
215
|
+
type: "ProgressIndicator";
|
|
216
|
+
props: ProgressIndicatorElementProps;
|
|
208
217
|
};
|
|
209
218
|
|
|
210
219
|
const UIElementSchema: z.ZodType<UIElement> = z.lazy(() =>
|
|
@@ -341,6 +350,13 @@ const UIElementSchema: z.ZodType<UIElement> = z.lazy(() =>
|
|
|
341
350
|
props: KeyboardAvoidingViewElementPropsSchema,
|
|
342
351
|
children: z.array(UIElementSchema),
|
|
343
352
|
}),
|
|
353
|
+
z.object({
|
|
354
|
+
id: z.string(),
|
|
355
|
+
name: z.string().optional(),
|
|
356
|
+
renderWhen: z.union([LeafConditionSchema, ConditionGroupSchema]).optional(),
|
|
357
|
+
type: z.literal("ProgressIndicator"),
|
|
358
|
+
props: ProgressIndicatorElementPropsSchema,
|
|
359
|
+
}),
|
|
344
360
|
])
|
|
345
361
|
);
|
|
346
362
|
|