@structured-id/ui-core 1.1.0 → 1.2.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@structured-id/ui-core",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -73,6 +73,7 @@
73
73
  :disable="loading"
74
74
  :label="identifierLabel"
75
75
  :lazy-rules="false"
76
+ :min-username-length="usernameMinLength"
76
77
  @update:principal-type="principalType = $event"
77
78
  />
78
79
 
@@ -215,6 +216,9 @@ const props = withDefaults(
215
216
  passwordMinLength?: number;
216
217
  /** Show confirm-password field with match validation. Default true. */
217
218
  showConfirmPassword?: boolean;
219
+ /** Min username length. Registration default 6 (premium feature gating);
220
+ * login flow can pass 3 since short usernames are valid post-registration. */
221
+ usernameMinLength?: number;
218
222
  }>(),
219
223
  {
220
224
  title: "Create account",
@@ -240,6 +244,7 @@ const props = withDefaults(
240
244
  inviteRequired: false,
241
245
  initialInviteCode: "",
242
246
  showConfirmPassword: true,
247
+ usernameMinLength: 6,
243
248
  },
244
249
  );
245
250
 
@@ -298,7 +303,10 @@ async function onSubmit() {
298
303
  error.value = null;
299
304
 
300
305
  try {
301
- const normalized = normalizePrincipal(identifier.value);
306
+ const normalized = normalizePrincipal(
307
+ identifier.value,
308
+ props.usernameMinLength,
309
+ );
302
310
  await props.registerFn(
303
311
  normalized.value,
304
312
  password.value,