@mesob/auth-react 0.3.3 → 0.3.5

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.
Files changed (43) hide show
  1. package/dist/components/auth/auth-layout.d.ts +1 -1
  2. package/dist/components/auth/auth-layout.js +10 -2
  3. package/dist/components/auth/auth-layout.js.map +1 -1
  4. package/dist/components/auth/countdown.js +8 -6
  5. package/dist/components/auth/countdown.js.map +1 -1
  6. package/dist/components/auth/forgot-password.js +16 -18
  7. package/dist/components/auth/forgot-password.js.map +1 -1
  8. package/dist/components/auth/reset-password-form.js +17 -20
  9. package/dist/components/auth/reset-password-form.js.map +1 -1
  10. package/dist/components/auth/sign-in.js +23 -25
  11. package/dist/components/auth/sign-in.js.map +1 -1
  12. package/dist/components/auth/sign-up.js +18 -24
  13. package/dist/components/auth/sign-up.js.map +1 -1
  14. package/dist/components/auth/verification-form.js +24 -27
  15. package/dist/components/auth/verification-form.js.map +1 -1
  16. package/dist/components/auth/verify-email.js +35 -30
  17. package/dist/components/auth/verify-email.js.map +1 -1
  18. package/dist/components/auth/verify-phone.js +35 -30
  19. package/dist/components/auth/verify-phone.js.map +1 -1
  20. package/dist/components/error-boundary.d.ts +2 -2
  21. package/dist/components/iam/permissions.js +9 -2
  22. package/dist/components/iam/permissions.js.map +1 -1
  23. package/dist/components/iam/roles.js +9 -2
  24. package/dist/components/iam/roles.js.map +1 -1
  25. package/dist/components/iam/tenants.js +9 -2
  26. package/dist/components/iam/tenants.js.map +1 -1
  27. package/dist/components/iam/users.js +9 -2
  28. package/dist/components/iam/users.js.map +1 -1
  29. package/dist/components/profile/change-email-form.js +26 -29
  30. package/dist/components/profile/change-email-form.js.map +1 -1
  31. package/dist/components/profile/change-phone-form.js +26 -29
  32. package/dist/components/profile/change-phone-form.js.map +1 -1
  33. package/dist/components/profile/otp-verification-modal.js +24 -27
  34. package/dist/components/profile/otp-verification-modal.js.map +1 -1
  35. package/dist/components/profile/security.js +38 -41
  36. package/dist/components/profile/security.js.map +1 -1
  37. package/dist/components/profile/verify-change-email-form.js +24 -27
  38. package/dist/components/profile/verify-change-email-form.js.map +1 -1
  39. package/dist/components/profile/verify-change-phone-form.js +24 -27
  40. package/dist/components/profile/verify-change-phone-form.js.map +1 -1
  41. package/dist/index.js +147 -159
  42. package/dist/index.js.map +1 -1
  43. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -20,8 +20,7 @@ import {
20
20
  FormItem,
21
21
  FormLabel,
22
22
  FormMessage,
23
- Input,
24
- Spinner
23
+ Input
25
24
  } from "@mesob/ui/components";
26
25
  import { useMesob as useMesob2 } from "@mesob/ui/providers";
27
26
  import { IconAlertCircle } from "@tabler/icons-react";
@@ -440,13 +439,21 @@ var AuthLayout = ({
440
439
  logoImage
441
440
  }) => {
442
441
  return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
443
- /* @__PURE__ */ jsx3("div", { className: "flex size-8 mb-6 w-full items-center justify-center rounded-md", children: /* @__PURE__ */ jsx3("img", { src: logoImage || "", alt: "Mesob", width: 42, height: 42 }) }),
442
+ /* @__PURE__ */ jsx3("div", { className: "flex size-8 mb-6 w-full items-center justify-center rounded-md", children: /* @__PURE__ */ jsx3(
443
+ "img",
444
+ {
445
+ src: logoImage || "",
446
+ alt: title,
447
+ width: 42,
448
+ height: 42
449
+ }
450
+ ) }),
444
451
  /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
445
452
  /* @__PURE__ */ jsx3("h1", { className: "text-2xl font-bold tracking-tight", children: title }),
446
453
  description && /* @__PURE__ */ jsx3("p", { className: "mt-2 text-sm text-muted-foreground", children: description })
447
454
  ] }),
448
455
  children,
449
- /* @__PURE__ */ jsx3("div", { className: "mt-2 w-full", children: footer && /* @__PURE__ */ jsx3("div", { className: "w-full text-center text-sm text-muted-foreground", children: footer }) })
456
+ footer && /* @__PURE__ */ jsx3("div", { className: "mt-2 w-full", children: /* @__PURE__ */ jsx3("div", { className: "w-full text-center text-sm text-muted-foreground", children: footer }) })
450
457
  ] });
451
458
  };
452
459
 
@@ -517,7 +524,7 @@ var ForgotPassword = () => {
517
524
  return /* @__PURE__ */ jsxs2(
518
525
  AuthLayout,
519
526
  {
520
- title: t("title"),
527
+ title: config.ui.name,
521
528
  description: t("description"),
522
529
  logoImage,
523
530
  footer: Link ? /* @__PURE__ */ jsx4(Link, { href: signInLink, className: "text-primary hover:underline", children: t("footer.backToSignIn") }) : /* @__PURE__ */ jsx4(
@@ -547,29 +554,20 @@ var ForgotPassword = () => {
547
554
  name: "account",
548
555
  render: ({ field }) => /* @__PURE__ */ jsxs2(FormItem, { children: [
549
556
  /* @__PURE__ */ jsx4(FormLabel, { children: t("form.accountLabel") }),
550
- /* @__PURE__ */ jsx4(FormControl, { children: /* @__PURE__ */ jsx4(
551
- Input,
552
- {
553
- ...field,
554
- type: "text",
555
- placeholder: t("form.accountPlaceholder")
556
- }
557
- ) }),
557
+ /* @__PURE__ */ jsx4(FormControl, { children: /* @__PURE__ */ jsx4(Input, { ...field, type: "text" }) }),
558
558
  /* @__PURE__ */ jsx4(FormMessage, {})
559
559
  ] })
560
560
  }
561
561
  ),
562
- /* @__PURE__ */ jsxs2(
562
+ /* @__PURE__ */ jsx4(
563
563
  Button,
564
564
  {
565
565
  type: "submit",
566
566
  form: "forgot-password-form",
567
567
  className: "w-full",
568
568
  disabled: isLoading || forgotPasswordMutation.isPending,
569
- children: [
570
- isLoading || forgotPasswordMutation.isPending && /* @__PURE__ */ jsx4(Spinner, {}),
571
- isLoading || forgotPasswordMutation.isPending ? t("form.submitting") : t("form.submit")
572
- ]
569
+ loading: isLoading || forgotPasswordMutation.isPending,
570
+ children: isLoading || forgotPasswordMutation.isPending ? t("form.submitting") : t("form.submit")
573
571
  }
574
572
  )
575
573
  ]
@@ -602,7 +600,6 @@ import {
602
600
  InputOTP,
603
601
  InputOTPGroup,
604
602
  InputOTPSlot,
605
- Spinner as Spinner2,
606
603
  useFormField
607
604
  } from "@mesob/ui/components";
608
605
  import { useMesob as useMesob3 } from "@mesob/ui/providers";
@@ -612,12 +609,7 @@ import { useForm as useForm2 } from "react-hook-form";
612
609
  import { toast as toast2 } from "sonner";
613
610
  import { z as z2 } from "zod";
614
611
  import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
615
- function PasswordInput({
616
- field,
617
- show,
618
- onToggle,
619
- placeholder
620
- }) {
612
+ function PasswordInput({ field, show, onToggle }) {
621
613
  const { formItemId, error } = useFormField();
622
614
  return /* @__PURE__ */ jsxs3("div", { className: "relative", children: [
623
615
  /* @__PURE__ */ jsx5(
@@ -626,7 +618,6 @@ function PasswordInput({
626
618
  ...field,
627
619
  id: formItemId,
628
620
  type: show ? "text" : "password",
629
- placeholder,
630
621
  "aria-invalid": !!error,
631
622
  className: "pr-10"
632
623
  }
@@ -747,7 +738,7 @@ var ResetPasswordForm = ({
747
738
  return /* @__PURE__ */ jsxs3(
748
739
  AuthLayout,
749
740
  {
750
- title: t("title"),
741
+ title: config.ui.name,
751
742
  description: t("description"),
752
743
  logoImage,
753
744
  footer: /* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-between w-full gap-2", children: [
@@ -810,8 +801,7 @@ var ResetPasswordForm = ({
810
801
  {
811
802
  field,
812
803
  show: showPassword,
813
- onToggle: () => setShowPassword(!showPassword),
814
- placeholder: t("form.passwordPlaceholder")
804
+ onToggle: () => setShowPassword(!showPassword)
815
805
  }
816
806
  ),
817
807
  /* @__PURE__ */ jsx5(FormMessage2, {})
@@ -830,25 +820,22 @@ var ResetPasswordForm = ({
830
820
  {
831
821
  field,
832
822
  show: showPassword,
833
- onToggle: () => setShowPassword(!showPassword),
834
- placeholder: t("form.passwordPlaceholder")
823
+ onToggle: () => setShowPassword(!showPassword)
835
824
  }
836
825
  ),
837
826
  /* @__PURE__ */ jsx5(FormMessage2, {})
838
827
  ] })
839
828
  }
840
829
  ),
841
- /* @__PURE__ */ jsxs3(
830
+ /* @__PURE__ */ jsx5(
842
831
  Button2,
843
832
  {
844
833
  type: "submit",
845
834
  form: "reset-password-form",
846
835
  className: "w-full",
847
836
  disabled: isLoading || resetPasswordMutation.isPending,
848
- children: [
849
- isLoading || resetPasswordMutation.isPending && /* @__PURE__ */ jsx5(Spinner2, {}),
850
- isLoading || resetPasswordMutation.isPending ? t("form.submitting") : t("form.submit")
851
- ]
837
+ loading: isLoading || resetPasswordMutation.isPending,
838
+ children: isLoading || resetPasswordMutation.isPending ? t("form.submitting") : t("form.submit")
852
839
  }
853
840
  )
854
841
  ]
@@ -908,12 +895,7 @@ function normalizePhone(phone) {
908
895
  // src/components/auth/sign-in.tsx
909
896
  import { Fragment, jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
910
897
  var isPhone = (s) => /^\+?[0-9()[\]\s-]{6,}$/.test(s);
911
- function PasswordInput2({
912
- field,
913
- show,
914
- onToggle,
915
- placeholder
916
- }) {
898
+ function PasswordInput2({ field, show, onToggle }) {
917
899
  const { formItemId, error } = useFormField2();
918
900
  return /* @__PURE__ */ jsxs4("div", { className: "relative", children: [
919
901
  /* @__PURE__ */ jsx6(
@@ -922,7 +904,6 @@ function PasswordInput2({
922
904
  ...field,
923
905
  id: formItemId,
924
906
  type: show ? "text" : "password",
925
- placeholder,
926
907
  autoComplete: "current-password",
927
908
  "aria-invalid": !!error,
928
909
  className: "pr-10"
@@ -983,7 +964,7 @@ var SignIn = ({ redirectUrl } = {}) => {
983
964
  const form = useForm3({
984
965
  resolver: zodResolver3(signInSchema(t, phoneRegex)),
985
966
  defaultValues: { username: "", password: "" },
986
- mode: "onChange"
967
+ mode: "onBlur"
987
968
  });
988
969
  useEffect3(() => {
989
970
  if (error) {
@@ -1007,11 +988,14 @@ var SignIn = ({ redirectUrl } = {}) => {
1007
988
  setShowPasswordField(true);
1008
989
  } else {
1009
990
  const email = isPhone(normalizedUsername) ? "" : normalizedUsername;
991
+ const redirectParam = defaultRedirect ? `&redirect=${encodeURIComponent(defaultRedirect)}` : "";
1010
992
  if (email) {
1011
- onNavigate(`${signUpLink}?email=${encodeURIComponent(email)}`);
993
+ onNavigate(
994
+ `${signUpLink}?email=${encodeURIComponent(email)}${redirectParam}`
995
+ );
1012
996
  } else {
1013
997
  onNavigate(
1014
- `${signUpLink}?phone=${encodeURIComponent(normalizedUsername)}`
998
+ `${signUpLink}?phone=${encodeURIComponent(normalizedUsername)}${redirectParam}`
1015
999
  );
1016
1000
  }
1017
1001
  }
@@ -1044,7 +1028,8 @@ var SignIn = ({ redirectUrl } = {}) => {
1044
1028
  }
1045
1029
  });
1046
1030
  if ("verificationId" in res && res.verificationId) {
1047
- const verifyPath = isPhone(username) ? `/auth/verify-phone?context=sign-in&verificationId=${res.verificationId}&identifier=${encodeURIComponent(username)}` : `/auth/verify-email?verificationId=${res.verificationId}`;
1031
+ const redirectParam = defaultRedirect ? `&redirect=${encodeURIComponent(defaultRedirect)}` : "";
1032
+ const verifyPath = isPhone(username) ? `/auth/verify-phone?context=sign-in&verificationId=${res.verificationId}&identifier=${encodeURIComponent(username)}${redirectParam}` : `/auth/verify-email?verificationId=${res.verificationId}${redirectParam}`;
1048
1033
  onNavigate(verifyPath);
1049
1034
  return;
1050
1035
  }
@@ -1107,6 +1092,7 @@ var SignIn = ({ redirectUrl } = {}) => {
1107
1092
  id: "sign-in-username",
1108
1093
  type: "text",
1109
1094
  value: username,
1095
+ autoComplete: "username",
1110
1096
  disabled: true
1111
1097
  }
1112
1098
  )
@@ -1123,8 +1109,7 @@ var SignIn = ({ redirectUrl } = {}) => {
1123
1109
  {
1124
1110
  field: { ...field, value: field.value ?? "" },
1125
1111
  show: showPassword,
1126
- onToggle: () => setShowPassword(!showPassword),
1127
- placeholder: t("form.passwordPlaceholder")
1112
+ onToggle: () => setShowPassword(!showPassword)
1128
1113
  }
1129
1114
  ),
1130
1115
  /* @__PURE__ */ jsx6(FormMessage3, {})
@@ -1138,15 +1123,7 @@ var SignIn = ({ redirectUrl } = {}) => {
1138
1123
  name: "username",
1139
1124
  render: ({ field }) => /* @__PURE__ */ jsxs4(FormItem3, { children: [
1140
1125
  /* @__PURE__ */ jsx6(FormLabel3, { children: t("form.accountLabel") }),
1141
- /* @__PURE__ */ jsx6(FormControl3, { children: /* @__PURE__ */ jsx6(
1142
- Input3,
1143
- {
1144
- ...field,
1145
- type: "text",
1146
- placeholder: t("form.accountPlaceholder"),
1147
- autoComplete: "username"
1148
- }
1149
- ) }),
1126
+ /* @__PURE__ */ jsx6(FormControl3, { children: /* @__PURE__ */ jsx6(Input3, { ...field, type: "text", autoComplete: "username" }) }),
1150
1127
  /* @__PURE__ */ jsx6(FormMessage3, {})
1151
1128
  ] })
1152
1129
  }
@@ -1167,7 +1144,7 @@ var SignIn = ({ redirectUrl } = {}) => {
1167
1144
  return /* @__PURE__ */ jsx6("div", { className: "space-y-4", children: /* @__PURE__ */ jsxs4(
1168
1145
  AuthLayout,
1169
1146
  {
1170
- title: t("title"),
1147
+ title: config.ui.name,
1171
1148
  description: t("description"),
1172
1149
  logoImage,
1173
1150
  footer: showPasswordField ? /* @__PURE__ */ jsx6("div", { className: "flex items-center justify-center w-full", children: Link ? /* @__PURE__ */ jsx6(
@@ -1225,12 +1202,7 @@ import { toast as toast4 } from "sonner";
1225
1202
  import { z as z4 } from "zod";
1226
1203
  import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
1227
1204
  var isPhone2 = (s) => /^\+?[0-9()[\]\s-]{6,}$/.test(s);
1228
- function PasswordInput3({
1229
- field,
1230
- show,
1231
- onToggle,
1232
- placeholder
1233
- }) {
1205
+ function PasswordInput3({ field, show, onToggle }) {
1234
1206
  const { formItemId, error } = useFormField3();
1235
1207
  return /* @__PURE__ */ jsxs5("div", { className: "relative", children: [
1236
1208
  /* @__PURE__ */ jsx7(
@@ -1239,7 +1211,6 @@ function PasswordInput3({
1239
1211
  ...field,
1240
1212
  id: formItemId,
1241
1213
  type: show ? "text" : "password",
1242
- placeholder,
1243
1214
  "aria-invalid": !!error,
1244
1215
  className: "pr-10"
1245
1216
  }
@@ -1341,13 +1312,14 @@ var SignUp = ({
1341
1312
  }
1342
1313
  });
1343
1314
  if ("verificationId" in res && res.verificationId) {
1315
+ const redirectParam = defaultRedirect ? `&redirect=${encodeURIComponent(defaultRedirect)}` : "";
1344
1316
  if (usingPhone) {
1345
1317
  onNavigate(
1346
- `/auth/verify-phone?context=sign-up&verificationId=${res.verificationId}&phone=${encodeURIComponent(identifier)}`
1318
+ `/auth/verify-phone?context=sign-up&verificationId=${res.verificationId}&phone=${encodeURIComponent(identifier)}${redirectParam}`
1347
1319
  );
1348
1320
  } else {
1349
1321
  onNavigate(
1350
- `/auth/verify-email?verificationId=${res.verificationId}&email=${encodeURIComponent(identifier)}`
1322
+ `/auth/verify-email?verificationId=${res.verificationId}&email=${encodeURIComponent(identifier)}${redirectParam}`
1351
1323
  );
1352
1324
  }
1353
1325
  return;
@@ -1383,7 +1355,7 @@ var SignUp = ({
1383
1355
  return /* @__PURE__ */ jsxs5(
1384
1356
  AuthLayout,
1385
1357
  {
1386
- title: t("title"),
1358
+ title: config.ui.name,
1387
1359
  description: t("description"),
1388
1360
  logoImage,
1389
1361
  footer: /* @__PURE__ */ jsxs5("p", { children: [
@@ -1411,13 +1383,7 @@ var SignUp = ({
1411
1383
  name: "fullName",
1412
1384
  render: ({ field }) => /* @__PURE__ */ jsxs5(FormItem4, { children: [
1413
1385
  /* @__PURE__ */ jsx7(FormLabel4, { children: t("form.fullNameLabel") }),
1414
- /* @__PURE__ */ jsx7(FormControl4, { children: /* @__PURE__ */ jsx7(
1415
- Input4,
1416
- {
1417
- ...field,
1418
- placeholder: t("form.fullNamePlaceholder")
1419
- }
1420
- ) }),
1386
+ /* @__PURE__ */ jsx7(FormControl4, { children: /* @__PURE__ */ jsx7(Input4, { ...field }) }),
1421
1387
  /* @__PURE__ */ jsx7(FormMessage4, {})
1422
1388
  ] })
1423
1389
  }
@@ -1440,7 +1406,6 @@ var SignUp = ({
1440
1406
  {
1441
1407
  ...field,
1442
1408
  type: field.value.includes("@") ? "email" : "tel",
1443
- placeholder: hasInitialIdentifier ? void 0 : t("form.accountPlaceholder") || "Email or phone number",
1444
1409
  disabled: hasInitialIdentifier
1445
1410
  }
1446
1411
  ) }),
@@ -1460,8 +1425,7 @@ var SignUp = ({
1460
1425
  {
1461
1426
  field,
1462
1427
  show: showPassword,
1463
- onToggle: () => setShowPassword(!showPassword),
1464
- placeholder: t("form.passwordPlaceholder")
1428
+ onToggle: () => setShowPassword(!showPassword)
1465
1429
  }
1466
1430
  ),
1467
1431
  /* @__PURE__ */ jsx7(FormMessage4, {})
@@ -1480,8 +1444,7 @@ var SignUp = ({
1480
1444
  {
1481
1445
  field,
1482
1446
  show: showConfirmPassword,
1483
- onToggle: () => setShowConfirmPassword(!showConfirmPassword),
1484
- placeholder: t("form.passwordPlaceholder")
1447
+ onToggle: () => setShowConfirmPassword(!showConfirmPassword)
1485
1448
  }
1486
1449
  ),
1487
1450
  /* @__PURE__ */ jsx7(FormMessage4, {})
@@ -1512,7 +1475,7 @@ var SignUp = ({
1512
1475
  // src/components/auth/verification-form.tsx
1513
1476
  import { zodResolver as zodResolver5 } from "@hookform/resolvers/zod";
1514
1477
  import {
1515
- Button as Button6,
1478
+ Button as Button5,
1516
1479
  Form as Form5,
1517
1480
  FormControl as FormControl5,
1518
1481
  FormField as FormField5,
@@ -1521,14 +1484,13 @@ import {
1521
1484
  FormMessage as FormMessage5,
1522
1485
  InputOTP as InputOTP2,
1523
1486
  InputOTPGroup as InputOTPGroup2,
1524
- InputOTPSlot as InputOTPSlot2,
1525
- Spinner as Spinner4
1487
+ InputOTPSlot as InputOTPSlot2
1526
1488
  } from "@mesob/ui/components";
1527
1489
  import { useForm as useForm5 } from "react-hook-form";
1528
1490
  import { z as z5 } from "zod";
1529
1491
 
1530
1492
  // src/components/auth/countdown.tsx
1531
- import { Button as Button5, Spinner as Spinner3 } from "@mesob/ui/components";
1493
+ import { Spinner } from "@mesob/ui/components";
1532
1494
  import { useEffect as useEffect5, useState as useState6 } from "react";
1533
1495
  import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
1534
1496
  var Countdown = ({
@@ -1564,17 +1526,19 @@ var Countdown = ({
1564
1526
  setIsResending(false);
1565
1527
  }
1566
1528
  };
1529
+ const busy = isResending || resending;
1567
1530
  if (seconds > 0) {
1568
- return /* @__PURE__ */ jsx8(Button5, { variant: "ghost", disabled: true, children: t("resendIn", { seconds }) });
1531
+ return /* @__PURE__ */ jsx8("p", { className: "text-sm text-muted-foreground", children: t("resendIn", { seconds }) });
1569
1532
  }
1570
1533
  return /* @__PURE__ */ jsxs6(
1571
- Button5,
1534
+ "button",
1572
1535
  {
1573
- variant: "ghost",
1536
+ type: "button",
1574
1537
  onClick: handleResend,
1575
- disabled: isResending || resending,
1538
+ disabled: busy,
1539
+ className: "text-sm text-primary hover:underline disabled:opacity-50 flex items-center gap-1",
1576
1540
  children: [
1577
- isResending || resending && /* @__PURE__ */ jsx8(Spinner3, {}),
1541
+ busy && /* @__PURE__ */ jsx8(Spinner, { className: "h-3 w-3" }),
1578
1542
  t("resend")
1579
1543
  ]
1580
1544
  }
@@ -1594,13 +1558,12 @@ var VerificationForm = ({
1594
1558
  const t = useTranslator("Auth.verification");
1595
1559
  const form = useForm5({
1596
1560
  resolver: zodResolver5(verificationSchema(t)),
1597
- defaultValues: {
1598
- code: ""
1599
- }
1561
+ defaultValues: { code: "" }
1600
1562
  });
1601
1563
  const handleSubmit = form.handleSubmit(async (values) => {
1602
1564
  await onSubmit(values);
1603
1565
  });
1566
+ const codeLength = form.watch("code").length;
1604
1567
  return /* @__PURE__ */ jsx9(Form5, { ...form, children: /* @__PURE__ */ jsxs7(
1605
1568
  "form",
1606
1569
  {
@@ -1638,21 +1601,18 @@ var VerificationForm = ({
1638
1601
  ] })
1639
1602
  }
1640
1603
  ),
1641
- /* @__PURE__ */ jsxs7("div", { className: "flex justify-between items-center", children: [
1642
- /* @__PURE__ */ jsx9(Countdown, { onResend, resending: isLoading }),
1643
- /* @__PURE__ */ jsxs7(
1644
- Button6,
1645
- {
1646
- type: "submit",
1647
- form: "verification-form",
1648
- disabled: isLoading || form.watch("code").length !== 6,
1649
- children: [
1650
- isLoading && /* @__PURE__ */ jsx9(Spinner4, {}),
1651
- t("form.confirm")
1652
- ]
1653
- }
1654
- )
1655
- ] })
1604
+ /* @__PURE__ */ jsx9(
1605
+ Button5,
1606
+ {
1607
+ type: "submit",
1608
+ form: "verification-form",
1609
+ className: "w-full",
1610
+ disabled: isLoading || codeLength !== 6,
1611
+ loading: isLoading,
1612
+ children: t("form.confirm")
1613
+ }
1614
+ ),
1615
+ /* @__PURE__ */ jsx9("div", { className: "flex justify-center", children: /* @__PURE__ */ jsx9(Countdown, { onResend, resending: isLoading }) })
1656
1616
  ]
1657
1617
  }
1658
1618
  ) });
@@ -1784,7 +1744,7 @@ var VerifyEmail = ({
1784
1744
  return /* @__PURE__ */ jsxs8(
1785
1745
  AuthLayout,
1786
1746
  {
1787
- title: t("email.title"),
1747
+ title: config.ui.name,
1788
1748
  description: t("email.description"),
1789
1749
  logoImage,
1790
1750
  footer: Link ? /* @__PURE__ */ jsx10(Link, { href: signInLink, className: "text-primary hover:underline", children: footer("backToSignIn") }) : /* @__PURE__ */ jsx10(
@@ -1949,7 +1909,7 @@ var VerifyPhone = ({
1949
1909
  return /* @__PURE__ */ jsxs9(
1950
1910
  AuthLayout,
1951
1911
  {
1952
- title: t("phone.title"),
1912
+ title: config.ui.name,
1953
1913
  description: t("phone.description", {
1954
1914
  target: phone || t("phone.missingPhone")
1955
1915
  }),
@@ -1988,7 +1948,7 @@ var VerifyPhone = ({
1988
1948
  };
1989
1949
 
1990
1950
  // src/components/error-boundary.tsx
1991
- import { Button as Button7 } from "@mesob/ui/components";
1951
+ import { Button as Button6 } from "@mesob/ui/components";
1992
1952
  import { Component } from "react";
1993
1953
  import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
1994
1954
  var ErrorBoundary = class extends Component {
@@ -2023,7 +1983,7 @@ function ErrorFallback({ error, reset }) {
2023
1983
  /* @__PURE__ */ jsx12("h2", { className: "text-2xl font-bold text-destructive", children: "Something went wrong" }),
2024
1984
  /* @__PURE__ */ jsx12("p", { className: "text-muted-foreground", children: error.message || "An unexpected error occurred" })
2025
1985
  ] }),
2026
- /* @__PURE__ */ jsx12(Button7, { onClick: reset, variant: "outline", children: "Try again" })
1986
+ /* @__PURE__ */ jsx12(Button6, { onClick: reset, variant: "outline", children: "Try again" })
2027
1987
  ] }) });
2028
1988
  }
2029
1989
  function AuthErrorBoundary({ children }) {
@@ -2031,7 +1991,7 @@ function AuthErrorBoundary({ children }) {
2031
1991
  }
2032
1992
 
2033
1993
  // src/components/iam/permissions.tsx
2034
- import { Badge, Button as Button8 } from "@mesob/ui/components";
1994
+ import { Badge, Button as Button7 } from "@mesob/ui/components";
2035
1995
  import { useLocale } from "next-intl";
2036
1996
  import { useState as useState9 } from "react";
2037
1997
 
@@ -2169,7 +2129,7 @@ function Permissions() {
2169
2129
  {
2170
2130
  key: "actions",
2171
2131
  header: "Actions",
2172
- cell: (_permission) => /* @__PURE__ */ jsx15(Button8, { variant: "outline", size: "sm", children: "Edit" })
2132
+ cell: (_permission) => /* @__PURE__ */ jsx15(Button7, { variant: "outline", size: "sm", children: "Edit" })
2173
2133
  }
2174
2134
  ];
2175
2135
  if (error) {
@@ -2181,7 +2141,7 @@ function Permissions() {
2181
2141
  /* @__PURE__ */ jsx15("h1", { className: "text-3xl font-bold", children: "Permissions" }),
2182
2142
  /* @__PURE__ */ jsx15("p", { className: "text-muted-foreground", children: "Manage system permissions" })
2183
2143
  ] }),
2184
- /* @__PURE__ */ jsx15(Button8, { children: "Create Permission" })
2144
+ /* @__PURE__ */ jsx15(Button7, { children: "Create Permission" })
2185
2145
  ] }),
2186
2146
  /* @__PURE__ */ jsx15(
2187
2147
  DataTable,
@@ -2194,11 +2154,11 @@ function Permissions() {
2194
2154
  ),
2195
2155
  data && "permissions" in data && data.permissions && data.permissions.length >= limit && /* @__PURE__ */ jsxs13("div", { className: "flex justify-between items-center", children: [
2196
2156
  /* @__PURE__ */ jsx15(
2197
- Button8,
2157
+ Button7,
2198
2158
  {
2199
2159
  variant: "outline",
2200
2160
  disabled: page === 1,
2201
- onClick: () => setPage(page - 1),
2161
+ onClick: () => setPage((prev) => prev - 1),
2202
2162
  children: "Previous"
2203
2163
  }
2204
2164
  ),
@@ -2206,13 +2166,20 @@ function Permissions() {
2206
2166
  "Page ",
2207
2167
  page
2208
2168
  ] }),
2209
- /* @__PURE__ */ jsx15(Button8, { variant: "outline", onClick: () => setPage(page + 1), children: "Next" })
2169
+ /* @__PURE__ */ jsx15(
2170
+ Button7,
2171
+ {
2172
+ variant: "outline",
2173
+ onClick: () => setPage((prev) => prev + 1),
2174
+ children: "Next"
2175
+ }
2176
+ )
2210
2177
  ] })
2211
2178
  ] });
2212
2179
  }
2213
2180
 
2214
2181
  // src/components/iam/roles.tsx
2215
- import { Badge as Badge2, Button as Button9 } from "@mesob/ui/components";
2182
+ import { Badge as Badge2, Button as Button8 } from "@mesob/ui/components";
2216
2183
  import { useLocale as useLocale2 } from "next-intl";
2217
2184
  import { useState as useState10 } from "react";
2218
2185
  import { jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
@@ -2264,8 +2231,8 @@ function Roles() {
2264
2231
  key: "actions",
2265
2232
  header: "Actions",
2266
2233
  cell: (_role) => /* @__PURE__ */ jsxs14("div", { className: "flex gap-2", children: [
2267
- /* @__PURE__ */ jsx16(Button9, { variant: "outline", size: "sm", children: "Permissions" }),
2268
- /* @__PURE__ */ jsx16(Button9, { variant: "outline", size: "sm", children: "Edit" })
2234
+ /* @__PURE__ */ jsx16(Button8, { variant: "outline", size: "sm", children: "Permissions" }),
2235
+ /* @__PURE__ */ jsx16(Button8, { variant: "outline", size: "sm", children: "Edit" })
2269
2236
  ] })
2270
2237
  }
2271
2238
  ];
@@ -2278,7 +2245,7 @@ function Roles() {
2278
2245
  /* @__PURE__ */ jsx16("h1", { className: "text-3xl font-bold", children: "Roles" }),
2279
2246
  /* @__PURE__ */ jsx16("p", { className: "text-muted-foreground", children: "Manage user roles" })
2280
2247
  ] }),
2281
- /* @__PURE__ */ jsx16(Button9, { children: "Create Role" })
2248
+ /* @__PURE__ */ jsx16(Button8, { children: "Create Role" })
2282
2249
  ] }),
2283
2250
  /* @__PURE__ */ jsx16(
2284
2251
  DataTable,
@@ -2291,11 +2258,11 @@ function Roles() {
2291
2258
  ),
2292
2259
  data && "roles" in data && data.roles && data.roles.length >= limit && /* @__PURE__ */ jsxs14("div", { className: "flex justify-between items-center", children: [
2293
2260
  /* @__PURE__ */ jsx16(
2294
- Button9,
2261
+ Button8,
2295
2262
  {
2296
2263
  variant: "outline",
2297
2264
  disabled: page === 1,
2298
- onClick: () => setPage(page - 1),
2265
+ onClick: () => setPage((prev) => prev - 1),
2299
2266
  children: "Previous"
2300
2267
  }
2301
2268
  ),
@@ -2303,13 +2270,20 @@ function Roles() {
2303
2270
  "Page ",
2304
2271
  page
2305
2272
  ] }),
2306
- /* @__PURE__ */ jsx16(Button9, { variant: "outline", onClick: () => setPage(page + 1), children: "Next" })
2273
+ /* @__PURE__ */ jsx16(
2274
+ Button8,
2275
+ {
2276
+ variant: "outline",
2277
+ onClick: () => setPage((prev) => prev + 1),
2278
+ children: "Next"
2279
+ }
2280
+ )
2307
2281
  ] })
2308
2282
  ] });
2309
2283
  }
2310
2284
 
2311
2285
  // src/components/iam/sessions.tsx
2312
- import { Button as Button10 } from "@mesob/ui/components";
2286
+ import { Button as Button9 } from "@mesob/ui/components";
2313
2287
  import { useState as useState11 } from "react";
2314
2288
  import { jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
2315
2289
  function Sessions() {
@@ -2364,7 +2338,7 @@ function Sessions() {
2364
2338
  key: "actions",
2365
2339
  header: "Actions",
2366
2340
  cell: (session) => /* @__PURE__ */ jsx17(
2367
- Button10,
2341
+ Button9,
2368
2342
  {
2369
2343
  variant: "destructive",
2370
2344
  size: "sm",
@@ -2396,7 +2370,7 @@ function Sessions() {
2396
2370
  }
2397
2371
 
2398
2372
  // src/components/iam/tenants.tsx
2399
- import { Badge as Badge3, Button as Button11 } from "@mesob/ui/components";
2373
+ import { Badge as Badge3, Button as Button10 } from "@mesob/ui/components";
2400
2374
  import { useState as useState12 } from "react";
2401
2375
  import { jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
2402
2376
  function Tenants() {
@@ -2437,8 +2411,8 @@ function Tenants() {
2437
2411
  key: "actions",
2438
2412
  header: "Actions",
2439
2413
  cell: (_tenant) => /* @__PURE__ */ jsxs16("div", { className: "flex gap-2", children: [
2440
- /* @__PURE__ */ jsx18(Button11, { variant: "outline", size: "sm", children: "Domains" }),
2441
- /* @__PURE__ */ jsx18(Button11, { variant: "outline", size: "sm", children: "Edit" })
2414
+ /* @__PURE__ */ jsx18(Button10, { variant: "outline", size: "sm", children: "Domains" }),
2415
+ /* @__PURE__ */ jsx18(Button10, { variant: "outline", size: "sm", children: "Edit" })
2442
2416
  ] })
2443
2417
  }
2444
2418
  ];
@@ -2451,7 +2425,7 @@ function Tenants() {
2451
2425
  /* @__PURE__ */ jsx18("h1", { className: "text-3xl font-bold", children: "Tenants" }),
2452
2426
  /* @__PURE__ */ jsx18("p", { className: "text-muted-foreground", children: "Manage tenant organizations" })
2453
2427
  ] }),
2454
- /* @__PURE__ */ jsx18(Button11, { children: "Create Tenant" })
2428
+ /* @__PURE__ */ jsx18(Button10, { children: "Create Tenant" })
2455
2429
  ] }),
2456
2430
  /* @__PURE__ */ jsx18(
2457
2431
  DataTable,
@@ -2464,11 +2438,11 @@ function Tenants() {
2464
2438
  ),
2465
2439
  data && "tenants" in data && data.tenants && data.tenants.length >= limit && /* @__PURE__ */ jsxs16("div", { className: "flex justify-between items-center", children: [
2466
2440
  /* @__PURE__ */ jsx18(
2467
- Button11,
2441
+ Button10,
2468
2442
  {
2469
2443
  variant: "outline",
2470
2444
  disabled: page === 1,
2471
- onClick: () => setPage(page - 1),
2445
+ onClick: () => setPage((prev) => prev - 1),
2472
2446
  children: "Previous"
2473
2447
  }
2474
2448
  ),
@@ -2476,13 +2450,20 @@ function Tenants() {
2476
2450
  "Page ",
2477
2451
  page
2478
2452
  ] }),
2479
- /* @__PURE__ */ jsx18(Button11, { variant: "outline", onClick: () => setPage(page + 1), children: "Next" })
2453
+ /* @__PURE__ */ jsx18(
2454
+ Button10,
2455
+ {
2456
+ variant: "outline",
2457
+ onClick: () => setPage((prev) => prev + 1),
2458
+ children: "Next"
2459
+ }
2460
+ )
2480
2461
  ] })
2481
2462
  ] });
2482
2463
  }
2483
2464
 
2484
2465
  // src/components/iam/users.tsx
2485
- import { Badge as Badge4, Button as Button12 } from "@mesob/ui/components";
2466
+ import { Badge as Badge4, Button as Button11 } from "@mesob/ui/components";
2486
2467
  import { useState as useState13 } from "react";
2487
2468
  import { jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
2488
2469
  function Users() {
@@ -2532,8 +2513,8 @@ function Users() {
2532
2513
  key: "actions",
2533
2514
  header: "Actions",
2534
2515
  cell: (_user) => /* @__PURE__ */ jsxs17("div", { className: "flex gap-2", children: [
2535
- /* @__PURE__ */ jsx19(Button12, { variant: "outline", size: "sm", children: "View" }),
2536
- /* @__PURE__ */ jsx19(Button12, { variant: "outline", size: "sm", children: "Edit" })
2516
+ /* @__PURE__ */ jsx19(Button11, { variant: "outline", size: "sm", children: "View" }),
2517
+ /* @__PURE__ */ jsx19(Button11, { variant: "outline", size: "sm", children: "Edit" })
2537
2518
  ] })
2538
2519
  }
2539
2520
  ];
@@ -2546,7 +2527,7 @@ function Users() {
2546
2527
  /* @__PURE__ */ jsx19("h1", { className: "text-3xl font-bold", children: "Users" }),
2547
2528
  /* @__PURE__ */ jsx19("p", { className: "text-muted-foreground", children: "Manage user accounts" })
2548
2529
  ] }),
2549
- /* @__PURE__ */ jsx19(Button12, { children: "Create User" })
2530
+ /* @__PURE__ */ jsx19(Button11, { children: "Create User" })
2550
2531
  ] }),
2551
2532
  /* @__PURE__ */ jsx19(
2552
2533
  DataTable,
@@ -2559,11 +2540,11 @@ function Users() {
2559
2540
  ),
2560
2541
  data && "users" in data && data.users && data.users.length >= limit && /* @__PURE__ */ jsxs17("div", { className: "flex justify-between items-center", children: [
2561
2542
  /* @__PURE__ */ jsx19(
2562
- Button12,
2543
+ Button11,
2563
2544
  {
2564
2545
  variant: "outline",
2565
2546
  disabled: page === 1,
2566
- onClick: () => setPage(page - 1),
2547
+ onClick: () => setPage((prev) => prev - 1),
2567
2548
  children: "Previous"
2568
2549
  }
2569
2550
  ),
@@ -2571,7 +2552,14 @@ function Users() {
2571
2552
  "Page ",
2572
2553
  page
2573
2554
  ] }),
2574
- /* @__PURE__ */ jsx19(Button12, { variant: "outline", onClick: () => setPage(page + 1), children: "Next" })
2555
+ /* @__PURE__ */ jsx19(
2556
+ Button11,
2557
+ {
2558
+ variant: "outline",
2559
+ onClick: () => setPage((prev) => prev + 1),
2560
+ children: "Next"
2561
+ }
2562
+ )
2575
2563
  ] })
2576
2564
  ] });
2577
2565
  }
@@ -2607,7 +2595,7 @@ function Account() {
2607
2595
 
2608
2596
  // src/components/profile/change-email-form.tsx
2609
2597
  import {
2610
- Button as Button14,
2598
+ Button as Button13,
2611
2599
  Collapsible,
2612
2600
  CollapsibleContent,
2613
2601
  CollapsibleTrigger
@@ -2617,7 +2605,7 @@ import { useState as useState16 } from "react";
2617
2605
 
2618
2606
  // src/components/profile/request-change-email-form.tsx
2619
2607
  import { zodResolver as zodResolver6 } from "@hookform/resolvers/zod";
2620
- import { Button as Button13, Input as Input5, Label, Spinner as Spinner5 } from "@mesob/ui/components";
2608
+ import { Button as Button12, Input as Input5, Label, Spinner as Spinner2 } from "@mesob/ui/components";
2621
2609
  import { IconEye as IconEye4, IconEyeOff as IconEyeOff4 } from "@tabler/icons-react";
2622
2610
  import { useEffect as useEffect8, useState as useState14 } from "react";
2623
2611
  import { useForm as useForm6 } from "react-hook-form";
@@ -2842,7 +2830,7 @@ function RequestChangeEmailForm({
2842
2830
  ] }),
2843
2831
  /* @__PURE__ */ jsxs19("div", { className: "flex justify-end gap-2", children: [
2844
2832
  /* @__PURE__ */ jsx21(
2845
- Button13,
2833
+ Button12,
2846
2834
  {
2847
2835
  type: "button",
2848
2836
  variant: "outline",
@@ -2851,8 +2839,8 @@ function RequestChangeEmailForm({
2851
2839
  children: "Cancel"
2852
2840
  }
2853
2841
  ),
2854
- /* @__PURE__ */ jsxs19(Button13, { type: "submit", disabled: isLoading, children: [
2855
- isLoading && /* @__PURE__ */ jsx21(Spinner5, { className: "mr-2 h-4 w-4" }),
2842
+ /* @__PURE__ */ jsxs19(Button12, { type: "submit", disabled: isLoading, children: [
2843
+ isLoading && /* @__PURE__ */ jsx21(Spinner2, { className: "mr-2 h-4 w-4" }),
2856
2844
  isChecking ? "Checking\u2026" : buttonText
2857
2845
  ] })
2858
2846
  ] })
@@ -3070,7 +3058,7 @@ function ChangeEmailForm() {
3070
3058
  CollapsibleTrigger,
3071
3059
  {
3072
3060
  render: /* @__PURE__ */ jsx24(
3073
- Button14,
3061
+ Button13,
3074
3062
  {
3075
3063
  variant: "ghost",
3076
3064
  className: "w-full justify-between p-4 h-auto"
@@ -3112,13 +3100,13 @@ function ChangeEmailForm() {
3112
3100
  // src/components/profile/change-password-form.tsx
3113
3101
  import { zodResolver as zodResolver7 } from "@hookform/resolvers/zod";
3114
3102
  import {
3115
- Button as Button15,
3103
+ Button as Button14,
3116
3104
  Collapsible as Collapsible2,
3117
3105
  CollapsibleContent as CollapsibleContent2,
3118
3106
  CollapsibleTrigger as CollapsibleTrigger2,
3119
3107
  Input as Input6,
3120
3108
  Label as Label2,
3121
- Spinner as Spinner6
3109
+ Spinner as Spinner3
3122
3110
  } from "@mesob/ui/components";
3123
3111
  import { IconChevronDown as IconChevronDown2, IconEye as IconEye5, IconEyeOff as IconEyeOff5 } from "@tabler/icons-react";
3124
3112
  import { useState as useState17 } from "react";
@@ -3214,7 +3202,7 @@ function ChangePasswordForm() {
3214
3202
  CollapsibleTrigger2,
3215
3203
  {
3216
3204
  render: /* @__PURE__ */ jsx25(
3217
- Button15,
3205
+ Button14,
3218
3206
  {
3219
3207
  variant: "ghost",
3220
3208
  className: "w-full justify-between p-4 h-auto"
@@ -3317,7 +3305,7 @@ function ChangePasswordForm() {
3317
3305
  ] }),
3318
3306
  /* @__PURE__ */ jsxs22("div", { className: "flex justify-end gap-2", children: [
3319
3307
  /* @__PURE__ */ jsx25(
3320
- Button15,
3308
+ Button14,
3321
3309
  {
3322
3310
  type: "button",
3323
3311
  variant: "outline",
@@ -3329,8 +3317,8 @@ function ChangePasswordForm() {
3329
3317
  children: "Cancel"
3330
3318
  }
3331
3319
  ),
3332
- /* @__PURE__ */ jsxs22(Button15, { type: "submit", disabled: isSubmitting, children: [
3333
- isSubmitting && /* @__PURE__ */ jsx25(Spinner6, { className: "mr-2 h-4 w-4" }),
3320
+ /* @__PURE__ */ jsxs22(Button14, { type: "submit", disabled: isSubmitting, children: [
3321
+ isSubmitting && /* @__PURE__ */ jsx25(Spinner3, { className: "mr-2 h-4 w-4" }),
3334
3322
  "Change Password"
3335
3323
  ] })
3336
3324
  ] })
@@ -3342,7 +3330,7 @@ function ChangePasswordForm() {
3342
3330
 
3343
3331
  // src/components/profile/change-phone-form.tsx
3344
3332
  import {
3345
- Button as Button17,
3333
+ Button as Button16,
3346
3334
  Collapsible as Collapsible3,
3347
3335
  CollapsibleContent as CollapsibleContent3,
3348
3336
  CollapsibleTrigger as CollapsibleTrigger3
@@ -3352,7 +3340,7 @@ import { useState as useState20 } from "react";
3352
3340
 
3353
3341
  // src/components/profile/request-change-phone-form.tsx
3354
3342
  import { zodResolver as zodResolver8 } from "@hookform/resolvers/zod";
3355
- import { Button as Button16, Input as Input7, Label as Label3, Spinner as Spinner7 } from "@mesob/ui/components";
3343
+ import { Button as Button15, Input as Input7, Label as Label3, Spinner as Spinner4 } from "@mesob/ui/components";
3356
3344
  import { IconEye as IconEye6, IconEyeOff as IconEyeOff6 } from "@tabler/icons-react";
3357
3345
  import { useEffect as useEffect9, useState as useState18 } from "react";
3358
3346
  import { useForm as useForm8 } from "react-hook-form";
@@ -3590,7 +3578,7 @@ function RequestChangePhoneForm({
3590
3578
  ] }),
3591
3579
  /* @__PURE__ */ jsxs23("div", { className: "flex justify-end gap-2", children: [
3592
3580
  /* @__PURE__ */ jsx26(
3593
- Button16,
3581
+ Button15,
3594
3582
  {
3595
3583
  type: "button",
3596
3584
  variant: "outline",
@@ -3599,8 +3587,8 @@ function RequestChangePhoneForm({
3599
3587
  children: "Cancel"
3600
3588
  }
3601
3589
  ),
3602
- /* @__PURE__ */ jsxs23(Button16, { type: "submit", disabled: isLoading, children: [
3603
- isLoading && /* @__PURE__ */ jsx26(Spinner7, { className: "mr-2 h-4 w-4" }),
3590
+ /* @__PURE__ */ jsxs23(Button15, { type: "submit", disabled: isLoading, children: [
3591
+ isLoading && /* @__PURE__ */ jsx26(Spinner4, { className: "mr-2 h-4 w-4" }),
3604
3592
  isChecking ? "Checking\u2026" : buttonText
3605
3593
  ] })
3606
3594
  ] })
@@ -3773,7 +3761,7 @@ function ChangePhoneForm() {
3773
3761
  CollapsibleTrigger3,
3774
3762
  {
3775
3763
  render: /* @__PURE__ */ jsx28(
3776
- Button17,
3764
+ Button16,
3777
3765
  {
3778
3766
  variant: "ghost",
3779
3767
  className: "w-full justify-between p-4 h-auto"