@quantaroute/checkout 1.3.1 → 1.4.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/README.md +345 -0
- package/dist/lib/index.d.ts +481 -8
- package/dist/lib/quantaroute-checkout.es.js +238 -1285
- package/dist/lib/quantaroute-checkout.umd.js +211 -64
- package/dist/style.css +1 -1
- package/package.json +2 -1
- package/src/components/AddressForm.native.tsx +56 -1
- package/src/components/AddressForm.tsx +55 -1
- package/src/components/CheckoutWidget.native.tsx +88 -21
- package/src/components/CheckoutWidget.tsx +579 -47
- package/src/components/CodAvailabilityBanner.native.tsx +108 -0
- package/src/components/CodAvailabilityBanner.tsx +104 -0
- package/src/components/EmailOtpStep.tsx +198 -0
- package/src/components/EmailStep.tsx +108 -0
- package/src/components/MapPinSelector.native.tsx +37 -25
- package/src/components/MapPinSelector.tsx +10 -5
- package/src/components/OtpStep.tsx +227 -0
- package/src/components/PaymentStep.tsx +162 -0
- package/src/components/PhoneStep.tsx +124 -0
- package/src/components/PrepaidNudge.tsx +31 -0
- package/src/components/SavedAddressStep.tsx +281 -0
- package/src/core/api.ts +86 -0
- package/src/core/checkout-api.ts +458 -0
- package/src/core/device.ts +47 -0
- package/src/core/types.ts +217 -3
- package/src/core/utm.ts +29 -0
- package/src/index.ts +65 -1
- package/src/styles/checkout.css +614 -0
- package/src/styles/checkout.native.ts +144 -0
|
@@ -86,6 +86,23 @@ export const styles = StyleSheet.create({
|
|
|
86
86
|
headerTitleDark: {
|
|
87
87
|
color: COLORS.textDark,
|
|
88
88
|
},
|
|
89
|
+
headerLogoImg: {
|
|
90
|
+
height: 28,
|
|
91
|
+
width: 120,
|
|
92
|
+
maxWidth: 140,
|
|
93
|
+
},
|
|
94
|
+
headerBannerSlot: {
|
|
95
|
+
paddingHorizontal: 16,
|
|
96
|
+
paddingTop: 8,
|
|
97
|
+
paddingBottom: 10,
|
|
98
|
+
borderBottomWidth: 1,
|
|
99
|
+
borderBottomColor: COLORS.border,
|
|
100
|
+
backgroundColor: COLORS.bgSubtle,
|
|
101
|
+
},
|
|
102
|
+
headerBannerSlotDark: {
|
|
103
|
+
borderBottomColor: COLORS.borderDark,
|
|
104
|
+
backgroundColor: COLORS.bgSubtleDark,
|
|
105
|
+
},
|
|
89
106
|
|
|
90
107
|
// ── Progress dots ───────────────────────────────────────────────────────────
|
|
91
108
|
progress: {
|
|
@@ -489,6 +506,45 @@ export const styles = StyleSheet.create({
|
|
|
489
506
|
color: COLORS.textMutedDark,
|
|
490
507
|
},
|
|
491
508
|
|
|
509
|
+
// ── Pincode serviceability warning ───────────────────────────────────────────
|
|
510
|
+
pincodeBanner: {
|
|
511
|
+
flexDirection: 'row',
|
|
512
|
+
alignItems: 'flex-start',
|
|
513
|
+
gap: 10,
|
|
514
|
+
marginHorizontal: 16,
|
|
515
|
+
marginBottom: 12,
|
|
516
|
+
padding: 12,
|
|
517
|
+
borderRadius: 8,
|
|
518
|
+
backgroundColor: 'rgba(245, 158, 11, 0.12)',
|
|
519
|
+
borderWidth: 1,
|
|
520
|
+
borderColor: 'rgba(245, 158, 11, 0.45)',
|
|
521
|
+
},
|
|
522
|
+
pincodeBannerDark: {
|
|
523
|
+
backgroundColor: 'rgba(245, 158, 11, 0.15)',
|
|
524
|
+
borderColor: 'rgba(245, 158, 11, 0.35)',
|
|
525
|
+
},
|
|
526
|
+
pincodeBannerIcon: {
|
|
527
|
+
fontSize: 16,
|
|
528
|
+
lineHeight: 20,
|
|
529
|
+
},
|
|
530
|
+
pincodeBannerTitle: {
|
|
531
|
+
fontSize: 13,
|
|
532
|
+
fontWeight: '600',
|
|
533
|
+
color: COLORS.text,
|
|
534
|
+
marginBottom: 4,
|
|
535
|
+
},
|
|
536
|
+
pincodeBannerTitleDark: {
|
|
537
|
+
color: COLORS.textDark,
|
|
538
|
+
},
|
|
539
|
+
pincodeBannerBody: {
|
|
540
|
+
fontSize: 12,
|
|
541
|
+
color: COLORS.textMuted,
|
|
542
|
+
lineHeight: 17,
|
|
543
|
+
},
|
|
544
|
+
pincodeBannerBodyDark: {
|
|
545
|
+
color: COLORS.textMutedDark,
|
|
546
|
+
},
|
|
547
|
+
|
|
492
548
|
// ── Form sections ───────────────────────────────────────────────────────────
|
|
493
549
|
sectionHeader: {
|
|
494
550
|
flexDirection: 'row',
|
|
@@ -791,6 +847,62 @@ export const styles = StyleSheet.create({
|
|
|
791
847
|
backgroundColor: COLORS.bgDark,
|
|
792
848
|
},
|
|
793
849
|
|
|
850
|
+
codBanner: {
|
|
851
|
+
alignSelf: 'stretch',
|
|
852
|
+
marginHorizontal: 16,
|
|
853
|
+
marginTop: 4,
|
|
854
|
+
marginBottom: 8,
|
|
855
|
+
padding: 14,
|
|
856
|
+
borderRadius: 10,
|
|
857
|
+
borderWidth: 1,
|
|
858
|
+
borderColor: COLORS.border,
|
|
859
|
+
backgroundColor: COLORS.bgSubtle,
|
|
860
|
+
gap: 6,
|
|
861
|
+
},
|
|
862
|
+
codBannerDark: {
|
|
863
|
+
borderColor: COLORS.borderDark,
|
|
864
|
+
backgroundColor: 'rgba(255,255,255,0.04)',
|
|
865
|
+
},
|
|
866
|
+
codBannerTitle: {
|
|
867
|
+
fontSize: 12,
|
|
868
|
+
fontWeight: '700',
|
|
869
|
+
letterSpacing: 0.4,
|
|
870
|
+
textTransform: 'uppercase',
|
|
871
|
+
color: COLORS.textMuted,
|
|
872
|
+
},
|
|
873
|
+
codBannerTitleDark: {
|
|
874
|
+
color: COLORS.textMutedDark,
|
|
875
|
+
},
|
|
876
|
+
codBannerRow: {
|
|
877
|
+
flexDirection: 'row',
|
|
878
|
+
alignItems: 'center',
|
|
879
|
+
gap: 10,
|
|
880
|
+
},
|
|
881
|
+
codBannerMuted: {
|
|
882
|
+
fontSize: 13,
|
|
883
|
+
color: COLORS.textMuted,
|
|
884
|
+
lineHeight: 18,
|
|
885
|
+
flex: 1,
|
|
886
|
+
},
|
|
887
|
+
codBannerMutedDark: {
|
|
888
|
+
color: COLORS.textMutedDark,
|
|
889
|
+
},
|
|
890
|
+
codBannerOk: {
|
|
891
|
+
fontSize: 13,
|
|
892
|
+
color: COLORS.success,
|
|
893
|
+
fontWeight: '600',
|
|
894
|
+
},
|
|
895
|
+
codBannerOkDark: {
|
|
896
|
+
color: '#34d399',
|
|
897
|
+
},
|
|
898
|
+
codBannerWarn: {
|
|
899
|
+
fontSize: 13,
|
|
900
|
+
color: COLORS.warning,
|
|
901
|
+
},
|
|
902
|
+
codBannerWarnDark: {
|
|
903
|
+
color: '#fbbf24',
|
|
904
|
+
},
|
|
905
|
+
|
|
794
906
|
// ── Footer ──────────────────────────────────────────────────────────────────
|
|
795
907
|
footer: {
|
|
796
908
|
flexDirection: 'row',
|
|
@@ -907,6 +1019,38 @@ export const styles = StyleSheet.create({
|
|
|
907
1019
|
color: COLORS.primary,
|
|
908
1020
|
},
|
|
909
1021
|
|
|
1022
|
+
// ── Address card meta row ───────────────────────────────────────────────────
|
|
1023
|
+
addrCardMeta: {
|
|
1024
|
+
flexDirection: 'row' as const,
|
|
1025
|
+
flexWrap: 'wrap' as const,
|
|
1026
|
+
alignItems: 'center',
|
|
1027
|
+
gap: 6,
|
|
1028
|
+
marginTop: 8,
|
|
1029
|
+
},
|
|
1030
|
+
|
|
1031
|
+
// ── "Saved at [Brand]" chip ─────────────────────────────────────────────────
|
|
1032
|
+
brandChip: {
|
|
1033
|
+
flexDirection: 'row' as const,
|
|
1034
|
+
alignItems: 'center',
|
|
1035
|
+
gap: 4,
|
|
1036
|
+
paddingHorizontal: 8,
|
|
1037
|
+
paddingVertical: 2,
|
|
1038
|
+
borderRadius: 20,
|
|
1039
|
+
backgroundColor: COLORS.primaryLight,
|
|
1040
|
+
borderWidth: 1,
|
|
1041
|
+
borderColor: COLORS.primary + '4D', // 30% opacity
|
|
1042
|
+
maxWidth: 140,
|
|
1043
|
+
},
|
|
1044
|
+
brandChipText: {
|
|
1045
|
+
fontSize: 11,
|
|
1046
|
+
fontWeight: '500' as const,
|
|
1047
|
+
color: COLORS.primary,
|
|
1048
|
+
},
|
|
1049
|
+
brandChipDark: {
|
|
1050
|
+
backgroundColor: COLORS.primaryDark + '26', // ~15% opacity
|
|
1051
|
+
borderColor: COLORS.primary + '55',
|
|
1052
|
+
},
|
|
1053
|
+
|
|
910
1054
|
// ── Generic text helpers ────────────────────────────────────────────────────
|
|
911
1055
|
textLight: {
|
|
912
1056
|
color: COLORS.textDark,
|