forma-ui 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Interfaces/dictionary.d.ts +25 -0
- package/dist/Interfaces/dictionary.js +8 -0
- package/dist/Interfaces/global.d.ts +21 -0
- package/dist/Interfaces/global.js +1 -0
- package/dist/Interfaces/meta.d.ts +39 -0
- package/dist/Interfaces/meta.js +8 -0
- package/dist/app/[lang]/stores/LangStore.d.ts +22 -0
- package/dist/app/[lang]/stores/LangStore.js +125 -0
- package/dist/components/icon/icon.d.ts +3 -0
- package/dist/components/icon/icon.js +6 -2
- package/dist/components/ui/Accordion.d.ts +1 -0
- package/dist/components/ui/Accordion.js +15 -6
- package/dist/components/ui/Button.d.ts +0 -0
- package/dist/components/ui/Button.js +1 -1
- package/dist/components/ui/CheckBox.d.ts +0 -0
- package/dist/components/ui/CheckBox.js +0 -0
- package/dist/components/ui/Input.d.ts +0 -0
- package/dist/components/ui/Input.js +10 -7
- package/dist/components/ui/Modal.d.ts +9 -9
- package/dist/components/ui/Modal.js +51 -6
- package/dist/components/ui/RadioButton.d.ts +0 -0
- package/dist/components/ui/RadioButton.js +0 -0
- package/dist/components/ui/Table.d.ts +0 -0
- package/dist/components/ui/Table.js +0 -0
- package/dist/components/ui/Tabs.d.ts +0 -0
- package/dist/components/ui/Tabs.js +0 -0
- package/dist/configs/language.d.ts +39 -0
- package/dist/configs/language.js +50 -0
- package/dist/configs/metadata.d.ts +69 -0
- package/dist/configs/metadata.js +143 -0
- package/dist/dictionaries/en.json +0 -0
- package/dist/dictionaries/fa.json +0 -0
- package/dist/dictionaries/index.d.ts +0 -0
- package/dist/dictionaries/index.js +0 -0
- package/dist/hooks/useDevice.d.ts +21 -0
- package/dist/hooks/useDevice.js +49 -0
- package/dist/hooks/useTranslation.d.ts +4 -0
- package/dist/hooks/useTranslation.js +34 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +10 -1
- package/dist/libs/api/axiosClient.d.ts +9 -0
- package/dist/libs/api/axiosClient.js +34 -0
- package/dist/libs/api/cns.d.ts +16 -0
- package/dist/libs/api/cns.js +29 -0
- package/dist/libs/api/usePostFetch.d.ts +23 -0
- package/dist/libs/api/usePostFetch.js +17 -0
- package/dist/libs/cn.d.ts +1 -0
- package/dist/libs/cn.js +12 -0
- package/dist/libs/cookieUtils.d.ts +10 -0
- package/dist/libs/cookieUtils.js +28 -0
- package/dist/libs/detectComponentResponsive.d.ts +10 -0
- package/dist/libs/detectComponentResponsive.js +24 -0
- package/dist/libs/detectDeviceFromUA.d.ts +8 -0
- package/dist/libs/detectDeviceFromUA.js +14 -0
- package/dist/libs/fonts.d.ts +10 -0
- package/dist/libs/fonts.js +94 -0
- package/dist/libs/metadataHelper.d.ts +17 -0
- package/dist/libs/metadataHelper.js +20 -0
- package/dist/libs/modal/Modal.d.ts +9 -0
- package/dist/libs/modal/Modal.js +41 -0
- package/dist/libs/translation.d.ts +5 -0
- package/dist/libs/translation.js +30 -0
- package/dist/{lib → libs}/utils.d.ts +0 -0
- package/dist/{lib → libs}/utils.js +0 -0
- package/dist/locale/about/en.json +3 -0
- package/dist/locale/about/fa.json +3 -0
- package/dist/locale/coin/en.json +4 -0
- package/dist/locale/coin/fa.json +4 -0
- package/dist/locale/en.d.ts +56 -0
- package/dist/locale/en.js +16 -0
- package/dist/locale/fa.d.ts +59 -0
- package/dist/locale/fa.js +16 -0
- package/dist/locale/global/en.json +12 -0
- package/dist/locale/global/fa.json +16 -0
- package/dist/locale/home/en.json +11 -0
- package/dist/locale/home/fa.json +11 -0
- package/dist/locale/index.d.ts +201 -0
- package/dist/locale/index.js +7 -0
- package/dist/locale/meta/about/en.json +10 -0
- package/dist/locale/meta/about/fa.json +5 -0
- package/dist/locale/meta/en.json +15 -0
- package/dist/locale/meta/fa.json +15 -0
- package/dist/locale/meta/home/en.json +10 -0
- package/dist/locale/meta/home/fa.json +5 -0
- package/dist/middleware.d.ts +14 -0
- package/dist/middleware.js +57 -0
- package/dist/store/appStore.d.ts +1 -1
- package/dist/store/appStore.js +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utils/nextImageLoader.d.ts +9 -0
- package/dist/utils/nextImageLoader.js +15 -0
- package/package.json +10 -3
- package/README.md +0 -36
- package/dist/components/PostDetailPage.d.ts +0 -7
- package/dist/components/PostDetailPage.js +0 -47
- package/dist/components/PostPage.d.ts +0 -6
- package/dist/components/PostPage.js +0 -48
- package/dist/config/language.d.ts +0 -11
- package/dist/config/language.js +0 -6
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @Author: Mohammad Felfelani
|
|
3
|
+
* @Email: mfelfelani72@gmail.com
|
|
4
|
+
* @Team:
|
|
5
|
+
* @Date: 2025-10-12 09:03:23
|
|
6
|
+
* @Description:
|
|
7
|
+
*/
|
|
8
|
+
import { OpenGraphMeta, TwitterMeta } from "@/Interfaces/meta";
|
|
9
|
+
import { Lang } from "@/configs/language";
|
|
10
|
+
export type Dictionary = Record<string, string | {
|
|
11
|
+
title: string;
|
|
12
|
+
description: string;
|
|
13
|
+
keywords?: string[];
|
|
14
|
+
openGraph?: OpenGraphMeta;
|
|
15
|
+
twitter?: TwitterMeta;
|
|
16
|
+
}>;
|
|
17
|
+
export interface LangState {
|
|
18
|
+
lang: Lang;
|
|
19
|
+
dir: "ltr" | "rtl";
|
|
20
|
+
refreshKey: number;
|
|
21
|
+
isInitialized: boolean;
|
|
22
|
+
setLang: (newLang: Lang) => void;
|
|
23
|
+
initializeLang: (langFromUrl?: string) => void;
|
|
24
|
+
triggerRefresh?: () => void;
|
|
25
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @Author: Mohammad Felfelani
|
|
3
|
+
* @Email: mfelfelani72@gmail.com
|
|
4
|
+
* @Team:
|
|
5
|
+
* @Date: 2025-10-12 15:00:49
|
|
6
|
+
* @Description:
|
|
7
|
+
*/
|
|
8
|
+
import type { ReactNode } from "react";
|
|
9
|
+
import { type Lang } from "@/configs/language";
|
|
10
|
+
import { Dictionary } from "@/Interfaces/dictionary";
|
|
11
|
+
export interface LangLayoutProps {
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
params: Promise<{
|
|
14
|
+
lang: string;
|
|
15
|
+
}>;
|
|
16
|
+
}
|
|
17
|
+
export interface LangWrapperProps {
|
|
18
|
+
langFromUrl: Lang;
|
|
19
|
+
dictionary: Dictionary;
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @Author: Mohammad Felfelani
|
|
3
|
+
* @Email: mfelfelani72@gmail.com
|
|
4
|
+
* @Team:
|
|
5
|
+
* @Date: 2025-10-12 08:39:25
|
|
6
|
+
* @Description:
|
|
7
|
+
*/
|
|
8
|
+
export interface BaseMeta {
|
|
9
|
+
title: string;
|
|
10
|
+
description: string;
|
|
11
|
+
keywords?: string[];
|
|
12
|
+
}
|
|
13
|
+
export interface PageMeta extends BaseMeta {
|
|
14
|
+
canonicalUrl?: string;
|
|
15
|
+
robots?: {
|
|
16
|
+
index?: boolean;
|
|
17
|
+
follow?: boolean;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export type OpenGraphMeta = {
|
|
21
|
+
title: string;
|
|
22
|
+
description: string;
|
|
23
|
+
url?: string;
|
|
24
|
+
locale?: string;
|
|
25
|
+
siteName?: string;
|
|
26
|
+
type?: string;
|
|
27
|
+
images?: {
|
|
28
|
+
url: string;
|
|
29
|
+
width: number;
|
|
30
|
+
height: number;
|
|
31
|
+
alt: string;
|
|
32
|
+
}[];
|
|
33
|
+
};
|
|
34
|
+
export type TwitterMeta = {
|
|
35
|
+
card?: string;
|
|
36
|
+
title?: string;
|
|
37
|
+
description?: string;
|
|
38
|
+
images?: string[];
|
|
39
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @Author: Mohammad Felfelani
|
|
3
|
+
* @Email: mfelfelani72@gmail.com
|
|
4
|
+
* @Team:
|
|
5
|
+
* @Date: 2025-10-05 12:41:14
|
|
6
|
+
* @Description: Lang store with JSON cookie
|
|
7
|
+
*/
|
|
8
|
+
import { LangState } from "@/Interfaces/dictionary";
|
|
9
|
+
export declare const useLangStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<LangState>, "setState" | "persist"> & {
|
|
10
|
+
setState(partial: LangState | Partial<LangState> | ((state: LangState) => LangState | Partial<LangState>), replace?: false | undefined): unknown;
|
|
11
|
+
setState(state: LangState | ((state: LangState) => LangState), replace: true): unknown;
|
|
12
|
+
persist: {
|
|
13
|
+
setOptions: (options: Partial<import("zustand/middleware").PersistOptions<LangState, unknown, unknown>>) => void;
|
|
14
|
+
clearStorage: () => void;
|
|
15
|
+
rehydrate: () => Promise<void> | void;
|
|
16
|
+
hasHydrated: () => boolean;
|
|
17
|
+
onHydrate: (fn: (state: LangState) => void) => () => void;
|
|
18
|
+
onFinishHydration: (fn: (state: LangState) => void) => () => void;
|
|
19
|
+
getOptions: () => Partial<import("zustand/middleware").PersistOptions<LangState, unknown, unknown>>;
|
|
20
|
+
};
|
|
21
|
+
}>;
|
|
22
|
+
export declare const initializeLang: (langFromUrl?: string) => void;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @Author: Mohammad Felfelani
|
|
3
|
+
* @Email: mfelfelani72@gmail.com
|
|
4
|
+
* @Team:
|
|
5
|
+
* @Date: 2025-10-05 12:41:14
|
|
6
|
+
* @Description: Lang store with JSON cookie
|
|
7
|
+
*/
|
|
8
|
+
import { create } from "zustand";
|
|
9
|
+
import { isBrowser, setCookie, getCookie } from "@/libs/cookieUtils";
|
|
10
|
+
import { persist, createJSONStorage } from "zustand/middleware";
|
|
11
|
+
// Constants
|
|
12
|
+
import { languages } from "@/configs/language";
|
|
13
|
+
// Functions
|
|
14
|
+
const isValidLang = (lang) => {
|
|
15
|
+
return typeof lang === "string" && lang in languages;
|
|
16
|
+
};
|
|
17
|
+
const cookieStorage = {
|
|
18
|
+
getItem: (name) => {
|
|
19
|
+
if (!isBrowser())
|
|
20
|
+
return null;
|
|
21
|
+
try {
|
|
22
|
+
return localStorage.getItem(name);
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
console.error("Error reading from storage:", error);
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
setItem: (name, value) => {
|
|
30
|
+
if (!isBrowser())
|
|
31
|
+
return;
|
|
32
|
+
try {
|
|
33
|
+
localStorage.setItem(name, value);
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
console.error("Error writing to storage:", error);
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
removeItem: (name) => {
|
|
40
|
+
if (!isBrowser())
|
|
41
|
+
return;
|
|
42
|
+
try {
|
|
43
|
+
localStorage.removeItem(name);
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
console.error("Error removing from storage:", error);
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
export const useLangStore = create()(persist((set, get) => ({
|
|
51
|
+
lang: "en",
|
|
52
|
+
dir: languages.en.dir,
|
|
53
|
+
isInitialized: false,
|
|
54
|
+
refreshKey: 0, // 🔹 اضافه شد
|
|
55
|
+
setLang: (newLang) => {
|
|
56
|
+
const dir = languages[newLang].dir;
|
|
57
|
+
set({
|
|
58
|
+
lang: newLang,
|
|
59
|
+
dir,
|
|
60
|
+
refreshKey: get().refreshKey + 1, // 🔹 trigger برای کامپوننتها
|
|
61
|
+
});
|
|
62
|
+
if (isBrowser()) {
|
|
63
|
+
const langCookieValue = JSON.stringify({
|
|
64
|
+
state: {
|
|
65
|
+
lang: newLang,
|
|
66
|
+
dir: dir,
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
setCookie("app_lang", langCookieValue);
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
triggerRefresh: () => {
|
|
73
|
+
set({ refreshKey: get().refreshKey + 1 });
|
|
74
|
+
},
|
|
75
|
+
initializeLang: (langFromUrl) => {
|
|
76
|
+
const { isInitialized } = get();
|
|
77
|
+
if (isInitialized)
|
|
78
|
+
return;
|
|
79
|
+
let finalLang = "en";
|
|
80
|
+
let finalDir = languages.en.dir;
|
|
81
|
+
if (langFromUrl && isValidLang(langFromUrl)) {
|
|
82
|
+
finalLang = langFromUrl;
|
|
83
|
+
finalDir = languages[finalLang].dir;
|
|
84
|
+
}
|
|
85
|
+
else if (isBrowser()) {
|
|
86
|
+
const savedLangCookie = getCookie("app_lang");
|
|
87
|
+
if (savedLangCookie) {
|
|
88
|
+
try {
|
|
89
|
+
const parsed = JSON.parse(savedLangCookie);
|
|
90
|
+
if (parsed.state) {
|
|
91
|
+
if (parsed.state.lang && isValidLang(parsed.state.lang)) {
|
|
92
|
+
finalLang = parsed.state.lang;
|
|
93
|
+
}
|
|
94
|
+
if (parsed.state.dir &&
|
|
95
|
+
(parsed.state.dir === "ltr" || parsed.state.dir === "rtl")) {
|
|
96
|
+
finalDir = parsed.state.dir;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
console.error("Error parsing lang cookie:", error);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
set({
|
|
106
|
+
lang: finalLang,
|
|
107
|
+
dir: finalDir,
|
|
108
|
+
isInitialized: true,
|
|
109
|
+
});
|
|
110
|
+
},
|
|
111
|
+
}), {
|
|
112
|
+
name: "lang-store",
|
|
113
|
+
storage: createJSONStorage(() => cookieStorage),
|
|
114
|
+
partialize: (state) => ({
|
|
115
|
+
lang: state.lang,
|
|
116
|
+
dir: state.dir,
|
|
117
|
+
isInitialized: state.isInitialized,
|
|
118
|
+
refreshKey: state.refreshKey, // 🔹 اضافه شد
|
|
119
|
+
}),
|
|
120
|
+
}));
|
|
121
|
+
export const initializeLang = (langFromUrl) => {
|
|
122
|
+
if (isBrowser()) {
|
|
123
|
+
useLangStore.getState().initializeLang(langFromUrl);
|
|
124
|
+
}
|
|
125
|
+
};
|
|
@@ -3,6 +3,8 @@ interface IconProps {
|
|
|
3
3
|
width?: string | number;
|
|
4
4
|
height?: string | number;
|
|
5
5
|
color?: string;
|
|
6
|
+
stroke?: string;
|
|
7
|
+
fill?: string;
|
|
6
8
|
}
|
|
7
9
|
export declare const SearchIcon: ({ className, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
10
|
export declare const FolderIcon: ({ className, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -113,4 +115,5 @@ export declare const InstagramIcon: ({ className, ...props }: IconProps) => impo
|
|
|
113
115
|
export declare const MobielIcon: ({ className, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
114
116
|
export declare const MoonIcon: ({ className, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
115
117
|
export declare const SunIcon: ({ className, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
118
|
+
export declare const LanguageIcon: ({ className, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
116
119
|
export {};
|
|
@@ -10,7 +10,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
|
-
import { cn } from "../../
|
|
13
|
+
import { cn } from "../../libs/utils";
|
|
14
14
|
export const SearchIcon = (_a) => {
|
|
15
15
|
var { className } = _a, props = __rest(_a, ["className"]);
|
|
16
16
|
return (_jsx("svg", Object.assign({ className: cn("text-Neutral-200 dark:text-white w-6 h-6", className), viewBox: "0 0 24 23", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props, { children: _jsx("g", { id: "Iconly/Curved/Light/Search", children: _jsxs("g", { id: "Search", children: [_jsx("path", { id: "Stroke 1", fillRule: "evenodd", clipRule: "evenodd", d: "M11.2754 2.5824C16.003 2.5824 19.8364 6.24121 19.8364 10.7556C19.8364 15.27 16.003 18.9289 11.2754 18.9289C6.54686 18.9289 2.71448 15.27 2.71448 10.7556C2.71448 6.24121 6.54686 2.5824 11.2754 2.5824Z", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { id: "Stroke 3", fillRule: "evenodd", clipRule: "evenodd", d: "M19.899 17.6414C20.678 17.6414 21.3095 18.2451 21.3095 18.988C21.3095 19.7326 20.678 20.3355 19.899 20.3355C19.1199 20.3355 18.4875 19.7326 18.4875 18.988C18.4875 18.2451 19.1199 17.6414 19.899 17.6414Z", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })] }) }) })));
|
|
@@ -415,7 +415,7 @@ export const UnlockIcon = (_a) => {
|
|
|
415
415
|
var { className } = _a, props = __rest(_a, ["className"]);
|
|
416
416
|
return (_jsxs("svg", Object.assign({ className: cn("text-Neutral-200 dark:text-white w-6 h-6", className), viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props, { children: [_jsx("path", { d: "M16.276 6.099C15.703 4.29 13.931 2.984 11.853 3.009C9.386 3.037 7.391 4.934 7.349 7.289V9.36", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M11.91 13.897V16.018", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M11.91 8.807C6.165 8.807 4.25 10.304 4.25 14.794C4.25 19.285 6.165 20.782 11.91 20.782C17.656 20.782 19.571 19.285 19.571 14.794C19.571 10.304 17.656 8.807 11.91 8.807Z", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })] })));
|
|
417
417
|
};
|
|
418
|
-
// old icons
|
|
418
|
+
// old icons
|
|
419
419
|
export const RefreshIcon = (_a) => {
|
|
420
420
|
var { className } = _a, props = __rest(_a, ["className"]);
|
|
421
421
|
return (_jsxs("svg", Object.assign({ className: cn("w-6 h-6 dark:text-white text-Neutral-500", className), viewBox: "0 0 24 25", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props, { children: [_jsx("path", { d: "M2.30677 14.7587C2.54907 14.7587 2.78895 14.6505 2.94726 14.4437L3.2986 13.9874C3.56277 15.5477 4.24169 17.0082 5.26425 18.2159C6.28681 19.4236 7.61536 20.3341 9.1107 20.8519C10.9599 21.4968 12.9711 21.5075 14.8271 20.8825C16.683 20.2574 18.278 19.032 19.3602 17.3999C19.4786 17.2212 19.5211 17.0029 19.4785 16.7928C19.4358 16.5828 19.3115 16.3984 19.1329 16.28C18.9542 16.1617 18.7359 16.1191 18.5258 16.1618C18.3158 16.2044 18.1314 16.3287 18.013 16.5074C17.129 17.8404 15.8262 18.8411 14.3103 19.3516C12.7944 19.862 11.1516 19.8531 9.64135 19.3262C8.39638 18.8947 7.2936 18.13 6.45297 17.1153C5.61235 16.1007 5.06607 14.8749 4.87359 13.5714L5.56497 14.1037C5.73473 14.2344 5.94945 14.2923 6.16188 14.2646C6.37432 14.237 6.56708 14.1261 6.69774 13.9563C6.82841 13.7865 6.88629 13.5718 6.85865 13.3594C6.83101 13.1469 6.7201 12.9542 6.55034 12.8235L4.63532 11.3495C4.2339 11.0402 3.66287 10.8665 3.29941 11.3406L1.66789 13.4592C1.57584 13.5786 1.51907 13.7213 1.50403 13.8713C1.48898 14.0213 1.51626 14.1726 1.58277 14.3078C1.64928 14.4431 1.75236 14.5571 1.88032 14.6368C2.00828 14.7165 2.15601 14.7587 2.30677 14.7587Z", fill: "currentColor" }), _jsx("path", { d: "M4.86713 8.73745C5.23785 8.98379 5.73943 8.88202 5.98739 8.51049C6.8719 7.17797 8.17471 6.17769 9.69045 5.66732C11.2062 5.15696 12.8487 5.16552 14.359 5.69167C15.604 6.12319 16.7068 6.88788 17.5474 7.90252C18.388 8.91717 18.9343 10.1429 19.1268 11.4464L18.4354 10.9142C18.3514 10.8495 18.2554 10.8019 18.153 10.7743C18.0506 10.7467 17.9437 10.7396 17.8385 10.7533C17.7333 10.7669 17.6319 10.8012 17.5399 10.8541C17.448 10.907 17.3673 10.9775 17.3026 11.0616C17.2379 11.1456 17.1904 11.2416 17.1628 11.344C17.1352 11.4464 17.1281 11.5533 17.1417 11.6585C17.1554 11.7637 17.1897 11.8651 17.2426 11.9571C17.2955 12.049 17.366 12.1296 17.45 12.1943L19.3651 13.6684C19.7738 13.9826 20.3319 14.1586 20.701 13.6772L22.3325 11.5587C22.3972 11.4747 22.4446 11.3788 22.4722 11.2764C22.4998 11.1741 22.5069 11.0673 22.4932 10.9622C22.4796 10.8571 22.4453 10.7557 22.3924 10.6638C22.3396 10.5719 22.2691 10.4914 22.1851 10.4267C22.1011 10.3621 22.0052 10.3146 21.9028 10.287C21.8005 10.2594 21.6937 10.2523 21.5886 10.266C21.4835 10.2797 21.3821 10.3139 21.2902 10.3668C21.1983 10.4197 21.1178 10.4901 21.0531 10.5741L20.7018 11.0305Z", fill: "currentColor" })] })));
|
|
@@ -448,3 +448,7 @@ export const SunIcon = (_a) => {
|
|
|
448
448
|
var { className } = _a, props = __rest(_a, ["className"]);
|
|
449
449
|
return (_jsx(_Fragment, { children: _jsx("svg", { width: props === null || props === void 0 ? void 0 : props.width, height: props === null || props === void 0 ? void 0 : props.height, className: cn("", className), viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M12 15.0001C12.8333 15.0001 13.5417 14.7084 14.125 14.1251C14.7083 13.5417 15 12.8334 15 12.0001C15 11.1667 14.7083 10.4584 14.125 9.87506C13.5417 9.29173 12.8333 9.00006 12 9.00006C11.1667 9.00006 10.4583 9.29173 9.875 9.87506C9.29167 10.4584 9 11.1667 9 12.0001C9 12.8334 9.29167 13.5417 9.875 14.1251C10.4583 14.7084 11.1667 15.0001 12 15.0001ZM12 17.0001C10.6167 17.0001 9.4375 16.5126 8.4625 15.5376C7.4875 14.5626 7 13.3834 7 12.0001C7 10.6167 7.4875 9.43756 8.4625 8.46256C9.4375 7.48756 10.6167 7.00006 12 7.00006C13.3833 7.00006 14.5625 7.48756 15.5375 8.46256C16.5125 9.43756 17 10.6167 17 12.0001C17 13.3834 16.5125 14.5626 15.5375 15.5376C14.5625 16.5126 13.3833 17.0001 12 17.0001ZM5 12.0001C5 12.5523 4.55228 13.0001 4 13.0001H2C1.44772 13.0001 1 12.5523 1 12.0001C1 11.4478 1.44772 11.0001 2 11.0001H4C4.55228 11.0001 5 11.4478 5 12.0001ZM23 12.0001C23 12.5523 22.5523 13.0001 22 13.0001H20C19.4477 13.0001 19 12.5523 19 12.0001C19 11.4478 19.4477 11.0001 20 11.0001H22C22.5523 11.0001 23 11.4478 23 12.0001ZM12 5.00006C11.4477 5.00006 11 4.55235 11 4.00006V2.00006C11 1.44778 11.4477 1.00006 12 1.00006C12.5523 1.00006 13 1.44778 13 2.00006V4.00006C13 4.55235 12.5523 5.00006 12 5.00006ZM12 23.0001C11.4477 23.0001 11 22.5523 11 22.0001V20.0001C11 19.4478 11.4477 19.0001 12 19.0001C12.5523 19.0001 13 19.4478 13 20.0001V22.0001C13 22.5523 12.5523 23.0001 12 23.0001ZM7.07413 7.02408C6.70367 7.42304 6.07813 7.44094 5.68546 7.06382L4.60178 6.02306C4.20074 5.6379 4.1888 5.00025 4.57514 4.60035C4.97098 4.19063 5.62794 4.19167 6.02248 4.60264L7.06302 5.68654C7.42058 6.059 7.42545 6.64573 7.07413 7.02408ZM19.4248 19.3998C19.029 19.8096 18.372 19.8086 17.9774 19.3977L16.9241 18.3009C16.5616 17.9235 16.5621 17.3271 16.9252 16.9503C17.2981 16.5634 17.9138 16.5515 18.3014 16.9237L19.3981 17.977C19.7992 18.3622 19.8112 18.9999 19.4248 19.3998ZM16.976 7.07419C16.577 6.70373 16.5591 6.07819 16.9362 5.68552L17.977 4.60184C18.3622 4.2008 18.9998 4.18886 19.3997 4.5752C19.8094 4.97104 19.8084 5.628 19.3974 6.02254L18.3135 7.06308C17.9411 7.42064 17.3543 7.42551 16.976 7.07419ZM4.60022 19.4248C4.19051 19.029 4.19148 18.3721 4.60236 17.9775L5.69914 16.9242C6.07657 16.5617 6.67295 16.5622 7.04977 16.9253C7.43669 17.2981 7.44861 17.9139 7.07641 18.3014L6.02307 19.3982C5.63787 19.7993 5.00016 19.8112 4.60022 19.4248Z", fill: props === null || props === void 0 ? void 0 : props.color }) }) }));
|
|
450
450
|
};
|
|
451
|
+
export const LanguageIcon = (_a) => {
|
|
452
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
453
|
+
return (_jsx(_Fragment, { children: _jsx("svg", Object.assign({ "aria-hidden": "true", xmlns: "http://www.w3.org/2000/svg", width: props === null || props === void 0 ? void 0 : props.width, height: props === null || props === void 0 ? void 0 : props.height, className: cn("w-6 h-6 text-gray-800 dark:text-white", className), fill: "none", viewBox: "0 0 24 24" }, props, { children: _jsx("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "m13 19 3.5-9 3.5 9m-6.125-2h5.25M3 7h7m0 0h2m-2 0c0 1.63-.793 3.926-2.239 5.655M7.5 6.818V5m.261 7.655C6.79 13.82 5.521 14.725 4 15m3.761-2.345L5 10m2.761 2.655L10.2 15" }) })) }));
|
|
454
|
+
};
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useState } from "react";
|
|
4
|
-
import { cn } from "../../
|
|
5
|
-
const Accordion = ({ parentClassName, className, circleLocation, secoundCircleLocation, children, icon, title, title_classname, open
|
|
6
|
-
const [isOpen, setIsOpen] = useState(open);
|
|
3
|
+
import { useState, useEffect } from "react";
|
|
4
|
+
import { cn } from "../../libs/utils";
|
|
5
|
+
const Accordion = ({ parentClassName, className, circleLocation, secoundCircleLocation, children, icon, title, title_classname, open, onToggle, sliding = true, animation = "slide", }) => {
|
|
6
|
+
const [isOpen, setIsOpen] = useState(open !== null && open !== void 0 ? open : false);
|
|
7
|
+
// sync with controlled open
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
if (open !== undefined)
|
|
10
|
+
setIsOpen(open);
|
|
11
|
+
}, [open]);
|
|
7
12
|
const toggleOpen = () => {
|
|
8
|
-
if (
|
|
9
|
-
|
|
13
|
+
if (onToggle) {
|
|
14
|
+
onToggle(); // parent کنترل میکند
|
|
15
|
+
}
|
|
16
|
+
else if (sliding) {
|
|
17
|
+
setIsOpen(!isOpen); // internal state
|
|
18
|
+
}
|
|
10
19
|
};
|
|
11
20
|
const getAnimationClasses = () => {
|
|
12
21
|
switch (animation) {
|
|
File without changes
|
|
@@ -12,7 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
// components/ui/Button.tsx
|
|
14
14
|
import { forwardRef } from "react";
|
|
15
|
-
import { cn } from "../../
|
|
15
|
+
import { cn } from "../../libs/utils";
|
|
16
16
|
const Button = forwardRef((_a, ref) => {
|
|
17
17
|
var { className, variant = "primary", size = "md", loading = false, icon, iconPosition = "left", fullWidth = false, clickAnimation = "none", children, disabled } = _a, props = __rest(_a, ["className", "variant", "size", "loading", "icon", "iconPosition", "fullWidth", "clickAnimation", "children", "disabled"]);
|
|
18
18
|
const isDisabled = disabled || loading;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -12,7 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
13
|
import { useState, useRef, useEffect } from "react";
|
|
14
14
|
import { CloseSquareIcon, EmailIcon, MobielIcon, SunIcon, HideIcon, LockIcon, SearchIcon, ShowIcon, MoonIcon, } from "../icon/icon";
|
|
15
|
-
import { cn } from "@/
|
|
15
|
+
import { cn } from "@/libs/utils";
|
|
16
16
|
// Simple translation function replacement (no external library)
|
|
17
17
|
const translate = (key) => {
|
|
18
18
|
const translations = {
|
|
@@ -30,7 +30,7 @@ export function InputText(_a) {
|
|
|
30
30
|
const handleClear = () => {
|
|
31
31
|
if (inputRef.current) {
|
|
32
32
|
inputRef.current.value = "";
|
|
33
|
-
const event = new Event(
|
|
33
|
+
const event = new Event("input", { bubbles: true });
|
|
34
34
|
inputRef.current.dispatchEvent(event);
|
|
35
35
|
}
|
|
36
36
|
onClear === null || onClear === void 0 ? void 0 : onClear();
|
|
@@ -45,7 +45,7 @@ export function InputEmail(_a) {
|
|
|
45
45
|
const handleClear = () => {
|
|
46
46
|
if (inputRef.current) {
|
|
47
47
|
inputRef.current.value = "";
|
|
48
|
-
const event = new Event(
|
|
48
|
+
const event = new Event("input", { bubbles: true });
|
|
49
49
|
inputRef.current.dispatchEvent(event);
|
|
50
50
|
}
|
|
51
51
|
onClear === null || onClear === void 0 ? void 0 : onClear();
|
|
@@ -64,7 +64,7 @@ export function InputMobile(_a) {
|
|
|
64
64
|
const handleClear = () => {
|
|
65
65
|
if (inputRef.current) {
|
|
66
66
|
inputRef.current.value = "";
|
|
67
|
-
const event = new Event(
|
|
67
|
+
const event = new Event("input", { bubbles: true });
|
|
68
68
|
inputRef.current.dispatchEvent(event);
|
|
69
69
|
}
|
|
70
70
|
onClear === null || onClear === void 0 ? void 0 : onClear();
|
|
@@ -79,7 +79,9 @@ export function InputTextArea(_a) {
|
|
|
79
79
|
// InputSearch Component
|
|
80
80
|
export function InputSearch(_a) {
|
|
81
81
|
var { className, id, inputSearchRef, classNameParent, searchClassname, param, value, onChange } = _a, props = __rest(_a, ["className", "id", "inputSearchRef", "classNameParent", "searchClassname", "param", "value", "onChange"]);
|
|
82
|
-
return (_jsxs("div", { ref: inputSearchRef, className: cn("relative", classNameParent), children: [_jsx("div", { className: "absolute rtl:right-3 ltr:left-3 h-full inline-flex items-center", children: _jsx(SearchIcon, { className: searchClassname }) }), param && (_jsx("div", { className: "absolute rtl:left-4 ltr:right-4 h-full inline-flex flex-row-reverse items-center", children: _jsx("span", { className: "text-Neutral-300 dark:text-Neutral-100 text-sm font-semibold leading-tight tracking-tight", children: param }) })), _jsx("input", Object.assign({ id: id, type: "text", value: value, onChange: onChange, className: cn(`autofill-input w-full bg-secondary-50 dark:bg-background-light text-Neutral-400 dark:text-Neutral-100 rounded-2xl ${param
|
|
82
|
+
return (_jsxs("div", { ref: inputSearchRef, className: cn("relative", classNameParent), children: [_jsx("div", { className: "absolute rtl:right-3 ltr:left-3 h-full inline-flex items-center", children: _jsx(SearchIcon, { className: searchClassname }) }), param && (_jsx("div", { className: "absolute rtl:left-4 ltr:right-4 h-full inline-flex flex-row-reverse items-center", children: _jsx("span", { className: "text-Neutral-300 dark:text-Neutral-100 text-sm font-semibold leading-tight tracking-tight", children: param }) })), _jsx("input", Object.assign({ id: id, type: "text", value: value, onChange: onChange, className: cn(`autofill-input w-full bg-secondary-50 dark:bg-background-light text-Neutral-400 dark:text-Neutral-100 rounded-2xl ${param
|
|
83
|
+
? "rtl:pr-11 rtl:pl-12 ltr:pl-11 ltr:pr-12"
|
|
84
|
+
: "rtl:pr-11 ltr:pl-11"} h-11 border-2 border-Neutral-50 dark:border-background-light focus-visible:outline focus-visible:outline-white`, className) }, props))] }));
|
|
83
85
|
}
|
|
84
86
|
// InputPassword Component
|
|
85
87
|
export function InputPassword(_a) {
|
|
@@ -92,12 +94,13 @@ export function InputPassword(_a) {
|
|
|
92
94
|
const handleClear = () => {
|
|
93
95
|
if (inputRef.current) {
|
|
94
96
|
inputRef.current.value = "";
|
|
95
|
-
const event = new Event(
|
|
97
|
+
const event = new Event("input", { bubbles: true });
|
|
96
98
|
inputRef.current.dispatchEvent(event);
|
|
97
99
|
}
|
|
98
100
|
onClear === null || onClear === void 0 ? void 0 : onClear();
|
|
99
101
|
};
|
|
100
|
-
return (_jsxs(_Fragment, { children: [label && (_jsx("label", { htmlFor: id, className: "text-base font-medium text-Neutral-300 px-3", children: label })), _jsxs("div", { className: "w-full relative mt-1", children: [_jsx("input", Object.assign({ ref: inputRef, id: id, type: showPassword ? "text" : "password", minLength: 5, placeholder: "xxxx xxxx xxxx xxxx", value: value, onChange: onChange, className: cn("autofill-input peer placeholder-Neutral-200 w-full px-[2.7rem] py-3 rounded-2xl bg-secondary-50 dark:bg-background-light border border-secondary-100 focus:outline-none focus:ring-0 focus:border-secondary-400 justify-between items-center text-Neutral-500 dark:text-white relative", variant === "change_password" &&
|
|
102
|
+
return (_jsxs(_Fragment, { children: [label && (_jsx("label", { htmlFor: id, className: "text-base font-medium text-Neutral-300 px-3", children: label })), _jsxs("div", { className: "w-full relative mt-1", children: [_jsx("input", Object.assign({ ref: inputRef, id: id, type: showPassword ? "text" : "password", minLength: 5, placeholder: "xxxx xxxx xxxx xxxx", value: value, onChange: onChange, className: cn("autofill-input peer placeholder-Neutral-200 w-full px-[2.7rem] py-3 rounded-2xl bg-secondary-50 dark:bg-background-light border border-secondary-100 focus:outline-none focus:ring-0 focus:border-secondary-400 justify-between items-center text-Neutral-500 dark:text-white relative", variant === "change_password" &&
|
|
103
|
+
"invalid:focus:border-Error-400 invalid:border-Error-400", className) }, props)), _jsx("div", { className: "absolute inset-y-0 rtl:right-0 ltr:left-0 rtl:pr-3 ltr:pl-3 flex items-center pointer-events-none", children: _jsx(LockIcon, {}) }), _jsx("div", { className: "absolute inset-y-0 rtl:left-0 ltr:right-0 px-3 flex items-center", children: variant === "password" ? (_jsx("button", { type: "button", onClick: handleClear, children: _jsx(CloseSquareIcon, {}) })) : (_jsx("button", { type: "button", onClick: handleTogglePassword, children: showPassword ? _jsx(HideIcon, {}) : _jsx(ShowIcon, {}) })) }), error && (_jsx("div", { className: "peer-focus:hidden absolute mt-2 mx-3", children: _jsx("div", { className: "text-Error-400 text-xs font-medium", children: translate(error) }) })), _jsx("div", { className: "hidden peer-invalid:flex absolute my-2 mx-3", children: _jsx("div", { className: "text-Error-400 text-xs font-medium", children: translate("error_min_length_password") }) })] })] }));
|
|
101
104
|
}
|
|
102
105
|
// InputRePassword Component
|
|
103
106
|
export function InputRePassword(_a) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export
|
|
1
|
+
import React, { HTMLAttributes } from "react";
|
|
2
|
+
interface ModalProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
action?: (id?: string) => void;
|
|
5
|
+
className?: string;
|
|
6
|
+
id?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const Modal: React.FC<ModalProps>;
|
|
9
|
+
export default Modal;
|
|
@@ -1,7 +1,52 @@
|
|
|
1
|
-
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
2
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
13
|
+
/*
|
|
14
|
+
* @Author: Mohammad Felfelani
|
|
15
|
+
* @Email: mfelfelani72@gmail.com
|
|
16
|
+
* @Team:
|
|
17
|
+
* @Date: 2025-10-26 15:32:12
|
|
18
|
+
* @Description:
|
|
19
|
+
*/
|
|
20
|
+
import { useEffect } from "react";
|
|
21
|
+
// Components
|
|
22
|
+
import { CloseSquareIcon } from "../icon/icon";
|
|
23
|
+
// Functions
|
|
24
|
+
import { cn } from "../../libs/cn";
|
|
25
|
+
import { CloseModal } from "@/libs/modal/Modal";
|
|
26
|
+
const Modal = (_a) => {
|
|
27
|
+
var { children, action, className, id } = _a, props = __rest(_a, ["children", "action", "className", "id"]);
|
|
28
|
+
// functions
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
const handleKeyDown = (event) => {
|
|
31
|
+
if (event.key === "Escape" && id) {
|
|
32
|
+
CloseModal(id);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
36
|
+
return () => {
|
|
37
|
+
window.removeEventListener("keydown", handleKeyDown);
|
|
38
|
+
};
|
|
39
|
+
}, [id]);
|
|
40
|
+
const handleOverlayClick = () => {
|
|
41
|
+
if (action && id) {
|
|
42
|
+
action(id);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
const handleCloseClick = () => {
|
|
46
|
+
if (id) {
|
|
47
|
+
CloseModal(id);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
return (_jsxs("div", Object.assign({}, props, { id: id, className: "hidden fixed inset-0 items-center justify-center z-[999] p-4", children: [_jsx("div", { onClick: handleOverlayClick, className: "absolute inset-0 bg-black opacity-30" }), _jsx("div", { className: cn("relative max-w-2xl w-full max-h-[90vh] overflow-auto bg-white dark:bg-background-light rounded-2xl shadow-xl", className), children: _jsxs("div", { className: "p-4", children: [_jsx("div", { onClick: handleCloseClick, className: "w-full flex justify-end cursor-pointer", children: _jsx(CloseSquareIcon, { className: "mt-4 mx-4" }) }), children] }) })] })));
|
|
51
|
+
};
|
|
52
|
+
export default Modal;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @Author: Mohammad Felfelani
|
|
3
|
+
* @Email: mfelfelani72@gmail.com
|
|
4
|
+
* @Team:
|
|
5
|
+
* @Date: 2025-10-26 09:29:58
|
|
6
|
+
* @Description:
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* @Author: Mohammad Felfelani
|
|
10
|
+
* @Email: mfelfelani72@gmail.com
|
|
11
|
+
* @Team:
|
|
12
|
+
* @Date: 2025-10-04 07:17:02
|
|
13
|
+
* @Description:
|
|
14
|
+
*/
|
|
15
|
+
export declare const languages: {
|
|
16
|
+
readonly en: {
|
|
17
|
+
readonly dir: "ltr";
|
|
18
|
+
readonly locale: "en_US";
|
|
19
|
+
readonly schemaLocale: "en-US";
|
|
20
|
+
readonly name: "English";
|
|
21
|
+
readonly flag: "🇺🇸";
|
|
22
|
+
readonly nativeName: "English";
|
|
23
|
+
};
|
|
24
|
+
readonly fa: {
|
|
25
|
+
readonly dir: "rtl";
|
|
26
|
+
readonly locale: "fa_IR";
|
|
27
|
+
readonly schemaLocale: "fa-IR";
|
|
28
|
+
readonly name: "Persian";
|
|
29
|
+
readonly flag: "🇮🇷";
|
|
30
|
+
readonly nativeName: "فارسی";
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export type Lang = keyof typeof languages;
|
|
34
|
+
export declare function getLocale(lang: Lang): string;
|
|
35
|
+
export declare function getSchemaLocale(lang: Lang): string;
|
|
36
|
+
export declare function getDirection(lang: Lang): "ltr" | "rtl";
|
|
37
|
+
export declare function getName(lang: Lang): string;
|
|
38
|
+
export declare function getNativeName(lang: Lang): string;
|
|
39
|
+
export declare function getFlag(lang: Lang): string;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @Author: Mohammad Felfelani
|
|
3
|
+
* @Email: mfelfelani72@gmail.com
|
|
4
|
+
* @Team:
|
|
5
|
+
* @Date: 2025-10-26 09:29:58
|
|
6
|
+
* @Description:
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* @Author: Mohammad Felfelani
|
|
10
|
+
* @Email: mfelfelani72@gmail.com
|
|
11
|
+
* @Team:
|
|
12
|
+
* @Date: 2025-10-04 07:17:02
|
|
13
|
+
* @Description:
|
|
14
|
+
*/
|
|
15
|
+
export const languages = {
|
|
16
|
+
en: {
|
|
17
|
+
dir: "ltr",
|
|
18
|
+
locale: "en_US",
|
|
19
|
+
schemaLocale: "en-US",
|
|
20
|
+
name: "English",
|
|
21
|
+
flag: "🇺🇸",
|
|
22
|
+
nativeName: "English",
|
|
23
|
+
},
|
|
24
|
+
fa: {
|
|
25
|
+
dir: "rtl",
|
|
26
|
+
locale: "fa_IR",
|
|
27
|
+
schemaLocale: "fa-IR",
|
|
28
|
+
name: "Persian",
|
|
29
|
+
flag: "🇮🇷",
|
|
30
|
+
nativeName: "فارسی",
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
export function getLocale(lang) {
|
|
34
|
+
return languages[lang].locale;
|
|
35
|
+
}
|
|
36
|
+
export function getSchemaLocale(lang) {
|
|
37
|
+
return languages[lang].schemaLocale;
|
|
38
|
+
}
|
|
39
|
+
export function getDirection(lang) {
|
|
40
|
+
return languages[lang].dir;
|
|
41
|
+
}
|
|
42
|
+
export function getName(lang) {
|
|
43
|
+
return languages[lang].name;
|
|
44
|
+
}
|
|
45
|
+
export function getNativeName(lang) {
|
|
46
|
+
return languages[lang].nativeName;
|
|
47
|
+
}
|
|
48
|
+
export function getFlag(lang) {
|
|
49
|
+
return languages[lang].flag;
|
|
50
|
+
}
|