@afosto/checkout-ui 0.0.14 → 0.0.16

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 (62) hide show
  1. package/README.md +333 -1
  2. package/dist/CheckoutAddressFields/CheckoutAddressFields.d.ts.map +1 -1
  3. package/dist/CheckoutAddressFields/CheckoutAddressFields.js +59 -57
  4. package/dist/CheckoutAgreementOptionCondition/CheckoutAgreementOptionCondition.d.ts +1 -1
  5. package/dist/CheckoutAgreementOptionCondition/CheckoutAgreementOptionCondition.js +23 -23
  6. package/dist/CheckoutAgreementsTimeline/CheckoutAgreementsTimeline.js +10 -10
  7. package/dist/CheckoutShippingMethodSection/CheckoutShippingMethodSection.d.ts +1 -1
  8. package/dist/CheckoutShippingMethodSection/CheckoutShippingMethodSection.d.ts.map +1 -1
  9. package/dist/CheckoutShippingMethodsField/CheckoutShippingMethodsField.d.ts +1 -1
  10. package/dist/CheckoutShippingMethodsField/CheckoutShippingMethodsField.d.ts.map +1 -1
  11. package/dist/CheckoutShippingMethodsField/CheckoutShippingMethodsField.js +78 -77
  12. package/dist/constants/paymentMethodIconMapping.d.ts +9 -0
  13. package/dist/constants/paymentMethodIconMapping.d.ts.map +1 -1
  14. package/dist/constants/paymentMethodIconMapping.js +76 -58
  15. package/dist/hooks/useCheckoutShippingMethods.d.ts +2 -1
  16. package/dist/hooks/useCheckoutShippingMethods.d.ts.map +1 -1
  17. package/dist/hooks/useCheckoutShippingMethods.js +110 -67
  18. package/dist/icons/index.js +178 -160
  19. package/dist/icons/paymentMethods/Alma.d.ts +3 -0
  20. package/dist/icons/paymentMethods/Alma.d.ts.map +1 -0
  21. package/dist/icons/paymentMethods/Alma.js +15 -0
  22. package/dist/icons/paymentMethods/Bancomat.d.ts +3 -0
  23. package/dist/icons/paymentMethods/Bancomat.d.ts.map +1 -0
  24. package/dist/icons/paymentMethods/Bancomat.js +15 -0
  25. package/dist/icons/paymentMethods/Bizum.d.ts +3 -0
  26. package/dist/icons/paymentMethods/Bizum.d.ts.map +1 -0
  27. package/dist/icons/paymentMethods/Bizum.js +28 -0
  28. package/dist/icons/paymentMethods/Blik.d.ts +3 -0
  29. package/dist/icons/paymentMethods/Blik.d.ts.map +1 -0
  30. package/dist/icons/paymentMethods/Blik.js +59 -0
  31. package/dist/icons/paymentMethods/ClickToPay.d.ts +3 -0
  32. package/dist/icons/paymentMethods/ClickToPay.d.ts.map +1 -0
  33. package/dist/icons/paymentMethods/ClickToPay.js +35 -0
  34. package/dist/icons/paymentMethods/MBWay.d.ts +3 -0
  35. package/dist/icons/paymentMethods/MBWay.d.ts.map +1 -0
  36. package/dist/icons/paymentMethods/MBWay.js +65 -0
  37. package/dist/icons/paymentMethods/MobilePay.d.ts +3 -0
  38. package/dist/icons/paymentMethods/MobilePay.d.ts.map +1 -0
  39. package/dist/icons/paymentMethods/MobilePay.js +103 -0
  40. package/dist/icons/paymentMethods/Satispay.d.ts +3 -0
  41. package/dist/icons/paymentMethods/Satispay.d.ts.map +1 -0
  42. package/dist/icons/paymentMethods/Satispay.js +15 -0
  43. package/dist/icons/paymentMethods/Vipps.d.ts +3 -0
  44. package/dist/icons/paymentMethods/Vipps.d.ts.map +1 -0
  45. package/dist/icons/paymentMethods/Vipps.js +15 -0
  46. package/dist/icons/paymentMethods/index.d.ts +9 -0
  47. package/dist/icons/paymentMethods/index.d.ts.map +1 -1
  48. package/dist/icons/paymentMethods/index.js +124 -106
  49. package/dist/index.js +356 -338
  50. package/dist/operations/cartOperations.d.ts.map +1 -1
  51. package/dist/operations/cartOperations.js +4 -6
  52. package/dist/operations/orderOperations.d.ts.map +1 -1
  53. package/dist/operations/orderOperations.js +4 -6
  54. package/dist/queries/getCartShippingMethodsQuery.d.ts +0 -1
  55. package/dist/queries/getCartShippingMethodsQuery.d.ts.map +1 -1
  56. package/dist/queries/getCartShippingMethodsQuery.js +6 -29
  57. package/dist/queries/getOrderShippingMethodsQuery.d.ts +0 -1
  58. package/dist/queries/getOrderShippingMethodsQuery.d.ts.map +1 -1
  59. package/dist/queries/getOrderShippingMethodsQuery.js +4 -27
  60. package/dist/types.d.ts +1 -1
  61. package/dist/types.d.ts.map +1 -1
  62. package/package.json +2 -2
@@ -1,33 +1,33 @@
1
- import { jsxs as s, jsx as a } from "react/jsx-runtime";
2
- import { Box as c, Typography as m } from "@afosto/components";
1
+ import { jsxs as s, jsx as i } from "react/jsx-runtime";
2
+ import { Box as m, Typography as c } from "@afosto/components";
3
3
  import { TurnDownRightSolid as g } from "../icons/TurnDownRightSolid.js";
4
4
  import { CheckoutCurrency as C } from "../CheckoutCurrency/CheckoutCurrency.js";
5
- import { camelize as x } from "@afosto/utils";
6
- import { useCheckout as v } from "../CheckoutStateProvider/CheckoutStateProvider.js";
7
- import { formatCurrency as D } from "../utils/formatCurrency.js";
5
+ import { camelize as D } from "@afosto/utils";
6
+ import { useCheckout as x } from "../CheckoutStateProvider/CheckoutStateProvider.js";
7
+ import { formatCurrency as v } from "../utils/formatCurrency.js";
8
8
  const w = {
9
9
  payImmediately: "Pay immediately",
10
- paymentOnDelivery: "Payment on delivery",
10
+ remainingAmountDueBeforeDelivery: "Remaining amount due before delivery",
11
11
  withinDaysOfTheInvoiceDate: "Within {days} days of the invoice date"
12
- }, S = (y) => {
12
+ }, b = (l) => {
13
13
  const {
14
14
  condition: e,
15
- currency: i,
15
+ currency: a,
16
16
  locale: r,
17
- translations: l = {}
18
- } = y, { settings: p, translations: d } = v(), { currency: u } = p || {}, n = {
17
+ translations: y = {}
18
+ } = l, { settings: u, translations: p } = x(), { currency: d } = u || {}, n = {
19
19
  ...w,
20
- ...d.agreementOptionConditions || {},
21
- ...l || {}
22
- }, o = x(e.type?.toLowerCase() || ""), f = e.outcome?.amount || 0;
20
+ ...p.agreementOptionConditions || {},
21
+ ...y || {}
22
+ }, o = D(e.type?.toLowerCase() || ""), f = e.outcome?.amount || 0;
23
23
  let t = e.type;
24
- return o === "downPayment" && e.isPercentage && (t = `${n.payImmediately}${e.amount > 0 && e.amount < 100 ? ` (${e.amount}%)` : ""}`), o === "downPayment" && !e.isPercentage && (t = `${n.payImmediately}${e.amount > 0 ? ` (${D(e.amount / 100, r, {
25
- currency: i || u
24
+ return o === "downPayment" && e.isPercentage && (t = `${n.payImmediately}${e.amount > 0 && e.amount < 100 ? ` (${e.amount}%)` : ""}`), o === "downPayment" && !e.isPercentage && (t = `${n.payImmediately}${e.amount > 0 ? ` (${v(e.amount / 100, r, {
25
+ currency: a || d
26
26
  })})` : ""}`), o === "postPaid" && (t = n.withinDaysOfTheInvoiceDate.replace(
27
27
  "{days}",
28
28
  e.pastDueAfter.toString()
29
- )), o === "cod" && (t = n.paymentOnDelivery), /* @__PURE__ */ s(
30
- c,
29
+ )), o === "cod" && (t = n.remainingAmountDueBeforeDelivery), /* @__PURE__ */ s(
30
+ m,
31
31
  {
32
32
  sx: {
33
33
  display: "flex",
@@ -36,19 +36,19 @@ const w = {
36
36
  justifyContent: "space-between"
37
37
  },
38
38
  children: [
39
- /* @__PURE__ */ s(c, { sx: { display: "flex", alignItems: "center", gap: 2.5 }, children: [
40
- /* @__PURE__ */ a(
39
+ /* @__PURE__ */ s(m, { sx: { display: "flex", alignItems: "center", gap: 2.5 }, children: [
40
+ /* @__PURE__ */ i(
41
41
  g,
42
42
  {
43
43
  sx: { color: (h) => h.palette.gray[400], fontSize: 16 }
44
44
  }
45
45
  ),
46
- /* @__PURE__ */ a(m, { children: t })
46
+ /* @__PURE__ */ i(c, { children: t })
47
47
  ] }),
48
- /* @__PURE__ */ a(m, { fontWeight: 500, children: /* @__PURE__ */ a(
48
+ /* @__PURE__ */ i(c, { fontWeight: 500, children: /* @__PURE__ */ i(
49
49
  C,
50
50
  {
51
- currency: i,
51
+ currency: a,
52
52
  locale: r,
53
53
  value: f / 100
54
54
  }
@@ -58,5 +58,5 @@ const w = {
58
58
  );
59
59
  };
60
60
  export {
61
- S as CheckoutAgreementOptionCondition
61
+ b as CheckoutAgreementOptionCondition
62
62
  };
@@ -1,17 +1,17 @@
1
1
  import { jsx as t, jsxs as n } from "react/jsx-runtime";
2
- import { Card as j, Timeline as A, TimelineItem as p, TimelineSeparator as m, TimelineDot as h, TimelineConnector as P, TimelineContent as u, Box as y, Typography as i } from "@afosto/components";
2
+ import { Card as j, Timeline as A, TimelineItem as p, TimelineSeparator as m, TimelineDot as u, TimelineConnector as P, TimelineContent as h, Box as y, Typography as i } from "@afosto/components";
3
3
  import { camelize as g } from "@afosto/utils";
4
4
  import { CheckoutCurrency as f } from "../CheckoutCurrency/CheckoutCurrency.js";
5
5
  import { useCheckout as L } from "../CheckoutStateProvider/CheckoutStateProvider.js";
6
6
  import { CheckSolid as x } from "../icons/CheckSolid.js";
7
7
  const S = {
8
8
  alreadyPaid: "Already paid",
9
- cod: "Pay on delivery",
9
+ cod: "Remaining amount due before delivery",
10
10
  downPayment: "Down payment",
11
11
  dueLater: "Due later",
12
12
  payImmediately: "Pay immediately",
13
13
  postPaid: "Pay afterwards"
14
- }, R = (T) => {
14
+ }, _ = (T) => {
15
15
  const {
16
16
  agreements: C = [],
17
17
  currency: c,
@@ -34,7 +34,7 @@ const S = {
34
34
  r > 0 && r < l && /* @__PURE__ */ n(p, { sx: { minHeight: 40 }, children: [
35
35
  /* @__PURE__ */ n(m, { children: [
36
36
  /* @__PURE__ */ t(
37
- h,
37
+ u,
38
38
  {
39
39
  sx: {
40
40
  width: 16,
@@ -59,7 +59,7 @@ const S = {
59
59
  }
60
60
  )
61
61
  ] }),
62
- /* @__PURE__ */ t(u, { sx: { pt: 0, pl: 1.5, pr: 0, pb: 0 }, children: /* @__PURE__ */ n(
62
+ /* @__PURE__ */ t(h, { sx: { pt: 0, pl: 1.5, pr: 0, pb: 0 }, children: /* @__PURE__ */ n(
63
63
  y,
64
64
  {
65
65
  sx: {
@@ -89,7 +89,7 @@ const S = {
89
89
  children: [
90
90
  /* @__PURE__ */ n(m, { children: [
91
91
  /* @__PURE__ */ t(
92
- h,
92
+ u,
93
93
  {
94
94
  sx: {
95
95
  width: 16,
@@ -130,7 +130,7 @@ const S = {
130
130
  }
131
131
  )
132
132
  ] }),
133
- /* @__PURE__ */ t(u, { sx: { pt: 0, pl: 1.5, pr: 0, pb: 0 }, children: /* @__PURE__ */ n(
133
+ /* @__PURE__ */ t(h, { sx: { pt: 0, pl: 1.5, pr: 0, pb: 0 }, children: /* @__PURE__ */ n(
134
134
  y,
135
135
  {
136
136
  sx: {
@@ -169,7 +169,7 @@ const S = {
169
169
  sx: { minHeight: b.length - 1 === o ? 48 : 64 },
170
170
  children: [
171
171
  /* @__PURE__ */ t(m, { children: /* @__PURE__ */ t(
172
- h,
172
+ u,
173
173
  {
174
174
  sx: {
175
175
  ...r >= l && r < l + (e.outcome?.amount || 0) ? {
@@ -211,7 +211,7 @@ const S = {
211
211
  children: r >= l + (e.outcome?.amount || 0) && /* @__PURE__ */ t(x, {})
212
212
  }
213
213
  ) }),
214
- /* @__PURE__ */ t(u, { sx: { pt: 0, pl: 1.5, pr: 0, pb: 0 }, children: /* @__PURE__ */ n(
214
+ /* @__PURE__ */ t(h, { sx: { pt: 0, pl: 1.5, pr: 0, pb: 0 }, children: /* @__PURE__ */ n(
215
215
  y,
216
216
  {
217
217
  sx: {
@@ -244,5 +244,5 @@ const S = {
244
244
  ] }) });
245
245
  };
246
246
  export {
247
- R as CheckoutAgreementsTimeline
247
+ _ as CheckoutAgreementsTimeline
248
248
  };
@@ -6,7 +6,7 @@ declare const defaultTranslations: {
6
6
  };
7
7
  export interface CheckoutShippingMethodSectionProps extends Omit<CheckoutSectionProps, 'children'> {
8
8
  countryCode: string;
9
- postalCode: string;
9
+ postalCode?: string;
10
10
  translations?: DeepPartial<typeof defaultTranslations>;
11
11
  }
12
12
  export declare const CheckoutShippingMethodSection: (props: CheckoutShippingMethodSectionProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"CheckoutShippingMethodSection.d.ts","sourceRoot":"","sources":["../../src/CheckoutShippingMethodSection/CheckoutShippingMethodSection.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,oCAAoC,CAAC;AAI5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,QAAA,MAAM,mBAAmB;;;CAGxB,CAAC;AAEF,MAAM,WAAW,kCACf,SAAQ,IAAI,CAAC,oBAAoB,EAAE,UAAU,CAAC;IAC9C,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,WAAW,CAAC,OAAO,mBAAmB,CAAC,CAAC;CACxD;AAED,eAAO,MAAM,6BAA6B,GACxC,OAAO,kCAAkC,qDA6B1C,CAAC"}
1
+ {"version":3,"file":"CheckoutShippingMethodSection.d.ts","sourceRoot":"","sources":["../../src/CheckoutShippingMethodSection/CheckoutShippingMethodSection.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,oCAAoC,CAAC;AAI5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,QAAA,MAAM,mBAAmB;;;CAGxB,CAAC;AAEF,MAAM,WAAW,kCACf,SAAQ,IAAI,CAAC,oBAAoB,EAAE,UAAU,CAAC;IAC9C,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,WAAW,CAAC,OAAO,mBAAmB,CAAC,CAAC;CACxD;AAED,eAAO,MAAM,6BAA6B,GACxC,OAAO,kCAAkC,qDA6B1C,CAAC"}
@@ -9,7 +9,7 @@ export interface CheckoutShippingMethodsFieldProps {
9
9
  countryCode: string;
10
10
  currency?: string;
11
11
  locale?: string;
12
- postalCode: string;
12
+ postalCode?: string;
13
13
  translations?: DeepPartial<typeof defaultTranslations>;
14
14
  }
15
15
  export declare const CheckoutShippingMethodsField: (props: CheckoutShippingMethodsFieldProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"CheckoutShippingMethodsField.d.ts","sourceRoot":"","sources":["../../src/CheckoutShippingMethodsField/CheckoutShippingMethodsField.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,WAAW,EAAiB,MAAM,UAAU,CAAC;AAE3D,QAAA,MAAM,mBAAmB;;;;CAKxB,CAAC;AAEF,MAAM,WAAW,iCAAiC;IAChD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,WAAW,CAAC,OAAO,mBAAmB,CAAC,CAAC;CACxD;AAED,eAAO,MAAM,4BAA4B,GACvC,OAAO,iCAAiC,qDA2IzC,CAAC"}
1
+ {"version":3,"file":"CheckoutShippingMethodsField.d.ts","sourceRoot":"","sources":["../../src/CheckoutShippingMethodsField/CheckoutShippingMethodsField.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,WAAW,EAAiB,MAAM,UAAU,CAAC;AAE3D,QAAA,MAAM,mBAAmB;;;;CAKxB,CAAC;AAEF,MAAM,WAAW,iCAAiC;IAChD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,WAAW,CAAC,OAAO,mBAAmB,CAAC,CAAC;CACxD;AAED,eAAO,MAAM,4BAA4B,GACvC,OAAO,iCAAiC,qDAwIzC,CAAC"}
@@ -1,103 +1,104 @@
1
- import { jsx as b } from "react/jsx-runtime";
2
- import { useFormContext as j } from "@afosto/components";
3
- import { CheckoutCardRadioField as D } from "../CheckoutCardRadioField/CheckoutCardRadioField.js";
4
- import { CheckoutShippingMethodOption as L } from "../CheckoutShippingMethodOption/CheckoutShippingMethodOption.js";
5
- import { useCheckoutShippingMethods as q } from "../hooks/useCheckoutShippingMethods.js";
6
- import { useCheckout as A } from "../CheckoutStateProvider/CheckoutStateProvider.js";
7
- import { getErrorMessage as B } from "../utils/getErrorMessage.js";
8
- import { capitalize as G } from "@afosto/utils";
9
- import { CheckoutMethodRadioSkeleton as H } from "../CheckoutMethodRadioSkeleton/CheckoutMethodRadioSkeleton.js";
10
- const J = {
1
+ import { jsx as j } from "react/jsx-runtime";
2
+ import { useFormContext as D } from "@afosto/components";
3
+ import { CheckoutCardRadioField as L } from "../CheckoutCardRadioField/CheckoutCardRadioField.js";
4
+ import { CheckoutShippingMethodOption as q } from "../CheckoutShippingMethodOption/CheckoutShippingMethodOption.js";
5
+ import { useCheckoutShippingMethods as A } from "../hooks/useCheckoutShippingMethods.js";
6
+ import { useCheckout as B } from "../CheckoutStateProvider/CheckoutStateProvider.js";
7
+ import { getErrorMessage as G } from "../utils/getErrorMessage.js";
8
+ import { capitalize as H } from "@afosto/utils";
9
+ import { CheckoutMethodRadioSkeleton as J } from "../CheckoutMethodRadioSkeleton/CheckoutMethodRadioSkeleton.js";
10
+ const K = {
11
11
  failedToSearchPickupPoints: "Pickup points search failed. Please try again.",
12
12
  failedToSelectShippingMethodTitle: "Shipping method not selected",
13
13
  failedToSelectShippingMethodDescription: "Something went wrong while selecting the shipping method. Choose another shipping method or try again."
14
- }, ii = (k) => {
14
+ }, oi = (S) => {
15
15
  const {
16
- countryCode: S,
17
- currency: C,
16
+ countryCode: f,
17
+ currency: k,
18
18
  locale: M,
19
- name: r = "methodId",
20
- postalCode: a,
21
- translations: T = {}
22
- } = k || {}, {
23
- activeStep: c,
24
- addShippingMethod: w,
25
- isProcessing: y,
26
- setErrorMessage: d,
19
+ name: p = "methodId",
20
+ postalCode: r,
21
+ translations: C = {}
22
+ } = S || {}, {
23
+ activeStep: a,
24
+ addShippingMethod: T,
25
+ isProcessing: w,
26
+ setErrorMessage: c,
27
27
  setIsProcessing: n,
28
- translations: h
29
- } = A(), {
30
- hasSearchPickupPointsError: I,
31
- isInitializingShippingMethods: v,
32
- isSearchingPickupPoints: E,
33
- pickupPoints: l,
34
- searchPickupPoints: V,
35
- setPickupPoints: s,
36
- shippingMethods: u
37
- } = q({
38
- countryCode: S,
39
- postalCode: a
40
- }), { formProps: x, getValues: F, reset: g, watch: O } = j(), { setData: z } = x || {}, [P] = O([r]), p = {
41
- ...J,
42
- ...h?.shippingMethodsField || {},
43
- ...h?.feedback || {},
44
- ...T || {}
28
+ translations: d
29
+ } = B(), {
30
+ hasSearchPickupPointsError: y,
31
+ isInitializingShippingMethods: I,
32
+ isSearchingPickupPoints: v,
33
+ loadPickupPointsForShippingMethod: E,
34
+ pickupPoints: h,
35
+ searchPickupPoints: F,
36
+ setPickupPoints: V,
37
+ shippingMethods: l
38
+ } = A({
39
+ countryCode: f,
40
+ postalCode: r
41
+ }), { formProps: x, getValues: O, reset: u, watch: z } = D(), { setData: R } = x || {}, [g] = z([p]), s = {
42
+ ...K,
43
+ ...d?.shippingMethodsField || {},
44
+ ...d?.feedback || {},
45
+ ...C || {}
45
46
  };
46
- return /* @__PURE__ */ b(
47
- D,
47
+ return /* @__PURE__ */ j(
48
+ L,
48
49
  {
49
50
  id: "field-radio-shipping-method",
50
- name: r,
51
- isLoading: v,
52
- onChange: async (o) => {
53
- const m = F(), R = [...l];
51
+ name: p,
52
+ isLoading: I,
53
+ onChange: async (i) => {
54
+ const P = O(), b = [...h];
54
55
  try {
55
- d(null), n(!0);
56
- const { value: e } = o.target, i = u.find(
57
- (t) => t.id === e
56
+ c(null), n(!0);
57
+ const { value: o } = i.target, e = l.find(
58
+ (t) => t.id === o
58
59
  );
59
- await w({ methodId: e }), i && (i?.pickupPoints || []).length > 0 ? s(i.pickupPoints) : s([]);
60
- const f = {
61
- methodId: e,
62
- isPickupPoint: i?.isPickupPoint,
60
+ await T({ methodId: o }), E(e);
61
+ const m = {
62
+ methodId: o,
63
+ isPickupPoint: e?.isPickupPoint,
63
64
  pickupPointId: ""
64
65
  };
65
- g({
66
- ...m,
67
- ...f
68
- }), z((t) => (t?.splice(c, 1, {
69
- ...t[c],
70
- ...f
66
+ u({
67
+ ...P,
68
+ ...m
69
+ }), R((t) => (t?.splice(a, 1, {
70
+ ...t[a],
71
+ ...m
71
72
  }), t)), n(!1);
72
- } catch (e) {
73
- const i = B(e);
74
- d({
75
- title: p.failedToSelectShippingMethodTitle,
76
- description: i ? G(i) : p.failedToSelectShippingMethodDescription
77
- }), g(m), s(R), n(!1), window && typeof window < "u" && window.scrollTo(0, 0);
73
+ } catch (o) {
74
+ const e = G(o);
75
+ c({
76
+ title: s.failedToSelectShippingMethodTitle,
77
+ description: e ? H(e) : s.failedToSelectShippingMethodDescription
78
+ }), u(P), V(b), n(!1), window && typeof window < "u" && window.scrollTo(0, 0);
78
79
  }
79
80
  },
80
- OptionComponent: L,
81
- OptionSkeletonComponent: H,
82
- options: u.map((o) => ({
83
- ...o,
84
- value: o.id,
85
- ...P === o.id ? {
86
- pickupPoints: l
81
+ OptionComponent: q,
82
+ OptionSkeletonComponent: J,
83
+ options: l.map((i) => ({
84
+ ...i,
85
+ value: i.id,
86
+ ...g === i.id ? {
87
+ pickupPoints: h
87
88
  } : {}
88
89
  })),
89
90
  optionProps: {
90
- currency: C,
91
- defaultPickupPointSearchValue: a,
92
- isSearchingPickupPoints: y || E,
91
+ currency: k,
92
+ defaultPickupPointSearchValue: r,
93
+ isSearchingPickupPoints: w || v,
93
94
  locale: M,
94
- onSearchPickupPoint: V,
95
- searchPickupPointsErrorMessage: I ? p.failedToSearchPickupPoints : void 0
95
+ onSearchPickupPoint: F,
96
+ searchPickupPointsErrorMessage: y ? s.failedToSearchPickupPoints : void 0
96
97
  },
97
- value: P
98
+ value: g
98
99
  }
99
100
  );
100
101
  };
101
102
  export {
102
- ii as CheckoutShippingMethodsField
103
+ oi as CheckoutShippingMethodsField
103
104
  };
@@ -47,5 +47,14 @@ export declare const CHECKOUT_PAYMENT_METHOD_ICON_MAPPING: {
47
47
  twint: (props: import('@afosto/components').SvgIconProps) => import("@emotion/react/jsx-runtime").JSX.Element;
48
48
  walley: (props: import('@afosto/components').SvgIconProps) => import("@emotion/react/jsx-runtime").JSX.Element;
49
49
  zip: (props: import('@afosto/components').SvgIconProps) => import("@emotion/react/jsx-runtime").JSX.Element;
50
+ alma: (props: import('@afosto/components').SvgIconProps) => import("@emotion/react/jsx-runtime").JSX.Element;
51
+ bancomatPay: (props: import('@afosto/components').SvgIconProps) => import("@emotion/react/jsx-runtime").JSX.Element;
52
+ bizum: (props: import('@afosto/components').SvgIconProps) => import("@emotion/react/jsx-runtime").JSX.Element;
53
+ blik: (props: import('@afosto/components').SvgIconProps) => import("@emotion/react/jsx-runtime").JSX.Element;
54
+ clickToPay: (props: import('@afosto/components').SvgIconProps) => import("@emotion/react/jsx-runtime").JSX.Element;
55
+ mbWay: (props: import('@afosto/components').SvgIconProps) => import("@emotion/react/jsx-runtime").JSX.Element;
56
+ mobilepay: (props: import('@afosto/components').SvgIconProps) => import("@emotion/react/jsx-runtime").JSX.Element;
57
+ satispay: (props: import('@afosto/components').SvgIconProps) => import("@emotion/react/jsx-runtime").JSX.Element;
58
+ vipps: (props: import('@afosto/components').SvgIconProps) => import("@emotion/react/jsx-runtime").JSX.Element;
50
59
  };
51
60
  //# sourceMappingURL=paymentMethodIconMapping.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"paymentMethodIconMapping.d.ts","sourceRoot":"","sources":["../../src/constants/paymentMethodIconMapping.ts"],"names":[],"mappings":"AA6CA,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiDhD,CAAC"}
1
+ {"version":3,"file":"paymentMethodIconMapping.d.ts","sourceRoot":"","sources":["../../src/constants/paymentMethodIconMapping.ts"],"names":[],"mappings":"AAsDA,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0DhD,CAAC"}
@@ -7,91 +7,109 @@ import { CashOnDelivery as f } from "../icons/paymentMethods/CashOnDelivery.js";
7
7
  import { Spraypay as e } from "../icons/paymentMethods/Spraypay.js";
8
8
  import { Klarna as r } from "../icons/paymentMethods/Klarna.js";
9
9
  import { PayPal as o } from "../icons/paymentMethods/PayPal.js";
10
- import { Bancontact as n } from "../icons/paymentMethods/Bancontact.js";
11
- import { Paysafe as l } from "../icons/paymentMethods/Paysafe.js";
12
- import { Giropay as c } from "../icons/paymentMethods/Giropay.js";
13
- import { Postepay as y } from "../icons/paymentMethods/Postepay.js";
10
+ import { Bancontact as l } from "../icons/paymentMethods/Bancontact.js";
11
+ import { Paysafe as n } from "../icons/paymentMethods/Paysafe.js";
12
+ import { Giropay as y } from "../icons/paymentMethods/Giropay.js";
13
+ import { Postepay as c } from "../icons/paymentMethods/Postepay.js";
14
14
  import { CarteBleue as s } from "../icons/paymentMethods/CarteBleue.js";
15
15
  import { Afterpay as u } from "../icons/paymentMethods/Afterpay.js";
16
16
  import { WebshopGiftcard as d } from "../icons/paymentMethods/WebshopGiftcard.js";
17
- import { Fashioncheque as C } from "../icons/paymentMethods/Fashioncheque.js";
18
- import { PodiumCadeaukaart as P } from "../icons/paymentMethods/PodiumCadeaukaart.js";
19
- import { YourGift as k } from "../icons/paymentMethods/YourGift.js";
20
- import { Giftcard as b } from "../icons/paymentMethods/Giftcard.js";
21
- import { GivaCard as h } from "../icons/paymentMethods/GivaCard.js";
22
- import { VVVCadeaukaart as B } from "../icons/paymentMethods/VVVCadeaukaart.js";
17
+ import { Fashioncheque as P } from "../icons/paymentMethods/Fashioncheque.js";
18
+ import { PodiumCadeaukaart as b } from "../icons/paymentMethods/PodiumCadeaukaart.js";
19
+ import { YourGift as C } from "../icons/paymentMethods/YourGift.js";
20
+ import { Giftcard as k } from "../icons/paymentMethods/Giftcard.js";
21
+ import { GivaCard as B } from "../icons/paymentMethods/GivaCard.js";
22
+ import { VVVCadeaukaart as h } from "../icons/paymentMethods/VVVCadeaukaart.js";
23
23
  import { WeChat as g } from "../icons/paymentMethods/WeChat.js";
24
- import { Alipay as w } from "../icons/paymentMethods/Alipay.js";
25
- import { Payconiq as v } from "../icons/paymentMethods/Payconiq.js";
24
+ import { Alipay as v } from "../icons/paymentMethods/Alipay.js";
25
+ import { Payconiq as w } from "../icons/paymentMethods/Payconiq.js";
26
26
  import { Multibanco as G } from "../icons/paymentMethods/Multibanco.js";
27
- import { EPSUberweisung as A } from "../icons/paymentMethods/EPSUberweisung.js";
28
- import { Przelewy24 as T } from "../icons/paymentMethods/Przelewy24.js";
27
+ import { EPSUberweisung as T } from "../icons/paymentMethods/EPSUberweisung.js";
28
+ import { Przelewy24 as A } from "../icons/paymentMethods/Przelewy24.js";
29
29
  import { Billink as M } from "../icons/paymentMethods/Billink.js";
30
30
  import { In3 as O } from "../icons/paymentMethods/In3.js";
31
- import { Interac as E } from "../icons/paymentMethods/Interac.js";
32
- import { Cash as I } from "../icons/paymentMethods/Cash.js";
33
- import { ManualGiftCard as q } from "../icons/paymentMethods/ManualGiftCard.js";
34
- import { ManualCard as D } from "../icons/paymentMethods/ManualCard.js";
35
- import { Pin as N } from "../icons/paymentMethods/Pin.js";
36
- import { ApplePay as W } from "../icons/paymentMethods/ApplePay.js";
37
- import { GooglePay as _ } from "../icons/paymentMethods/GooglePay.js";
38
- import { Bank as z } from "../icons/paymentMethods/Bank.js";
39
- import { Riverty as K } from "../icons/paymentMethods/Riverty.js";
40
- import { Twint as U } from "../icons/paymentMethods/Twint.js";
41
- import { Walley as V } from "../icons/paymentMethods/Walley.js";
42
- import { Zip as x } from "../icons/paymentMethods/Zip.js";
43
- import { Belfius as H } from "../icons/paymentMethods/Belfius.js";
44
- import { Kbc as S } from "../icons/paymentMethods/Kbc.js";
45
- const Nr = {
31
+ import { Interac as W } from "../icons/paymentMethods/Interac.js";
32
+ import { Cash as z } from "../icons/paymentMethods/Cash.js";
33
+ import { ManualGiftCard as E } from "../icons/paymentMethods/ManualGiftCard.js";
34
+ import { ManualCard as I } from "../icons/paymentMethods/ManualCard.js";
35
+ import { Pin as q } from "../icons/paymentMethods/Pin.js";
36
+ import { ApplePay as D } from "../icons/paymentMethods/ApplePay.js";
37
+ import { GooglePay as N } from "../icons/paymentMethods/GooglePay.js";
38
+ import { Bank as V } from "../icons/paymentMethods/Bank.js";
39
+ import { Riverty as _ } from "../icons/paymentMethods/Riverty.js";
40
+ import { Twint as K } from "../icons/paymentMethods/Twint.js";
41
+ import { Walley as S } from "../icons/paymentMethods/Walley.js";
42
+ import { Zip as U } from "../icons/paymentMethods/Zip.js";
43
+ import { Belfius as x } from "../icons/paymentMethods/Belfius.js";
44
+ import { Kbc as H } from "../icons/paymentMethods/Kbc.js";
45
+ import { Alma as Y } from "../icons/paymentMethods/Alma.js";
46
+ import { Bancomat as F } from "../icons/paymentMethods/Bancomat.js";
47
+ import { Bizum as R } from "../icons/paymentMethods/Bizum.js";
48
+ import { Blik as Z } from "../icons/paymentMethods/Blik.js";
49
+ import { ClickToPay as j } from "../icons/paymentMethods/ClickToPay.js";
50
+ import { MBWay as J } from "../icons/paymentMethods/MBWay.js";
51
+ import { MobilePay as L } from "../icons/paymentMethods/MobilePay.js";
52
+ import { Satispay as Q } from "../icons/paymentMethods/Satispay.js";
53
+ import { Vipps as X } from "../icons/paymentMethods/Vipps.js";
54
+ const Xr = {
46
55
  ideal: m,
47
56
  card: i,
48
57
  bacsDirectDebit: a,
49
58
  bankTransfer: t,
50
- belfius: H,
51
- kbc: S,
59
+ belfius: x,
60
+ kbc: H,
52
61
  onAccount: p,
53
62
  cod: f,
54
63
  spraypay: e,
55
64
  sofort: r,
56
65
  paypalExpress: o,
57
66
  paypal: o,
58
- mistercashBancontact: n,
59
- paysafecard: l,
60
- giftCard: b,
61
- giropay: c,
62
- postepay: y,
67
+ mistercashBancontact: l,
68
+ paysafecard: n,
69
+ giftCard: k,
70
+ giropay: y,
71
+ postepay: c,
63
72
  carteBleue: s,
64
73
  afterpay: u,
65
74
  webshopgiftcard: d,
66
- fashioncheque: C,
67
- podiumcadeaukaart: P,
68
- yourgift: k,
69
- givacard: h,
70
- vvvCadeaukaart: B,
75
+ fashioncheque: P,
76
+ podiumcadeaukaart: b,
77
+ yourgift: C,
78
+ givacard: B,
79
+ vvvCadeaukaart: h,
71
80
  wechatPay: g,
72
- alipay: w,
73
- payconiq: v,
81
+ alipay: v,
82
+ payconiq: w,
74
83
  multibanco: G,
75
- epsUberweisung: A,
76
- przelewy24: T,
84
+ epsUberweisung: T,
85
+ przelewy24: A,
77
86
  billink: M,
78
87
  klarna: r,
79
88
  klarnaNow: r,
80
89
  klarnaOverTime: r,
81
90
  in3: O,
82
- interac: E,
83
- cash: I,
84
- manualGiftCard: q,
85
- manualCard: D,
86
- pin: N,
87
- applePay: W,
88
- googleWallet: _,
89
- payByBank: z,
90
- riverty: K,
91
- twint: U,
92
- walley: V,
93
- zip: x
91
+ interac: W,
92
+ cash: z,
93
+ manualGiftCard: E,
94
+ manualCard: I,
95
+ pin: q,
96
+ applePay: D,
97
+ googleWallet: N,
98
+ payByBank: V,
99
+ riverty: _,
100
+ twint: K,
101
+ walley: S,
102
+ zip: U,
103
+ alma: Y,
104
+ bancomatPay: F,
105
+ bizum: R,
106
+ blik: Z,
107
+ clickToPay: j,
108
+ mbWay: J,
109
+ mobilepay: L,
110
+ satispay: Q,
111
+ vipps: X
94
112
  };
95
113
  export {
96
- Nr as CHECKOUT_PAYMENT_METHOD_ICON_MAPPING
114
+ Xr as CHECKOUT_PAYMENT_METHOD_ICON_MAPPING
97
115
  };
@@ -1,11 +1,12 @@
1
1
  import { CheckoutShippingMethodOptionType, CheckoutShippingMethodPickupPoint } from '../types';
2
2
  export declare const useCheckoutShippingMethods: ({ countryCode, postalCode }: {
3
3
  countryCode: string;
4
- postalCode: string;
4
+ postalCode?: string;
5
5
  }) => {
6
6
  hasSearchPickupPointsError: boolean;
7
7
  isInitializingShippingMethods: boolean;
8
8
  isSearchingPickupPoints: boolean;
9
+ loadPickupPointsForShippingMethod: (shippingMethod?: CheckoutShippingMethodOptionType) => void;
9
10
  pickupPoints: CheckoutShippingMethodPickupPoint[];
10
11
  searchPickupPoints: (...args: unknown[]) => Promise<void>;
11
12
  setPickupPoints: import('react').Dispatch<import('react').SetStateAction<CheckoutShippingMethodPickupPoint[]>>;
@@ -1 +1 @@
1
- {"version":3,"file":"useCheckoutShippingMethods.d.ts","sourceRoot":"","sources":["../../src/hooks/useCheckoutShippingMethods.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,gCAAgC,EAChC,iCAAiC,EAClC,MAAM,UAAU,CAAC;AAGlB,eAAO,MAAM,0BAA0B,GAAI,6BAGxC;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB;;;;;;;;CAgKA,CAAC"}
1
+ {"version":3,"file":"useCheckoutShippingMethods.d.ts","sourceRoot":"","sources":["../../src/hooks/useCheckoutShippingMethods.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EACV,gCAAgC,EAChC,iCAAiC,EAClC,MAAM,UAAU,CAAC;AAGlB,eAAO,MAAM,0BAA0B,GAAI,6BAGxC;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;;;;yDA0FqB,gCAAgC;;;;;CAkIrD,CAAC"}