@alepha/ui 0.13.0 → 0.13.1

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 (117) hide show
  1. package/dist/admin/{AdminFiles-CllAxb1B.js → AdminFiles-BjofP3OC.js} +11 -11
  2. package/dist/admin/AdminFiles-BjofP3OC.js.map +1 -0
  3. package/dist/admin/AdminFiles-DldZB7oo.js +3 -0
  4. package/dist/admin/AdminJobs-BOq6AZOW.js +3 -0
  5. package/dist/admin/{AdminJobs-BXkFtlVo.js → AdminJobs-CDnVxEv6.js} +11 -11
  6. package/dist/admin/AdminJobs-CDnVxEv6.js.map +1 -0
  7. package/dist/admin/AdminLayout-Bgx25J8m.js +3 -0
  8. package/dist/admin/{AdminLayout-CtkVYk-u.js → AdminLayout-CervL8LV.js} +6 -6
  9. package/dist/admin/AdminLayout-CervL8LV.js.map +1 -0
  10. package/dist/admin/AdminNotifications-BDQXt3-e.js +3 -0
  11. package/dist/admin/{AdminNotifications-DnnulNNV.js → AdminNotifications-DvI2989x.js} +6 -6
  12. package/dist/admin/AdminNotifications-DvI2989x.js.map +1 -0
  13. package/dist/admin/{AdminParameters-B3hvpLpu.js → AdminParameters-CWi7crdn.js} +6 -6
  14. package/dist/admin/AdminParameters-CWi7crdn.js.map +1 -0
  15. package/dist/admin/AdminParameters-DKRAVen3.js +3 -0
  16. package/dist/admin/{AdminSessions-Pjdz-iZx.js → AdminSessions-CmDVneE2.js} +11 -11
  17. package/dist/admin/AdminSessions-CmDVneE2.js.map +1 -0
  18. package/dist/admin/AdminSessions-Dkk_fzWK.js +3 -0
  19. package/dist/admin/{AdminUsers-C1HsrRxn.js → AdminUsers-88De5pev.js} +9 -9
  20. package/dist/admin/AdminUsers-88De5pev.js.map +1 -0
  21. package/dist/admin/AdminUsers-oyAXqZ5l.js +3 -0
  22. package/dist/admin/AdminVerifications-D93TKymL.js +3 -0
  23. package/dist/admin/{AdminVerifications-VMpm30mS.js → AdminVerifications-DBVEoqJe.js} +6 -6
  24. package/dist/admin/AdminVerifications-DBVEoqJe.js.map +1 -0
  25. package/dist/admin/index.d.ts +80 -80
  26. package/dist/admin/index.js +17 -17
  27. package/dist/auth/{IconGoogle-Bfmuv9Rv.js → IconGoogle-v_58os2T.js} +1 -1
  28. package/dist/auth/{IconGoogle-Bfmuv9Rv.js.map → IconGoogle-v_58os2T.js.map} +1 -1
  29. package/dist/auth/Login-BC2jTczq.js +4 -0
  30. package/dist/auth/{Login-JeXFsUf5.js → Login-OCrvjs9U.js} +12 -12
  31. package/dist/auth/Login-OCrvjs9U.js.map +1 -0
  32. package/dist/auth/Register-Dh0lsQmI.js +4 -0
  33. package/dist/auth/{Register-CPQnvXCZ.js → Register-Ei34GSba.js} +16 -16
  34. package/dist/auth/Register-Ei34GSba.js.map +1 -0
  35. package/dist/auth/ResetPassword-BnlAQAOE.js +3 -0
  36. package/dist/auth/{ResetPassword-BzUjGG_-.js → ResetPassword-tO0oMzfo.js} +12 -12
  37. package/dist/auth/ResetPassword-tO0oMzfo.js.map +1 -0
  38. package/dist/auth/index.d.ts +413 -830
  39. package/dist/auth/index.js +10 -10
  40. package/dist/auth/index.js.map +1 -1
  41. package/dist/core/index.d.ts +70 -70
  42. package/package.json +6 -9
  43. package/dist/admin/AdminFiles-BM6_7_5A.cjs +0 -4
  44. package/dist/admin/AdminFiles-BaCIMeNt.js +0 -4
  45. package/dist/admin/AdminFiles-CllAxb1B.js.map +0 -1
  46. package/dist/admin/AdminFiles-DC3T8uWZ.cjs +0 -122
  47. package/dist/admin/AdminFiles-DC3T8uWZ.cjs.map +0 -1
  48. package/dist/admin/AdminJobs-BXkFtlVo.js.map +0 -1
  49. package/dist/admin/AdminJobs-C428qrNQ.cjs +0 -130
  50. package/dist/admin/AdminJobs-C428qrNQ.cjs.map +0 -1
  51. package/dist/admin/AdminJobs-DCPPaJ4i.cjs +0 -4
  52. package/dist/admin/AdminJobs-yC6DarGO.js +0 -4
  53. package/dist/admin/AdminLayout-Bqo4cd33.cjs +0 -4
  54. package/dist/admin/AdminLayout-CQpxfko6.js +0 -4
  55. package/dist/admin/AdminLayout-CiLlywAQ.cjs +0 -93
  56. package/dist/admin/AdminLayout-CiLlywAQ.cjs.map +0 -1
  57. package/dist/admin/AdminLayout-CtkVYk-u.js.map +0 -1
  58. package/dist/admin/AdminNotifications-DNUeJ-PW.cjs +0 -44
  59. package/dist/admin/AdminNotifications-DNUeJ-PW.cjs.map +0 -1
  60. package/dist/admin/AdminNotifications-DaMu1AQ4.js +0 -4
  61. package/dist/admin/AdminNotifications-DnnulNNV.js.map +0 -1
  62. package/dist/admin/AdminNotifications-ihgbKVCx.cjs +0 -4
  63. package/dist/admin/AdminParameters-B3hvpLpu.js.map +0 -1
  64. package/dist/admin/AdminParameters-U4lU1rUF.cjs +0 -4
  65. package/dist/admin/AdminParameters-gdf7036N.cjs +0 -44
  66. package/dist/admin/AdminParameters-gdf7036N.cjs.map +0 -1
  67. package/dist/admin/AdminParameters-prMcCgxf.js +0 -4
  68. package/dist/admin/AdminSessions-BF_P4lHs.cjs +0 -128
  69. package/dist/admin/AdminSessions-BF_P4lHs.cjs.map +0 -1
  70. package/dist/admin/AdminSessions-CATIU61I.cjs +0 -4
  71. package/dist/admin/AdminSessions-DqOXOpYR.js +0 -4
  72. package/dist/admin/AdminSessions-Pjdz-iZx.js.map +0 -1
  73. package/dist/admin/AdminUsers-BgTL-zSY.js +0 -4
  74. package/dist/admin/AdminUsers-C1HsrRxn.js.map +0 -1
  75. package/dist/admin/AdminUsers-HqvxwNGZ.cjs +0 -4
  76. package/dist/admin/AdminUsers-M2uEQbp5.cjs +0 -109
  77. package/dist/admin/AdminUsers-M2uEQbp5.cjs.map +0 -1
  78. package/dist/admin/AdminVerifications-BVssbtfU.cjs +0 -44
  79. package/dist/admin/AdminVerifications-BVssbtfU.cjs.map +0 -1
  80. package/dist/admin/AdminVerifications-Df6DRgNo.js +0 -4
  81. package/dist/admin/AdminVerifications-DxAtcYUR.cjs +0 -4
  82. package/dist/admin/AdminVerifications-VMpm30mS.js.map +0 -1
  83. package/dist/admin/core-CzO6aavT.js +0 -2507
  84. package/dist/admin/core-CzO6aavT.js.map +0 -1
  85. package/dist/admin/core-aFtK4l9I.cjs +0 -2530
  86. package/dist/admin/core-aFtK4l9I.cjs.map +0 -1
  87. package/dist/admin/index.cjs +0 -87
  88. package/dist/admin/index.cjs.map +0 -1
  89. package/dist/admin/index.d.cts +0 -1739
  90. package/dist/auth/IconGoogle-B17BTQyD.cjs +0 -69
  91. package/dist/auth/IconGoogle-B17BTQyD.cjs.map +0 -1
  92. package/dist/auth/Login-BTBmbnWl.cjs +0 -181
  93. package/dist/auth/Login-BTBmbnWl.cjs.map +0 -1
  94. package/dist/auth/Login-BcQOtG3v.js +0 -5
  95. package/dist/auth/Login-Btmd70Um.cjs +0 -5
  96. package/dist/auth/Login-JeXFsUf5.js.map +0 -1
  97. package/dist/auth/Register-CPQnvXCZ.js.map +0 -1
  98. package/dist/auth/Register-CbesZal3.cjs +0 -5
  99. package/dist/auth/Register-DpI_JdyO.js +0 -5
  100. package/dist/auth/Register-HP3rP71B.cjs +0 -323
  101. package/dist/auth/Register-HP3rP71B.cjs.map +0 -1
  102. package/dist/auth/ResetPassword-B-tkzV7g.cjs +0 -248
  103. package/dist/auth/ResetPassword-B-tkzV7g.cjs.map +0 -1
  104. package/dist/auth/ResetPassword-BlK3xEpU.js +0 -4
  105. package/dist/auth/ResetPassword-BzUjGG_-.js.map +0 -1
  106. package/dist/auth/ResetPassword-W3xjOnWy.cjs +0 -4
  107. package/dist/auth/chunk-DhGyd7sr.js +0 -28
  108. package/dist/auth/core-D1MHij1j.js +0 -1795
  109. package/dist/auth/core-D1MHij1j.js.map +0 -1
  110. package/dist/auth/core-rDZ9d92K.cjs +0 -1824
  111. package/dist/auth/core-rDZ9d92K.cjs.map +0 -1
  112. package/dist/auth/index.cjs +0 -211
  113. package/dist/auth/index.cjs.map +0 -1
  114. package/dist/auth/index.d.cts +0 -6265
  115. package/dist/core/index.cjs +0 -2620
  116. package/dist/core/index.cjs.map +0 -1
  117. package/dist/core/index.d.cts +0 -2737
@@ -1,16 +1,16 @@
1
- import { a as ui, i as ActionButton_default, t as AlephaUI } from "./core-D1MHij1j.js";
2
- import "./IconGoogle-Bfmuv9Rv.js";
3
- import { t as Login_default } from "./Login-JeXFsUf5.js";
4
- import { t as Register_default } from "./Register-CPQnvXCZ.js";
5
- import { t as ResetPassword_default } from "./ResetPassword-BzUjGG_-.js";
1
+ import "./IconGoogle-v_58os2T.js";
2
+ import { t as Login_default } from "./Login-OCrvjs9U.js";
3
+ import { t as Register_default } from "./Register-Ei34GSba.js";
4
+ import { t as ResetPassword_default } from "./ResetPassword-tO0oMzfo.js";
6
5
  import { AlephaReactAuth, useAuth } from "@alepha/react/auth";
7
6
  import { $dictionary, AlephaReactI18n } from "@alepha/react/i18n";
7
+ import { ActionButton, AlephaUI, ui } from "@alepha/ui";
8
8
  import { $module, t } from "alepha";
9
9
  import { $page } from "@alepha/react";
10
+ import { $client } from "alepha/server/links";
10
11
  import { Avatar } from "@mantine/core";
11
12
  import { IconLogout, IconUser } from "@tabler/icons-react";
12
13
  import { jsx } from "react/jsx-runtime";
13
- import { $client } from "alepha/server/links";
14
14
 
15
15
  //#region src/auth/AuthI18n.ts
16
16
  var AuthI18n = class {
@@ -120,7 +120,7 @@ var AuthRouter = class {
120
120
  login = $page({
121
121
  path: "/login",
122
122
  schema: { query: t.object({ redirect: t.optional(t.string()) }) },
123
- lazy: () => import("./Login-BcQOtG3v.js"),
123
+ lazy: () => import("./Login-BC2jTczq.js"),
124
124
  resolve: async () => {
125
125
  return { realmConfig: await this.userRealmClient.getRealmConfig() };
126
126
  }
@@ -128,7 +128,7 @@ var AuthRouter = class {
128
128
  register = $page({
129
129
  path: "/register",
130
130
  schema: { query: t.object({ redirect: t.optional(t.string()) }) },
131
- lazy: () => import("./Register-DpI_JdyO.js"),
131
+ lazy: () => import("./Register-Dh0lsQmI.js"),
132
132
  resolve: async () => {
133
133
  return { realmConfig: await this.userRealmClient.getRealmConfig() };
134
134
  }
@@ -136,7 +136,7 @@ var AuthRouter = class {
136
136
  resetPassword = $page({
137
137
  path: "/reset-password",
138
138
  schema: { query: t.object({ redirect: t.optional(t.string()) }) },
139
- lazy: () => import("./ResetPassword-BlK3xEpU.js"),
139
+ lazy: () => import("./ResetPassword-BnlAQAOE.js"),
140
140
  resolve: async () => {
141
141
  return { realmConfig: await this.userRealmClient.getRealmConfig() };
142
142
  }
@@ -164,7 +164,7 @@ const UserButton = (props) => {
164
164
  onClick: () => auth.logout()
165
165
  });
166
166
  const hasAvatar = !icon && auth.user.picture;
167
- return /* @__PURE__ */ jsx(ActionButton_default, {
167
+ return /* @__PURE__ */ jsx(ActionButton, {
168
168
  ...buttonProps,
169
169
  icon: hasAvatar ? void 0 : icon ?? IconUser,
170
170
  leftSection: hasAvatar ? /* @__PURE__ */ jsx(Avatar, {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["items: ActionMenuItem[]","ActionButton"],"sources":["../../src/auth/AuthI18n.ts","../../src/auth/AuthRouter.ts","../../src/auth/components/buttons/UserButton.tsx","../../src/auth/index.ts"],"sourcesContent":["import { $dictionary } from \"@alepha/react/i18n\";\n\nexport class AuthI18n {\n en = $dictionary({\n name: \"alepha.ui.auth.en\",\n lazy: () => ({\n default: {\n loginSignIn: \"Sign in\",\n loginContinueWith: \"Continue with $1\",\n loginOr: \"OR\",\n loginCancel: \"Cancel\",\n loginForgotPassword: \"Forgot password?\",\n loginNoAccount: \"Don't have an account?\",\n loginSignUp: \"Sign up\",\n loginUsername: \"Username\",\n loginEmail: \"Email\",\n loginPhone: \"Phone number\",\n loginPassword: \"Password\",\n registerCreateAccount: \"Create account\",\n registerContinueWith: \"Continue with $1\",\n registerOr: \"OR\",\n registerCancel: \"Cancel\",\n registerHaveAccount: \"Already have an account?\",\n registerSignIn: \"Sign in\",\n registerUsername: \"Username\",\n registerEmail: \"Email\",\n registerPhone: \"Phone number\",\n registerPassword: \"Password\",\n registerConfirmPassword: \"Confirm password\",\n registerDisabled:\n \"Registration is not available. Please contact your administrator.\",\n registerBackToSignIn: \"Back to sign in\",\n registerVerifyTitle: \"Verify your account\",\n registerVerifyDescription:\n \"Please enter the verification code(s) sent to you.\",\n registerEmailCode: \"Email verification code\",\n registerPhoneCode: \"Phone verification code\",\n registerVerifySubmit: \"Complete Registration\",\n registerVerifyBack: \"Back to registration\",\n resetPasswordTitle: \"Reset password\",\n resetPasswordEmail: \"Email\",\n resetPasswordEnterEmail:\n \"Enter your email address to reset your password\",\n resetPasswordSendCode: \"Send verification code\",\n resetPasswordCodeSent: \"We've sent a verification code to your email.\",\n resetPasswordEnterCode: \"Enter the 6-digit code\",\n resetPasswordResendCode: \"Resend code\",\n resetPasswordEnterNewPassword: \"Create your new password\",\n resetPasswordNewPassword: \"New password\",\n resetPasswordConfirmPassword: \"Confirm password\",\n resetPasswordSetNewPassword: \"Set new password\",\n resetPasswordSuccess: \"Your password has been reset successfully.\",\n resetPasswordBackToSignIn: \"Back to sign in\",\n resetPasswordCancel: \"Cancel\",\n resetPasswordDisabled:\n \"Password reset is not available. Please contact your administrator.\",\n },\n }),\n });\n\n fr = $dictionary({\n lazy: () => ({\n default: {\n loginSignIn: \"Se connecter\",\n loginContinueWith: \"Continuer avec $1\",\n loginOr: \"OU\",\n loginCancel: \"Annuler\",\n loginForgotPassword: \"Mot de passe oublié ?\",\n loginNoAccount: \"Vous n'avez pas de compte ?\",\n loginSignUp: \"S'inscrire\",\n loginUsername: \"Nom d'utilisateur\",\n loginEmail: \"E-mail\",\n loginPhone: \"Numéro de téléphone\",\n loginPassword: \"Mot de passe\",\n registerCreateAccount: \"Créer un compte\",\n registerContinueWith: \"Continuer avec $1\",\n registerOr: \"OU\",\n registerCancel: \"Annuler\",\n registerHaveAccount: \"Vous avez déjà un compte ?\",\n registerSignIn: \"Se connecter\",\n registerUsername: \"Nom d'utilisateur\",\n registerEmail: \"E-mail\",\n registerPhone: \"Numéro de téléphone\",\n registerPassword: \"Mot de passe\",\n registerConfirmPassword: \"Confirmer le mot de passe\",\n registerDisabled:\n \"L'inscription n'est pas disponible. Veuillez contacter votre administrateur.\",\n registerBackToSignIn: \"Retour à la connexion\",\n registerVerifyTitle: \"Vérifiez votre compte\",\n registerVerifyDescription:\n \"Veuillez entrer le(s) code(s) de vérification qui vous ont été envoyés.\",\n registerEmailCode: \"Code de vérification par e-mail\",\n registerPhoneCode: \"Code de vérification par téléphone\",\n registerVerifySubmit: \"Terminer l'inscription\",\n registerVerifyBack: \"Retour à l'inscription\",\n resetPasswordTitle: \"Réinitialiser le mot de passe\",\n resetPasswordEmail: \"E-mail\",\n resetPasswordEnterEmail:\n \"Entrez votre adresse e-mail pour réinitialiser votre mot de passe\",\n resetPasswordSendCode: \"Envoyer le code de vérification\",\n resetPasswordCodeSent:\n \"Nous avons envoyé un code de vérification à votre e-mail.\",\n resetPasswordEnterCode: \"Entrez le code à 6 chiffres\",\n resetPasswordResendCode: \"Renvoyer le code\",\n resetPasswordEnterNewPassword: \"Créez votre nouveau mot de passe\",\n resetPasswordNewPassword: \"Nouveau mot de passe\",\n resetPasswordConfirmPassword: \"Confirmer le mot de passe\",\n resetPasswordSetNewPassword: \"Définir le nouveau mot de passe\",\n resetPasswordSuccess:\n \"Votre mot de passe a été réinitialisé avec succès.\",\n resetPasswordBackToSignIn: \"Retour à la connexion\",\n resetPasswordCancel: \"Annuler\",\n resetPasswordDisabled:\n \"La réinitialisation du mot de passe n'est pas disponible. Veuillez contacter votre administrateur.\",\n },\n }),\n });\n}\n","import { $page } from \"@alepha/react\";\nimport { t } from \"alepha\";\nimport type { UserRealmController } from \"alepha/api/users\";\nimport { $client } from \"alepha/server/links\";\n\nexport class AuthRouter {\n userRealmClient = $client<UserRealmController>();\n\n login = $page({\n path: \"/login\",\n schema: {\n query: t.object({\n redirect: t.optional(t.string()),\n }),\n },\n lazy: () => import(\"./components/Login.tsx\"),\n resolve: async () => {\n return {\n realmConfig: await this.userRealmClient.getRealmConfig(),\n };\n },\n });\n\n register = $page({\n path: \"/register\",\n schema: {\n query: t.object({\n redirect: t.optional(t.string()),\n }),\n },\n lazy: () => import(\"./components/Register.tsx\"),\n resolve: async () => {\n return {\n realmConfig: await this.userRealmClient.getRealmConfig(),\n };\n },\n });\n\n resetPassword = $page({\n path: \"/reset-password\",\n schema: {\n query: t.object({\n redirect: t.optional(t.string()),\n }),\n },\n lazy: () => import(\"./components/ResetPassword.tsx\"),\n resolve: async () => {\n return {\n realmConfig: await this.userRealmClient.getRealmConfig(),\n };\n },\n });\n}\n","import { useAuth } from \"@alepha/react/auth\";\nimport {\n ActionButton,\n type ActionMenuConfig,\n type ActionMenuItem,\n type ActionProps,\n ui,\n} from \"@alepha/ui\";\nimport { Avatar } from \"@mantine/core\";\nimport { IconLogout, IconUser } from \"@tabler/icons-react\";\nimport type { ReactNode } from \"react\";\n\nexport interface UserButtonProps\n extends Omit<ActionProps, \"menu\" | \"icon\" | \"onClick\"> {\n /**\n * Additional menu items to display before the logout option\n */\n menuItems?: ActionMenuItem[];\n\n /**\n * Custom logout label (default: \"Sign out\")\n */\n logoutLabel?: string;\n\n /**\n * Menu configuration overrides\n */\n menuConfig?: Partial<Omit<ActionMenuConfig, \"items\">>;\n\n /**\n * Whether to show a divider before logout (default: true when menuItems provided)\n */\n showLogoutDivider?: boolean;\n\n /**\n * Custom icon to use instead of user avatar (default: IconUser)\n */\n icon?: ReactNode;\n}\n\nconst UserButton = (props: UserButtonProps) => {\n const {\n menuItems = [],\n logoutLabel = \"Sign out\",\n menuConfig,\n showLogoutDivider = menuItems.length > 0,\n icon,\n children,\n ...buttonProps\n } = props;\n\n const auth = useAuth<{\n username?: string;\n email?: string;\n picture?: string;\n }>();\n\n if (!auth.user) {\n return null;\n }\n\n const userLabel = auth.user.username || auth.user.email;\n\n const items: ActionMenuItem[] = [];\n\n // Add user info label if available\n if (auth.user.email && auth.user.username) {\n items.push({\n type: \"label\",\n label: auth.user.email,\n });\n }\n\n // Add custom menu items\n items.push(...menuItems);\n\n // Add divider before logout if needed\n if (showLogoutDivider && items.length > 0) {\n items.push({ type: \"divider\" });\n }\n\n // Add logout item\n items.push({\n label: logoutLabel,\n icon: <IconLogout size={ui.sizes.icon.md} />,\n color: \"red\",\n onClick: () => auth.logout(),\n });\n\n // Use leftSection for Avatar (JSX element), icon prop for component types\n const hasAvatar = !icon && auth.user.picture;\n\n return (\n <ActionButton\n {...buttonProps}\n icon={hasAvatar ? undefined : (icon ?? IconUser)}\n leftSection={\n hasAvatar ? (\n <Avatar\n src={`/api/files/${auth.user.picture}`}\n size={24}\n radius=\"xl\"\n />\n ) : undefined\n }\n menu={{\n position: \"bottom-end\",\n width: 200,\n ...menuConfig,\n items,\n }}\n >\n {children ?? userLabel}\n </ActionButton>\n );\n};\n\nexport default UserButton;\n","import { AlephaReactAuth } from \"@alepha/react/auth\";\nimport { AlephaReactI18n } from \"@alepha/react/i18n\";\nimport { AlephaUI } from \"@alepha/ui\";\nimport { $module } from \"alepha\";\nimport { AuthI18n } from \"./AuthI18n.ts\";\nimport { AuthRouter } from \"./AuthRouter.ts\";\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport * from \"./AuthRouter.ts\";\nexport type { UserButtonProps } from \"./components/buttons/UserButton.tsx\";\nexport { default as UserButton } from \"./components/buttons/UserButton.tsx\";\nexport { default as Login } from \"./components/Login.tsx\";\nexport { default as Register } from \"./components/Register.tsx\";\nexport { default as ResetPassword } from \"./components/ResetPassword.tsx\";\n\n// ---------------------------------------------------------------------------------------------------------------------\n\n/**\n * Login UI Module\n *\n * @module alepha.ui.auth\n */\nexport const AlephaUIAuth = $module({\n name: \"alepha.ui.auth\",\n services: [AlephaUI, AlephaReactAuth, AlephaReactI18n, AuthRouter, AuthI18n],\n});\n"],"mappings":";;;;;;;;;;;;;;;AAEA,IAAa,WAAb,MAAsB;CACpB,KAAK,YAAY;EACf,MAAM;EACN,aAAa,EACX,SAAS;GAC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M,SAAS,EACtC,OAAM,KAAK,EAAE,MAAM,WAAW,CAAC;AAIjC,OAAM,KAAK;EACT,OAAO;EACP,MAAM,oBAAC,cAAW,MAAM,GAAG,MAAM,KAAK,KAAM;EAC5C,OAAO;EACP,eAAe,KAAK,QAAQ;EAC7B,CAAC;CAGF,MAAM,YAAY,CAAC,QAAQ,KAAK,KAAK;AAErC,QACE,oBAACC;EACC,GAAI;EACJ,MAAM,YAAY,SAAa,QAAQ;EACvC,aACE,YACE,oBAAC;GACC,KAAK,cAAc,KAAK,KAAK;GAC7B,MAAM;GACN,QAAO;IACP,GACA;EAEN,MAAM;GACJ,UAAU;GACV,OAAO;GACP,GAAG;GACH;GACD;YAEA,YAAY;GACA;;AAInB,yBAAe;;;;;;;;;AC9Ff,MAAa,eAAe,QAAQ;CAClC,MAAM;CACN,UAAU;EAAC;EAAU;EAAiB;EAAiB;EAAY;EAAS;CAC7E,CAAC"}
1
+ {"version":3,"file":"index.js","names":["items: ActionMenuItem[]"],"sources":["../../src/auth/AuthI18n.ts","../../src/auth/AuthRouter.ts","../../src/auth/components/buttons/UserButton.tsx","../../src/auth/index.ts"],"sourcesContent":["import { $dictionary } from \"@alepha/react/i18n\";\n\nexport class AuthI18n {\n en = $dictionary({\n name: \"alepha.ui.auth.en\",\n lazy: () => ({\n default: {\n loginSignIn: \"Sign in\",\n loginContinueWith: \"Continue with $1\",\n loginOr: \"OR\",\n loginCancel: \"Cancel\",\n loginForgotPassword: \"Forgot password?\",\n loginNoAccount: \"Don't have an account?\",\n loginSignUp: \"Sign up\",\n loginUsername: \"Username\",\n loginEmail: \"Email\",\n loginPhone: \"Phone number\",\n loginPassword: \"Password\",\n registerCreateAccount: \"Create account\",\n registerContinueWith: \"Continue with $1\",\n registerOr: \"OR\",\n registerCancel: \"Cancel\",\n registerHaveAccount: \"Already have an account?\",\n registerSignIn: \"Sign in\",\n registerUsername: \"Username\",\n registerEmail: \"Email\",\n registerPhone: \"Phone number\",\n registerPassword: \"Password\",\n registerConfirmPassword: \"Confirm password\",\n registerDisabled:\n \"Registration is not available. Please contact your administrator.\",\n registerBackToSignIn: \"Back to sign in\",\n registerVerifyTitle: \"Verify your account\",\n registerVerifyDescription:\n \"Please enter the verification code(s) sent to you.\",\n registerEmailCode: \"Email verification code\",\n registerPhoneCode: \"Phone verification code\",\n registerVerifySubmit: \"Complete Registration\",\n registerVerifyBack: \"Back to registration\",\n resetPasswordTitle: \"Reset password\",\n resetPasswordEmail: \"Email\",\n resetPasswordEnterEmail:\n \"Enter your email address to reset your password\",\n resetPasswordSendCode: \"Send verification code\",\n resetPasswordCodeSent: \"We've sent a verification code to your email.\",\n resetPasswordEnterCode: \"Enter the 6-digit code\",\n resetPasswordResendCode: \"Resend code\",\n resetPasswordEnterNewPassword: \"Create your new password\",\n resetPasswordNewPassword: \"New password\",\n resetPasswordConfirmPassword: \"Confirm password\",\n resetPasswordSetNewPassword: \"Set new password\",\n resetPasswordSuccess: \"Your password has been reset successfully.\",\n resetPasswordBackToSignIn: \"Back to sign in\",\n resetPasswordCancel: \"Cancel\",\n resetPasswordDisabled:\n \"Password reset is not available. Please contact your administrator.\",\n },\n }),\n });\n\n fr = $dictionary({\n lazy: () => ({\n default: {\n loginSignIn: \"Se connecter\",\n loginContinueWith: \"Continuer avec $1\",\n loginOr: \"OU\",\n loginCancel: \"Annuler\",\n loginForgotPassword: \"Mot de passe oublié ?\",\n loginNoAccount: \"Vous n'avez pas de compte ?\",\n loginSignUp: \"S'inscrire\",\n loginUsername: \"Nom d'utilisateur\",\n loginEmail: \"E-mail\",\n loginPhone: \"Numéro de téléphone\",\n loginPassword: \"Mot de passe\",\n registerCreateAccount: \"Créer un compte\",\n registerContinueWith: \"Continuer avec $1\",\n registerOr: \"OU\",\n registerCancel: \"Annuler\",\n registerHaveAccount: \"Vous avez déjà un compte ?\",\n registerSignIn: \"Se connecter\",\n registerUsername: \"Nom d'utilisateur\",\n registerEmail: \"E-mail\",\n registerPhone: \"Numéro de téléphone\",\n registerPassword: \"Mot de passe\",\n registerConfirmPassword: \"Confirmer le mot de passe\",\n registerDisabled:\n \"L'inscription n'est pas disponible. Veuillez contacter votre administrateur.\",\n registerBackToSignIn: \"Retour à la connexion\",\n registerVerifyTitle: \"Vérifiez votre compte\",\n registerVerifyDescription:\n \"Veuillez entrer le(s) code(s) de vérification qui vous ont été envoyés.\",\n registerEmailCode: \"Code de vérification par e-mail\",\n registerPhoneCode: \"Code de vérification par téléphone\",\n registerVerifySubmit: \"Terminer l'inscription\",\n registerVerifyBack: \"Retour à l'inscription\",\n resetPasswordTitle: \"Réinitialiser le mot de passe\",\n resetPasswordEmail: \"E-mail\",\n resetPasswordEnterEmail:\n \"Entrez votre adresse e-mail pour réinitialiser votre mot de passe\",\n resetPasswordSendCode: \"Envoyer le code de vérification\",\n resetPasswordCodeSent:\n \"Nous avons envoyé un code de vérification à votre e-mail.\",\n resetPasswordEnterCode: \"Entrez le code à 6 chiffres\",\n resetPasswordResendCode: \"Renvoyer le code\",\n resetPasswordEnterNewPassword: \"Créez votre nouveau mot de passe\",\n resetPasswordNewPassword: \"Nouveau mot de passe\",\n resetPasswordConfirmPassword: \"Confirmer le mot de passe\",\n resetPasswordSetNewPassword: \"Définir le nouveau mot de passe\",\n resetPasswordSuccess:\n \"Votre mot de passe a été réinitialisé avec succès.\",\n resetPasswordBackToSignIn: \"Retour à la connexion\",\n resetPasswordCancel: \"Annuler\",\n resetPasswordDisabled:\n \"La réinitialisation du mot de passe n'est pas disponible. Veuillez contacter votre administrateur.\",\n },\n }),\n });\n}\n","import { $page } from \"@alepha/react\";\nimport { t } from \"alepha\";\nimport type { UserRealmController } from \"alepha/api/users\";\nimport { $client } from \"alepha/server/links\";\n\nexport class AuthRouter {\n userRealmClient = $client<UserRealmController>();\n\n login = $page({\n path: \"/login\",\n schema: {\n query: t.object({\n redirect: t.optional(t.string()),\n }),\n },\n lazy: () => import(\"./components/Login.tsx\"),\n resolve: async () => {\n return {\n realmConfig: await this.userRealmClient.getRealmConfig(),\n };\n },\n });\n\n register = $page({\n path: \"/register\",\n schema: {\n query: t.object({\n redirect: t.optional(t.string()),\n }),\n },\n lazy: () => import(\"./components/Register.tsx\"),\n resolve: async () => {\n return {\n realmConfig: await this.userRealmClient.getRealmConfig(),\n };\n },\n });\n\n resetPassword = $page({\n path: \"/reset-password\",\n schema: {\n query: t.object({\n redirect: t.optional(t.string()),\n }),\n },\n lazy: () => import(\"./components/ResetPassword.tsx\"),\n resolve: async () => {\n return {\n realmConfig: await this.userRealmClient.getRealmConfig(),\n };\n },\n });\n}\n","import { useAuth } from \"@alepha/react/auth\";\nimport {\n ActionButton,\n type ActionMenuConfig,\n type ActionMenuItem,\n type ActionProps,\n ui,\n} from \"@alepha/ui\";\nimport { Avatar } from \"@mantine/core\";\nimport { IconLogout, IconUser } from \"@tabler/icons-react\";\nimport type { ReactNode } from \"react\";\n\nexport interface UserButtonProps\n extends Omit<ActionProps, \"menu\" | \"icon\" | \"onClick\"> {\n /**\n * Additional menu items to display before the logout option\n */\n menuItems?: ActionMenuItem[];\n\n /**\n * Custom logout label (default: \"Sign out\")\n */\n logoutLabel?: string;\n\n /**\n * Menu configuration overrides\n */\n menuConfig?: Partial<Omit<ActionMenuConfig, \"items\">>;\n\n /**\n * Whether to show a divider before logout (default: true when menuItems provided)\n */\n showLogoutDivider?: boolean;\n\n /**\n * Custom icon to use instead of user avatar (default: IconUser)\n */\n icon?: ReactNode;\n}\n\nconst UserButton = (props: UserButtonProps) => {\n const {\n menuItems = [],\n logoutLabel = \"Sign out\",\n menuConfig,\n showLogoutDivider = menuItems.length > 0,\n icon,\n children,\n ...buttonProps\n } = props;\n\n const auth = useAuth<{\n username?: string;\n email?: string;\n picture?: string;\n }>();\n\n if (!auth.user) {\n return null;\n }\n\n const userLabel = auth.user.username || auth.user.email;\n\n const items: ActionMenuItem[] = [];\n\n // Add user info label if available\n if (auth.user.email && auth.user.username) {\n items.push({\n type: \"label\",\n label: auth.user.email,\n });\n }\n\n // Add custom menu items\n items.push(...menuItems);\n\n // Add divider before logout if needed\n if (showLogoutDivider && items.length > 0) {\n items.push({ type: \"divider\" });\n }\n\n // Add logout item\n items.push({\n label: logoutLabel,\n icon: <IconLogout size={ui.sizes.icon.md} />,\n color: \"red\",\n onClick: () => auth.logout(),\n });\n\n // Use leftSection for Avatar (JSX element), icon prop for component types\n const hasAvatar = !icon && auth.user.picture;\n\n return (\n <ActionButton\n {...buttonProps}\n icon={hasAvatar ? undefined : (icon ?? IconUser)}\n leftSection={\n hasAvatar ? (\n <Avatar\n src={`/api/files/${auth.user.picture}`}\n size={24}\n radius=\"xl\"\n />\n ) : undefined\n }\n menu={{\n position: \"bottom-end\",\n width: 200,\n ...menuConfig,\n items,\n }}\n >\n {children ?? userLabel}\n </ActionButton>\n );\n};\n\nexport default UserButton;\n","import { AlephaReactAuth } from \"@alepha/react/auth\";\nimport { AlephaReactI18n } from \"@alepha/react/i18n\";\nimport { AlephaUI } from \"@alepha/ui\";\nimport { $module } from \"alepha\";\nimport { AuthI18n } from \"./AuthI18n.ts\";\nimport { AuthRouter } from \"./AuthRouter.ts\";\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport * from \"./AuthRouter.ts\";\nexport type { UserButtonProps } from \"./components/buttons/UserButton.tsx\";\nexport { default as UserButton } from \"./components/buttons/UserButton.tsx\";\nexport { default as Login } from \"./components/Login.tsx\";\nexport { default as Register } from \"./components/Register.tsx\";\nexport { default as ResetPassword } from \"./components/ResetPassword.tsx\";\n\n// ---------------------------------------------------------------------------------------------------------------------\n\n/**\n * Login UI Module\n *\n * @module alepha.ui.auth\n */\nexport const AlephaUIAuth = $module({\n name: \"alepha.ui.auth\",\n services: [AlephaUI, AlephaReactAuth, AlephaReactI18n, AuthRouter, AuthI18n],\n});\n"],"mappings":";;;;;;;;;;;;;;;AAEA,IAAa,WAAb,MAAsB;CACpB,KAAK,YAAY;EACf,MAAM;EACN,aAAa,EACX,SAAS;GACP,aAAa;GACb,mBAAmB;GACnB,SAAS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MAAM,WAAW,CAAC;AAIjC,OAAM,KAAK;EACT,OAAO;EACP,MAAM,oBAAC,cAAW,MAAM,GAAG,MAAM,KAAK,KAAM;EAC5C,OAAO;EACP,eAAe,KAAK,QAAQ;EAC7B,CAAC;CAGF,MAAM,YAAY,CAAC,QAAQ,KAAK,KAAK;AAErC,QACE,oBAAC;EACC,GAAI;EACJ,MAAM,YAAY,SAAa,QAAQ;EACvC,aACE,YACE,oBAAC;GACC,KAAK,cAAc,KAAK,KAAK;GAC7B,MAAM;GACN,QAAO;IACP,GACA;EAEN,MAAM;GACJ,UAAU;GACV,OAAO;GACP,GAAG;GACH;GACD;YAEA,YAAY;GACA;;AAInB,yBAAe;;;;;;;;;AC9Ff,MAAa,eAAe,QAAQ;CAClC,MAAM;CACN,UAAU;EAAC;EAAU;EAAiB;EAAiB;EAAY;EAAS;CAC7E,CAAC"}
@@ -1,4 +1,4 @@
1
- import * as alepha86 from "alepha";
1
+ import * as alepha59 from "alepha";
2
2
  import { Alepha, AlephaError, Async, Descriptor, FileLike, InstantiableClass, LogLevel, LoggerInterface, Page, PageMetadata, Static, StreamLike, TArray, TFile, TObject, TProperties, TRecord, TSchema, TStream, TString, TVoid, TypeBoxError } from "alepha";
3
3
  import { AnchorProps, AppShellFooterProps, AppShellHeaderProps, AppShellMainProps, AppShellNavbarProps, AppShellProps, AutocompleteProps, BurgerProps, ButtonProps, ColorInputProps, ColorSchemeScriptProps, FileInputProps, Flex, FlexProps, MantineBreakpoint, MantineProviderProps, MantineSize, MenuProps, MenuTargetProps, ModalProps, MultiSelectProps, NumberInputProps, PasswordInputProps, SegmentedControlProps, SelectProps, SliderProps, SwitchProps, TableProps, TableTrProps, TagsInputProps, Text, TextInputProps, TextareaProps, ThemeIconProps, TooltipProps } from "@mantine/core";
4
4
  import { ModalsProviderProps } from "@mantine/modals";
@@ -21,15 +21,15 @@ import { Readable } from "node:stream";
21
21
  import { ReadableStream } from "node:stream/web";
22
22
 
23
23
  //#region ../alepha/src/logger/schemas/logEntrySchema.d.ts
24
- declare const logEntrySchema: alepha86.TObject<{
25
- level: alepha86.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
26
- message: alepha86.TString;
27
- service: alepha86.TString;
28
- module: alepha86.TString;
29
- context: alepha86.TOptional<alepha86.TString>;
30
- app: alepha86.TOptional<alepha86.TString>;
31
- data: alepha86.TOptional<alepha86.TAny>;
32
- timestamp: alepha86.TNumber;
24
+ declare const logEntrySchema: alepha59.TObject<{
25
+ level: alepha59.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
26
+ message: alepha59.TString;
27
+ service: alepha59.TString;
28
+ module: alepha59.TString;
29
+ context: alepha59.TOptional<alepha59.TString>;
30
+ app: alepha59.TOptional<alepha59.TString>;
31
+ data: alepha59.TOptional<alepha59.TAny>;
32
+ timestamp: alepha59.TNumber;
33
33
  }>;
34
34
  type LogEntry = Static<typeof logEntrySchema>;
35
35
  //#endregion
@@ -44,8 +44,8 @@ declare class DateTimeProvider {
44
44
  protected readonly timeouts: Timeout[];
45
45
  protected readonly intervals: Interval[];
46
46
  constructor();
47
- protected readonly onStart: alepha86.HookDescriptor<"start">;
48
- protected readonly onStop: alepha86.HookDescriptor<"stop">;
47
+ protected readonly onStart: alepha59.HookDescriptor<"start">;
48
+ protected readonly onStop: alepha59.HookDescriptor<"stop">;
49
49
  setLocale(locale: string): void;
50
50
  isDateTime(value: unknown): value is DateTime;
51
51
  /**
@@ -177,7 +177,7 @@ declare class Logger implements LoggerInterface {
177
177
  }
178
178
  //#endregion
179
179
  //#region ../alepha/src/logger/index.d.ts
180
- declare const envSchema$6: alepha86.TObject<{
180
+ declare const envSchema$6: alepha59.TObject<{
181
181
  /**
182
182
  * Default log level for the application.
183
183
  *
@@ -194,14 +194,14 @@ declare const envSchema$6: alepha86.TObject<{
194
194
  * LOG_LEVEL=my.module.name:debug,info # Set debug level for my.module.name and info for all other modules
195
195
  * LOG_LEVEL=alepha:trace, info # Set trace level for all alepha modules and info for all other modules
196
196
  */
197
- LOG_LEVEL: alepha86.TOptional<alepha86.TString>;
197
+ LOG_LEVEL: alepha59.TOptional<alepha59.TString>;
198
198
  /**
199
199
  * Built-in log formats.
200
200
  * - "json" - JSON format, useful for structured logging and log aggregation. {@link JsonFormatterProvider}
201
201
  * - "pretty" - Simple text format, human-readable, with colors. {@link SimpleFormatterProvider}
202
202
  * - "raw" - Raw format, no formatting, just the message. {@link RawFormatterProvider}
203
203
  */
204
- LOG_FORMAT: alepha86.TOptional<alepha86.TUnsafe<"json" | "pretty" | "raw">>;
204
+ LOG_FORMAT: alepha59.TOptional<alepha59.TUnsafe<"json" | "pretty" | "raw">>;
205
205
  }>;
206
206
  declare module "alepha" {
207
207
  interface Env extends Partial<Static<typeof envSchema$6>> {}
@@ -691,8 +691,8 @@ declare class ServerTimingProvider {
691
691
  prefix: string;
692
692
  disabled: boolean;
693
693
  };
694
- readonly onRequest: alepha86.HookDescriptor<"server:onRequest">;
695
- readonly onResponse: alepha86.HookDescriptor<"server:onResponse">;
694
+ readonly onRequest: alepha59.HookDescriptor<"server:onRequest">;
695
+ readonly onResponse: alepha59.HookDescriptor<"server:onResponse">;
696
696
  protected get handlerName(): string;
697
697
  beginTiming(name: string): void;
698
698
  endTiming(name: string): void;
@@ -756,11 +756,11 @@ declare class ServerProvider {
756
756
  /**
757
757
  * When a Node.js HTTP request is received from outside. (Vercel, AWS Lambda, etc.)
758
758
  */
759
- protected readonly onNodeRequest: alepha86.HookDescriptor<"node:request">;
759
+ protected readonly onNodeRequest: alepha59.HookDescriptor<"node:request">;
760
760
  /**
761
761
  * When a Web (Fetch API) request is received from outside. (Netlify, Cloudflare Workers, etc.)
762
762
  */
763
- protected readonly onWebRequest: alepha86.HookDescriptor<"web:request">;
763
+ protected readonly onWebRequest: alepha59.HookDescriptor<"web:request">;
764
764
  /**
765
765
  * Handle Node.js HTTP request event.
766
766
  *
@@ -1095,15 +1095,15 @@ type ServerActionHandler<TConfig extends RequestConfigSchema = RequestConfigSche
1095
1095
  interface ServerActionRequest<TConfig extends RequestConfigSchema> extends ServerRequest<TConfig> {}
1096
1096
  //#endregion
1097
1097
  //#region ../alepha/src/server/schemas/errorSchema.d.ts
1098
- declare const errorSchema: alepha86.TObject<{
1099
- error: alepha86.TString;
1100
- status: alepha86.TInteger;
1101
- message: alepha86.TString;
1102
- details: alepha86.TOptional<alepha86.TString>;
1103
- requestId: alepha86.TOptional<alepha86.TString>;
1104
- cause: alepha86.TOptional<alepha86.TObject<{
1105
- name: alepha86.TString;
1106
- message: alepha86.TString;
1098
+ declare const errorSchema: alepha59.TObject<{
1099
+ error: alepha59.TString;
1100
+ status: alepha59.TInteger;
1101
+ message: alepha59.TString;
1102
+ details: alepha59.TOptional<alepha59.TString>;
1103
+ requestId: alepha59.TOptional<alepha59.TString>;
1104
+ cause: alepha59.TOptional<alepha59.TObject<{
1105
+ name: alepha59.TString;
1106
+ message: alepha59.TString;
1107
1107
  }>>;
1108
1108
  }>;
1109
1109
  type ErrorSchema = Static<typeof errorSchema>;
@@ -1128,18 +1128,18 @@ interface HttpErrorLike extends Error {
1128
1128
  }
1129
1129
  //#endregion
1130
1130
  //#region ../alepha/src/server/providers/BunHttpServerProvider.d.ts
1131
- declare const envSchema$5: alepha86.TObject<{
1132
- SERVER_PORT: alepha86.TInteger;
1133
- SERVER_HOST: alepha86.TString;
1131
+ declare const envSchema$5: alepha59.TObject<{
1132
+ SERVER_PORT: alepha59.TInteger;
1133
+ SERVER_HOST: alepha59.TString;
1134
1134
  }>;
1135
1135
  declare module "alepha" {
1136
1136
  interface Env extends Partial<Static<typeof envSchema$5>> {}
1137
1137
  }
1138
1138
  //#endregion
1139
1139
  //#region ../alepha/src/server/providers/NodeHttpServerProvider.d.ts
1140
- declare const envSchema$4: alepha86.TObject<{
1141
- SERVER_PORT: alepha86.TInteger;
1142
- SERVER_HOST: alepha86.TString;
1140
+ declare const envSchema$4: alepha59.TObject<{
1141
+ SERVER_PORT: alepha59.TInteger;
1142
+ SERVER_HOST: alepha59.TString;
1143
1143
  }>;
1144
1144
  declare module "alepha" {
1145
1145
  interface Env extends Partial<Static<typeof envSchema$4>> {}
@@ -1316,8 +1316,8 @@ declare class Redirection extends Error {
1316
1316
  }
1317
1317
  //#endregion
1318
1318
  //#region ../react/src/core/providers/ReactPageProvider.d.ts
1319
- declare const envSchema$3: alepha86.TObject<{
1320
- REACT_STRICT_MODE: alepha86.TBoolean;
1319
+ declare const envSchema$3: alepha59.TObject<{
1320
+ REACT_STRICT_MODE: alepha59.TBoolean;
1321
1321
  }>;
1322
1322
  declare module "alepha" {
1323
1323
  interface Env extends Partial<Static<typeof envSchema$3>> {}
@@ -1617,15 +1617,15 @@ type CssAnimation = {
1617
1617
  };
1618
1618
  //#endregion
1619
1619
  //#region ../alepha/src/security/schemas/userAccountInfoSchema.d.ts
1620
- declare const userAccountInfoSchema: alepha86.TObject<{
1621
- id: alepha86.TString;
1622
- name: alepha86.TOptional<alepha86.TString>;
1623
- email: alepha86.TOptional<alepha86.TString>;
1624
- username: alepha86.TOptional<alepha86.TString>;
1625
- picture: alepha86.TOptional<alepha86.TString>;
1626
- sessionId: alepha86.TOptional<alepha86.TString>;
1627
- organizations: alepha86.TOptional<alepha86.TArray<alepha86.TString>>;
1628
- roles: alepha86.TOptional<alepha86.TArray<alepha86.TString>>;
1620
+ declare const userAccountInfoSchema: alepha59.TObject<{
1621
+ id: alepha59.TString;
1622
+ name: alepha59.TOptional<alepha59.TString>;
1623
+ email: alepha59.TOptional<alepha59.TString>;
1624
+ username: alepha59.TOptional<alepha59.TString>;
1625
+ picture: alepha59.TOptional<alepha59.TString>;
1626
+ sessionId: alepha59.TOptional<alepha59.TString>;
1627
+ organizations: alepha59.TOptional<alepha59.TArray<alepha59.TString>>;
1628
+ roles: alepha59.TOptional<alepha59.TArray<alepha59.TString>>;
1629
1629
  }>;
1630
1630
  type UserAccount = Static<typeof userAccountInfoSchema>;
1631
1631
  //#endregion
@@ -1651,8 +1651,8 @@ interface UserAccountToken extends UserAccount {
1651
1651
  }
1652
1652
  //#endregion
1653
1653
  //#region ../alepha/src/security/providers/SecurityProvider.d.ts
1654
- declare const envSchema$2: alepha86.TObject<{
1655
- APP_SECRET: alepha86.TString;
1654
+ declare const envSchema$2: alepha59.TObject<{
1655
+ APP_SECRET: alepha59.TString;
1656
1656
  }>;
1657
1657
  declare module "alepha" {
1658
1658
  interface Env extends Partial<Static<typeof envSchema$2>> {}
@@ -1745,15 +1745,15 @@ declare module "alepha/server" {
1745
1745
  */
1746
1746
  //#endregion
1747
1747
  //#region ../alepha/src/server-links/schemas/apiLinksResponseSchema.d.ts
1748
- declare const apiLinksResponseSchema: alepha86.TObject<{
1749
- prefix: alepha86.TOptional<alepha86.TString>;
1750
- links: alepha86.TArray<alepha86.TObject<{
1751
- name: alepha86.TString;
1752
- group: alepha86.TOptional<alepha86.TString>;
1753
- path: alepha86.TString;
1754
- method: alepha86.TOptional<alepha86.TString>;
1755
- requestBodyType: alepha86.TOptional<alepha86.TString>;
1756
- service: alepha86.TOptional<alepha86.TString>;
1748
+ declare const apiLinksResponseSchema: alepha59.TObject<{
1749
+ prefix: alepha59.TOptional<alepha59.TString>;
1750
+ links: alepha59.TArray<alepha59.TObject<{
1751
+ name: alepha59.TString;
1752
+ group: alepha59.TOptional<alepha59.TString>;
1753
+ path: alepha59.TString;
1754
+ method: alepha59.TOptional<alepha59.TString>;
1755
+ requestBodyType: alepha59.TOptional<alepha59.TString>;
1756
+ service: alepha59.TOptional<alepha59.TString>;
1757
1757
  }>>;
1758
1758
  }>;
1759
1759
  type ApiLinksResponse = Static<typeof apiLinksResponseSchema>;
@@ -1783,8 +1783,8 @@ declare module "alepha" {
1783
1783
  */
1784
1784
  //#endregion
1785
1785
  //#region ../react/src/core/providers/ReactBrowserProvider.d.ts
1786
- declare const envSchema$1: alepha86.TObject<{
1787
- REACT_ROOT_ID: alepha86.TString;
1786
+ declare const envSchema$1: alepha59.TObject<{
1787
+ REACT_ROOT_ID: alepha59.TString;
1788
1788
  }>;
1789
1789
  declare module "alepha" {
1790
1790
  interface Env extends Partial<Static<typeof envSchema$1>> {}
@@ -1792,8 +1792,8 @@ declare module "alepha" {
1792
1792
  /**
1793
1793
  * React browser renderer configuration atom
1794
1794
  */
1795
- declare const reactBrowserOptions: alepha86.Atom<alepha86.TObject<{
1796
- scrollRestoration: alepha86.TUnsafe<"top" | "manual">;
1795
+ declare const reactBrowserOptions: alepha59.Atom<alepha59.TObject<{
1796
+ scrollRestoration: alepha59.TUnsafe<"top" | "manual">;
1797
1797
  }>, "alepha.react.browser.options">;
1798
1798
  type ReactBrowserRendererOptions = Static<typeof reactBrowserOptions.schema>;
1799
1799
  declare module "alepha" {
@@ -1860,10 +1860,10 @@ interface UseActiveOptions {
1860
1860
  }
1861
1861
  //#endregion
1862
1862
  //#region ../react/src/core/providers/ReactServerProvider.d.ts
1863
- declare const envSchema: alepha86.TObject<{
1864
- REACT_SSR_ENABLED: alepha86.TOptional<alepha86.TBoolean>;
1865
- REACT_ROOT_ID: alepha86.TString;
1866
- REACT_SERVER_TEMPLATE: alepha86.TOptional<alepha86.TString>;
1863
+ declare const envSchema: alepha59.TObject<{
1864
+ REACT_SSR_ENABLED: alepha59.TOptional<alepha59.TBoolean>;
1865
+ REACT_ROOT_ID: alepha59.TString;
1866
+ REACT_SERVER_TEMPLATE: alepha59.TOptional<alepha59.TString>;
1867
1867
  }>;
1868
1868
  declare module "alepha" {
1869
1869
  interface Env extends Partial<Static<typeof envSchema>> {}
@@ -1874,11 +1874,11 @@ declare module "alepha" {
1874
1874
  /**
1875
1875
  * React server provider configuration atom
1876
1876
  */
1877
- declare const reactServerOptions: alepha86.Atom<alepha86.TObject<{
1878
- publicDir: alepha86.TString;
1879
- staticServer: alepha86.TObject<{
1880
- disabled: alepha86.TBoolean;
1881
- path: alepha86.TString;
1877
+ declare const reactServerOptions: alepha59.Atom<alepha59.TObject<{
1878
+ publicDir: alepha59.TString;
1879
+ staticServer: alepha59.TObject<{
1880
+ disabled: alepha59.TBoolean;
1881
+ path: alepha59.TString;
1882
1882
  }>;
1883
1883
  }>, "alepha.react.server.options">;
1884
1884
  type ReactServerProviderOptions = Static<typeof reactServerOptions.schema>;
@@ -2737,7 +2737,7 @@ declare module "@alepha/react" {
2737
2737
  *
2738
2738
  * @module alepha.ui
2739
2739
  */
2740
- declare const AlephaUI: alepha86.Service<alepha86.Module>;
2740
+ declare const AlephaUI: alepha59.Service<alepha59.Module>;
2741
2741
  //#endregion
2742
2742
  export { ActionButton, type ActionClickButtonProps, type ActionCommonProps, type ActionMenuConfig, type ActionMenuItem, type ActionNavigationButtonProps, type ActionProps, type ActionSubmitButtonProps, AdminShell, type AdminShellProps, AlephaMantineProvider, AlephaUI, AlertDialog, type AlertDialogOptions, type AlertDialogProps, AppBar, type AppBarBurger, type AppBarDark, type AppBarDivider, type AppBarElement, type AppBarItem, type AppBarLang, type AppBarProps, type AppBarSearch, type AppBarSpacer, type BaseDialogOptions, BurgerButton, ClipboardButton, type ClipboardButtonProps, ConfirmDialog, type ConfirmDialogOptions, type ConfirmDialogProps, Control, ControlDate, ControlQueryBuilder, ControlSelect, DarkModeButton, DataTable, type DataTableColumn, type DataTableProps, DialogService, Flex, IconSize, JsonViewer, LanguageButton, OPERATOR_INFO, Omnibar, OmnibarButton, PromptDialog, type PromptDialogOptions, type PromptDialogProps, RootRouter, SchemaField, Sidebar, type SidebarAbstractItem, type SidebarButtonTheme, type SidebarDivider, type SidebarElement, type SidebarItemProps, type SidebarMenuItem, type SidebarNode, type SidebarProps, type SidebarSearch, type SidebarSection, type SidebarSpacer, type SidebarTheme, Text, ToastService, TypeForm, capitalize, extractSchemaFields, getDefaultIcon, getOperatorsForField, prettyName, ui, useDialog, useToast };
2743
2743
  //# sourceMappingURL=index.d.ts.map
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "mantine"
8
8
  ],
9
9
  "author": "Nicolas Foures",
10
- "version": "0.13.0",
10
+ "version": "0.13.1",
11
11
  "type": "module",
12
12
  "engines": {
13
13
  "node": ">=22.0.0"
@@ -21,7 +21,7 @@
21
21
  "src"
22
22
  ],
23
23
  "dependencies": {
24
- "@alepha/react": "0.13.0",
24
+ "@alepha/react": "0.13.1",
25
25
  "@mantine/core": "^8.3.9",
26
26
  "@mantine/dates": "^8.3.9",
27
27
  "@mantine/hooks": "^8.3.9",
@@ -30,7 +30,7 @@
30
30
  "@mantine/nprogress": "^8.3.9",
31
31
  "@mantine/spotlight": "^8.3.9",
32
32
  "@tabler/icons-react": "^3.35.0",
33
- "alepha": "0.13.0",
33
+ "alepha": "0.13.1",
34
34
  "dayjs": "^1.11.19"
35
35
  },
36
36
  "devDependencies": {
@@ -56,18 +56,15 @@
56
56
  "exports": {
57
57
  "./admin": {
58
58
  "types": "./dist/admin/index.js",
59
- "import": "./dist/admin/index.js",
60
- "require": "./dist/admin/index.js"
59
+ "import": "./dist/admin/index.js"
61
60
  },
62
61
  "./auth": {
63
62
  "types": "./dist/auth/index.js",
64
- "import": "./dist/auth/index.js",
65
- "require": "./dist/auth/index.js"
63
+ "import": "./dist/auth/index.js"
66
64
  },
67
65
  ".": {
68
66
  "types": "./dist/core/index.js",
69
- "import": "./dist/core/index.js",
70
- "require": "./dist/core/index.js"
67
+ "import": "./dist/core/index.js"
71
68
  },
72
69
  "./styles": "./styles.css"
73
70
  },
@@ -1,4 +0,0 @@
1
- require('./core-aFtK4l9I.cjs');
2
- const require_AdminFiles = require('./AdminFiles-DC3T8uWZ.cjs');
3
-
4
- exports.default = require_AdminFiles.AdminFiles_default;
@@ -1,4 +0,0 @@
1
- import "./core-CzO6aavT.js";
2
- import { t as AdminFiles_default } from "./AdminFiles-CllAxb1B.js";
3
-
4
- export { AdminFiles_default as default };
@@ -1 +0,0 @@
1
- {"version":3,"file":"AdminFiles-CllAxb1B.js","names":["Flex","DataTable","filters","Text"],"sources":["../../src/admin/components/AdminFiles.tsx"],"sourcesContent":["import { useClient } from \"@alepha/react\";\nimport { useI18n } from \"@alepha/react/i18n\";\nimport { DataTable, Flex, Text } from \"@alepha/ui\";\nimport { Badge } from \"@mantine/core\";\nimport { type Page, t } from \"alepha\";\nimport { type FileController, type FileEntity, files } from \"alepha/api/files\";\n\nconst AdminFiles = () => {\n const client = useClient<FileController>();\n const { l } = useI18n();\n\n const filters = t.object({\n bucket: t.optional(t.string()),\n name: t.optional(\n t.string({\n $control: {\n query: t.pick(files.schema, [\"name\", \"bucket\", \"mimeType\"]),\n },\n }),\n ),\n });\n\n const formatFileSize = (bytes: number) => {\n if (bytes === 0) return \"0 B\";\n const k = 1024;\n const sizes = [\"B\", \"KB\", \"MB\", \"GB\"];\n const i = Math.floor(Math.log(bytes) / Math.log(k));\n return `${Number.parseFloat((bytes / k ** i).toFixed(1))} ${sizes[i]}`;\n };\n\n return (\n <Flex flex={1}>\n <DataTable<FileEntity, typeof filters>\n submitOnInit\n defaultSize={10}\n typeFormProps={{\n skipSubmitButton: true,\n columns: 3,\n }}\n tableProps={{\n horizontalSpacing: \"xs\",\n verticalSpacing: \"xs\",\n }}\n onFilterChange={(key, _value, form) => {\n if (key === \"name\" || key === \"bucket\") {\n return form.submit();\n }\n }}\n filters={filters}\n items={async (filters) => {\n const response = await client.findFiles({\n query: filters,\n });\n\n return response as Page<FileEntity>;\n }}\n columns={{\n name: {\n label: \"Name\",\n value: (item) => (\n <Text size=\"sm\" fw={500} lineClamp={1}>\n {item.name}\n </Text>\n ),\n },\n bucket: {\n label: \"Bucket\",\n fit: true,\n value: (item) => (\n <Badge size=\"sm\" variant=\"light\" color=\"blue\">\n {item.bucket}\n </Badge>\n ),\n },\n mimeType: {\n label: \"Type\",\n fit: true,\n value: (item) => (\n <Text size=\"xs\" c=\"dimmed\">\n {item.mimeType}\n </Text>\n ),\n },\n size: {\n label: \"Size\",\n fit: true,\n value: (item) => (\n <Text size=\"xs\" c=\"dimmed\">\n {formatFileSize(item.size)}\n </Text>\n ),\n },\n creatorName: {\n label: \"Creator\",\n fit: true,\n value: (item) => (\n <Text size=\"xs\" c=\"dimmed\">\n {item.creatorName || \"-\"}\n </Text>\n ),\n },\n createdAt: {\n label: \"Created\",\n fit: true,\n value: (item) => (\n <Text size=\"xs\" c=\"dimmed\">\n {l(item.createdAt, { date: \"fromNow\" })}\n </Text>\n ),\n },\n }}\n />\n </Flex>\n );\n};\n\nexport default AdminFiles;\n"],"mappings":";;;;;;;;;AAOA,MAAM,mBAAmB;CACvB,MAAM,SAAS,WAA2B;CAC1C,MAAM,EAAE,MAAM,SAAS;CAEvB,MAAM,UAAU,EAAE,OAAO;EACvB,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAC;EAC9B,MAAM,EAAE,SACN,EAAE,OAAO,EACP,UAAU,EACR,OAAO,EAAE,KAAK,MAAM,QAAQ;GAAC;GAAQ;GAAU;GAAW,CAAC,EAC5D,EACF,CAAC,CACH;EACF,CAAC;CAEF,MAAM,kBAAkB,UAAkB;AACxC,MAAI,UAAU,EAAG,QAAO;EACxB,MAAM,IAAI;EACV,MAAM,QAAQ;GAAC;GAAK;GAAM;GAAM;GAAK;EACrC,MAAM,IAAI,KAAK,MAAM,KAAK,IAAI,MAAM,GAAG,KAAK,IAAI,EAAE,CAAC;AACnD,SAAO,GAAG,OAAO,YAAY,QAAQ,KAAK,GAAG,QAAQ,EAAE,CAAC,CAAC,GAAG,MAAM;;AAGpE,QACE,oBAACA;EAAK,MAAM;YACV,oBAACC;GACC;GACA,aAAa;GACb,eAAe;IACb,kBAAkB;IAClB,SAAS;IACV;GACD,YAAY;IACV,mBAAmB;IACnB,iBAAiB;IAClB;GACD,iBAAiB,KAAK,QAAQ,SAAS;AACrC,QAAI,QAAQ,UAAU,QAAQ,SAC5B,QAAO,KAAK,QAAQ;;GAGf;GACT,OAAO,OAAO,cAAY;AAKxB,WAJiB,MAAM,OAAO,UAAU,EACtC,OAAOC,WACR,CAAC;;GAIJ,SAAS;IACP,MAAM;KACJ,OAAO;KACP,QAAQ,SACN,oBAACC;MAAK,MAAK;MAAK,IAAI;MAAK,WAAW;gBACjC,KAAK;OACD;KAEV;IACD,QAAQ;KACN,OAAO;KACP,KAAK;KACL,QAAQ,SACN,oBAAC;MAAM,MAAK;MAAK,SAAQ;MAAQ,OAAM;gBACpC,KAAK;OACA;KAEX;IACD,UAAU;KACR,OAAO;KACP,KAAK;KACL,QAAQ,SACN,oBAACA;MAAK,MAAK;MAAK,GAAE;gBACf,KAAK;OACD;KAEV;IACD,MAAM;KACJ,OAAO;KACP,KAAK;KACL,QAAQ,SACN,oBAACA;MAAK,MAAK;MAAK,GAAE;gBACf,eAAe,KAAK,KAAK;OACrB;KAEV;IACD,aAAa;KACX,OAAO;KACP,KAAK;KACL,QAAQ,SACN,oBAACA;MAAK,MAAK;MAAK,GAAE;gBACf,KAAK,eAAe;OAChB;KAEV;IACD,WAAW;KACT,OAAO;KACP,KAAK;KACL,QAAQ,SACN,oBAACA;MAAK,MAAK;MAAK,GAAE;gBACf,EAAE,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;OAClC;KAEV;IACF;IACD;GACG;;AAIX,yBAAe"}
@@ -1,122 +0,0 @@
1
- const require_core = require('./core-aFtK4l9I.cjs');
2
- let __alepha_react_i18n = require("@alepha/react/i18n");
3
- let alepha = require("alepha");
4
- let __alepha_react = require("@alepha/react");
5
- let __mantine_core = require("@mantine/core");
6
- let react_jsx_runtime = require("react/jsx-runtime");
7
- let alepha_api_files = require("alepha/api/files");
8
-
9
- //#region src/admin/components/AdminFiles.tsx
10
- const AdminFiles = () => {
11
- const client = (0, __alepha_react.useClient)();
12
- const { l } = (0, __alepha_react_i18n.useI18n)();
13
- const filters = alepha.t.object({
14
- bucket: alepha.t.optional(alepha.t.string()),
15
- name: alepha.t.optional(alepha.t.string({ $control: { query: alepha.t.pick(alepha_api_files.files.schema, [
16
- "name",
17
- "bucket",
18
- "mimeType"
19
- ]) } }))
20
- });
21
- const formatFileSize = (bytes) => {
22
- if (bytes === 0) return "0 B";
23
- const k = 1024;
24
- const sizes = [
25
- "B",
26
- "KB",
27
- "MB",
28
- "GB"
29
- ];
30
- const i = Math.floor(Math.log(bytes) / Math.log(k));
31
- return `${Number.parseFloat((bytes / k ** i).toFixed(1))} ${sizes[i]}`;
32
- };
33
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__mantine_core.Flex, {
34
- flex: 1,
35
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_core.DataTable_default, {
36
- submitOnInit: true,
37
- defaultSize: 10,
38
- typeFormProps: {
39
- skipSubmitButton: true,
40
- columns: 3
41
- },
42
- tableProps: {
43
- horizontalSpacing: "xs",
44
- verticalSpacing: "xs"
45
- },
46
- onFilterChange: (key, _value, form) => {
47
- if (key === "name" || key === "bucket") return form.submit();
48
- },
49
- filters,
50
- items: async (filters$1) => {
51
- return await client.findFiles({ query: filters$1 });
52
- },
53
- columns: {
54
- name: {
55
- label: "Name",
56
- value: (item) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__mantine_core.Text, {
57
- size: "sm",
58
- fw: 500,
59
- lineClamp: 1,
60
- children: item.name
61
- })
62
- },
63
- bucket: {
64
- label: "Bucket",
65
- fit: true,
66
- value: (item) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__mantine_core.Badge, {
67
- size: "sm",
68
- variant: "light",
69
- color: "blue",
70
- children: item.bucket
71
- })
72
- },
73
- mimeType: {
74
- label: "Type",
75
- fit: true,
76
- value: (item) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__mantine_core.Text, {
77
- size: "xs",
78
- c: "dimmed",
79
- children: item.mimeType
80
- })
81
- },
82
- size: {
83
- label: "Size",
84
- fit: true,
85
- value: (item) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__mantine_core.Text, {
86
- size: "xs",
87
- c: "dimmed",
88
- children: formatFileSize(item.size)
89
- })
90
- },
91
- creatorName: {
92
- label: "Creator",
93
- fit: true,
94
- value: (item) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__mantine_core.Text, {
95
- size: "xs",
96
- c: "dimmed",
97
- children: item.creatorName || "-"
98
- })
99
- },
100
- createdAt: {
101
- label: "Created",
102
- fit: true,
103
- value: (item) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__mantine_core.Text, {
104
- size: "xs",
105
- c: "dimmed",
106
- children: l(item.createdAt, { date: "fromNow" })
107
- })
108
- }
109
- }
110
- })
111
- });
112
- };
113
- var AdminFiles_default = AdminFiles;
114
-
115
- //#endregion
116
- Object.defineProperty(exports, 'AdminFiles_default', {
117
- enumerable: true,
118
- get: function () {
119
- return AdminFiles_default;
120
- }
121
- });
122
- //# sourceMappingURL=AdminFiles-DC3T8uWZ.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AdminFiles-DC3T8uWZ.cjs","names":["t","files","Flex","DataTable","filters","Text","Badge"],"sources":["../../src/admin/components/AdminFiles.tsx"],"sourcesContent":["import { useClient } from \"@alepha/react\";\nimport { useI18n } from \"@alepha/react/i18n\";\nimport { DataTable, Flex, Text } from \"@alepha/ui\";\nimport { Badge } from \"@mantine/core\";\nimport { type Page, t } from \"alepha\";\nimport { type FileController, type FileEntity, files } from \"alepha/api/files\";\n\nconst AdminFiles = () => {\n const client = useClient<FileController>();\n const { l } = useI18n();\n\n const filters = t.object({\n bucket: t.optional(t.string()),\n name: t.optional(\n t.string({\n $control: {\n query: t.pick(files.schema, [\"name\", \"bucket\", \"mimeType\"]),\n },\n }),\n ),\n });\n\n const formatFileSize = (bytes: number) => {\n if (bytes === 0) return \"0 B\";\n const k = 1024;\n const sizes = [\"B\", \"KB\", \"MB\", \"GB\"];\n const i = Math.floor(Math.log(bytes) / Math.log(k));\n return `${Number.parseFloat((bytes / k ** i).toFixed(1))} ${sizes[i]}`;\n };\n\n return (\n <Flex flex={1}>\n <DataTable<FileEntity, typeof filters>\n submitOnInit\n defaultSize={10}\n typeFormProps={{\n skipSubmitButton: true,\n columns: 3,\n }}\n tableProps={{\n horizontalSpacing: \"xs\",\n verticalSpacing: \"xs\",\n }}\n onFilterChange={(key, _value, form) => {\n if (key === \"name\" || key === \"bucket\") {\n return form.submit();\n }\n }}\n filters={filters}\n items={async (filters) => {\n const response = await client.findFiles({\n query: filters,\n });\n\n return response as Page<FileEntity>;\n }}\n columns={{\n name: {\n label: \"Name\",\n value: (item) => (\n <Text size=\"sm\" fw={500} lineClamp={1}>\n {item.name}\n </Text>\n ),\n },\n bucket: {\n label: \"Bucket\",\n fit: true,\n value: (item) => (\n <Badge size=\"sm\" variant=\"light\" color=\"blue\">\n {item.bucket}\n </Badge>\n ),\n },\n mimeType: {\n label: \"Type\",\n fit: true,\n value: (item) => (\n <Text size=\"xs\" c=\"dimmed\">\n {item.mimeType}\n </Text>\n ),\n },\n size: {\n label: \"Size\",\n fit: true,\n value: (item) => (\n <Text size=\"xs\" c=\"dimmed\">\n {formatFileSize(item.size)}\n </Text>\n ),\n },\n creatorName: {\n label: \"Creator\",\n fit: true,\n value: (item) => (\n <Text size=\"xs\" c=\"dimmed\">\n {item.creatorName || \"-\"}\n </Text>\n ),\n },\n createdAt: {\n label: \"Created\",\n fit: true,\n value: (item) => (\n <Text size=\"xs\" c=\"dimmed\">\n {l(item.createdAt, { date: \"fromNow\" })}\n </Text>\n ),\n },\n }}\n />\n </Flex>\n );\n};\n\nexport default AdminFiles;\n"],"mappings":";;;;;;;;;AAOA,MAAM,mBAAmB;CACvB,MAAM,wCAAoC;CAC1C,MAAM,EAAE,wCAAe;CAEvB,MAAM,UAAUA,SAAE,OAAO;EACvB,QAAQA,SAAE,SAASA,SAAE,QAAQ,CAAC;EAC9B,MAAMA,SAAE,SACNA,SAAE,OAAO,EACP,UAAU,EACR,OAAOA,SAAE,KAAKC,uBAAM,QAAQ;GAAC;GAAQ;GAAU;GAAW,CAAC,EAC5D,EACF,CAAC,CACH;EACF,CAAC;CAEF,MAAM,kBAAkB,UAAkB;AACxC,MAAI,UAAU,EAAG,QAAO;EACxB,MAAM,IAAI;EACV,MAAM,QA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KAEV;IACF;IACD;GACG;;AAIX,yBAAe"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"AdminJobs-BXkFtlVo.js","names":["Flex","DataTable","filters","Text"],"sources":["../../src/admin/components/AdminJobs.tsx"],"sourcesContent":["import { useClient } from \"@alepha/react\";\nimport { useI18n } from \"@alepha/react/i18n\";\nimport { DataTable, Flex, Text } from \"@alepha/ui\";\nimport { Badge } from \"@mantine/core\";\nimport {\n IconCheck,\n IconClock,\n IconPlayerPlay,\n IconX,\n} from \"@tabler/icons-react\";\nimport { type Page, t } from \"alepha\";\nimport {\n type JobController,\n type JobExecutionEntity,\n jobExecutions,\n} from \"alepha/api/jobs\";\n\nconst AdminJobs = () => {\n const client = useClient<JobController>();\n const { l } = useI18n();\n\n const filters = t.object({\n job: t.optional(\n t.string({\n $control: {\n query: t.pick(jobExecutions.schema, [\"job\"]),\n },\n }),\n ),\n status: t.optional(t.enum([\"STARTED\", \"FAILED\", \"COMPLETED\"])),\n });\n\n const getStatusColor = (status: string) => {\n switch (status) {\n case \"COMPLETED\":\n return \"green\";\n case \"FAILED\":\n return \"red\";\n case \"STARTED\":\n return \"blue\";\n default:\n return \"gray\";\n }\n };\n\n const getStatusIcon = (status: string) => {\n switch (status) {\n case \"COMPLETED\":\n return <IconCheck size={12} />;\n case \"FAILED\":\n return <IconX size={12} />;\n case \"STARTED\":\n return <IconPlayerPlay size={12} />;\n default:\n return <IconClock size={12} />;\n }\n };\n\n const formatDuration = (\n start: Date | string,\n end?: Date | string | null,\n ): string => {\n const startTime = new Date(start).getTime();\n const endTime = end ? new Date(end).getTime() : Date.now();\n const duration = endTime - startTime;\n\n if (duration < 1000) return `${duration}ms`;\n if (duration < 60000) return `${(duration / 1000).toFixed(1)}s`;\n return `${Math.floor(duration / 60000)}m ${Math.floor((duration % 60000) / 1000)}s`;\n };\n\n return (\n <Flex flex={1}>\n <DataTable<JobExecutionEntity, typeof filters>\n submitOnInit\n defaultSize={10}\n typeFormProps={{\n skipSubmitButton: true,\n columns: 3,\n }}\n tableProps={{\n horizontalSpacing: \"xs\",\n verticalSpacing: \"xs\",\n }}\n onFilterChange={(key, _value, form) => {\n if (key === \"job\" || key === \"status\") {\n return form.submit();\n }\n }}\n filters={filters}\n items={async (filters) => {\n const response = await client.getJobExecutions({\n query: filters,\n });\n\n return response as Page<JobExecutionEntity>;\n }}\n columns={{\n job: {\n label: \"Job\",\n value: (item) => (\n <Text size=\"sm\" fw={500}>\n {item.job}\n </Text>\n ),\n },\n status: {\n label: \"Status\",\n fit: true,\n value: (item) => (\n <Badge\n size=\"sm\"\n variant=\"light\"\n color={getStatusColor(item.status)}\n leftSection={getStatusIcon(item.status)}\n >\n {item.status}\n </Badge>\n ),\n },\n duration: {\n label: \"Duration\",\n fit: true,\n value: (item) => (\n <Text size=\"xs\" c=\"dimmed\" ff=\"monospace\">\n {formatDuration(item.createdAt, item.finishedAt)}\n </Text>\n ),\n },\n error: {\n label: \"Error\",\n value: (item) =>\n item.error ? (\n <Text size=\"xs\" c=\"red\" lineClamp={1}>\n {item.error}\n </Text>\n ) : (\n <Text size=\"xs\" c=\"dimmed\">\n -\n </Text>\n ),\n },\n createdAt: {\n label: \"Started\",\n fit: true,\n value: (item) => (\n <Text size=\"xs\" c=\"dimmed\">\n {l(item.createdAt, { date: \"fromNow\" })}\n </Text>\n ),\n },\n }}\n />\n </Flex>\n );\n};\n\nexport default AdminJobs;\n"],"mappings":";;;;;;;;;;AAiBA,MAAM,kBAAkB;CACtB,MAAM,SAAS,WAA0B;CACzC,MAAM,EAAE,MAAM,SAAS;CAEvB,MAAM,UAAU,EAAE,OAAO;EACvB,KAAK,EAAE,SACL,EAAE,OAAO,EACP,UAAU,EACR,OAAO,EAAE,KAAK,cAAc,QAAQ,CAAC,MAAM,CAAC,EAC7C,EACF,CAAC,CACH;EACD,QAAQ,EAAE,SAAS,EAAE,KAAK;GAAC;GAAW;GAAU;GAAY,CAAC,CAAC;EAC/D,CAAC;CAEF,MAAM,kBAAkB,WAA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