@rubixscript/react-native-onboarding 1.0.0 → 1.0.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.
Files changed (48) hide show
  1. package/dist/components/NavigationButtons.d.ts +23 -0
  2. package/dist/components/NavigationButtons.d.ts.map +1 -0
  3. package/dist/components/NavigationButtons.js +106 -0
  4. package/dist/components/Onboarding.d.ts +11 -0
  5. package/dist/components/Onboarding.d.ts.map +1 -0
  6. package/dist/components/Onboarding.js +219 -0
  7. package/dist/components/Pagination.d.ts +5 -0
  8. package/dist/components/Pagination.d.ts.map +1 -0
  9. package/dist/components/Pagination.js +269 -0
  10. package/dist/components/index.d.ts +5 -0
  11. package/dist/components/index.d.ts.map +1 -0
  12. package/dist/components/index.js +4 -0
  13. package/dist/index.d.ts +7 -0
  14. package/dist/index.d.ts.map +1 -0
  15. package/dist/index.js +10 -0
  16. package/dist/presets/index.d.ts +27 -0
  17. package/dist/presets/index.d.ts.map +1 -0
  18. package/dist/presets/index.js +373 -0
  19. package/dist/slides/FormSlide.d.ts +12 -0
  20. package/dist/slides/FormSlide.d.ts.map +1 -0
  21. package/dist/slides/FormSlide.js +227 -0
  22. package/dist/slides/IconSlide.d.ts +10 -0
  23. package/dist/slides/IconSlide.d.ts.map +1 -0
  24. package/dist/slides/IconSlide.js +133 -0
  25. package/dist/slides/ImageSlide.d.ts +10 -0
  26. package/dist/slides/ImageSlide.d.ts.map +1 -0
  27. package/dist/slides/ImageSlide.js +99 -0
  28. package/dist/slides/VideoSlide.d.ts +10 -0
  29. package/dist/slides/VideoSlide.d.ts.map +1 -0
  30. package/dist/slides/VideoSlide.js +101 -0
  31. package/dist/slides/index.d.ts +14 -0
  32. package/dist/slides/index.d.ts.map +1 -0
  33. package/dist/slides/index.js +25 -0
  34. package/dist/themes/index.d.ts +35 -0
  35. package/dist/themes/index.d.ts.map +1 -0
  36. package/dist/themes/index.js +545 -0
  37. package/dist/types/index.d.ts +191 -0
  38. package/dist/types/index.d.ts.map +1 -0
  39. package/dist/types/index.js +1 -0
  40. package/package.json +10 -4
  41. package/src/components/Onboarding.tsx +8 -11
  42. package/src/components/Pagination.tsx +1 -1
  43. package/src/slides/FormSlide.tsx +1 -1
  44. package/src/slides/IconSlide.tsx +1 -1
  45. package/src/slides/ImageSlide.tsx +1 -1
  46. package/src/slides/VideoSlide.tsx +1 -1
  47. package/src/slides/{index.ts → index.tsx} +0 -7
  48. package/src/types/index.ts +3 -3
@@ -0,0 +1,545 @@
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: 24,
279
+ },
280
+ title: {
281
+ fontSize: 22,
282
+ marginBottom: 12,
283
+ textAlign: 'center',
284
+ fontWeight: '600',
285
+ },
286
+ description: {
287
+ fontSize: 14,
288
+ textAlign: 'center',
289
+ paddingHorizontal: 32,
290
+ lineHeight: 20,
291
+ },
292
+ },
293
+ };
294
+ // ============================================================================
295
+ // MODERN THEME
296
+ // ============================================================================
297
+ export const modernTheme = {
298
+ colors: {
299
+ primary: '#8B5CF6',
300
+ secondary: '#EC4899',
301
+ background: '#FFFFFF',
302
+ surface: '#F9FAFB',
303
+ text: {
304
+ primary: '#111827',
305
+ secondary: '#6B7280',
306
+ inverse: '#FFFFFF',
307
+ },
308
+ border: '#E5E7EB',
309
+ overlay: 'rgba(0, 0, 0, 0.05)',
310
+ },
311
+ typography: {
312
+ title: {
313
+ ...createBaseTypography().title,
314
+ fontSize: 30,
315
+ color: '#111827',
316
+ },
317
+ description: {
318
+ ...createBaseTypography().description,
319
+ fontSize: 16,
320
+ color: '#6B7280',
321
+ },
322
+ button: {
323
+ ...createBaseTypography().button,
324
+ fontSize: 16,
325
+ color: '#FFFFFF',
326
+ },
327
+ },
328
+ spacing: createSpacing(),
329
+ borderRadius: createBorderRadius(),
330
+ shadows: createShadows(),
331
+ };
332
+ export const modernPreset = {
333
+ theme: modernTheme,
334
+ navigation: {
335
+ style: 'progress-bar',
336
+ position: 'top',
337
+ showSkip: true,
338
+ showBack: true,
339
+ skipLabel: 'Skip',
340
+ backLabel: 'Back',
341
+ nextLabel: 'Next',
342
+ doneLabel: 'Get Started',
343
+ },
344
+ animation: {
345
+ type: 'slide',
346
+ duration: 350,
347
+ },
348
+ defaultSlideStyles: {
349
+ title: {
350
+ fontSize: 28,
351
+ marginBottom: 16,
352
+ fontWeight: '700',
353
+ },
354
+ description: {
355
+ fontSize: 16,
356
+ lineHeight: 24,
357
+ },
358
+ },
359
+ };
360
+ // ============================================================================
361
+ // MINIMAL THEME
362
+ // ============================================================================
363
+ export const minimalTheme = {
364
+ colors: {
365
+ primary: '#111827',
366
+ secondary: '#6B7280',
367
+ background: '#FFFFFF',
368
+ surface: '#FFFFFF',
369
+ text: {
370
+ primary: '#111827',
371
+ secondary: '#6B7280',
372
+ inverse: '#FFFFFF',
373
+ },
374
+ border: '#E5E7EB',
375
+ },
376
+ typography: {
377
+ title: {
378
+ ...createBaseTypography().title,
379
+ fontSize: 24,
380
+ color: '#111827',
381
+ },
382
+ description: {
383
+ ...createBaseTypography().description,
384
+ fontSize: 15,
385
+ color: '#6B7280',
386
+ },
387
+ button: {
388
+ ...createBaseTypography().button,
389
+ fontSize: 15,
390
+ color: '#FFFFFF',
391
+ },
392
+ },
393
+ spacing: createSpacing(),
394
+ borderRadius: createBorderRadius(),
395
+ shadows: createShadows(),
396
+ };
397
+ export const minimalPreset = {
398
+ theme: minimalTheme,
399
+ navigation: {
400
+ style: 'steps',
401
+ position: 'bottom',
402
+ showSkip: true,
403
+ showBack: false,
404
+ skipLabel: 'Skip',
405
+ nextLabel: 'Next',
406
+ doneLabel: 'Start',
407
+ },
408
+ animation: {
409
+ type: 'fade',
410
+ duration: 200,
411
+ },
412
+ defaultSlideStyles: {
413
+ title: {
414
+ fontSize: 22,
415
+ marginBottom: 8,
416
+ fontWeight: '600',
417
+ },
418
+ description: {
419
+ fontSize: 14,
420
+ lineHeight: 20,
421
+ },
422
+ },
423
+ };
424
+ // ============================================================================
425
+ // GRADIENT THEME
426
+ // ============================================================================
427
+ export const gradientTheme = {
428
+ colors: {
429
+ primary: '#667EEA',
430
+ secondary: '#764BA2',
431
+ background: '#667EEA',
432
+ surface: 'rgba(255, 255, 255, 0.15)',
433
+ text: {
434
+ primary: '#FFFFFF',
435
+ secondary: 'rgba(255, 255, 255, 0.8)',
436
+ inverse: '#FFFFFF',
437
+ },
438
+ border: 'rgba(255, 255, 255, 0.2)',
439
+ overlay: 'rgba(255, 255, 255, 0.1)',
440
+ },
441
+ typography: {
442
+ title: {
443
+ ...createBaseTypography().title,
444
+ fontSize: 32,
445
+ color: '#FFFFFF',
446
+ },
447
+ description: {
448
+ ...createBaseTypography().description,
449
+ fontSize: 16,
450
+ color: 'rgba(255, 255, 255, 0.9)',
451
+ },
452
+ button: {
453
+ ...createBaseTypography().button,
454
+ fontSize: 16,
455
+ color: '#FFFFFF',
456
+ },
457
+ },
458
+ spacing: createSpacing(),
459
+ borderRadius: createBorderRadius(),
460
+ shadows: createShadows(),
461
+ };
462
+ export const gradientPreset = {
463
+ theme: gradientTheme,
464
+ navigation: {
465
+ style: 'dots',
466
+ position: 'floating',
467
+ showSkip: true,
468
+ showBack: true,
469
+ skipLabel: 'Skip',
470
+ backLabel: 'Back',
471
+ nextLabel: 'Next',
472
+ doneLabel: 'Get Started',
473
+ },
474
+ animation: {
475
+ type: 'parallax',
476
+ duration: 400,
477
+ parallaxFactor: 0.3,
478
+ },
479
+ defaultSlideStyles: {
480
+ title: {
481
+ fontSize: 28,
482
+ marginBottom: 16,
483
+ textAlign: 'center',
484
+ },
485
+ description: {
486
+ fontSize: 15,
487
+ textAlign: 'center',
488
+ paddingHorizontal: 24,
489
+ lineHeight: 22,
490
+ },
491
+ },
492
+ };
493
+ // ============================================================================
494
+ // THEME GETTERS
495
+ // ============================================================================
496
+ export const getTheme = (preset) => {
497
+ const themes = {
498
+ onepage: onepageTheme,
499
+ zaprecipe: zaprecipeTheme,
500
+ pomodo: pomodoTheme,
501
+ modern: modernTheme,
502
+ minimal: minimalTheme,
503
+ gradient: gradientTheme,
504
+ };
505
+ return themes[preset] || modernTheme;
506
+ };
507
+ export const getPreset = (preset) => {
508
+ const presets = {
509
+ onepage: onepagePreset,
510
+ zaprecipe: zaprecipePreset,
511
+ pomodo: pomodoPreset,
512
+ modern: modernPreset,
513
+ minimal: minimalPreset,
514
+ gradient: gradientPreset,
515
+ };
516
+ return presets[preset] || modernPreset;
517
+ };
518
+ export const mergeTheme = (base, custom) => {
519
+ if (!custom)
520
+ return base;
521
+ return {
522
+ colors: { ...base.colors, ...custom.colors, text: { ...base.colors.text, ...custom.colors?.text } },
523
+ typography: { ...base.typography, ...custom.typography },
524
+ spacing: { ...base.spacing, ...custom.spacing },
525
+ borderRadius: { ...base.borderRadius, ...custom.borderRadius },
526
+ shadows: { ...base.shadows, ...custom.shadows },
527
+ };
528
+ };
529
+ export default {
530
+ onepageTheme,
531
+ zaprecipeTheme,
532
+ pomodoTheme,
533
+ modernTheme,
534
+ minimalTheme,
535
+ gradientTheme,
536
+ onepagePreset,
537
+ zaprecipePreset,
538
+ pomodoPreset,
539
+ modernPreset,
540
+ minimalPreset,
541
+ gradientPreset,
542
+ getTheme,
543
+ getPreset,
544
+ mergeTheme,
545
+ };