everest-npm-features 0.0.9 → 0.0.10

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.
@@ -1,6 +1,6 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
- import { C as b } from "../../../../index-BMhrzXlc.js";
3
+ import { C as b } from "../../../../index-DNVjDI72.js";
4
4
  import "../../../../index-ceeCtFuh.js";
5
5
  import "../../Shared/backBtn.js";
6
6
  import "../../../../util/functions.js";
@@ -3,7 +3,7 @@ import "react";
3
3
  import "../../Shared/backBtn.js";
4
4
  import "../../../../util/functions.js";
5
5
  import "../../../../util/constants.js";
6
- import { a as b } from "../../../../index-BMhrzXlc.js";
6
+ import { a as b } from "../../../../index-DNVjDI72.js";
7
7
  import "../../Shared/Button/index.js";
8
8
  import "../../../../constants-74hrsFxy.js";
9
9
  import "../../../../order-BJOkWhkX.js";
@@ -10,7 +10,7 @@ import "../../../../order-BJOkWhkX.js";
10
10
  import "../../../Shared/tooltip.js";
11
11
  import "../../../../util/functions.js";
12
12
  import "../../Shared/Button/index.js";
13
- import { B as w } from "../../../../index-BMhrzXlc.js";
13
+ import { B as w } from "../../../../index-DNVjDI72.js";
14
14
  import "../../../../Grid2-IYppkw5f.js";
15
15
  import "../../../../Box-Bt8cGqC7.js";
16
16
  import "../../../../Typography-Du8mj1kr.js";
@@ -1,7 +1,7 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
3
  import "../../../../hoc/withThemeProvider.js";
4
- import { b as L, F as T, M as c, P as g, i as h } from "../../../../index-BMhrzXlc.js";
4
+ import { b as L, F as T, M as c, P as g, i as h } from "../../../../index-DNVjDI72.js";
5
5
  import "../../../../util/constants.js";
6
6
  import "@incodetech/welcome";
7
7
  import "../../../../axios-BEX6n2A7.js";
@@ -5,6 +5,7 @@ import { OrderActionTypes } from 'everest-npm-api';
5
5
  export interface RocketRampBuyProps {
6
6
  partnerKey: string;
7
7
  rrBaseUrl: string;
8
+ checkoutSdkKey: string;
8
9
  }
9
10
  interface BaseBuySubComponentProps {
10
11
  dispatch: Dispatch<OrderActionTypes>;
@@ -1,130 +1,135 @@
1
- import { jsxs as u, Fragment as F, jsx as r } from "react/jsx-runtime";
1
+ import { jsxs as u, Fragment as R, jsx as a } from "react/jsx-runtime";
2
2
  import { useState as d } from "react";
3
3
  import f from "../../Shared/Button/index.js";
4
- import m from "../../Shared/Input/index.js";
4
+ import p, { UserNameInputField as T } from "../../Shared/Input/index.js";
5
5
  import "../../../../constants-74hrsFxy.js";
6
- import { e as R } from "../../../../auth-CD4Ih2jU.js";
6
+ import { e as S } from "../../../../auth-CD4Ih2jU.js";
7
+ import { userNameRegex as L } from "../../../../util/regex.js";
8
+ import { USERNAME_SUFFIX as b, USERNAME_TOOLTIP as U } from "../../../../util/constants.js";
7
9
  import { T as v } from "../../../../Typography-Du8mj1kr.js";
8
- import { B as T } from "../../../../Box-Bt8cGqC7.js";
9
- import { S as b } from "../../../../Stack-Ce-OQAtj.js";
10
- import { I as W } from "../../../../InputAdornment-HG4f5A6g.js";
11
- import { F as L } from "../../../../FormControl-C_Aq5EJK.js";
12
- import { F as S, C as B } from "../../../../FormControlLabel-DzW2M9Zf.js";
10
+ import { B as W } from "../../../../Box-Bt8cGqC7.js";
11
+ import { S as y } from "../../../../Stack-Ce-OQAtj.js";
12
+ import { I as E } from "../../../../InputAdornment-HG4f5A6g.js";
13
+ import { F as B } from "../../../../FormControl-C_Aq5EJK.js";
14
+ import { F as w, C as _ } from "../../../../FormControlLabel-DzW2M9Zf.js";
13
15
  import { L as j } from "../../../../Link-0ytX5jId.js";
14
- const Q = ({
16
+ const I = ({
15
17
  showAlertMessage: t,
16
- loader: p,
17
- registerInfo: e,
18
- setRegisterInfo: y,
19
- setCurrentStep: c,
20
- dispatch: N,
21
- validationError: l,
22
- storeName: k
18
+ loader: c,
19
+ registerInfo: r,
20
+ setRegisterInfo: N,
21
+ setCurrentStep: h,
22
+ dispatch: x,
23
+ validationError: m,
24
+ storeName: P
23
25
  }) => {
24
- const [s, C] = d(!1), [o, P] = d({
26
+ const [l, g] = d(!1), [o, k] = d({
25
27
  username: !1,
26
28
  firstName: !1,
27
29
  lastName: !1,
28
30
  phone: !1
29
- }), n = (a, h) => {
30
- a === "phone" && !/^\d*$/.test(h) || (y((i) => ({
31
+ }), n = (e, s) => {
32
+ e === "phone" && !/^\d*$/.test(s) || e === "username" && !L.test(s) || (N((i) => ({
31
33
  ...i,
32
- [a]: h
33
- })), P((i) => ({
34
+ [e]: s
35
+ })), k((i) => ({
34
36
  ...i,
35
- [a]: !0
37
+ [e]: !0
36
38
  })));
37
- }, g = (a) => {
38
- if (a.preventDefault(), !e.username)
39
+ }, C = (e) => {
40
+ if (e.preventDefault(), !r.username)
39
41
  return t({ message: "Please provide username." }), !1;
40
- if (!e.firstName)
42
+ if (!r.firstName)
41
43
  return t({ message: "Please provide your name." }), !1;
42
- if (!e.lastName)
44
+ if (!r.lastName)
43
45
  return t({ message: "Please provide your surname." }), !1;
44
- if (!e.phone)
46
+ if (!r.phone)
45
47
  return t({ message: "Please provide your mobile number." }), !1;
46
- if (!s)
48
+ if (!l)
47
49
  return t({ message: "Please accept the privacy terms." }), !1;
48
- c(3);
49
- }, x = () => {
50
- e.username && N(
51
- R({
52
- email: e.email,
53
- username: e.username,
54
- storename: k
50
+ h(3);
51
+ }, F = () => {
52
+ r.username && x(
53
+ S({
54
+ email: r.email,
55
+ username: r.username + b,
56
+ storename: P
55
57
  })
56
58
  );
57
59
  };
58
- return /* @__PURE__ */ u(F, { children: [
59
- /* @__PURE__ */ r(v, { variant: "lg", fontWeight: "500", children: "Add your personal information" }),
60
- /* @__PURE__ */ r(v, { variant: "sm", children: "Please, provide the following information:" }),
61
- /* @__PURE__ */ r(T, { component: "form", onSubmit: g, width: "100%", children: /* @__PURE__ */ u(b, { direction: "column", gap: 2, children: [
62
- /* @__PURE__ */ r(
63
- m,
60
+ return /* @__PURE__ */ u(R, { children: [
61
+ /* @__PURE__ */ a(v, { variant: "lg", fontWeight: "500", children: "Add your personal information" }),
62
+ /* @__PURE__ */ a(v, { variant: "sm", children: "Please, provide the following information:" }),
63
+ /* @__PURE__ */ a(W, { component: "form", onSubmit: C, width: "100%", children: /* @__PURE__ */ u(y, { direction: "column", gap: 2, children: [
64
+ /* @__PURE__ */ a(
65
+ T,
64
66
  {
65
- value: e.username,
67
+ suffix: b,
68
+ value: r.username,
66
69
  label: "Username",
67
70
  placeholder: "Create a username",
68
- onChange: (a) => n("username", a.target.value),
69
- onBlur: x,
70
- error: o.username && !e.username || !!l,
71
- errorText: l,
71
+ onChange: (e) => n("username", e.target.value),
72
+ onBlur: F,
73
+ error: o.username && !r.username || !!m,
74
+ errorText: m,
75
+ showInfoIcon: !0,
76
+ tooltipText: U,
72
77
  autoFocus: !0,
73
78
  fullWidth: !0
74
79
  }
75
80
  ),
76
- /* @__PURE__ */ r(
77
- m,
81
+ /* @__PURE__ */ a(
82
+ p,
78
83
  {
79
- value: e.firstName,
84
+ value: r.firstName,
80
85
  label: "First name",
81
86
  placeholder: "Enter your name",
82
- onChange: (a) => n("firstName", a.target.value),
83
- error: o.firstName && !e.firstName,
87
+ onChange: (e) => n("firstName", e.target.value),
88
+ error: o.firstName && !r.firstName,
84
89
  fullWidth: !0
85
90
  }
86
91
  ),
87
- /* @__PURE__ */ r(
88
- m,
92
+ /* @__PURE__ */ a(
93
+ p,
89
94
  {
90
- value: e.lastName,
95
+ value: r.lastName,
91
96
  label: "Last name",
92
97
  placeholder: "Enter your surname",
93
- onChange: (a) => n("lastName", a.target.value),
94
- error: o.lastName && !e.lastName,
98
+ onChange: (e) => n("lastName", e.target.value),
99
+ error: o.lastName && !r.lastName,
95
100
  fullWidth: !0
96
101
  }
97
102
  ),
98
- /* @__PURE__ */ r(
99
- m,
103
+ /* @__PURE__ */ a(
104
+ p,
100
105
  {
101
- value: e.phone,
106
+ value: r.phone,
102
107
  label: "Mobile number",
103
108
  placeholder: "Enter your mobile number",
104
- onChange: (a) => n("phone", a.target.value),
105
- error: o.phone && !e.phone,
109
+ onChange: (e) => n("phone", e.target.value),
110
+ error: o.phone && !r.phone,
106
111
  slotProps: {
107
112
  input: {
108
- startAdornment: /* @__PURE__ */ r(W, { position: "start", children: "+1" })
113
+ startAdornment: /* @__PURE__ */ a(E, { position: "start", children: "+1" })
109
114
  }
110
115
  }
111
116
  }
112
117
  ),
113
- /* @__PURE__ */ r(L, { error: !s, component: "fieldset", children: /* @__PURE__ */ r(
114
- S,
118
+ /* @__PURE__ */ a(B, { error: !l, component: "fieldset", children: /* @__PURE__ */ a(
119
+ w,
115
120
  {
116
- control: /* @__PURE__ */ r(
117
- B,
121
+ control: /* @__PURE__ */ a(
122
+ _,
118
123
  {
119
- checked: s,
120
- onChange: () => C((a) => !a),
124
+ checked: l,
125
+ onChange: () => g((e) => !e),
121
126
  color: "primary"
122
127
  }
123
128
  ),
124
129
  label: /* @__PURE__ */ u("span", { children: [
125
130
  "I accept the",
126
131
  " ",
127
- /* @__PURE__ */ r(
132
+ /* @__PURE__ */ a(
128
133
  j,
129
134
  {
130
135
  href: "https://www.rocket-ramp.com/page/privacy",
@@ -137,21 +142,21 @@ const Q = ({
137
142
  ] })
138
143
  }
139
144
  ) }),
140
- /* @__PURE__ */ r(
145
+ /* @__PURE__ */ a(
141
146
  f,
142
147
  {
143
148
  type: "submit",
144
149
  fullWidth: !0,
145
- disabled: !!l || p,
146
- isLoading: p,
150
+ disabled: !!m || c,
151
+ isLoading: c,
147
152
  children: "Submit"
148
153
  }
149
154
  ),
150
- /* @__PURE__ */ r(b, { direction: "row", alignItems: "flex-start", children: /* @__PURE__ */ r(
155
+ /* @__PURE__ */ a(y, { direction: "row", alignItems: "flex-start", children: /* @__PURE__ */ a(
151
156
  f,
152
157
  {
153
158
  isText: !0,
154
- onClick: () => c(1),
159
+ onClick: () => h(1),
155
160
  sx: { fontWeight: 500, padding: 0 },
156
161
  customSize: "small",
157
162
  children: "Go back and edit"
@@ -161,5 +166,5 @@ const Q = ({
161
166
  ] });
162
167
  };
163
168
  export {
164
- Q as default
169
+ I as default
165
170
  };
@@ -1,31 +1,31 @@
1
1
  import { jsxs as r, Fragment as R, jsx as t } from "react/jsx-runtime";
2
- import u from "../../Shared/Button/index.js";
2
+ import h from "../../Shared/Button/index.js";
3
3
  import P from "../../Shared/Input/index.js";
4
- import { useState as l, useEffect as f } from "react";
5
- import { RESEND_EMAIL_TIMER as p } from "../../../../util/constants.js";
4
+ import { useState as l, useEffect as u } from "react";
5
+ import { RESEND_EMAIL_TIMER as f } from "../../../../util/constants.js";
6
6
  import { T as a } from "../../../../Typography-Du8mj1kr.js";
7
7
  import { B as C } from "../../../../Box-Bt8cGqC7.js";
8
8
  import { S as d } from "../../../../Stack-Ce-OQAtj.js";
9
9
  const _ = ({
10
10
  showAlertMessage: o,
11
- loader: c,
11
+ loader: p,
12
12
  otpLoader: g,
13
13
  registerInfo: v,
14
14
  initVerifyRegister: y,
15
15
  initReSendOtp: E
16
16
  }) => {
17
- const [e, S] = l(""), [x, m] = l(!1), [n, h] = l(p);
18
- f(() => {
17
+ const [e, S] = l(""), [x, c] = l(!1), [n, m] = l(f);
18
+ u(() => {
19
19
  if (n === 0) return;
20
20
  const i = setInterval(() => {
21
- h((s) => s - 1);
21
+ m((s) => s - 1);
22
22
  }, 1e3);
23
23
  return () => clearInterval(i);
24
- }, [n]), f(() => {
25
- m(e ? e.length !== 6 : !1);
24
+ }, [n]), u(() => {
25
+ c(e ? e.length !== 6 : !1);
26
26
  }, [e]);
27
27
  const T = () => {
28
- E(), h(p), o({
28
+ E(), m(f), o({
29
29
  message: "A new OTP has been send to the given email address.",
30
30
  type: "success",
31
31
  duration: 6e3
@@ -70,7 +70,7 @@ const _ = ({
70
70
  b(n)
71
71
  ] }),
72
72
  /* @__PURE__ */ t(
73
- u,
73
+ h,
74
74
  {
75
75
  onClick: T,
76
76
  customSize: "medium",
@@ -83,12 +83,12 @@ const _ = ({
83
83
  )
84
84
  ] }),
85
85
  /* @__PURE__ */ t(d, { direction: "row", spacing: 2, justifyContent: "flex-end", children: /* @__PURE__ */ t(
86
- u,
86
+ h,
87
87
  {
88
88
  onClick: k,
89
89
  fullWidth: !0,
90
- disabled: !c,
91
- isLoading: c,
90
+ disabled: !e,
91
+ isLoading: p,
92
92
  children: "Confirm"
93
93
  }
94
94
  ) })
@@ -3,10 +3,16 @@ interface RocketRampInputProps extends Omit<InputProps, "onInvalid" | "onKeyDown
3
3
  label?: string;
4
4
  errorText?: string;
5
5
  helperText?: string;
6
+ showInfoIcon?: boolean;
7
+ tooltipText?: string;
6
8
  highlightedLabel?: boolean;
7
9
  backgroundColor?: string;
8
10
  labelFontWeight?: number;
9
11
  slotProps?: Record<string, any>;
10
12
  }
13
+ interface UserNameInputProps extends RocketRampInputProps {
14
+ suffix: string;
15
+ }
11
16
  declare const RocketRampInput: ({ label, highlightedLabel, error, errorText, helperText, backgroundColor, labelFontWeight, ...props }: RocketRampInputProps) => import("react/jsx-runtime").JSX.Element;
12
17
  export default RocketRampInput;
18
+ export declare const UserNameInputField: (props: UserNameInputProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,48 +1,87 @@
1
- import { jsxs as d, jsx as o } from "react/jsx-runtime";
1
+ import { jsxs as m, jsx as o } from "react/jsx-runtime";
2
+ import s from "../../../Shared/tooltip.js";
2
3
  import { F as c } from "../../../../FormControl-C_Aq5EJK.js";
3
- import { T as s, F as a } from "../../../../TextField-CWAqkoYU.js";
4
- const C = ({
4
+ import { I as x } from "../../../../IconButton-DS04obIe.js";
5
+ import { I as f } from "../../../../Info-DTcjrneu.js";
6
+ import { T as u, F as a } from "../../../../TextField-CWAqkoYU.js";
7
+ import { I } from "../../../../InputAdornment-HG4f5A6g.js";
8
+ const g = ({
5
9
  label: t,
6
- highlightedLabel: e,
7
- error: r,
8
- errorText: i,
9
- helperText: l,
10
- backgroundColor: u,
11
- labelFontWeight: n,
12
- ...m
13
- }) => /* @__PURE__ */ d(c, { fullWidth: !0, variant: "outlined", error: r, children: [
14
- t && /* @__PURE__ */ d(
10
+ highlightedLabel: i,
11
+ error: n,
12
+ errorText: e,
13
+ helperText: d,
14
+ backgroundColor: p,
15
+ labelFontWeight: l,
16
+ ...r
17
+ }) => /* @__PURE__ */ m(c, { fullWidth: !0, variant: "outlined", error: n, children: [
18
+ t && /* @__PURE__ */ m(
15
19
  "label",
16
20
  {
17
21
  style: {
18
- fontSize: e ? "1.125rem" : "0.75rem",
19
- fontWeight: n || 400,
20
- color: e ? "black" : "#1A202C",
22
+ fontSize: i ? "1.125rem" : "0.75rem",
23
+ fontWeight: l || 400,
24
+ color: i ? "black" : "#1A202C",
21
25
  marginBottom: "0.2rem"
22
26
  },
23
27
  children: [
24
28
  t,
25
29
  " ",
26
- m.required ? "*" : null
30
+ r.required ? "*" : null,
31
+ r.showInfoIcon && /* @__PURE__ */ o(s, { title: r.tooltipText, placement: "top", children: /* @__PURE__ */ o(
32
+ x,
33
+ {
34
+ className: "info-fee-icon",
35
+ sx: { padding: 0, paddingLeft: "5px", paddingBottom: "3px" },
36
+ children: /* @__PURE__ */ o(f, { style: { fontSize: "14px" } })
37
+ }
38
+ ) })
27
39
  ]
28
40
  }
29
41
  ),
30
42
  /* @__PURE__ */ o(
31
- s,
43
+ u,
32
44
  {
33
45
  variant: "outlined",
34
46
  fullWidth: !0,
35
47
  sx: {
36
- backgroundColor: u ?? "white",
37
- borderColor: r ? "red" : "#1A202C"
48
+ backgroundColor: p ?? "white",
49
+ borderColor: n ? "red" : "#1A202C"
38
50
  },
39
- error: r,
40
- ...m
51
+ error: n,
52
+ ...r
41
53
  }
42
54
  ),
43
- i && /* @__PURE__ */ o(a, { sx: { color: "red", margin: "5px 0px" }, children: i }),
44
- l && /* @__PURE__ */ o(a, { sx: { color: "#718096", margin: "5px 0px" }, children: l })
45
- ] });
55
+ e && /* @__PURE__ */ o(a, { sx: { color: "red", margin: "5px 0px" }, children: e }),
56
+ d && /* @__PURE__ */ o(a, { sx: { color: "#718096", margin: "5px 0px" }, children: d })
57
+ ] }), B = (t) => /* @__PURE__ */ o(
58
+ g,
59
+ {
60
+ ...t,
61
+ slotProps: {
62
+ input: {
63
+ sx: {
64
+ padding: 0
65
+ },
66
+ endAdornment: /* @__PURE__ */ o(
67
+ I,
68
+ {
69
+ sx: {
70
+ backgroundColor: "#f0f0f0",
71
+ border: "1px solid #ccc",
72
+ padding: "27px 15px",
73
+ borderRadius: "0 4px 4px 0",
74
+ marginRight: "0px"
75
+ },
76
+ position: "start",
77
+ children: t.suffix
78
+ }
79
+ )
80
+ }
81
+ }
82
+ }
83
+ );
46
84
  export {
47
- C as default
85
+ B as UserNameInputField,
86
+ g as default
48
87
  };