forma-ui 0.0.8 → 0.0.10

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 (94) hide show
  1. package/dist/Interfaces/dictionary.d.ts +25 -0
  2. package/dist/Interfaces/dictionary.js +8 -0
  3. package/dist/Interfaces/global.d.ts +21 -0
  4. package/dist/Interfaces/global.js +1 -0
  5. package/dist/Interfaces/meta.d.ts +39 -0
  6. package/dist/Interfaces/meta.js +8 -0
  7. package/dist/app/[lang]/stores/LangStore.d.ts +22 -0
  8. package/dist/app/[lang]/stores/LangStore.js +125 -0
  9. package/dist/components/icon/icon.d.ts +119 -0
  10. package/dist/components/icon/icon.js +454 -0
  11. package/dist/components/ui/Accordion.d.ts +17 -0
  12. package/dist/components/ui/Accordion.js +41 -0
  13. package/dist/components/ui/Button.d.ts +12 -0
  14. package/dist/components/ui/Button.js +48 -0
  15. package/dist/components/ui/CheckBox.d.ts +7 -0
  16. package/dist/components/ui/CheckBox.js +4 -0
  17. package/dist/components/ui/Input.d.ts +11 -0
  18. package/dist/components/ui/Input.js +176 -0
  19. package/dist/components/ui/Input.types.d.ts +45 -0
  20. package/dist/components/ui/Input.types.js +1 -0
  21. package/dist/components/ui/Modal.d.ts +9 -0
  22. package/dist/components/ui/Modal.js +52 -0
  23. package/dist/components/ui/RadioButton.d.ts +9 -0
  24. package/dist/components/ui/RadioButton.js +4 -0
  25. package/dist/components/ui/Table.d.ts +10 -0
  26. package/dist/components/ui/Table.js +4 -0
  27. package/dist/components/ui/Tabs.d.ts +10 -0
  28. package/dist/components/ui/Tabs.js +9 -0
  29. package/dist/configs/language.d.ts +39 -0
  30. package/dist/configs/language.js +50 -0
  31. package/dist/configs/metadata.d.ts +69 -0
  32. package/dist/configs/metadata.js +143 -0
  33. package/dist/dictionaries/en.json +18 -0
  34. package/dist/dictionaries/fa.json +18 -0
  35. package/dist/dictionaries/index.d.ts +35 -0
  36. package/dist/dictionaries/index.js +10 -0
  37. package/dist/hooks/useDevice.d.ts +21 -0
  38. package/dist/hooks/useDevice.js +49 -0
  39. package/dist/hooks/useTranslation.d.ts +4 -0
  40. package/dist/hooks/useTranslation.js +34 -0
  41. package/dist/index.d.ts +11 -0
  42. package/dist/index.js +14 -0
  43. package/dist/libs/api/axiosClient.d.ts +9 -0
  44. package/dist/libs/api/axiosClient.js +34 -0
  45. package/dist/libs/api/cns.d.ts +16 -0
  46. package/dist/libs/api/cns.js +29 -0
  47. package/dist/libs/api/usePostFetch.d.ts +23 -0
  48. package/dist/libs/api/usePostFetch.js +17 -0
  49. package/dist/libs/cn.d.ts +1 -0
  50. package/dist/libs/cn.js +12 -0
  51. package/dist/libs/cookieUtils.d.ts +10 -0
  52. package/dist/libs/cookieUtils.js +28 -0
  53. package/dist/libs/detectComponentResponsive.d.ts +10 -0
  54. package/dist/libs/detectComponentResponsive.js +24 -0
  55. package/dist/libs/detectDeviceFromUA.d.ts +8 -0
  56. package/dist/libs/detectDeviceFromUA.js +14 -0
  57. package/dist/libs/fonts.d.ts +10 -0
  58. package/dist/libs/fonts.js +94 -0
  59. package/dist/libs/metadataHelper.d.ts +17 -0
  60. package/dist/libs/metadataHelper.js +20 -0
  61. package/dist/libs/modal/Modal.d.ts +9 -0
  62. package/dist/libs/modal/Modal.js +41 -0
  63. package/dist/libs/translation.d.ts +5 -0
  64. package/dist/libs/translation.js +30 -0
  65. package/dist/libs/utils.d.ts +2 -0
  66. package/dist/libs/utils.js +6 -0
  67. package/dist/locale/about/en.json +3 -0
  68. package/dist/locale/about/fa.json +3 -0
  69. package/dist/locale/coin/en.json +4 -0
  70. package/dist/locale/coin/fa.json +4 -0
  71. package/dist/locale/en.d.ts +56 -0
  72. package/dist/locale/en.js +16 -0
  73. package/dist/locale/fa.d.ts +59 -0
  74. package/dist/locale/fa.js +16 -0
  75. package/dist/locale/global/en.json +12 -0
  76. package/dist/locale/global/fa.json +16 -0
  77. package/dist/locale/home/en.json +11 -0
  78. package/dist/locale/home/fa.json +11 -0
  79. package/dist/locale/index.d.ts +201 -0
  80. package/dist/locale/index.js +7 -0
  81. package/dist/locale/meta/about/en.json +10 -0
  82. package/dist/locale/meta/about/fa.json +5 -0
  83. package/dist/locale/meta/en.json +15 -0
  84. package/dist/locale/meta/fa.json +15 -0
  85. package/dist/locale/meta/home/en.json +10 -0
  86. package/dist/locale/meta/home/fa.json +5 -0
  87. package/dist/middleware.d.ts +14 -0
  88. package/dist/middleware.js +57 -0
  89. package/dist/store/appStore.d.ts +8 -0
  90. package/dist/store/appStore.js +16 -0
  91. package/dist/tsconfig.build.tsbuildinfo +1 -0
  92. package/dist/utils/nextImageLoader.d.ts +9 -0
  93. package/dist/utils/nextImageLoader.js +15 -0
  94. package/package.json +1 -2
@@ -0,0 +1,201 @@
1
+ declare const dictionaries: {
2
+ en: {
3
+ mood_day: string;
4
+ mood_week: string;
5
+ aimoonhub: string;
6
+ welcome_title: string;
7
+ financial_markets: string;
8
+ cryptocurrencies: string;
9
+ welcome_description: string;
10
+ login_dashboard: string;
11
+ go_to_news: string;
12
+ welcome_title_2: string;
13
+ welcome_description_2: string;
14
+ loaderPage: string;
15
+ loading: string;
16
+ header: string;
17
+ home: string;
18
+ about_us: string;
19
+ contact_us: string;
20
+ features: string;
21
+ prices: string;
22
+ support: string;
23
+ login_telegram: string;
24
+ meta: {
25
+ title: string;
26
+ description: string;
27
+ keywords: string[];
28
+ openGraph: {
29
+ title: string;
30
+ description: string;
31
+ image: string;
32
+ };
33
+ twitter: {
34
+ title: string;
35
+ description: string;
36
+ image: string;
37
+ };
38
+ };
39
+ meta_home: {
40
+ title: string;
41
+ description: string;
42
+ keywords: string[];
43
+ };
44
+ meta_about: {
45
+ title: string;
46
+ description: string;
47
+ keywords: string[];
48
+ };
49
+ };
50
+ fa: {
51
+ mood_day: string;
52
+ mood_week: string;
53
+ aimoonhub: string;
54
+ welcome_title: string;
55
+ financial_markets: string;
56
+ cryptocurrencies: string;
57
+ welcome_description: string;
58
+ login_dashboard: string;
59
+ go_to_news: string;
60
+ welcome_title_2: string;
61
+ welcome_description_2: string;
62
+ loaderPage: string;
63
+ loading: string;
64
+ coin: string;
65
+ sentiment: string;
66
+ news: string;
67
+ header: string;
68
+ home: string;
69
+ about_us: string;
70
+ contact_us: string;
71
+ features: string;
72
+ prices: string;
73
+ support: string;
74
+ login_telegram: string;
75
+ meta: {
76
+ title: string;
77
+ description: string;
78
+ keywords: string[];
79
+ openGraph: {
80
+ title: string;
81
+ description: string;
82
+ image: string;
83
+ };
84
+ twitter: {
85
+ title: string;
86
+ description: string;
87
+ image: string;
88
+ };
89
+ };
90
+ meta_home: {
91
+ title: string;
92
+ description: string;
93
+ keywords: string[];
94
+ };
95
+ meta_about: {
96
+ title: string;
97
+ description: string;
98
+ keywords: string[];
99
+ };
100
+ };
101
+ };
102
+ export type Lang = keyof typeof dictionaries;
103
+ export declare const getDictionary: (lang?: Lang) => {
104
+ mood_day: string;
105
+ mood_week: string;
106
+ aimoonhub: string;
107
+ welcome_title: string;
108
+ financial_markets: string;
109
+ cryptocurrencies: string;
110
+ welcome_description: string;
111
+ login_dashboard: string;
112
+ go_to_news: string;
113
+ welcome_title_2: string;
114
+ welcome_description_2: string;
115
+ loaderPage: string;
116
+ loading: string;
117
+ header: string;
118
+ home: string;
119
+ about_us: string;
120
+ contact_us: string;
121
+ features: string;
122
+ prices: string;
123
+ support: string;
124
+ login_telegram: string;
125
+ meta: {
126
+ title: string;
127
+ description: string;
128
+ keywords: string[];
129
+ openGraph: {
130
+ title: string;
131
+ description: string;
132
+ image: string;
133
+ };
134
+ twitter: {
135
+ title: string;
136
+ description: string;
137
+ image: string;
138
+ };
139
+ };
140
+ meta_home: {
141
+ title: string;
142
+ description: string;
143
+ keywords: string[];
144
+ };
145
+ meta_about: {
146
+ title: string;
147
+ description: string;
148
+ keywords: string[];
149
+ };
150
+ } | {
151
+ mood_day: string;
152
+ mood_week: string;
153
+ aimoonhub: string;
154
+ welcome_title: string;
155
+ financial_markets: string;
156
+ cryptocurrencies: string;
157
+ welcome_description: string;
158
+ login_dashboard: string;
159
+ go_to_news: string;
160
+ welcome_title_2: string;
161
+ welcome_description_2: string;
162
+ loaderPage: string;
163
+ loading: string;
164
+ coin: string;
165
+ sentiment: string;
166
+ news: string;
167
+ header: string;
168
+ home: string;
169
+ about_us: string;
170
+ contact_us: string;
171
+ features: string;
172
+ prices: string;
173
+ support: string;
174
+ login_telegram: string;
175
+ meta: {
176
+ title: string;
177
+ description: string;
178
+ keywords: string[];
179
+ openGraph: {
180
+ title: string;
181
+ description: string;
182
+ image: string;
183
+ };
184
+ twitter: {
185
+ title: string;
186
+ description: string;
187
+ image: string;
188
+ };
189
+ };
190
+ meta_home: {
191
+ title: string;
192
+ description: string;
193
+ keywords: string[];
194
+ };
195
+ meta_about: {
196
+ title: string;
197
+ description: string;
198
+ keywords: string[];
199
+ };
200
+ };
201
+ export {};
@@ -0,0 +1,7 @@
1
+ import { cache } from "react";
2
+ import en from "./en";
3
+ import fa from "./fa";
4
+ const dictionaries = { en, fa };
5
+ export const getDictionary = cache((lang = "en") => {
6
+ return dictionaries[lang];
7
+ });
@@ -0,0 +1,10 @@
1
+ {
2
+ "title": "About",
3
+ "description": "Description Home",
4
+ "keywords": [
5
+ "njksdfjksdhfksdjhf",
6
+ "sdfsdfsdfsd",
7
+ "mufsdfsdfsdfsdltilingual",
8
+ "dfgdfgdfgdfg"
9
+ ]
10
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "title": "درباره",
3
+ "description": "توضیح برای متای خانه",
4
+ "keywords": ["منسیابتنسیا", "سیبسیب", "سیبسیبسی", "سیبسیبسیبسی"]
5
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "title": "Mohammad Felfelani",
3
+ "description": "AimoonHub",
4
+ "keywords": ["next.js", "react", "multilingual", "website"],
5
+ "openGraph": {
6
+ "title": "My Multilingual Website",
7
+ "description": "Explore our multilingual platform built with Next.js.",
8
+ "image": "/og-en.jpg"
9
+ },
10
+ "twitter": {
11
+ "title": "My Multilingual Website",
12
+ "description": "Welcome to our multilingual website!",
13
+ "image": "/twitter-en.jpg"
14
+ }
15
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "title": "آیمون‌هاب",
3
+ "description": "به وب‌سایت چندزبانه من خوش آمدید!",
4
+ "keywords": ["نکست", "ری‌اکت", "چندزبانه", "وب‌سایت"],
5
+ "openGraph": {
6
+ "title": "وب‌سایت چندزبانه من",
7
+ "description": "پلتفرم چندزبانه ما را که با Next.js ساخته شده، کشف کنید.",
8
+ "image": "/og-fa.jpg"
9
+ },
10
+ "twitter": {
11
+ "title": "وب‌سایت چندزبانه من",
12
+ "description": "به وب‌سایت چندزبانه ما خوش آمدید!",
13
+ "image": "/twitter-fa.jpg"
14
+ }
15
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "title": "Home",
3
+ "description": "Description Home",
4
+ "keywords": [
5
+ "njksdfjksdhfksdjhf",
6
+ "sdfsdfsdfsd",
7
+ "mufsdfsdfsdfsdltilingual",
8
+ "dfgdfgdfgdfg"
9
+ ]
10
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "title": "خانه",
3
+ "description": "توضیح برای متای خانه",
4
+ "keywords": ["منسیابتنسیا", "سیبسیب", "سیبسیبسی", "سیبسیبسیبسی"]
5
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @Author: Mohammad Felfelani
3
+ * @Email: mfelfelani72@gmail.com
4
+ * @Team:
5
+ * @Date: 2025-10-19
6
+ * @Description: Middleware with language and device detection
7
+ *
8
+ */
9
+ import { NextResponse } from "next/server";
10
+ import type { NextRequest } from "next/server";
11
+ export declare function middleware(request: NextRequest): NextResponse<unknown>;
12
+ export declare const config: {
13
+ matcher: string[];
14
+ };
@@ -0,0 +1,57 @@
1
+ /**
2
+ * @Author: Mohammad Felfelani
3
+ * @Email: mfelfelani72@gmail.com
4
+ * @Team:
5
+ * @Date: 2025-10-19
6
+ * @Description: Middleware with language and device detection
7
+ *
8
+ */
9
+ import { NextResponse } from "next/server";
10
+ // Functions
11
+ import { detectDeviceFromUA } from "./libs/detectDeviceFromUA";
12
+ export function middleware(request) {
13
+ var _a, _b, _c;
14
+ const url = request.nextUrl.clone();
15
+ // ----------------------------
16
+ // Handle language
17
+ // ----------------------------
18
+ const cookieLang = (_a = request.cookies.get("app_lang")) === null || _a === void 0 ? void 0 : _a.value;
19
+ let defaultLang = "en";
20
+ if (cookieLang) {
21
+ try {
22
+ const parsed = JSON.parse(cookieLang);
23
+ if ((_b = parsed.state) === null || _b === void 0 ? void 0 : _b.lang) {
24
+ defaultLang = parsed.state.lang;
25
+ }
26
+ }
27
+ catch (error) {
28
+ defaultLang = cookieLang;
29
+ }
30
+ }
31
+ if (url.pathname === "/") {
32
+ url.pathname = `/${defaultLang}/${process.env.NEXT_PUBLIC_BASE_ROUTE}`;
33
+ return NextResponse.redirect(url);
34
+ }
35
+ // ----------------------------
36
+ // Handle device detection
37
+ // ----------------------------
38
+ const ua = request.headers.get("user-agent") || "";
39
+ const device = detectDeviceFromUA(ua);
40
+ const existingDevice = (_c = request.cookies.get("device-type")) === null || _c === void 0 ? void 0 : _c.value;
41
+ if (!existingDevice) {
42
+ const res = NextResponse.next();
43
+ res.cookies.set({
44
+ name: "device-type",
45
+ value: device,
46
+ path: "/",
47
+ maxAge: 60 * 60 * 24 * 365,
48
+ httpOnly: false,
49
+ sameSite: "lax",
50
+ });
51
+ return res;
52
+ }
53
+ return NextResponse.next();
54
+ }
55
+ export const config = {
56
+ matcher: ["/", "/:path*"],
57
+ };
@@ -0,0 +1,8 @@
1
+ import { Lang } from "../configs/language";
2
+ interface AppState {
3
+ lang: Lang;
4
+ dir: "ltr" | "rtl";
5
+ setLang: (lang: Lang) => void;
6
+ }
7
+ export declare const useAppStore: import("zustand").UseBoundStore<import("zustand").StoreApi<AppState>>;
8
+ export {};
@@ -0,0 +1,16 @@
1
+ import { create } from "zustand";
2
+ import { languages } from "../configs/language";
3
+ function getInitialLang() {
4
+ if (typeof window === "undefined")
5
+ return "en";
6
+ const firstSegment = window.location.pathname.split("/")[1];
7
+ return firstSegment && firstSegment in languages
8
+ ? firstSegment
9
+ : "en";
10
+ }
11
+ const initialLang = getInitialLang();
12
+ export const useAppStore = create((set) => ({
13
+ lang: initialLang,
14
+ dir: languages[initialLang].dir,
15
+ setLang: (lang) => set({ lang, dir: languages[lang].dir }),
16
+ }));