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,79 +1,80 @@
1
- import { jsxs as i, Fragment as T, jsx as r } from "react/jsx-runtime";
1
+ import { jsxs as s, Fragment as S, jsx as r } from "react/jsx-runtime";
2
2
  import { useState as b } from "react";
3
- import g from "../../Shared/Button/index.js";
4
- import s from "../../Shared/Input/index.js";
3
+ import T from "../../Shared/Button/index.js";
4
+ import i from "../../Shared/Input/index.js";
5
5
  import "../../../../constants-74hrsFxy.js";
6
- import { f as v } from "../../../../auth-CD4Ih2jU.js";
6
+ import { f as y } from "../../../../auth-CD4Ih2jU.js";
7
7
  import { generateRandomString as B, isValidEmail as L } from "../../../../util/functions.js";
8
- import { T as y } from "../../../../Typography-Du8mj1kr.js";
9
- import { B as W } from "../../../../Box-Bt8cGqC7.js";
10
- import { S as j } from "../../../../Stack-Ce-OQAtj.js";
11
- import { I as F } from "../../../../InputAdornment-HG4f5A6g.js";
12
- import { F as E } from "../../../../FormControl-C_Aq5EJK.js";
13
- import { F as q, C as D } from "../../../../FormControlLabel-DzW2M9Zf.js";
14
- import { L as V } from "../../../../Link-0ytX5jId.js";
15
- const A = ({
16
- showAlertMessage: o,
17
- loader: c,
8
+ import { userNameRegex as W } from "../../../../util/regex.js";
9
+ import { T as v } from "../../../../Typography-Du8mj1kr.js";
10
+ import { B as j } from "../../../../Box-Bt8cGqC7.js";
11
+ import { S as F } from "../../../../Stack-Ce-OQAtj.js";
12
+ import { I as E } from "../../../../InputAdornment-HG4f5A6g.js";
13
+ import { F as q } from "../../../../FormControl-C_Aq5EJK.js";
14
+ import { F as D, C as V } from "../../../../FormControlLabel-DzW2M9Zf.js";
15
+ import { L as _ } from "../../../../Link-0ytX5jId.js";
16
+ const I = ({
17
+ showAlertMessage: t,
18
+ loader: h,
18
19
  registerInfo: e,
19
20
  setRegisterInfo: N,
20
21
  setCurrentStep: P,
21
- dispatch: h,
22
- validationError: t,
22
+ dispatch: f,
23
+ validationError: o,
23
24
  validationField: m
24
25
  }) => {
25
- const d = B(), [p, C] = b(!1), [l, k] = b({
26
+ const d = B(), [p, x] = b(!1), [l, C] = b({
26
27
  firstName: !1,
27
28
  lastName: !1,
28
29
  phone: !1,
29
30
  email: !1
30
- }), n = (a, f) => {
31
- a === "phone" && !/^\d*$/.test(f) || (N((u) => ({
32
- ...u,
33
- [a]: f
34
- })), k((u) => ({
35
- ...u,
31
+ }), n = (a, u) => {
32
+ a === "phone" && !/^\d*$/.test(u) || a === "username" && !W.test(u) || (N((c) => ({
33
+ ...c,
34
+ [a]: u
35
+ })), C((c) => ({
36
+ ...c,
36
37
  [a]: !0
37
38
  })));
38
- }, x = (a) => {
39
+ }, k = (a) => {
39
40
  if (a.preventDefault(), !e.firstName)
40
- return o({ message: "Please provide your name." }), !1;
41
+ return t({ message: "Please provide your name." }), !1;
41
42
  if (!e.lastName)
42
- return o({ message: "Please provide your surname." }), !1;
43
+ return t({ message: "Please provide your surname." }), !1;
43
44
  if (!e.phone)
44
- return o({ message: "Please provide your mobile number." }), !1;
45
+ return t({ message: "Please provide your mobile number." }), !1;
45
46
  if (!e.email)
46
- return o({ message: "Please provide email address." }), !1;
47
+ return t({ message: "Please provide email address." }), !1;
47
48
  if (!L(e.email))
48
- return o({ message: "Please provide valid email address." }), !1;
49
+ return t({ message: "Please provide valid email address." }), !1;
49
50
  if (!p)
50
- return o({ message: "Please accept the privacy terms." }), !1;
51
+ return t({ message: "Please accept the privacy terms." }), !1;
51
52
  P(2);
52
53
  }, R = () => {
53
- e.phone && h(
54
- v({
54
+ e.phone && f(
55
+ y({
55
56
  phone: "+1" + e.phone,
56
57
  storename: d
57
58
  })
58
59
  );
59
- }, S = () => {
60
- e.email && h(
61
- v({
60
+ }, g = () => {
61
+ e.email && f(
62
+ y({
62
63
  email: e.email,
63
64
  storename: d
64
65
  })
65
66
  );
66
67
  };
67
- return /* @__PURE__ */ i(T, { children: [
68
- /* @__PURE__ */ i(y, { variant: "3xl", fontWeight: "bold", children: [
68
+ return /* @__PURE__ */ s(S, { children: [
69
+ /* @__PURE__ */ s(v, { variant: "3xl", fontWeight: "bold", children: [
69
70
  "Ready to join us?",
70
71
  /* @__PURE__ */ r("br", {}),
71
72
  "Tell us about yourself"
72
73
  ] }),
73
- /* @__PURE__ */ r(y, { variant: "sm", children: "Please, provide the following information:" }),
74
- /* @__PURE__ */ r(W, { component: "form", onSubmit: x, width: "100%", children: /* @__PURE__ */ i(j, { direction: "column", gap: 2, children: [
74
+ /* @__PURE__ */ r(v, { variant: "sm", children: "Please, provide the following information:" }),
75
+ /* @__PURE__ */ r(j, { component: "form", onSubmit: k, width: "100%", children: /* @__PURE__ */ s(F, { direction: "column", gap: 2, children: [
75
76
  /* @__PURE__ */ r(
76
- s,
77
+ i,
77
78
  {
78
79
  value: e.firstName,
79
80
  label: "First name",
@@ -84,7 +85,7 @@ const A = ({
84
85
  }
85
86
  ),
86
87
  /* @__PURE__ */ r(
87
- s,
88
+ i,
88
89
  {
89
90
  value: e.lastName,
90
91
  label: "Last name",
@@ -95,50 +96,50 @@ const A = ({
95
96
  }
96
97
  ),
97
98
  /* @__PURE__ */ r(
98
- s,
99
+ i,
99
100
  {
100
101
  value: e.phone,
101
102
  label: "Mobile number",
102
103
  placeholder: "Enter your mobile number",
103
104
  onChange: (a) => n("phone", a.target.value),
104
105
  onBlur: R,
105
- error: l.phone && !e.phone || m === "phone" && !!t,
106
- errorText: m === "phone" ? t : "",
106
+ error: l.phone && !e.phone || m === "phone" && !!o,
107
+ errorText: m === "phone" ? o : "",
107
108
  slotProps: {
108
109
  input: {
109
- startAdornment: /* @__PURE__ */ r(F, { position: "start", children: "+1" })
110
+ startAdornment: /* @__PURE__ */ r(E, { position: "start", children: "+1" })
110
111
  }
111
112
  }
112
113
  }
113
114
  ),
114
115
  /* @__PURE__ */ r(
115
- s,
116
+ i,
116
117
  {
117
118
  value: e.email,
118
119
  label: "E-mail address",
119
120
  onChange: (a) => n("email", a.target.value),
120
- onBlur: S,
121
- error: l.email && !e.email || m === "email" && !!t,
122
- errorText: m === "email" ? t : "",
121
+ onBlur: g,
122
+ error: l.email && !e.email || m === "email" && !!o,
123
+ errorText: m === "email" ? o : "",
123
124
  fullWidth: !0
124
125
  }
125
126
  ),
126
- /* @__PURE__ */ r(E, { error: !p, component: "fieldset", children: /* @__PURE__ */ r(
127
- q,
127
+ /* @__PURE__ */ r(q, { error: !p, component: "fieldset", children: /* @__PURE__ */ r(
128
+ D,
128
129
  {
129
130
  control: /* @__PURE__ */ r(
130
- D,
131
+ V,
131
132
  {
132
133
  checked: p,
133
- onChange: () => C((a) => !a),
134
+ onChange: () => x((a) => !a),
134
135
  color: "primary"
135
136
  }
136
137
  ),
137
- label: /* @__PURE__ */ i("span", { children: [
138
+ label: /* @__PURE__ */ s("span", { children: [
138
139
  "I accept the",
139
140
  " ",
140
141
  /* @__PURE__ */ r(
141
- V,
142
+ _,
142
143
  {
143
144
  href: "https://www.rocket-ramp.com/page/privacy",
144
145
  target: "_blank",
@@ -151,12 +152,12 @@ const A = ({
151
152
  }
152
153
  ) }),
153
154
  /* @__PURE__ */ r(
154
- g,
155
+ T,
155
156
  {
156
157
  type: "submit",
157
158
  fullWidth: !0,
158
- disabled: !!t || c,
159
- isLoading: c,
159
+ disabled: !!o || h,
160
+ isLoading: h,
160
161
  children: "Next"
161
162
  }
162
163
  )
@@ -164,5 +165,5 @@ const A = ({
164
165
  ] });
165
166
  };
166
167
  export {
167
- A as default
168
+ I as default
168
169
  };
@@ -1,24 +1,26 @@
1
- import { jsxs as l, Fragment as N, jsx as e } from "react/jsx-runtime";
2
- import { useState as v } from "react";
3
- import d from "../../Shared/Button/index.js";
4
- import n from "../../Shared/Input/index.js";
1
+ import { jsxs as d, Fragment as y, jsx as e } from "react/jsx-runtime";
2
+ import { useState as c } from "react";
3
+ import p from "../../Shared/Button/index.js";
4
+ import u, { UserNameInputField as C } from "../../Shared/Input/index.js";
5
5
  import "../../../../constants-74hrsFxy.js";
6
- import { f as R } from "../../../../auth-CD4Ih2jU.js";
7
- import { T as c } from "../../../../Typography-Du8mj1kr.js";
8
- import { A as k } from "../../../../Alert-D1uo0xUN.js";
9
- import { B as y } from "../../../../Box-Bt8cGqC7.js";
10
- import { S as p } from "../../../../Stack-Ce-OQAtj.js";
11
- import { I as u } from "../../../../InputAdornment-HG4f5A6g.js";
12
- const z = ({
6
+ import { f as k } from "../../../../auth-CD4Ih2jU.js";
7
+ import { USERNAME_SUFFIX as w, USERNAME_TOOLTIP as T } from "../../../../util/constants.js";
8
+ import { storeNameOnChangeRegex as P, storeNameRegex as U } from "../../../../util/regex.js";
9
+ import { T as f } from "../../../../Typography-Du8mj1kr.js";
10
+ import { A } from "../../../../Alert-D1uo0xUN.js";
11
+ import { B as L } from "../../../../Box-Bt8cGqC7.js";
12
+ import { S as h } from "../../../../Stack-Ce-OQAtj.js";
13
+ import { I as x } from "../../../../InputAdornment-HG4f5A6g.js";
14
+ const Y = ({
13
15
  showAlertMessage: a,
14
16
  loader: m,
15
- validationError: i,
17
+ validationError: n,
16
18
  registerInfo: t,
17
- setRegisterInfo: f,
18
- dispatch: h,
19
- setCurrentStep: s
19
+ setRegisterInfo: N,
20
+ dispatch: S,
21
+ setCurrentStep: i
20
22
  }) => {
21
- const [o, x] = v(""), b = (r) => {
23
+ const [o, g] = c(""), [s, l] = c(""), b = (r) => {
22
24
  if (r.preventDefault(), !t.storeName)
23
25
  return a({ message: "Please provide store name." }), !1;
24
26
  if (!o)
@@ -27,39 +29,45 @@ const z = ({
27
29
  return a({
28
30
  message: "Store Name & Confirm Store Name doesn't match."
29
31
  }), !1;
30
- s(3);
31
- }, g = () => {
32
- t.storeName && h(
33
- R({
32
+ i(3);
33
+ }, v = () => {
34
+ l(""), t.storeName && U.test(t.storeName) ? S(
35
+ k({
34
36
  storename: t.storeName
35
37
  })
38
+ ) : l(
39
+ "Store name may contain only lowercase letters, numbers, and underscores"
36
40
  );
37
41
  };
38
- return /* @__PURE__ */ l(N, { children: [
39
- /* @__PURE__ */ e(c, { variant: "lg", fontWeight: "bold", children: "Create a name for your store to activate it." }),
40
- /* @__PURE__ */ e(c, { variant: "sm", children: "You need to create your Store name, which will be visible to your customers and will appear in the URL link of your e-commerce." }),
41
- /* @__PURE__ */ e(k, { severity: "info", children: "Please note that you won't be able to change your store name." }),
42
- /* @__PURE__ */ e(y, { component: "form", onSubmit: b, width: "100%", children: /* @__PURE__ */ l(p, { direction: "column", gap: 2, children: [
42
+ return /* @__PURE__ */ d(y, { children: [
43
+ /* @__PURE__ */ e(f, { variant: "lg", fontWeight: "bold", children: "Create a name for your store to activate it." }),
44
+ /* @__PURE__ */ e(f, { variant: "sm", children: "You need to create your Store name, which will be visible to your customers and will appear in the URL link of your e-commerce." }),
45
+ /* @__PURE__ */ e(A, { severity: "info", children: "Please note that you won't be able to change your store name." }),
46
+ /* @__PURE__ */ e(L, { component: "form", onSubmit: b, width: "100%", children: /* @__PURE__ */ d(h, { direction: "column", gap: 2, children: [
43
47
  /* @__PURE__ */ e(
44
- n,
48
+ C,
45
49
  {
50
+ suffix: w,
51
+ showInfoIcon: !0,
52
+ tooltipText: T,
46
53
  value: t.storeName,
47
54
  label: "Store Name",
48
- placeholder: "Store Name",
49
- onBlur: g,
50
- onChange: (r) => f((S) => ({
51
- ...S,
52
- storeName: r.target.value
53
- })),
54
- error: !!i,
55
- errorText: i,
55
+ onBlur: v,
56
+ onChange: (r) => {
57
+ P.test(r.target.value) && N((R) => ({
58
+ ...R,
59
+ storeName: r.target.value
60
+ }));
61
+ },
62
+ error: !!n || !!s,
63
+ errorText: n || s,
56
64
  fullWidth: !0
57
65
  }
58
66
  ),
59
67
  /* @__PURE__ */ e(
60
- n,
68
+ u,
61
69
  {
62
- value: t.storeName,
70
+ value: t.storeName.toLowerCase(),
63
71
  label: "Store URL Preview",
64
72
  slotProps: {
65
73
  input: {
@@ -67,7 +75,7 @@ const z = ({
67
75
  padding: 0
68
76
  },
69
77
  startAdornment: /* @__PURE__ */ e(
70
- u,
78
+ x,
71
79
  {
72
80
  sx: {
73
81
  backgroundColor: "#f0f0f0",
@@ -80,7 +88,7 @@ const z = ({
80
88
  }
81
89
  ),
82
90
  endAdornment: /* @__PURE__ */ e(
83
- u,
91
+ x,
84
92
  {
85
93
  sx: {
86
94
  backgroundColor: "#f0f0f0",
@@ -100,29 +108,29 @@ const z = ({
100
108
  }
101
109
  ),
102
110
  /* @__PURE__ */ e(
103
- n,
111
+ u,
104
112
  {
105
113
  value: o,
106
114
  label: "Confirm Store Name",
107
115
  placeholder: "Confirm Store Name",
108
- onChange: (r) => x(r.target.value),
116
+ onChange: (r) => g(r.target.value),
109
117
  fullWidth: !0
110
118
  }
111
119
  ),
112
120
  /* @__PURE__ */ e(
113
- d,
121
+ p,
114
122
  {
115
123
  type: "submit",
116
- disabled: !t.storeName || !o || !!i || m,
124
+ disabled: !t.storeName || !o || !!n || m,
117
125
  isLoading: m,
118
126
  children: "Next"
119
127
  }
120
128
  ),
121
- /* @__PURE__ */ e(p, { direction: "row", alignItems: "flex-start", children: /* @__PURE__ */ e(
122
- d,
129
+ /* @__PURE__ */ e(h, { direction: "row", alignItems: "flex-start", children: /* @__PURE__ */ e(
130
+ p,
123
131
  {
124
132
  isText: !0,
125
- onClick: () => s(1),
133
+ onClick: () => i(1),
126
134
  sx: { fontWeight: 500, padding: 0 },
127
135
  customSize: "small",
128
136
  children: "Go back and edit"
@@ -132,5 +140,5 @@ const z = ({
132
140
  ] });
133
141
  };
134
142
  export {
135
- z as default
143
+ Y as default
136
144
  };