next-auth-mfelfelani72 0.0.42 → 0.0.44

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.
@@ -1,3 +1,3 @@
1
1
  import React from "react";
2
2
  import type { LoginProps } from "../../../types";
3
- export default function Login({ layout, theme, className }: LoginProps): React.JSX.Element;
3
+ export default function Login({ layout, theme, className, translations, }: LoginProps): React.JSX.Element;
@@ -16,11 +16,11 @@ const LAYOUT_MAP = {
16
16
  };
17
17
  // Functions
18
18
  import { cn } from "forma-li";
19
- export default function Login({ layout, theme, className }) {
20
- // States
19
+ import { setTranslationOverrides } from "../../../locale";
20
+ export default function Login({ layout, theme, className, translations, }) {
21
+ setTranslationOverrides(translations);
21
22
  const [errors, setErrors] = useState({});
22
23
  const [message, setMessage] = useState(null);
23
- // Functions
24
24
  const handleSubmit = async (formData) => {
25
25
  setMessage(null);
26
26
  setErrors({});
@@ -62,5 +62,5 @@ export default function Login({ layout, theme, className }) {
62
62
  }, [layout]);
63
63
  return (_jsx("div", { style: {
64
64
  backgroundImage: `url('/images/jpg/${theme || "default"}_auth.jpeg')`,
65
- }, className: cn("zz-10 w-full max-w-md px-4 max-h-screen bg-cover bg-center bg-fixed overflow-hidden", className), children: _jsx(RenderUi, { onSubmit: handleSubmit, errors: errors, message: message, theme: theme }) }));
65
+ }, className: cn("zz-10 w-full max-w-md px-4 max-h-screen bg-cover bg-center bg-fixed overflow-hidden", className), children: _jsx(RenderUi, { onSubmit: handleSubmit, errors: errors, message: message, theme: theme, translations: translations }) }));
66
66
  }
package/dist/index.d.ts CHANGED
@@ -1,6 +1,4 @@
1
1
  export { default as Login } from "./components/demo/auth/Login";
2
2
  export { default as Register } from "./components/demo/auth/Register";
3
- export { setTranslationOverrides, clearTranslationOverrides, } from "./locale";
4
- export { useTranslation } from "./hooks/useTranslation";
5
3
  export { loginHandler } from "./libraries/auth/loginHandler";
6
4
  export { registerHandler } from "./libraries/auth/registerHandler";
package/dist/index.js CHANGED
@@ -1,9 +1,6 @@
1
1
  // Components
2
2
  export { default as Login } from "./components/demo/auth/Login";
3
3
  export { default as Register } from "./components/demo/auth/Register";
4
- // Translation
5
- export { setTranslationOverrides, clearTranslationOverrides, } from "./locale";
6
- export { useTranslation } from "./hooks/useTranslation";
7
4
  // Server handlers
8
5
  export { loginHandler } from "./libraries/auth/loginHandler";
9
6
  export { registerHandler } from "./libraries/auth/registerHandler";
@@ -1,10 +1,4 @@
1
- /**
2
- * @Author: Mohammad Felfelani
3
- * @Email: mfelfelani72@gmail.com, sinasalehimilani2016@gmail.com
4
- * @Team:
5
- * @Date: 2025-10-07 07:53:42
6
- * @Description:
7
- */
1
+ import { setTranslationOverrides, clearTranslationOverrides } from "./overrides";
8
2
  declare const dictionaries: {
9
3
  en: {
10
4
  meta: any;
@@ -155,4 +149,4 @@ export declare const getDictionary: (lang?: Lang) => {
155
149
  loading: string;
156
150
  send: string;
157
151
  };
158
- export { setTranslationOverrides, clearTranslationOverrides, } from "./overrides";
152
+ export { setTranslationOverrides, clearTranslationOverrides, };
@@ -1,16 +1,7 @@
1
- /**
2
- * @Author: Mohammad Felfelani
3
- * @Email: mfelfelani72@gmail.com, sinasalehimilani2016@gmail.com
4
- * @Team:
5
- * @Date: 2025-10-07 07:53:42
6
- * @Description:
7
- */
8
1
  import { cache } from "react";
9
- // Files
10
2
  import en from "./en";
11
3
  import fa from "./fa";
12
- // Translation overrides
13
- import { getTranslationOverrides } from "./overrides";
4
+ import { getTranslationOverrides, setTranslationOverrides, clearTranslationOverrides, } from "./overrides";
14
5
  const dictionaries = {
15
6
  en,
16
7
  fa,
@@ -18,4 +9,4 @@ const dictionaries = {
18
9
  export const getDictionary = cache((lang = "en") => {
19
10
  return Object.assign(Object.assign({}, dictionaries[lang]), getTranslationOverrides(lang));
20
11
  });
21
- export { setTranslationOverrides, clearTranslationOverrides, } from "./overrides";
12
+ export { setTranslationOverrides, clearTranslationOverrides, };
@@ -1,13 +1,3 @@
1
- /**
2
- * @Author: Mohammad Felfelani
3
- * @Email: mfelfelani72@gmail.com, sinasalehimilani2016@gmail.com
4
- * @Team:
5
- * @Date: 2025-10-07 07:53:42
6
- * @Description:
7
- */
8
- import type { Dictionary, Lang } from "forma-li";
9
- type TranslationOverrides = Partial<Record<Lang, Partial<Dictionary>>>;
10
- export declare function setTranslationOverrides(nextOverrides: TranslationOverrides): void;
11
- export declare function getTranslationOverrides(lang: Lang): Partial<Dictionary>;
1
+ export declare function setTranslationOverrides(nextOverrides?: Record<string, Record<string, string>>): void;
2
+ export declare function getTranslationOverrides(lang: string): Record<string, string>;
12
3
  export declare function clearTranslationOverrides(): void;
13
- export {};
@@ -1,12 +1,8 @@
1
- /**
2
- * @Author: Mohammad Felfelani
3
- * @Email: mfelfelani72@gmail.com, sinasalehimilani2016@gmail.com
4
- * @Team:
5
- * @Date: 2025-10-07 07:53:42
6
- * @Description:
7
- */
8
1
  const overrides = {};
9
2
  export function setTranslationOverrides(nextOverrides) {
3
+ if (!nextOverrides) {
4
+ return;
5
+ }
10
6
  Object.assign(overrides, nextOverrides);
11
7
  }
12
8
  export function getTranslationOverrides(lang) {
@@ -1,3 +1,4 @@
1
+ import type { Dictionary, Lang } from "forma-li";
1
2
  export interface LoginComponentProps {
2
3
  onSubmit: (formData: FormData) => void;
3
4
  errors?: {
@@ -6,11 +7,13 @@ export interface LoginComponentProps {
6
7
  };
7
8
  message?: string | null;
8
9
  theme?: string;
10
+ translations?: Partial<Record<Lang, Partial<Dictionary>>>;
9
11
  }
10
12
  export interface LoginProps {
11
13
  layout: string;
12
14
  theme?: string;
13
15
  className?: string;
16
+ translations?: Partial<Record<Lang, Partial<Dictionary>>>;
14
17
  }
15
18
  export interface RegisterComponentProps {
16
19
  onSubmit: (formData: FormData) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-auth-mfelfelani72",
3
- "version": "0.0.42",
3
+ "version": "0.0.44",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [