@nubase/frontend 0.1.18 → 0.1.19

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/dist/index.js CHANGED
@@ -15917,7 +15917,8 @@ function SignInScreen() {
15917
15917
  {
15918
15918
  name: "email",
15919
15919
  validators: {
15920
- onBlur: ({ value }) => !value ? "Email is required" : void 0
15920
+ onBlur: ({ value }) => !value ? "Email is required" : void 0,
15921
+ onChange: ({ value }) => !value ? "Email is required" : void 0
15921
15922
  },
15922
15923
  children: (field) => /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(FormControl, { label: "Email", required: true, field, children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
15923
15924
  TextInput,
@@ -15927,6 +15928,7 @@ function SignInScreen() {
15927
15928
  placeholder: "Enter your email",
15928
15929
  value: field.state.value,
15929
15930
  onChange: (e) => field.handleChange(e.target.value),
15931
+ onInput: (e) => field.handleChange(e.target.value),
15930
15932
  onBlur: field.handleBlur,
15931
15933
  autoComplete: "email",
15932
15934
  disabled: isLoading,
@@ -15940,7 +15942,8 @@ function SignInScreen() {
15940
15942
  {
15941
15943
  name: "password",
15942
15944
  validators: {
15943
- onBlur: ({ value }) => !value ? "Password is required" : void 0
15945
+ onBlur: ({ value }) => !value ? "Password is required" : void 0,
15946
+ onChange: ({ value }) => !value ? "Password is required" : void 0
15944
15947
  },
15945
15948
  children: (field) => /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(FormControl, { label: "Password", required: true, field, children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
15946
15949
  TextInput,
@@ -15950,6 +15953,7 @@ function SignInScreen() {
15950
15953
  placeholder: "Enter your password",
15951
15954
  value: field.state.value,
15952
15955
  onChange: (e) => field.handleChange(e.target.value),
15956
+ onInput: (e) => field.handleChange(e.target.value),
15953
15957
  onBlur: field.handleBlur,
15954
15958
  autoComplete: "current-password",
15955
15959
  disabled: isLoading,
@@ -16123,6 +16127,13 @@ function SignUpScreen() {
16123
16127
  return "Please enter a valid email address";
16124
16128
  }
16125
16129
  return void 0;
16130
+ },
16131
+ onChange: ({ value }) => {
16132
+ if (!value) return "Email is required";
16133
+ if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value)) {
16134
+ return "Please enter a valid email address";
16135
+ }
16136
+ return void 0;
16126
16137
  }
16127
16138
  },
16128
16139
  children: (field) => /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(FormControl, { label: "Email", required: true, field, children: /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
@@ -16133,6 +16144,7 @@ function SignUpScreen() {
16133
16144
  placeholder: "Enter your email",
16134
16145
  value: field.state.value,
16135
16146
  onChange: (e) => field.handleChange(e.target.value),
16147
+ onInput: (e) => field.handleChange(e.target.value),
16136
16148
  onBlur: field.handleBlur,
16137
16149
  autoComplete: "email",
16138
16150
  disabled: isLoading,
@@ -16175,6 +16187,13 @@ function SignUpScreen() {
16175
16187
  return "Password must be at least 8 characters";
16176
16188
  }
16177
16189
  return void 0;
16190
+ },
16191
+ onChange: ({ value }) => {
16192
+ if (!value) return "Password is required";
16193
+ if (value.length < 8) {
16194
+ return "Password must be at least 8 characters";
16195
+ }
16196
+ return void 0;
16178
16197
  }
16179
16198
  },
16180
16199
  children: (field) => /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(FormControl, { label: "Password", required: true, field, children: /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
@@ -16185,6 +16204,7 @@ function SignUpScreen() {
16185
16204
  placeholder: "Enter your password",
16186
16205
  value: field.state.value,
16187
16206
  onChange: (e) => field.handleChange(e.target.value),
16207
+ onInput: (e) => field.handleChange(e.target.value),
16188
16208
  onBlur: field.handleBlur,
16189
16209
  autoComplete: "new-password",
16190
16210
  disabled: isLoading,
@@ -16203,6 +16223,12 @@ function SignUpScreen() {
16203
16223
  if (!value) return "Please confirm your password";
16204
16224
  if (value !== password) return "Passwords do not match";
16205
16225
  return void 0;
16226
+ },
16227
+ onChange: ({ value, fieldApi }) => {
16228
+ const password = fieldApi.form.getFieldValue("password");
16229
+ if (!value) return "Please confirm your password";
16230
+ if (value !== password) return "Passwords do not match";
16231
+ return void 0;
16206
16232
  }
16207
16233
  },
16208
16234
  children: (field) => /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(FormControl, { label: "Confirm Password", required: true, field, children: /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
@@ -16213,6 +16239,7 @@ function SignUpScreen() {
16213
16239
  placeholder: "Confirm your password",
16214
16240
  value: field.state.value,
16215
16241
  onChange: (e) => field.handleChange(e.target.value),
16242
+ onInput: (e) => field.handleChange(e.target.value),
16216
16243
  onBlur: field.handleBlur,
16217
16244
  autoComplete: "new-password",
16218
16245
  disabled: isLoading,