@quantaroute/checkout 1.4.3 → 1.4.4
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/CHANGELOG.md +17 -0
- package/README.md +2 -2
- package/dist/lib/index.d.ts +14 -0
- package/dist/lib/quantaroute-checkout.es.js +153 -140
- package/dist/lib/quantaroute-checkout.umd.js +151 -138
- package/dist/style.css +1 -1
- package/package.json +3 -2
- package/src/components/AddressForm.native.tsx +70 -14
- package/src/components/AddressForm.tsx +51 -11
- package/src/components/AddressLabelIcons.native.tsx +144 -0
- package/src/components/AddressLabelIcons.tsx +46 -0
- package/src/components/CheckoutWidget.tsx +3 -0
- package/src/components/MapPinSelector.native.tsx +8 -1
- package/src/components/MapPinSelector.tsx +9 -1
- package/src/components/SavedAddressStep.tsx +7 -1
- package/src/core/api.ts +9 -1
- package/src/core/checkout-api.ts +3 -0
- package/src/core/digipin.ts +10 -1
- package/src/core/types.ts +2 -0
- package/src/index.ts +2 -0
- package/src/styles/checkout.css +86 -20
- package/src/styles/checkout.native.ts +25 -15
package/src/index.ts
CHANGED
|
@@ -46,6 +46,7 @@ export {
|
|
|
46
46
|
normalizeDigiPinInput,
|
|
47
47
|
formatDigiPin,
|
|
48
48
|
isCompleteDigiPinInput,
|
|
49
|
+
isPotentialDigiPinInput,
|
|
49
50
|
DIGIPIN_BOUNDS,
|
|
50
51
|
} from './core/digipin';
|
|
51
52
|
|
|
@@ -55,6 +56,7 @@ export {
|
|
|
55
56
|
reverseGeocode,
|
|
56
57
|
autocompleteAddress,
|
|
57
58
|
looksLikeDigiPin,
|
|
59
|
+
couldBeDigiPinInput,
|
|
58
60
|
validatePincode,
|
|
59
61
|
pincodeHasDeliveryOffice,
|
|
60
62
|
} from './core/api';
|
package/src/styles/checkout.css
CHANGED
|
@@ -814,45 +814,106 @@
|
|
|
814
814
|
font-size: 14px;
|
|
815
815
|
}
|
|
816
816
|
|
|
817
|
+
.qr-fieldset__legend--compact {
|
|
818
|
+
padding: 10px 16px 8px;
|
|
819
|
+
font-size: 11px;
|
|
820
|
+
letter-spacing: 0.08em;
|
|
821
|
+
}
|
|
822
|
+
|
|
817
823
|
.qr-label-picker {
|
|
818
|
-
display:
|
|
819
|
-
|
|
820
|
-
gap:
|
|
824
|
+
display: flex;
|
|
825
|
+
flex-wrap: nowrap;
|
|
826
|
+
gap: 6px;
|
|
821
827
|
padding: 0 16px 12px;
|
|
828
|
+
overflow-x: auto;
|
|
829
|
+
-webkit-overflow-scrolling: touch;
|
|
830
|
+
scrollbar-width: none;
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
.qr-label-picker::-webkit-scrollbar {
|
|
834
|
+
display: none;
|
|
822
835
|
}
|
|
823
836
|
|
|
824
837
|
.qr-label-picker__option {
|
|
825
|
-
display: flex;
|
|
826
|
-
flex
|
|
838
|
+
display: inline-flex;
|
|
839
|
+
flex: 1 1 0;
|
|
840
|
+
flex-direction: row;
|
|
827
841
|
align-items: center;
|
|
828
842
|
justify-content: center;
|
|
829
|
-
gap:
|
|
830
|
-
min-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
border
|
|
834
|
-
|
|
843
|
+
gap: 6px;
|
|
844
|
+
min-width: 0;
|
|
845
|
+
min-height: 44px;
|
|
846
|
+
padding: 0 12px;
|
|
847
|
+
border: 1px solid var(--qr-border);
|
|
848
|
+
border-radius: 999px;
|
|
849
|
+
background: var(--qr-bg-subtle);
|
|
835
850
|
color: var(--qr-text-muted);
|
|
836
851
|
font-family: inherit;
|
|
837
852
|
font-size: 13px;
|
|
838
853
|
font-weight: 500;
|
|
854
|
+
line-height: 1;
|
|
839
855
|
cursor: pointer;
|
|
840
|
-
|
|
856
|
+
-webkit-tap-highlight-color: transparent;
|
|
857
|
+
user-select: none;
|
|
858
|
+
transition:
|
|
859
|
+
background 160ms ease-out,
|
|
860
|
+
color 160ms ease-out,
|
|
861
|
+
border-color 160ms ease-out,
|
|
862
|
+
transform 100ms ease-out;
|
|
841
863
|
}
|
|
842
864
|
|
|
843
|
-
|
|
844
|
-
|
|
865
|
+
@media (hover: hover) and (pointer: fine) {
|
|
866
|
+
.qr-label-picker__option:hover:not(.qr-label-picker__option--active) {
|
|
867
|
+
background: color-mix(in srgb, var(--qr-border) 45%, var(--qr-bg-subtle));
|
|
868
|
+
border-color: color-mix(in srgb, var(--qr-primary) 28%, var(--qr-border));
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
.qr-label-picker__option:active {
|
|
873
|
+
transform: scale(0.97);
|
|
845
874
|
}
|
|
846
875
|
|
|
847
876
|
.qr-label-picker__option--active {
|
|
848
|
-
border-color:
|
|
849
|
-
background:
|
|
850
|
-
color: var(--qr-
|
|
877
|
+
border-color: transparent;
|
|
878
|
+
background: var(--qr-primary-light);
|
|
879
|
+
color: var(--qr-primary);
|
|
880
|
+
font-weight: 600;
|
|
851
881
|
}
|
|
852
882
|
|
|
853
883
|
.qr-label-picker__icon {
|
|
854
|
-
|
|
855
|
-
|
|
884
|
+
display: flex;
|
|
885
|
+
flex-shrink: 0;
|
|
886
|
+
align-items: center;
|
|
887
|
+
justify-content: center;
|
|
888
|
+
width: 16px;
|
|
889
|
+
height: 16px;
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
.qr-label-picker__icon svg {
|
|
893
|
+
width: 16px;
|
|
894
|
+
height: 16px;
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
.qr-label-text-field {
|
|
898
|
+
padding: 0 16px 12px;
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
.qr-label-text-field .qr-field__label {
|
|
902
|
+
margin-bottom: 6px;
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
.qr-label-text-field .qr-field__input {
|
|
906
|
+
width: 100%;
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
@media (prefers-reduced-motion: reduce) {
|
|
910
|
+
.qr-label-picker__option {
|
|
911
|
+
transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
.qr-label-picker__option:active {
|
|
915
|
+
transform: none;
|
|
916
|
+
}
|
|
856
917
|
}
|
|
857
918
|
|
|
858
919
|
/* ── Auto-filled grid ────────────────────────────────────── */
|
|
@@ -1409,9 +1470,14 @@
|
|
|
1409
1470
|
.qr-locate-btn,
|
|
1410
1471
|
.qr-field__input,
|
|
1411
1472
|
.qr-progress__dot,
|
|
1412
|
-
.qr-progress__line
|
|
1473
|
+
.qr-progress__line,
|
|
1474
|
+
.qr-label-picker__option {
|
|
1413
1475
|
transition: none;
|
|
1414
1476
|
}
|
|
1477
|
+
|
|
1478
|
+
.qr-label-picker__option:active {
|
|
1479
|
+
transform: none;
|
|
1480
|
+
}
|
|
1415
1481
|
}
|
|
1416
1482
|
|
|
1417
1483
|
/* ── Focus visible (keyboard nav) ────────────────────────── */
|
|
@@ -567,6 +567,14 @@ export const styles = StyleSheet.create({
|
|
|
567
567
|
sectionHeaderTextDark: {
|
|
568
568
|
color: COLORS.textMutedDark,
|
|
569
569
|
},
|
|
570
|
+
sectionHeaderCompact: {
|
|
571
|
+
paddingTop: 10,
|
|
572
|
+
paddingBottom: 8,
|
|
573
|
+
},
|
|
574
|
+
sectionHeaderTextCompact: {
|
|
575
|
+
fontSize: 11,
|
|
576
|
+
letterSpacing: 1,
|
|
577
|
+
},
|
|
570
578
|
sectionDivider: {
|
|
571
579
|
height: 1,
|
|
572
580
|
backgroundColor: COLORS.border,
|
|
@@ -724,38 +732,36 @@ export const styles = StyleSheet.create({
|
|
|
724
732
|
// ── Address label picker ────────────────────────────────────────────────────
|
|
725
733
|
labelPicker: {
|
|
726
734
|
flexDirection: 'row',
|
|
727
|
-
gap:
|
|
735
|
+
gap: 6,
|
|
728
736
|
paddingHorizontal: 16,
|
|
729
737
|
paddingBottom: 12,
|
|
730
738
|
},
|
|
731
739
|
labelPickerOption: {
|
|
732
740
|
flex: 1,
|
|
741
|
+
flexDirection: 'row',
|
|
733
742
|
alignItems: 'center',
|
|
734
743
|
justifyContent: 'center',
|
|
735
|
-
gap:
|
|
736
|
-
minHeight:
|
|
737
|
-
paddingVertical:
|
|
738
|
-
paddingHorizontal:
|
|
739
|
-
borderWidth: 1
|
|
744
|
+
gap: 6,
|
|
745
|
+
minHeight: 44,
|
|
746
|
+
paddingVertical: 0,
|
|
747
|
+
paddingHorizontal: 12,
|
|
748
|
+
borderWidth: 1,
|
|
740
749
|
borderColor: COLORS.border,
|
|
741
|
-
borderRadius:
|
|
742
|
-
backgroundColor: COLORS.
|
|
750
|
+
borderRadius: 999,
|
|
751
|
+
backgroundColor: COLORS.bgSubtle,
|
|
743
752
|
},
|
|
744
753
|
labelPickerOptionDark: {
|
|
745
754
|
borderColor: COLORS.borderDark,
|
|
746
|
-
backgroundColor: COLORS.
|
|
755
|
+
backgroundColor: COLORS.bgSubtleDark,
|
|
747
756
|
},
|
|
748
757
|
labelPickerOptionActive: {
|
|
749
|
-
borderColor:
|
|
758
|
+
borderColor: 'transparent',
|
|
750
759
|
backgroundColor: COLORS.primaryLight,
|
|
751
760
|
},
|
|
752
761
|
labelPickerOptionActiveDark: {
|
|
753
|
-
borderColor:
|
|
762
|
+
borderColor: 'transparent',
|
|
754
763
|
backgroundColor: '#0c4a6e33',
|
|
755
764
|
},
|
|
756
|
-
labelPickerIcon: {
|
|
757
|
-
fontSize: 18,
|
|
758
|
-
},
|
|
759
765
|
labelPickerText: {
|
|
760
766
|
fontSize: 13,
|
|
761
767
|
fontWeight: '500',
|
|
@@ -765,9 +771,13 @@ export const styles = StyleSheet.create({
|
|
|
765
771
|
color: COLORS.textMutedDark,
|
|
766
772
|
},
|
|
767
773
|
labelPickerTextActive: {
|
|
768
|
-
color: COLORS.
|
|
774
|
+
color: COLORS.primary,
|
|
769
775
|
fontWeight: '600',
|
|
770
776
|
},
|
|
777
|
+
labelTextField: {
|
|
778
|
+
paddingHorizontal: 16,
|
|
779
|
+
paddingBottom: 12,
|
|
780
|
+
},
|
|
771
781
|
|
|
772
782
|
// ── Manual fields ───────────────────────────────────────────────────────────
|
|
773
783
|
fieldsGrid: {
|