@afosto/checkout-ui 0.0.1-alpha.5 → 0.0.1-alpha.6

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 (34) hide show
  1. package/dist/CheckoutCartProvider/CheckoutCartProvider.d.ts.map +1 -1
  2. package/dist/CheckoutCartProvider/CheckoutCartProvider.js +45 -42
  3. package/dist/CheckoutContactInformationSection/CheckoutContactInformationSection.d.ts +1 -0
  4. package/dist/CheckoutContactInformationSection/CheckoutContactInformationSection.d.ts.map +1 -1
  5. package/dist/CheckoutContactInformationSection/CheckoutContactInformationSection.js +50 -40
  6. package/dist/CheckoutOrderProvider/CheckoutOrderProvider.d.ts.map +1 -1
  7. package/dist/CheckoutOrderProvider/CheckoutOrderProvider.js +41 -38
  8. package/dist/CheckoutProvider/components/CheckoutThemeProvider/CheckoutThemeProvider.d.ts.map +1 -1
  9. package/dist/CheckoutProvider/components/CheckoutThemeProvider/CheckoutThemeProvider.js +35 -36
  10. package/dist/CheckoutSummary/components/CheckoutSummaryFees/CheckoutSummaryFees.d.ts.map +1 -1
  11. package/dist/CheckoutSummary/components/CheckoutSummaryFees/CheckoutSummaryFees.js +24 -24
  12. package/dist/CheckoutSummary/components/CheckoutSummaryPaymentFees/CheckoutSummaryPaymentFees.d.ts.map +1 -1
  13. package/dist/CheckoutSummary/components/CheckoutSummaryPaymentFees/CheckoutSummaryPaymentFees.js +28 -20
  14. package/dist/CheckoutSummary/components/CheckoutSummaryShippingFees/CheckoutSummaryShippingFees.d.ts.map +1 -1
  15. package/dist/CheckoutSummary/components/CheckoutSummaryShippingFees/CheckoutSummaryShippingFees.js +32 -24
  16. package/dist/CheckoutSummary/components/CheckoutSummaryTotalBreakdown/CheckoutSummaryTotalBreakdown.d.ts.map +1 -1
  17. package/dist/CheckoutSummary/components/CheckoutSummaryTotalBreakdown/CheckoutSummaryTotalBreakdown.js +54 -53
  18. package/dist/hooks/useCheckoutCart.d.ts +2 -0
  19. package/dist/hooks/useCheckoutCart.d.ts.map +1 -1
  20. package/dist/hooks/useCheckoutCart.js +124 -120
  21. package/dist/hooks/useCheckoutForm.d.ts +2 -0
  22. package/dist/hooks/useCheckoutForm.d.ts.map +1 -1
  23. package/dist/hooks/useCheckoutForm.js +35 -34
  24. package/dist/hooks/useCheckoutOrder.d.ts +2 -0
  25. package/dist/hooks/useCheckoutOrder.d.ts.map +1 -1
  26. package/dist/hooks/useCheckoutOrder.js +73 -69
  27. package/dist/steps/informationStep.d.ts +1 -0
  28. package/dist/steps/informationStep.d.ts.map +1 -1
  29. package/dist/steps/informationStep.js +96 -94
  30. package/dist/steps/paymentStep.js +1 -1
  31. package/dist/steps/shippingStep.js +1 -1
  32. package/dist/types.d.ts +5 -1
  33. package/dist/types.d.ts.map +1 -1
  34. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"CheckoutCartProvider.d.ts","sourceRoot":"","sources":["../../src/CheckoutCartProvider/CheckoutCartProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EACL,KAAK,sBAAsB,EAE5B,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AAEtF,OAAO,KAAK,EACV,uBAAuB,EACvB,4BAA4B,EAC5B,gBAAgB,EAChB,aAAa,EACb,oBAAoB,EACpB,WAAW,EACZ,MAAM,UAAU,CAAC;AAMlB,MAAM,WAAW,yBACf,SAAQ,IAAI,CAAC,yBAAyB,EAAE,eAAe,CAAC;IACxD,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IACxB,QAAQ,EAAE,SAAS,CAAC;IACpB,aAAa,EAAE,uBAAuB,CAAC;IACvC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EACP,WAAW,CAAC,sBAAsB,CAAC,GACnC,CAAC,WAAW,CAAC,sBAAsB,CAAC,GAClC,MAAM,CAAC,MAAM,EAAE,4BAA4B,CAAC,CAAC,CAAC;IACpD,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,KAAK,EAAE,aAAa,CAAC;IACrB,YAAY,EAAE,oBAAoB,CAAC;CACpC;AAED,eAAO,MAAM,oBAAoB,GAAI,OAAO,yBAAyB,qDA+DpE,CAAC"}
1
+ {"version":3,"file":"CheckoutCartProvider.d.ts","sourceRoot":"","sources":["../../src/CheckoutCartProvider/CheckoutCartProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EACL,KAAK,sBAAsB,EAE5B,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AAEtF,OAAO,KAAK,EACV,uBAAuB,EACvB,4BAA4B,EAC5B,gBAAgB,EAChB,aAAa,EACb,oBAAoB,EACpB,WAAW,EACZ,MAAM,UAAU,CAAC;AAMlB,MAAM,WAAW,yBACf,SAAQ,IAAI,CAAC,yBAAyB,EAAE,eAAe,CAAC;IACxD,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IACxB,QAAQ,EAAE,SAAS,CAAC;IACpB,aAAa,EAAE,uBAAuB,CAAC;IACvC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EACP,WAAW,CAAC,sBAAsB,CAAC,GACnC,CAAC,WAAW,CAAC,sBAAsB,CAAC,GAClC,MAAM,CAAC,MAAM,EAAE,4BAA4B,CAAC,CAAC,CAAC;IACpD,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,KAAK,EAAE,aAAa,CAAC;IACrB,YAAY,EAAE,oBAAoB,CAAC;CACpC;AAED,eAAO,MAAM,oBAAoB,GAAI,OAAO,yBAAyB,qDAkEpE,CAAC"}
@@ -1,61 +1,64 @@
1
- import { jsx as l } from "react/jsx-runtime";
2
- import { CheckoutStateProvider as k } from "../CheckoutStateProvider/CheckoutStateProvider.js";
3
- import { cartOperations as O } from "../operations/cartOperations.js";
4
- import { useCheckoutCart as v } from "../hooks/useCheckoutCart.js";
5
- import { authOperations as P } from "../operations/authOperations.js";
6
- const w = (u) => {
1
+ import { jsx as k } from "react/jsx-runtime";
2
+ import { CheckoutStateProvider as O } from "../CheckoutStateProvider/CheckoutStateProvider.js";
3
+ import { cartOperations as v } from "../operations/cartOperations.js";
4
+ import { useCheckoutCart as P } from "../hooks/useCheckoutCart.js";
5
+ import { authOperations as S } from "../operations/authOperations.js";
6
+ const y = (d) => {
7
7
  const {
8
- analytics: d,
8
+ analytics: f,
9
9
  cartId: o,
10
- createSummary: e,
11
- isLoadingChannel: f,
12
- locale: s,
13
- storefront: a,
14
- operations: n = {},
15
- settings: c,
16
- steps: i,
17
- ...h
18
- } = u, t = {
19
- ...P,
20
- ...O
21
- }, p = Object.keys(n || {}).reduce(
22
- (m, r) => ({
23
- ...m,
10
+ channel: e,
11
+ createSummary: s,
12
+ isLoadingChannel: h,
13
+ locale: a,
14
+ storefront: n,
15
+ operations: c = {},
16
+ settings: i,
17
+ steps: p,
18
+ ...l
19
+ } = d, t = {
20
+ ...S,
21
+ ...v
22
+ }, m = Object.keys(c || {}).reduce(
23
+ (u, r) => ({
24
+ ...u,
24
25
  [r]: {
25
- ...m[r] || {},
26
- ...n[r] || {}
26
+ ...u[r] || {},
27
+ ...c[r] || {}
27
28
  }
28
29
  }),
29
30
  t
30
- ), C = v({
31
+ ), C = P({
31
32
  cartId: o,
32
- analytics: d,
33
- createSummary: e,
33
+ analytics: f,
34
+ channel: e,
35
+ createSummary: s,
34
36
  defaultOperations: t,
35
- isLoadingChannel: f,
36
- locale: s,
37
- operations: p,
38
- settings: c,
39
- storefront: a,
40
- steps: i
37
+ isLoadingChannel: h,
38
+ locale: a,
39
+ operations: m,
40
+ settings: i,
41
+ storefront: n,
42
+ steps: p
41
43
  });
42
- return /* @__PURE__ */ l(
43
- k,
44
+ return /* @__PURE__ */ k(
45
+ O,
44
46
  {
45
- ...h,
47
+ ...l,
46
48
  ...C,
47
49
  cartId: o,
48
- createSummary: e,
50
+ channel: e,
51
+ createSummary: s,
49
52
  defaultOperations: t,
50
53
  flow: "cart",
51
- locale: s,
52
- operations: p,
53
- settings: c,
54
- steps: i,
55
- storefront: a
54
+ locale: a,
55
+ operations: m,
56
+ settings: i,
57
+ steps: p,
58
+ storefront: n
56
59
  }
57
60
  );
58
61
  };
59
62
  export {
60
- w as CheckoutCartProvider
63
+ y as CheckoutCartProvider
61
64
  };
@@ -5,6 +5,7 @@ declare const defaultTranslations: {
5
5
  alreadyHaveAnAccountMessage: string;
6
6
  confirmPassword: string;
7
7
  email: string;
8
+ emailOptInMessage: string;
8
9
  password: string;
9
10
  phoneNumber: string;
10
11
  shouldCreateAccountMessage: string;
@@ -1 +1 @@
1
- {"version":3,"file":"CheckoutContactInformationSection.d.ts","sourceRoot":"","sources":["../../src/CheckoutContactInformationSection/CheckoutContactInformationSection.tsx"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,oCAAoC,CAAC;AAc5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,QAAA,MAAM,mBAAmB;;;;;;;;;CAUxB,CAAC;AAEF,MAAM,WAAW,sCACf,SAAQ,IAAI,CAAC,oBAAoB,EAAE,UAAU,CAAC;IAC9C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,WAAW,CAAC,OAAO,mBAAmB,CAAC,CAAC;CACxD;AAED,eAAO,MAAM,iCAAiC,GAC5C,OAAO,sCAAsC,qDA+J9C,CAAC"}
1
+ {"version":3,"file":"CheckoutContactInformationSection.d.ts","sourceRoot":"","sources":["../../src/CheckoutContactInformationSection/CheckoutContactInformationSection.tsx"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,oCAAoC,CAAC;AAc5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,QAAA,MAAM,mBAAmB;;;;;;;;;;CAWxB,CAAC;AAEF,MAAM,WAAW,sCACf,SAAQ,IAAI,CAAC,oBAAoB,EAAE,UAAU,CAAC;IAC9C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,WAAW,CAAC,OAAO,mBAAmB,CAAC,CAAC;CACxD;AAED,eAAO,MAAM,iCAAiC,GAC5C,OAAO,sCAAsC,qDAyK9C,CAAC"}
@@ -1,10 +1,10 @@
1
- import { jsxs as n, jsx as e, Fragment as i } from "react/jsx-runtime";
1
+ import { jsxs as o, jsx as e, Fragment as i } from "react/jsx-runtime";
2
2
  import { useState as W, useEffect as V } from "react";
3
3
  import { CheckoutPhoneNumberCard as $ } from "../CheckoutPhoneNumberCard/CheckoutPhoneNumberCard.js";
4
4
  import { CheckoutSection as j } from "../CheckoutSection/CheckoutSection.js";
5
5
  import { CheckoutSectionHeader as D } from "../CheckoutSectionHeader/CheckoutSectionHeader.js";
6
6
  import { useCheckout as G } from "../CheckoutStateProvider/CheckoutStateProvider.js";
7
- import { useFormContext as L, Typography as U, Link as q, Grid as r, Fields as s, Collapse as h } from "@afosto/components";
7
+ import { useFormContext as L, Typography as U, Link as q, Grid as t, Fields as s, Collapse as h } from "@afosto/components";
8
8
  import { isDefined as p } from "@afosto/utils";
9
9
  import { canEditInformation as z } from "../utils/canEditInformation.js";
10
10
  import { CheckoutSignedInAsMessage as B } from "../CheckoutSignedInAsMessage/CheckoutSignedInAsMessage.js";
@@ -13,107 +13,108 @@ const J = {
13
13
  alreadyHaveAnAccountMessage: "Already have an account?",
14
14
  confirmPassword: "Confirm password",
15
15
  email: "Email",
16
+ emailOptInMessage: "I would like to receive the latest news and promotions",
16
17
  password: "Password",
17
18
  phoneNumber: "Phone number",
18
19
  shouldCreateAccountMessage: "Create an account so I can easily track my orders",
19
20
  signIn: "Sign in"
20
- }, ne = (b) => {
21
+ }, te = (b) => {
21
22
  const {
22
23
  canEdit: C,
23
24
  translations: f = {},
24
25
  ...w
25
26
  } = b || {}, [l, a] = W(!1), {
26
27
  getUser: g,
27
- isSignedIn: t,
28
+ isSignedIn: r,
28
29
  setShowSignIn: N,
29
30
  settings: x,
30
- translations: y
31
- } = G(), { isAccountEnabled: c } = x || {}, A = C ?? z(g()), { getValues: u, setValue: P, watch: S } = L(), [k, I, E] = S([
31
+ translations: I
32
+ } = G(), { emailOptIn: y = !1, isAccountEnabled: c } = x || {}, A = C ?? z(g()), { getValues: m, setValue: P, watch: S } = L(), [k, E, v] = S([
32
33
  "shouldCreateAccount",
33
34
  "phoneNumber",
34
35
  "phoneNumberCountry"
35
36
  ]);
36
37
  V(() => {
37
- if (t) {
38
- const d = u(), M = d.phoneNumber, T = d.phoneNumberCountry, H = p(M) && p(T);
38
+ if (r) {
39
+ const d = m(), O = d.phoneNumber, T = d.phoneNumberCountry, H = p(O) && p(T);
39
40
  a(H);
40
41
  } else
41
42
  a(!1);
42
- }, [u, t]);
43
- const [m] = E?.callingCodes || [], o = {
43
+ }, [m, r]);
44
+ const [u] = v?.callingCodes || [], n = {
44
45
  ...J,
45
- ...y?.contactInformationSection || {},
46
+ ...I?.contactInformationSection || {},
46
47
  ...f || {}
47
- }, v = () => {
48
- a(!1), P("phoneNumberIsDirty", !0);
49
48
  }, F = () => {
49
+ a(!1), P("phoneNumberIsDirty", !0);
50
+ }, M = () => {
50
51
  N(!0);
51
52
  };
52
- return /* @__PURE__ */ n(j, { ...w, children: [
53
+ return /* @__PURE__ */ o(j, { ...w, children: [
53
54
  /* @__PURE__ */ e(
54
55
  D,
55
56
  {
56
- title: o.title,
57
- endAdornment: c && !t && /* @__PURE__ */ n(U, { component: "span", color: "gray.800", children: [
58
- o.alreadyHaveAnAccountMessage,
57
+ title: n.title,
58
+ endAdornment: c && !r && /* @__PURE__ */ o(U, { component: "span", color: "gray.800", children: [
59
+ n.alreadyHaveAnAccountMessage,
59
60
  /* @__PURE__ */ e(
60
61
  q,
61
62
  {
62
63
  component: "button",
63
64
  type: "button",
64
- onClick: F,
65
+ onClick: M,
65
66
  sx: {
66
67
  ml: 0.5,
67
68
  verticalAlign: "baseline",
68
69
  lineHeight: "initial"
69
70
  },
70
- children: o.signIn
71
+ children: n.signIn
71
72
  }
72
73
  )
73
74
  ] }),
74
- sx: { mb: t ? 1 : 3 }
75
+ sx: { mb: r ? 1 : 3 }
75
76
  }
76
77
  ),
77
- t && /* @__PURE__ */ e(B, { sx: { mb: 3 } }),
78
- /* @__PURE__ */ n(r, { container: !0, spacing: 2, children: [
79
- !t && /* @__PURE__ */ n(i, { children: [
80
- /* @__PURE__ */ e(r, { item: !0, xs: 12, children: /* @__PURE__ */ e(
78
+ r && /* @__PURE__ */ e(B, { sx: { mb: 3 } }),
79
+ /* @__PURE__ */ o(t, { container: !0, spacing: 2, children: [
80
+ !r && /* @__PURE__ */ o(i, { children: [
81
+ /* @__PURE__ */ e(t, { item: !0, xs: 12, children: /* @__PURE__ */ e(
81
82
  s.TextField,
82
83
  {
83
84
  id: "email",
84
85
  name: "email",
85
- label: o.email,
86
+ label: n.email,
86
87
  autoComplete: "email",
87
88
  autoFocus: !0,
88
89
  fullWidth: !0
89
90
  }
90
91
  ) }),
91
- c && /* @__PURE__ */ n(i, { children: [
92
- /* @__PURE__ */ e(r, { item: !0, xs: 12, children: /* @__PURE__ */ e(
92
+ c && /* @__PURE__ */ o(i, { children: [
93
+ /* @__PURE__ */ e(t, { item: !0, xs: 12, children: /* @__PURE__ */ e(
93
94
  s.Checkbox,
94
95
  {
95
96
  id: "should-create-account",
96
97
  name: "shouldCreateAccount",
97
- label: o.shouldCreateAccountMessage
98
+ label: n.shouldCreateAccountMessage
98
99
  }
99
100
  ) }),
100
- k && /* @__PURE__ */ n(i, { children: [
101
- /* @__PURE__ */ e(r, { item: !0, xs: 12, children: /* @__PURE__ */ e(
101
+ k && /* @__PURE__ */ o(i, { children: [
102
+ /* @__PURE__ */ e(t, { item: !0, xs: 12, children: /* @__PURE__ */ e(
102
103
  s.Password,
103
104
  {
104
105
  id: "new-password",
105
106
  name: "password",
106
- label: o.password,
107
+ label: n.password,
107
108
  autoComplete: "new-password",
108
109
  fullWidth: !0
109
110
  }
110
111
  ) }),
111
- /* @__PURE__ */ e(r, { item: !0, xs: 12, children: /* @__PURE__ */ e(
112
+ /* @__PURE__ */ e(t, { item: !0, xs: 12, children: /* @__PURE__ */ e(
112
113
  s.Password,
113
114
  {
114
115
  id: "confirm-new-password",
115
116
  name: "passwordConfirm",
116
- label: o.confirmPassword,
117
+ label: n.confirmPassword,
117
118
  autoComplete: "new-password",
118
119
  fullWidth: !0
119
120
  }
@@ -121,13 +122,13 @@ const J = {
121
122
  ] })
122
123
  ] })
123
124
  ] }),
124
- /* @__PURE__ */ n(r, { item: !0, xs: 12, children: [
125
+ /* @__PURE__ */ o(t, { item: !0, xs: 12, children: [
125
126
  /* @__PURE__ */ e(h, { in: l, children: /* @__PURE__ */ e(
126
127
  $,
127
128
  {
128
- title: o.phoneNumber,
129
- onEdit: A ? v : void 0,
130
- phoneNumber: `${m ? `+${m} ` : ""}${I}`
129
+ title: n.phoneNumber,
130
+ onEdit: A ? F : void 0,
131
+ phoneNumber: `${u ? `+${u} ` : ""}${E}`
131
132
  }
132
133
  ) }),
133
134
  /* @__PURE__ */ e(h, { in: !l, children: /* @__PURE__ */ e(
@@ -135,15 +136,24 @@ const J = {
135
136
  {
136
137
  id: "phone-number",
137
138
  numberFieldName: "phoneNumber",
138
- label: o.phoneNumber,
139
+ label: n.phoneNumber,
139
140
  autoComplete: "tel-national",
140
141
  fullWidth: !0
141
142
  }
142
143
  ) })
143
- ] })
144
+ ] }),
145
+ y && /* @__PURE__ */ e(t, { item: !0, xs: 12, children: /* @__PURE__ */ e(
146
+ s.Checkbox,
147
+ {
148
+ id: "emailOptIn",
149
+ name: "emailOptIn",
150
+ label: n.emailOptInMessage,
151
+ sx: { mt: -0.5 }
152
+ }
153
+ ) })
144
154
  ] })
145
155
  ] });
146
156
  };
147
157
  export {
148
- ne as CheckoutContactInformationSection
158
+ te as CheckoutContactInformationSection
149
159
  };
@@ -1 +1 @@
1
- {"version":3,"file":"CheckoutOrderProvider.d.ts","sourceRoot":"","sources":["../../src/CheckoutOrderProvider/CheckoutOrderProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EACV,uBAAuB,EACvB,4BAA4B,EAC5B,gBAAgB,EAChB,aAAa,EACb,oBAAoB,EACpB,WAAW,EACZ,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,KAAK,uBAAuB,EAE7B,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AAOtF,MAAM,WAAW,0BACf,SAAQ,IAAI,CAAC,yBAAyB,EAAE,eAAe,CAAC;IACxD,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IACxB,QAAQ,EAAE,SAAS,CAAC;IACpB,aAAa,EAAE,uBAAuB,CAAC;IACvC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EACP,WAAW,CAAC,uBAAuB,CAAC,GACpC,CAAC,WAAW,CAAC,uBAAuB,CAAC,GACnC,MAAM,CAAC,MAAM,EAAE,4BAA4B,CAAC,CAAC,CAAC;IACpD,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,KAAK,EAAE,aAAa,CAAC;IACrB,YAAY,EAAE,oBAAoB,CAAC;CACpC;AAED,eAAO,MAAM,qBAAqB,GAAI,OAAO,0BAA0B,qDA+DtE,CAAC"}
1
+ {"version":3,"file":"CheckoutOrderProvider.d.ts","sourceRoot":"","sources":["../../src/CheckoutOrderProvider/CheckoutOrderProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EACV,uBAAuB,EACvB,4BAA4B,EAC5B,gBAAgB,EAChB,aAAa,EACb,oBAAoB,EACpB,WAAW,EACZ,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,KAAK,uBAAuB,EAE7B,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AAOtF,MAAM,WAAW,0BACf,SAAQ,IAAI,CAAC,yBAAyB,EAAE,eAAe,CAAC;IACxD,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IACxB,QAAQ,EAAE,SAAS,CAAC;IACpB,aAAa,EAAE,uBAAuB,CAAC;IACvC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EACP,WAAW,CAAC,uBAAuB,CAAC,GACpC,CAAC,WAAW,CAAC,uBAAuB,CAAC,GACnC,MAAM,CAAC,MAAM,EAAE,4BAA4B,CAAC,CAAC,CAAC;IACpD,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,KAAK,EAAE,aAAa,CAAC;IACrB,YAAY,EAAE,oBAAoB,CAAC;CACpC;AAED,eAAO,MAAM,qBAAqB,GAAI,OAAO,0BAA0B,qDAkEtE,CAAC"}
@@ -1,61 +1,64 @@
1
- import { jsx as l } from "react/jsx-runtime";
2
- import { CheckoutStateProvider as k } from "../CheckoutStateProvider/CheckoutStateProvider.js";
3
- import { orderOperations as C } from "../operations/orderOperations.js";
4
- import { authOperations as v } from "../operations/authOperations.js";
5
- import { useCheckoutOrder as P } from "../hooks/useCheckoutOrder.js";
6
- const w = (m) => {
1
+ import { jsx as k } from "react/jsx-runtime";
2
+ import { CheckoutStateProvider as C } from "../CheckoutStateProvider/CheckoutStateProvider.js";
3
+ import { orderOperations as v } from "../operations/orderOperations.js";
4
+ import { authOperations as P } from "../operations/authOperations.js";
5
+ import { useCheckoutOrder as S } from "../hooks/useCheckoutOrder.js";
6
+ const y = (u) => {
7
7
  const {
8
8
  orderId: t,
9
- analytics: u,
10
- createSummary: e,
11
- isLoadingChannel: f,
12
- locale: s,
13
- storefront: n,
14
- operations: i = {},
15
- settings: a,
9
+ analytics: f,
10
+ channel: e,
11
+ createSummary: s,
12
+ isLoadingChannel: h,
13
+ locale: n,
14
+ storefront: i,
15
+ operations: a = {},
16
+ settings: c,
16
17
  steps: d,
17
18
  ...O
18
- } = m, r = {
19
- ...v,
20
- ...C
21
- }, c = Object.keys(i || {}).reduce(
22
- (p, o) => ({
23
- ...p,
19
+ } = u, r = {
20
+ ...P,
21
+ ...v
22
+ }, p = Object.keys(a || {}).reduce(
23
+ (m, o) => ({
24
+ ...m,
24
25
  [o]: {
25
- ...p[o] || {},
26
- ...i[o] || {}
26
+ ...m[o] || {},
27
+ ...a[o] || {}
27
28
  }
28
29
  }),
29
30
  r
30
- ), h = P({
31
+ ), l = S({
31
32
  orderId: t,
32
- analytics: u,
33
- createSummary: e,
33
+ analytics: f,
34
+ channel: e,
35
+ createSummary: s,
34
36
  defaultOperations: r,
35
- isLoadingChannel: f,
36
- locale: s,
37
- operations: c,
38
- settings: a,
39
- storefront: n,
37
+ isLoadingChannel: h,
38
+ locale: n,
39
+ operations: p,
40
+ settings: c,
41
+ storefront: i,
40
42
  steps: d
41
43
  });
42
- return /* @__PURE__ */ l(
43
- k,
44
+ return /* @__PURE__ */ k(
45
+ C,
44
46
  {
45
47
  ...O,
46
- ...h,
47
- createSummary: e,
48
+ ...l,
49
+ channel: e,
50
+ createSummary: s,
48
51
  defaultOperations: r,
49
52
  flow: "order",
50
53
  orderId: t,
51
- locale: s,
52
- operations: c,
53
- settings: a,
54
+ locale: n,
55
+ operations: p,
56
+ settings: c,
54
57
  steps: d,
55
- storefront: n
58
+ storefront: i
56
59
  }
57
60
  );
58
61
  };
59
62
  export {
60
- w as CheckoutOrderProvider
63
+ y as CheckoutOrderProvider
61
64
  };
@@ -1 +1 @@
1
- {"version":3,"file":"CheckoutThemeProvider.d.ts","sourceRoot":"","sources":["../../../../src/CheckoutProvider/components/CheckoutThemeProvider/CheckoutThemeProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAIL,KAAK,KAAK,EACX,MAAM,oBAAoB,CAAC;AAG5B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;CACxB;AAED,eAAO,MAAM,qBAAqB,GAAI,OAAO,0BAA0B,qDAuEtE,CAAC"}
1
+ {"version":3,"file":"CheckoutThemeProvider.d.ts","sourceRoot":"","sources":["../../../../src/CheckoutProvider/components/CheckoutThemeProvider/CheckoutThemeProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAIL,KAAK,KAAK,EACX,MAAM,oBAAoB,CAAC;AAG5B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;CACxB;AAED,eAAO,MAAM,qBAAqB,GAAI,OAAO,0BAA0B,qDAkEtE,CAAC"}
@@ -1,25 +1,25 @@
1
- import { jsx as p } from "react/jsx-runtime";
2
- import { theme as l, createTheme as u, ThemeProvider as h } from "@afosto/components";
3
- import { darken as r, lighten as t } from "../../../utils/colorManipulator.js";
4
- import { deepMerge as m } from "../../../utils/deepMerge.js";
5
- const x = (a) => {
6
- const { branding: d, children: c, theme: n } = a, { primary: e } = d?.colors || {}, o = e ? {
1
+ import { jsx as h } from "react/jsx-runtime";
2
+ import { theme as a, createTheme as f, ThemeProvider as b } from "@afosto/components";
3
+ import { darken as o, lighten as t } from "../../../utils/colorManipulator.js";
4
+ import { deepMerge as i } from "../../../utils/deepMerge.js";
5
+ const C = (m) => {
6
+ const { branding: c, children: p, theme: n } = m, { primary: e } = c?.colors || {}, s = e ? {
7
7
  main: e,
8
8
  100: t(e, 0.9),
9
9
  200: t(e, 0.6),
10
10
  300: t(e, 0.3),
11
11
  400: t(e, 0.1),
12
12
  500: e,
13
- 600: r(e, 0.1),
14
- 700: r(e, 0.2),
15
- 800: r(e, 0.3),
16
- 900: r(e, 0.4)
17
- } : null;
18
- let i = m(l, {
13
+ 600: o(e, 0.1),
14
+ 700: o(e, 0.2),
15
+ 800: o(e, 0.3),
16
+ 900: o(e, 0.4)
17
+ } : {}, r = i(
18
+ a.palette.primary,
19
+ i(s, n?.palette?.primary || {})
20
+ ), d = {
19
21
  palette: {
20
- ...o ? {
21
- primary: o
22
- } : {}
22
+ primary: r
23
23
  },
24
24
  components: {
25
25
  MuiInputBase: {
@@ -32,32 +32,31 @@ const x = (a) => {
32
32
  }
33
33
  },
34
34
  MuiButton: {
35
- ...o ? {
36
- styleOverrides: {
37
- root: {
38
- "&.Mui-focusVisible, &:focus-visible": {
39
- boxShadow: `0 0 0 3px ${o.main}88`
40
- }
35
+ styleOverrides: {
36
+ root: {
37
+ "&.Mui-focusVisible, &:focus-visible": {
38
+ boxShadow: `0 0 0 3px ${r.main}88`
39
+ }
40
+ },
41
+ containedPrimary: {
42
+ backgroundColor: r.main,
43
+ color: "#fff",
44
+ "&:hover:not(.Mui-disabled):not(:active)": {
45
+ backgroundColor: r[600]
41
46
  },
42
- containedPrimary: {
43
- backgroundColor: o.main,
44
- color: "#fff",
45
- "&:hover:not(.Mui-disabled):not(:active)": {
46
- backgroundColor: o[600]
47
- },
48
- '&:active, &[aria-expanded="true"]': {
49
- backgroundColor: o[700]
50
- }
47
+ '&:active, &[aria-expanded="true"]': {
48
+ backgroundColor: r[700]
51
49
  }
52
50
  }
53
- } : {}
51
+ }
54
52
  }
55
53
  }
56
- });
57
- n && (i = m(i, n));
58
- const s = u(i);
59
- return /* @__PURE__ */ p(h, { theme: s, children: c });
54
+ }, l = i(
55
+ a,
56
+ i(d, n || {})
57
+ ), u = f(l);
58
+ return /* @__PURE__ */ h(b, { theme: u, children: p });
60
59
  };
61
60
  export {
62
- x as CheckoutThemeProvider
61
+ C as CheckoutThemeProvider
63
62
  };
@@ -1 +1 @@
1
- {"version":3,"file":"CheckoutSummaryFees.d.ts","sourceRoot":"","sources":["../../../../src/CheckoutSummary/components/CheckoutSummaryFees/CheckoutSummaryFees.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAGzD,OAAO,EAEL,KAAK,yBAAyB,EAC/B,MAAM,8CAA8C,CAAC;AAEtD,QAAA,MAAM,mBAAmB;;;;CAIxB,CAAC;AAEF,MAAM,WAAW,wBACf,SAAQ,IAAI,CAAC,yBAAyB,EAAE,UAAU,CAAC;IACnD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAC5B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,YAAY,CAAC,EAAE,OAAO,CAAC,OAAO,mBAAmB,CAAC,CAAC;CACpD;AAED,eAAO,MAAM,mBAAmB,GAAI,OAAO,wBAAwB,4DAsElE,CAAC"}
1
+ {"version":3,"file":"CheckoutSummaryFees.d.ts","sourceRoot":"","sources":["../../../../src/CheckoutSummary/components/CheckoutSummaryFees/CheckoutSummaryFees.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAGzD,OAAO,EAEL,KAAK,yBAAyB,EAC/B,MAAM,8CAA8C,CAAC;AAEtD,QAAA,MAAM,mBAAmB;;;;CAIxB,CAAC;AAEF,MAAM,WAAW,wBACf,SAAQ,IAAI,CAAC,yBAAyB,EAAE,UAAU,CAAC;IACnD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAC5B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,YAAY,CAAC,EAAE,OAAO,CAAC,OAAO,mBAAmB,CAAC,CAAC;CACpD;AAED,eAAO,MAAM,mBAAmB,GAAI,OAAO,wBAAwB,4DAyElE,CAAC"}
@@ -1,57 +1,57 @@
1
- import { jsxs as v, jsx as o } from "react/jsx-runtime";
2
- import { useCheckout as w } from "../../../CheckoutStateProvider/CheckoutStateProvider.js";
3
- import { isDefined as D } from "@afosto/utils";
4
- import { CheckoutSummaryRow as r } from "../CheckoutSummaryRow/CheckoutSummaryRow.js";
5
- import { CheckoutSummaryGroup as I } from "../CheckoutSummaryGroup/CheckoutSummaryGroup.js";
6
- const x = {
1
+ import { jsxs as w, jsx as a } from "react/jsx-runtime";
2
+ import { useCheckout as D } from "../../../CheckoutStateProvider/CheckoutStateProvider.js";
3
+ import { isDefined as I } from "@afosto/utils";
4
+ import { CheckoutSummaryRow as l } from "../CheckoutSummaryRow/CheckoutSummaryRow.js";
5
+ import { CheckoutSummaryGroup as x } from "../CheckoutSummaryGroup/CheckoutSummaryGroup.js";
6
+ const T = {
7
7
  calculatedInStep: "Calculated in step {step}",
8
8
  free: "Free",
9
9
  defaultFeesDescription: "Fees"
10
- }, Z = (c) => {
10
+ }, b = (c) => {
11
11
  const {
12
- calculatedStep: a,
12
+ calculatedStep: r,
13
13
  currency: u,
14
14
  disablePadding: p = !0,
15
15
  divider: d = !1,
16
- showFreeWhenEmpty: l = !1,
16
+ showFreeWhenEmpty: n = !1,
17
17
  showFreeWhenZero: m = !1,
18
18
  showFeeWhenZero: f = !1,
19
19
  locale: h,
20
20
  fees: F = [],
21
21
  hideCalculatedInStep: S = !1,
22
22
  translations: C = {},
23
- ...y
24
- } = c, { translations: k } = w(), t = {
25
- ...x,
23
+ ...v
24
+ } = c, { activeStep: y, translations: k } = D(), t = {
25
+ ...T,
26
26
  ...k?.summary || {},
27
27
  ...C || {}
28
- }, n = F.filter((e) => f || e.total !== 0), s = n.length > 0, i = !S && D(a);
29
- return !s && !i && !l ? null : /* @__PURE__ */ v(
30
- I,
28
+ }, i = F.filter((e) => f || e.total !== 0), s = i.length > 0, o = !S && I(r) && (r || 0) > y;
29
+ return !s && !o && !n ? null : /* @__PURE__ */ w(
30
+ x,
31
31
  {
32
- ...y,
32
+ ...v,
33
33
  disablePadding: p,
34
34
  divider: d,
35
35
  children: [
36
- !s && i && /* @__PURE__ */ o(
37
- r,
36
+ !s && o && /* @__PURE__ */ a(
37
+ l,
38
38
  {
39
39
  description: t.defaultFeesDescription,
40
40
  value: t.calculatedInStep.replace(
41
41
  "{step}",
42
- `${a}`
42
+ `${r}`
43
43
  )
44
44
  }
45
45
  ),
46
- !s && l && /* @__PURE__ */ o(
47
- r,
46
+ !s && !o && n && /* @__PURE__ */ a(
47
+ l,
48
48
  {
49
49
  description: t.defaultFeesDescription,
50
50
  value: t.free
51
51
  }
52
52
  ),
53
- s && n.map((e) => /* @__PURE__ */ o(
54
- r,
53
+ s && !o && i.map((e) => /* @__PURE__ */ a(
54
+ l,
55
55
  {
56
56
  description: e.description,
57
57
  value: !m || e.total !== 0 ? e.total : t.free,
@@ -65,5 +65,5 @@ const x = {
65
65
  );
66
66
  };
67
67
  export {
68
- Z as CheckoutSummaryFees
68
+ b as CheckoutSummaryFees
69
69
  };
@@ -1 +1 @@
1
- {"version":3,"file":"CheckoutSummaryPaymentFees.d.ts","sourceRoot":"","sources":["../../../../src/CheckoutSummary/components/CheckoutSummaryPaymentFees/CheckoutSummaryPaymentFees.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,wBAAwB,EAC9B,MAAM,4CAA4C,CAAC;AAGpD,QAAA,MAAM,mBAAmB;;CAExB,CAAC;AAEF,MAAM,WAAW,+BACf,SAAQ,IAAI,CAAC,wBAAwB,EAAE,cAAc,CAAC;IACtD,YAAY,CAAC,EAAE,OAAO,CAAC,OAAO,mBAAmB,CAAC,CAAC;CACpD;AAED,eAAO,MAAM,0BAA0B,GACrC,OAAO,+BAA+B,qDA6BvC,CAAC"}
1
+ {"version":3,"file":"CheckoutSummaryPaymentFees.d.ts","sourceRoot":"","sources":["../../../../src/CheckoutSummary/components/CheckoutSummaryPaymentFees/CheckoutSummaryPaymentFees.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,wBAAwB,EAC9B,MAAM,4CAA4C,CAAC;AAIpD,QAAA,MAAM,mBAAmB;;CAExB,CAAC;AAEF,MAAM,WAAW,+BACf,SAAQ,IAAI,CAAC,wBAAwB,EAAE,cAAc,CAAC;IACtD,YAAY,CAAC,EAAE,OAAO,CAAC,OAAO,mBAAmB,CAAC,CAAC;CACpD;AAED,eAAO,MAAM,0BAA0B,GACrC,OAAO,+BAA+B,qDAwCvC,CAAC"}