@rubixscript/react-native-onboarding 1.0.0 → 1.1.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 (59) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +383 -383
  3. package/dist/components/NavigationButtons.d.ts +23 -0
  4. package/dist/components/NavigationButtons.d.ts.map +1 -0
  5. package/dist/components/NavigationButtons.js +106 -0
  6. package/dist/components/Onboarding.d.ts +11 -0
  7. package/dist/components/Onboarding.d.ts.map +1 -0
  8. package/dist/components/Onboarding.js +219 -0
  9. package/dist/components/Pagination.d.ts +5 -0
  10. package/dist/components/Pagination.d.ts.map +1 -0
  11. package/dist/components/Pagination.js +269 -0
  12. package/dist/components/SimpleOnboardingScreen.d.ts +54 -0
  13. package/dist/components/SimpleOnboardingScreen.d.ts.map +1 -0
  14. package/dist/components/SimpleOnboardingScreen.js +184 -0
  15. package/dist/components/index.d.ts +7 -0
  16. package/dist/components/index.d.ts.map +1 -0
  17. package/dist/components/index.js +5 -0
  18. package/dist/index.d.ts +9 -0
  19. package/dist/index.d.ts.map +1 -0
  20. package/dist/index.js +12 -0
  21. package/dist/presets/index.d.ts +27 -0
  22. package/dist/presets/index.d.ts.map +1 -0
  23. package/dist/presets/index.js +370 -0
  24. package/dist/slides/FormSlide.d.ts +12 -0
  25. package/dist/slides/FormSlide.d.ts.map +1 -0
  26. package/dist/slides/FormSlide.js +227 -0
  27. package/dist/slides/IconSlide.d.ts +10 -0
  28. package/dist/slides/IconSlide.d.ts.map +1 -0
  29. package/dist/slides/IconSlide.js +133 -0
  30. package/dist/slides/ImageSlide.d.ts +10 -0
  31. package/dist/slides/ImageSlide.d.ts.map +1 -0
  32. package/dist/slides/ImageSlide.js +99 -0
  33. package/dist/slides/VideoSlide.d.ts +10 -0
  34. package/dist/slides/VideoSlide.d.ts.map +1 -0
  35. package/dist/slides/VideoSlide.js +101 -0
  36. package/dist/slides/index.d.ts +14 -0
  37. package/dist/slides/index.d.ts.map +1 -0
  38. package/dist/slides/index.js +25 -0
  39. package/dist/themes/index.d.ts +35 -0
  40. package/dist/themes/index.d.ts.map +1 -0
  41. package/dist/themes/index.js +547 -0
  42. package/dist/types/index.d.ts +191 -0
  43. package/dist/types/index.d.ts.map +1 -0
  44. package/dist/types/index.js +1 -0
  45. package/package.json +73 -60
  46. package/src/components/NavigationButtons.tsx +198 -198
  47. package/src/components/Onboarding.tsx +337 -340
  48. package/src/components/Pagination.tsx +337 -337
  49. package/src/components/SimpleOnboardingScreen.tsx +266 -0
  50. package/src/components/index.ts +7 -5
  51. package/src/index.ts +69 -65
  52. package/src/presets/index.ts +391 -394
  53. package/src/slides/FormSlide.tsx +314 -314
  54. package/src/slides/IconSlide.tsx +166 -166
  55. package/src/slides/ImageSlide.tsx +132 -132
  56. package/src/slides/VideoSlide.tsx +146 -146
  57. package/src/slides/{index.ts → index.tsx} +37 -44
  58. package/src/themes/index.ts +576 -574
  59. package/src/types/index.ts +247 -247
@@ -0,0 +1,547 @@
1
+ import { Platform } from 'react-native';
2
+ // ============================================================================
3
+ // BASE THEME UTILITIES
4
+ // ============================================================================
5
+ const createBaseTypography = () => ({
6
+ title: {
7
+ fontFamily: Platform.select({ ios: 'System', android: 'Roboto' }),
8
+ fontWeight: '700',
9
+ letterSpacing: -0.5,
10
+ },
11
+ description: {
12
+ fontFamily: Platform.select({ ios: 'System', android: 'Roboto' }),
13
+ fontWeight: '400',
14
+ lineHeight: 24,
15
+ },
16
+ button: {
17
+ fontFamily: Platform.select({ ios: 'System', android: 'Roboto' }),
18
+ fontWeight: '600',
19
+ letterSpacing: 0.5,
20
+ },
21
+ label: {
22
+ fontFamily: Platform.select({ ios: 'System', android: 'Roboto' }),
23
+ fontWeight: '500',
24
+ },
25
+ });
26
+ const createSpacing = () => ({
27
+ xs: 4,
28
+ sm: 8,
29
+ md: 16,
30
+ lg: 24,
31
+ xl: 32,
32
+ xxl: 48,
33
+ });
34
+ const createBorderRadius = () => ({
35
+ sm: 4,
36
+ md: 12,
37
+ lg: 16,
38
+ xl: 24,
39
+ full: 9999,
40
+ });
41
+ const createShadows = () => ({
42
+ sm: {
43
+ ...Platform.select({
44
+ ios: { shadowColor: '#000', shadowOffset: { width: 0, height: 1 }, shadowOpacity: 0.1, shadowRadius: 2 },
45
+ android: { elevation: 2 },
46
+ }),
47
+ },
48
+ md: {
49
+ ...Platform.select({
50
+ ios: { shadowColor: '#000', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 0.15, shadowRadius: 4 },
51
+ android: { elevation: 4 },
52
+ }),
53
+ },
54
+ lg: {
55
+ ...Platform.select({
56
+ ios: { shadowColor: '#000', shadowOffset: { width: 0, height: 4 }, shadowOpacity: 0.2, shadowRadius: 8 },
57
+ android: { elevation: 8 },
58
+ }),
59
+ },
60
+ });
61
+ // ============================================================================
62
+ // ONEPAGE THEME
63
+ // ============================================================================
64
+ export const onepageTheme = {
65
+ colors: {
66
+ primary: '#667EEA',
67
+ secondary: '#06D6A0',
68
+ background: '#F8FAFC',
69
+ surface: '#FFFFFF',
70
+ text: {
71
+ primary: '#1E293B',
72
+ secondary: '#64748B',
73
+ inverse: '#FFFFFF',
74
+ },
75
+ border: '#E2E8F0',
76
+ overlay: 'rgba(0, 0, 0, 0.1)',
77
+ },
78
+ typography: {
79
+ title: {
80
+ ...createBaseTypography().title,
81
+ fontSize: 28,
82
+ color: '#1E293B',
83
+ },
84
+ description: {
85
+ ...createBaseTypography().description,
86
+ fontSize: 15,
87
+ color: '#64748B',
88
+ },
89
+ button: {
90
+ ...createBaseTypography().button,
91
+ fontSize: 16,
92
+ color: '#FFFFFF',
93
+ },
94
+ label: {
95
+ ...createBaseTypography().label,
96
+ fontSize: 14,
97
+ color: '#475569',
98
+ },
99
+ },
100
+ spacing: createSpacing(),
101
+ borderRadius: createBorderRadius(),
102
+ shadows: createShadows(),
103
+ };
104
+ export const onepagePreset = {
105
+ theme: onepageTheme,
106
+ navigation: {
107
+ style: 'dots',
108
+ position: 'bottom',
109
+ showSkip: true,
110
+ showBack: true,
111
+ skipLabel: 'Skip',
112
+ backLabel: 'Back',
113
+ nextLabel: 'Next',
114
+ doneLabel: "Let's Get Started",
115
+ },
116
+ animation: {
117
+ type: 'slide',
118
+ duration: 300,
119
+ },
120
+ defaultSlideStyles: {
121
+ image: {
122
+ width: '100%',
123
+ height: 280,
124
+ borderRadius: 16,
125
+ marginBottom: 24,
126
+ },
127
+ title: {
128
+ fontSize: 24,
129
+ marginBottom: 12,
130
+ textAlign: 'center',
131
+ },
132
+ description: {
133
+ fontSize: 15,
134
+ textAlign: 'center',
135
+ paddingHorizontal: 32,
136
+ lineHeight: 22,
137
+ },
138
+ },
139
+ };
140
+ // ============================================================================
141
+ // ZAPRECIPE THEME
142
+ // ============================================================================
143
+ export const zaprecipeTheme = {
144
+ colors: {
145
+ primary: '#6B4EFF',
146
+ secondary: '#FF8C42',
147
+ background: '#FFFFFF',
148
+ surface: '#FFFFFF',
149
+ text: {
150
+ primary: '#1E293B',
151
+ secondary: '#64748B',
152
+ inverse: '#FFFFFF',
153
+ },
154
+ border: '#E2E8F0',
155
+ overlay: 'rgba(255, 255, 255, 0.2)',
156
+ },
157
+ typography: {
158
+ title: {
159
+ ...createBaseTypography().title,
160
+ fontSize: 32,
161
+ color: '#FFFFFF',
162
+ },
163
+ description: {
164
+ ...createBaseTypography().description,
165
+ fontSize: 16,
166
+ color: 'rgba(255, 255, 255, 0.9)',
167
+ },
168
+ button: {
169
+ ...createBaseTypography().button,
170
+ fontSize: 16,
171
+ color: '#FFFFFF',
172
+ },
173
+ label: {
174
+ ...createBaseTypography().label,
175
+ fontSize: 14,
176
+ color: '#FFFFFF',
177
+ },
178
+ },
179
+ spacing: createSpacing(),
180
+ borderRadius: createBorderRadius(),
181
+ shadows: createShadows(),
182
+ };
183
+ export const zaprecipePreset = {
184
+ theme: zaprecipeTheme,
185
+ navigation: {
186
+ style: 'dots',
187
+ position: 'floating',
188
+ showSkip: true,
189
+ showBack: true,
190
+ skipLabel: 'Skip',
191
+ backLabel: 'Back',
192
+ nextLabel: 'Continue',
193
+ doneLabel: "Let's Start Cooking!",
194
+ },
195
+ animation: {
196
+ type: 'fade',
197
+ duration: 250,
198
+ },
199
+ defaultSlideStyles: {
200
+ image: {
201
+ width: '100%',
202
+ height: 300,
203
+ borderRadius: 0,
204
+ marginBottom: 0,
205
+ },
206
+ title: {
207
+ fontSize: 28,
208
+ marginBottom: 16,
209
+ textAlign: 'center',
210
+ },
211
+ description: {
212
+ fontSize: 15,
213
+ textAlign: 'center',
214
+ paddingHorizontal: 24,
215
+ lineHeight: 22,
216
+ },
217
+ },
218
+ };
219
+ // ============================================================================
220
+ // POMODO THEME
221
+ // ============================================================================
222
+ export const pomodoTheme = {
223
+ colors: {
224
+ primary: '#FF6B6B',
225
+ secondary: '#667EEA',
226
+ background: '#F6F6F6',
227
+ surface: '#FFFFFF',
228
+ text: {
229
+ primary: '#1E293B',
230
+ secondary: '#64748B',
231
+ inverse: '#FFFFFF',
232
+ },
233
+ border: '#E2E8F0',
234
+ overlay: 'rgba(0, 0, 0, 0.05)',
235
+ },
236
+ typography: {
237
+ title: {
238
+ ...createBaseTypography().title,
239
+ fontSize: 24,
240
+ color: '#1E293B',
241
+ },
242
+ description: {
243
+ ...createBaseTypography().description,
244
+ fontSize: 14,
245
+ color: '#64748B',
246
+ },
247
+ button: {
248
+ ...createBaseTypography().button,
249
+ fontSize: 16,
250
+ color: '#FFFFFF',
251
+ },
252
+ },
253
+ spacing: createSpacing(),
254
+ borderRadius: createBorderRadius(),
255
+ shadows: createShadows(),
256
+ };
257
+ export const pomodoPreset = {
258
+ theme: pomodoTheme,
259
+ navigation: {
260
+ style: 'dots',
261
+ position: 'bottom',
262
+ showSkip: false,
263
+ showBack: false,
264
+ nextLabel: 'Next',
265
+ doneLabel: 'Get Started',
266
+ },
267
+ animation: {
268
+ type: 'fade',
269
+ duration: 500,
270
+ },
271
+ defaultSlideStyles: {
272
+ icon: {
273
+ width: 160,
274
+ height: 160,
275
+ borderRadius: 80,
276
+ justifyContent: 'center',
277
+ alignItems: 'center',
278
+ marginBottom: 40,
279
+ },
280
+ title: {
281
+ fontSize: 28,
282
+ marginBottom: 16,
283
+ textAlign: 'center',
284
+ fontWeight: '700',
285
+ color: '#000000',
286
+ },
287
+ description: {
288
+ fontSize: 17,
289
+ textAlign: 'center',
290
+ paddingHorizontal: 40,
291
+ lineHeight: 24,
292
+ color: '#666666',
293
+ },
294
+ },
295
+ };
296
+ // ============================================================================
297
+ // MODERN THEME
298
+ // ============================================================================
299
+ export const modernTheme = {
300
+ colors: {
301
+ primary: '#8B5CF6',
302
+ secondary: '#EC4899',
303
+ background: '#FFFFFF',
304
+ surface: '#F9FAFB',
305
+ text: {
306
+ primary: '#111827',
307
+ secondary: '#6B7280',
308
+ inverse: '#FFFFFF',
309
+ },
310
+ border: '#E5E7EB',
311
+ overlay: 'rgba(0, 0, 0, 0.05)',
312
+ },
313
+ typography: {
314
+ title: {
315
+ ...createBaseTypography().title,
316
+ fontSize: 30,
317
+ color: '#111827',
318
+ },
319
+ description: {
320
+ ...createBaseTypography().description,
321
+ fontSize: 16,
322
+ color: '#6B7280',
323
+ },
324
+ button: {
325
+ ...createBaseTypography().button,
326
+ fontSize: 16,
327
+ color: '#FFFFFF',
328
+ },
329
+ },
330
+ spacing: createSpacing(),
331
+ borderRadius: createBorderRadius(),
332
+ shadows: createShadows(),
333
+ };
334
+ export const modernPreset = {
335
+ theme: modernTheme,
336
+ navigation: {
337
+ style: 'progress-bar',
338
+ position: 'top',
339
+ showSkip: true,
340
+ showBack: true,
341
+ skipLabel: 'Skip',
342
+ backLabel: 'Back',
343
+ nextLabel: 'Next',
344
+ doneLabel: 'Get Started',
345
+ },
346
+ animation: {
347
+ type: 'slide',
348
+ duration: 350,
349
+ },
350
+ defaultSlideStyles: {
351
+ title: {
352
+ fontSize: 28,
353
+ marginBottom: 16,
354
+ fontWeight: '700',
355
+ },
356
+ description: {
357
+ fontSize: 16,
358
+ lineHeight: 24,
359
+ },
360
+ },
361
+ };
362
+ // ============================================================================
363
+ // MINIMAL THEME
364
+ // ============================================================================
365
+ export const minimalTheme = {
366
+ colors: {
367
+ primary: '#111827',
368
+ secondary: '#6B7280',
369
+ background: '#FFFFFF',
370
+ surface: '#FFFFFF',
371
+ text: {
372
+ primary: '#111827',
373
+ secondary: '#6B7280',
374
+ inverse: '#FFFFFF',
375
+ },
376
+ border: '#E5E7EB',
377
+ },
378
+ typography: {
379
+ title: {
380
+ ...createBaseTypography().title,
381
+ fontSize: 24,
382
+ color: '#111827',
383
+ },
384
+ description: {
385
+ ...createBaseTypography().description,
386
+ fontSize: 15,
387
+ color: '#6B7280',
388
+ },
389
+ button: {
390
+ ...createBaseTypography().button,
391
+ fontSize: 15,
392
+ color: '#FFFFFF',
393
+ },
394
+ },
395
+ spacing: createSpacing(),
396
+ borderRadius: createBorderRadius(),
397
+ shadows: createShadows(),
398
+ };
399
+ export const minimalPreset = {
400
+ theme: minimalTheme,
401
+ navigation: {
402
+ style: 'steps',
403
+ position: 'bottom',
404
+ showSkip: true,
405
+ showBack: false,
406
+ skipLabel: 'Skip',
407
+ nextLabel: 'Next',
408
+ doneLabel: 'Start',
409
+ },
410
+ animation: {
411
+ type: 'fade',
412
+ duration: 200,
413
+ },
414
+ defaultSlideStyles: {
415
+ title: {
416
+ fontSize: 22,
417
+ marginBottom: 8,
418
+ fontWeight: '600',
419
+ },
420
+ description: {
421
+ fontSize: 14,
422
+ lineHeight: 20,
423
+ },
424
+ },
425
+ };
426
+ // ============================================================================
427
+ // GRADIENT THEME
428
+ // ============================================================================
429
+ export const gradientTheme = {
430
+ colors: {
431
+ primary: '#667EEA',
432
+ secondary: '#764BA2',
433
+ background: '#667EEA',
434
+ surface: 'rgba(255, 255, 255, 0.15)',
435
+ text: {
436
+ primary: '#FFFFFF',
437
+ secondary: 'rgba(255, 255, 255, 0.8)',
438
+ inverse: '#FFFFFF',
439
+ },
440
+ border: 'rgba(255, 255, 255, 0.2)',
441
+ overlay: 'rgba(255, 255, 255, 0.1)',
442
+ },
443
+ typography: {
444
+ title: {
445
+ ...createBaseTypography().title,
446
+ fontSize: 32,
447
+ color: '#FFFFFF',
448
+ },
449
+ description: {
450
+ ...createBaseTypography().description,
451
+ fontSize: 16,
452
+ color: 'rgba(255, 255, 255, 0.9)',
453
+ },
454
+ button: {
455
+ ...createBaseTypography().button,
456
+ fontSize: 16,
457
+ color: '#FFFFFF',
458
+ },
459
+ },
460
+ spacing: createSpacing(),
461
+ borderRadius: createBorderRadius(),
462
+ shadows: createShadows(),
463
+ };
464
+ export const gradientPreset = {
465
+ theme: gradientTheme,
466
+ navigation: {
467
+ style: 'dots',
468
+ position: 'floating',
469
+ showSkip: true,
470
+ showBack: true,
471
+ skipLabel: 'Skip',
472
+ backLabel: 'Back',
473
+ nextLabel: 'Next',
474
+ doneLabel: 'Get Started',
475
+ },
476
+ animation: {
477
+ type: 'parallax',
478
+ duration: 400,
479
+ parallaxFactor: 0.3,
480
+ },
481
+ defaultSlideStyles: {
482
+ title: {
483
+ fontSize: 28,
484
+ marginBottom: 16,
485
+ textAlign: 'center',
486
+ },
487
+ description: {
488
+ fontSize: 15,
489
+ textAlign: 'center',
490
+ paddingHorizontal: 24,
491
+ lineHeight: 22,
492
+ },
493
+ },
494
+ };
495
+ // ============================================================================
496
+ // THEME GETTERS
497
+ // ============================================================================
498
+ export const getTheme = (preset) => {
499
+ const themes = {
500
+ onepage: onepageTheme,
501
+ zaprecipe: zaprecipeTheme,
502
+ pomodo: pomodoTheme,
503
+ modern: modernTheme,
504
+ minimal: minimalTheme,
505
+ gradient: gradientTheme,
506
+ };
507
+ return themes[preset] || modernTheme;
508
+ };
509
+ export const getPreset = (preset) => {
510
+ const presets = {
511
+ onepage: onepagePreset,
512
+ zaprecipe: zaprecipePreset,
513
+ pomodo: pomodoPreset,
514
+ modern: modernPreset,
515
+ minimal: minimalPreset,
516
+ gradient: gradientPreset,
517
+ };
518
+ return presets[preset] || modernPreset;
519
+ };
520
+ export const mergeTheme = (base, custom) => {
521
+ if (!custom)
522
+ return base;
523
+ return {
524
+ colors: { ...base.colors, ...custom.colors, text: { ...base.colors.text, ...custom.colors?.text } },
525
+ typography: { ...base.typography, ...custom.typography },
526
+ spacing: { ...base.spacing, ...custom.spacing },
527
+ borderRadius: { ...base.borderRadius, ...custom.borderRadius },
528
+ shadows: { ...base.shadows, ...custom.shadows },
529
+ };
530
+ };
531
+ export default {
532
+ onepageTheme,
533
+ zaprecipeTheme,
534
+ pomodoTheme,
535
+ modernTheme,
536
+ minimalTheme,
537
+ gradientTheme,
538
+ onepagePreset,
539
+ zaprecipePreset,
540
+ pomodoPreset,
541
+ modernPreset,
542
+ minimalPreset,
543
+ gradientPreset,
544
+ getTheme,
545
+ getPreset,
546
+ mergeTheme,
547
+ };