@sikka/hawa 0.10.16-next → 0.10.17

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.d.mts CHANGED
@@ -1053,6 +1053,7 @@ type RegisterFormTypes = {
1053
1053
  emailInvalidText: string;
1054
1054
  usernameLabel: string;
1055
1055
  usernamePlaceholder: string;
1056
+ usernameInvalid: string;
1056
1057
  usernameRequired: string;
1057
1058
  passwordLabel: string;
1058
1059
  passwordPlaceholder: string;
package/dist/index.d.ts CHANGED
@@ -1053,6 +1053,7 @@ type RegisterFormTypes = {
1053
1053
  emailInvalidText: string;
1054
1054
  usernameLabel: string;
1055
1055
  usernamePlaceholder: string;
1056
+ usernameInvalid: string;
1056
1057
  usernameRequired: string;
1057
1058
  passwordLabel: string;
1058
1059
  passwordPlaceholder: string;
package/dist/index.js CHANGED
@@ -7119,10 +7119,13 @@ var RegisterForm = function(_param) {
7119
7119
  case "username":
7120
7120
  fieldSchemas["username"] = z2.string({
7121
7121
  required_error: texts === null || texts === void 0 ? void 0 : texts.usernameRequired
7122
+ }).min(1, {
7123
+ message: texts === null || texts === void 0 ? void 0 : texts.usernameRequired
7122
7124
  }).refine(function(value) {
7123
- return value !== "";
7125
+ var isValid = /^[a-zA-Z][a-zA-Z0-9_-]{2,14}$/.test(value);
7126
+ return isValid;
7124
7127
  }, {
7125
- message: texts === null || texts === void 0 ? void 0 : texts.usernameRequired
7128
+ message: texts === null || texts === void 0 ? void 0 : texts.usernameInvalid
7126
7129
  });
7127
7130
  break;
7128
7131
  }
package/dist/index.mjs CHANGED
@@ -7004,9 +7004,13 @@ var RegisterForm = ({ texts, ...props }) => {
7004
7004
  fieldSchemas["email"] = z2.string({ required_error: texts?.emailRequiredText }).email({ message: texts?.emailInvalidText }).min(1, { message: texts?.emailRequiredText });
7005
7005
  break;
7006
7006
  case "username":
7007
- fieldSchemas["username"] = z2.string({ required_error: texts?.usernameRequired }).refine((value) => value !== "", {
7008
- message: texts?.usernameRequired
7009
- });
7007
+ fieldSchemas["username"] = z2.string({ required_error: texts?.usernameRequired }).min(1, { message: texts?.usernameRequired }).refine(
7008
+ (value) => {
7009
+ const isValid = /^[a-zA-Z][a-zA-Z0-9_-]{2,14}$/.test(value);
7010
+ return isValid;
7011
+ },
7012
+ { message: texts?.usernameInvalid }
7013
+ );
7010
7014
  break;
7011
7015
  }
7012
7016
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sikka/hawa",
3
- "version": "0.10.16-next",
3
+ "version": "0.10.17",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "exports": {
@@ -84,4 +84,4 @@
84
84
  "tailwindcss-animate": "^1.0.7",
85
85
  "tsup": "^7.2.0"
86
86
  }
87
- }
87
+ }