forma-ui 0.0.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 (65) hide show
  1. package/README.md +36 -0
  2. package/dist/app/[lang]/home/button/page.d.ts +1 -0
  3. package/dist/app/[lang]/home/button/page.js +6 -0
  4. package/dist/app/[lang]/home/checkBox/page.d.ts +1 -0
  5. package/dist/app/[lang]/home/checkBox/page.js +8 -0
  6. package/dist/app/[lang]/home/input/page.d.ts +1 -0
  7. package/dist/app/[lang]/home/input/page.js +11 -0
  8. package/dist/app/[lang]/home/layout.d.ts +8 -0
  9. package/dist/app/[lang]/home/layout.js +12 -0
  10. package/dist/app/[lang]/home/modal/page.d.ts +1 -0
  11. package/dist/app/[lang]/home/modal/page.js +9 -0
  12. package/dist/app/[lang]/home/page.d.ts +1 -0
  13. package/dist/app/[lang]/home/page.js +4 -0
  14. package/dist/app/[lang]/home/radioButton/page.d.ts +1 -0
  15. package/dist/app/[lang]/home/radioButton/page.js +7 -0
  16. package/dist/app/[lang]/home/settings/page.d.ts +1 -0
  17. package/dist/app/[lang]/home/settings/page.js +4 -0
  18. package/dist/app/[lang]/home/tab/page.d.ts +2 -0
  19. package/dist/app/[lang]/home/tab/page.js +10 -0
  20. package/dist/app/[lang]/home/table/page.d.ts +1 -0
  21. package/dist/app/[lang]/home/table/page.js +14 -0
  22. package/dist/app/[lang]/layout.d.ts +14 -0
  23. package/dist/app/[lang]/layout.js +26 -0
  24. package/dist/app/[lang]/page.d.ts +1 -0
  25. package/dist/app/[lang]/page.js +18 -0
  26. package/dist/app/layout.d.ts +6 -0
  27. package/dist/app/layout.js +9 -0
  28. package/dist/app/page.d.ts +1 -0
  29. package/dist/app/page.js +17 -0
  30. package/dist/components/PostDetailPage.d.ts +7 -0
  31. package/dist/components/PostDetailPage.js +47 -0
  32. package/dist/components/PostPage.d.ts +6 -0
  33. package/dist/components/PostPage.js +48 -0
  34. package/dist/components/app/Footer.d.ts +1 -0
  35. package/dist/components/app/Footer.js +4 -0
  36. package/dist/components/app/Header.d.ts +1 -0
  37. package/dist/components/app/Header.js +4 -0
  38. package/dist/components/app/Sidebar.d.ts +1 -0
  39. package/dist/components/app/Sidebar.js +28 -0
  40. package/dist/components/ui/Button.d.ts +9 -0
  41. package/dist/components/ui/Button.js +16 -0
  42. package/dist/components/ui/CheckBox.d.ts +7 -0
  43. package/dist/components/ui/CheckBox.js +4 -0
  44. package/dist/components/ui/Input.d.ts +10 -0
  45. package/dist/components/ui/Input.js +4 -0
  46. package/dist/components/ui/Modal.d.ts +9 -0
  47. package/dist/components/ui/Modal.js +7 -0
  48. package/dist/components/ui/RadioButton.d.ts +9 -0
  49. package/dist/components/ui/RadioButton.js +4 -0
  50. package/dist/components/ui/Table.d.ts +10 -0
  51. package/dist/components/ui/Table.js +4 -0
  52. package/dist/components/ui/Tabs.d.ts +10 -0
  53. package/dist/components/ui/Tabs.js +9 -0
  54. package/dist/config/language.d.ts +11 -0
  55. package/dist/config/language.js +6 -0
  56. package/dist/dictionaries/en.json +18 -0
  57. package/dist/dictionaries/fa.json +18 -0
  58. package/dist/dictionaries/index.d.ts +35 -0
  59. package/dist/dictionaries/index.js +10 -0
  60. package/dist/index.d.ts +2 -0
  61. package/dist/index.js +2 -0
  62. package/dist/store/appStore.d.ts +8 -0
  63. package/dist/store/appStore.js +16 -0
  64. package/dist/tsconfig.build.tsbuildinfo +1 -0
  65. package/package.json +33 -0
package/README.md ADDED
@@ -0,0 +1,36 @@
1
+ This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
2
+
3
+ ## Getting Started
4
+
5
+ First, run the development server:
6
+
7
+ ```bash
8
+ npm run dev
9
+ # or
10
+ yarn dev
11
+ # or
12
+ pnpm dev
13
+ # or
14
+ bun dev
15
+ ```
16
+
17
+ Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
18
+
19
+ You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
20
+
21
+ This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
22
+
23
+ ## Learn More
24
+
25
+ To learn more about Next.js, take a look at the following resources:
26
+
27
+ - [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
28
+ - [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
29
+
30
+ You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
31
+
32
+ ## Deploy on Vercel
33
+
34
+ The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
35
+
36
+ Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
@@ -0,0 +1 @@
1
+ export default function ButtonExample(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import Button from "@/components/ui/Button";
4
+ export default function ButtonExample() {
5
+ return (_jsxs("div", { className: "flex gap-4 p-4", children: [_jsx(Button, { variant: "primary", onClick: () => alert("Primary clicked"), children: "Primary" }), _jsx(Button, { variant: "secondary", children: "Secondary" }), _jsx(Button, { variant: "danger", children: "Danger" })] }));
6
+ }
@@ -0,0 +1 @@
1
+ export default function CheckboxExample(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useState } from "react";
4
+ import Checkbox from "@/components/ui/CheckBox";
5
+ export default function CheckboxExample() {
6
+ const [checked, setChecked] = useState(false);
7
+ return (_jsxs("div", { className: "p-4", children: [_jsx(Checkbox, { label: "\u0645\u0648\u0627\u0641\u0642\u0645", checked: checked, onChange: setChecked }), _jsxs("p", { className: "mt-2", children: ["\u0648\u0636\u0639\u06CC\u062A: ", checked ? "فعال" : "غیرفعال"] })] }));
8
+ }
@@ -0,0 +1 @@
1
+ export default function InputExample(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,11 @@
1
+ "use client"; // ✅ must be exactly like this
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useState } from "react";
4
+ import Input from "@/components/ui/Input";
5
+ export default function InputExample() {
6
+ const [text, setText] = useState("");
7
+ const handleChange = (e) => {
8
+ setText(e.target.value);
9
+ };
10
+ return (_jsxs("div", { className: "p-4", children: [_jsx(Input, { value: text, onChange: handleChange, placeholder: "\u0646\u0627\u0645 \u062E\u0648\u062F \u0631\u0627 \u0648\u0627\u0631\u062F \u06A9\u0646\u06CC\u062F" }), _jsxs("p", { className: "mt-2 text-gray-700", children: ["\u0645\u0642\u062F\u0627\u0631 \u0648\u0627\u0631\u062F \u0634\u062F\u0647: ", text] })] }));
11
+ }
@@ -0,0 +1,8 @@
1
+ import "../../../app/globals.css";
2
+ export declare const metadata: {
3
+ title: string;
4
+ description: string;
5
+ };
6
+ export default function RootLayout({ children, }: {
7
+ children: React.ReactNode;
8
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import "../../../app/globals.css";
3
+ import Sidebar from "@/components/app/Sidebar";
4
+ import Header from "@/components/app/Header";
5
+ import Footer from "@/components/app/Footer";
6
+ export const metadata = {
7
+ title: "UI Kit Example",
8
+ description: "ساختار با Sidebar و Header/Footer",
9
+ };
10
+ export default function RootLayout({ children, }) {
11
+ return (_jsx("html", { lang: "fa", dir: "rtl", children: _jsxs("body", { className: "flex", children: [_jsx(Sidebar, {}), _jsxs("div", { className: "flex-1 flex flex-col min-h-screen", children: [_jsx(Header, {}), _jsx("main", { className: "flex-1 p-4 bg-gray-50", children: children }), _jsx(Footer, {})] })] }) }));
12
+ }
@@ -0,0 +1 @@
1
+ export default function ModalExample(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useState } from "react";
4
+ import Modal from "@/components/ui/Modal";
5
+ import Button from "@/components/ui/Button";
6
+ export default function ModalExample() {
7
+ const [isOpen, setIsOpen] = useState(false);
8
+ return (_jsxs("div", { className: "p-4 flex flex-col gap-4", children: [_jsx(Button, { variant: "primary", onClick: () => setIsOpen(true), children: "\u0628\u0627\u0632 \u06A9\u0631\u062F\u0646 \u0645\u0648\u062F\u0627\u0644" }), _jsxs(Modal, { isOpen: isOpen, onClose: () => setIsOpen(false), title: "\u0639\u0646\u0648\u0627\u0646 \u0645\u0648\u062F\u0627\u0644", children: [_jsx("p", { children: "\u0627\u06CC\u0646 \u06CC\u06A9 \u0645\u062D\u062A\u0648\u0627\u06CC \u0646\u0645\u0648\u0646\u0647 \u0628\u0631\u0627\u06CC \u0645\u0648\u062F\u0627\u0644 \u0627\u0633\u062A." }), _jsxs("div", { className: "mt-4 flex justify-end gap-2", children: [_jsx(Button, { variant: "secondary", onClick: () => setIsOpen(false), children: "\u0628\u0633\u062A\u0646" }), _jsx(Button, { variant: "primary", onClick: () => alert("تأیید شد"), children: "\u062A\u0623\u06CC\u06CC\u062F" })] })] })] }));
9
+ }
@@ -0,0 +1 @@
1
+ export default function HomePage(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ export default function HomePage() {
3
+ return _jsx("div", { children: "\u0635\u0641\u062D\u0647 \u0627\u0635\u0644\u06CC" });
4
+ }
@@ -0,0 +1 @@
1
+ export default function RadioExample(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useState } from "react";
4
+ export default function RadioExample() {
5
+ const [selected, setSelected] = useState("male");
6
+ return (_jsxs("div", { className: "p-4 flex flex-col gap-2", children: [_jsxs("label", { className: "flex items-center gap-2", children: [_jsx("input", { type: "radio", name: "gender", value: "male", checked: selected === "male", onChange: () => setSelected("male"), className: "w-4 h-4 text-blue-600 border-gray-300" }), "\u0645\u0631\u062F"] }), _jsxs("label", { className: "flex items-center gap-2", children: [_jsx("input", { type: "radio", name: "gender", value: "female", checked: selected === "female", onChange: () => setSelected("female"), className: "w-4 h-4 text-blue-600 border-gray-300" }), "\u0632\u0646"] }), _jsxs("p", { children: ["\u0627\u0646\u062A\u062E\u0627\u0628 \u0634\u062F\u0647: ", selected] })] }));
7
+ }
@@ -0,0 +1 @@
1
+ export default function SettingsPage(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ export default function SettingsPage() {
3
+ return _jsx("div", { children: "\u0635\u0641\u062D\u0647 \u062A\u0646\u0638\u06CC\u0645\u0627\u062A" });
4
+ }
@@ -0,0 +1,2 @@
1
+ declare const page: () => import("react/jsx-runtime").JSX.Element;
2
+ export default page;
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import Tabs from "@/components/ui/Tabs";
3
+ const page = () => {
4
+ return (_jsx(Tabs, { tabs: [
5
+ { label: "پیش‌فرض", content: _jsx("p", { children: "\u0645\u062D\u062A\u0648\u0627\u06CC \u062A\u0628 \u06F1" }) },
6
+ { label: "تنظیمات", content: _jsx("p", { children: "\u0645\u062D\u062A\u0648\u0627\u06CC \u062A\u0628 \u06F2" }) },
7
+ { label: "داشبورد", content: _jsx("p", { children: "\u0645\u062D\u062A\u0648\u0627\u06CC \u062A\u0628 \u06F3" }) },
8
+ ] }));
9
+ };
10
+ export default page;
@@ -0,0 +1 @@
1
+ export default function TableExample(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import Table from "@/components/ui/Table";
3
+ export default function TableExample() {
4
+ const columns = [
5
+ { header: "نام", accessor: "name" },
6
+ { header: "ایمیل", accessor: "email" },
7
+ { header: "سن", accessor: "age" },
8
+ ];
9
+ const data = [
10
+ { name: "علی", email: "ali@example.com", age: 25 },
11
+ { name: "سارا", email: "sara@example.com", age: 30 },
12
+ ];
13
+ return (_jsx("div", { className: "p-4", children: _jsx(Table, { columns: columns, data: data }) }));
14
+ }
@@ -0,0 +1,14 @@
1
+ import { ReactNode } from "react";
2
+ export declare function generateStaticParams(): Promise<{
3
+ lang: string;
4
+ }[]>;
5
+ interface LangLayoutProps {
6
+ children: ReactNode;
7
+ params: {
8
+ lang: string;
9
+ } | Promise<{
10
+ lang: string;
11
+ }>;
12
+ }
13
+ export default function LangLayout({ children, params, }: LangLayoutProps): Promise<import("react/jsx-runtime").JSX.Element>;
14
+ export {};
@@ -0,0 +1,26 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { getDictionary } from "../../dictionaries";
3
+ import { languages } from "../../config/language";
4
+ import { Geist, Geist_Mono } from "next/font/google";
5
+ const geistSans = Geist({
6
+ variable: "--font-geist-sans",
7
+ subsets: ["latin"],
8
+ display: "swap",
9
+ });
10
+ const geistMono = Geist_Mono({
11
+ variable: "--font-geist-mono",
12
+ subsets: ["latin"],
13
+ display: "swap",
14
+ });
15
+ export async function generateStaticParams() {
16
+ return Object.keys(languages).map((lang) => ({ lang }));
17
+ }
18
+ export default async function LangLayout({ children, params, }) {
19
+ // ⚡ حتما await params
20
+ const { lang: paramLang } = await params;
21
+ const lang = (paramLang in languages ? paramLang : "en");
22
+ const dir = languages[lang].dir;
23
+ // لود دیکشنری برای این زبان
24
+ const dict = await getDictionary(lang);
25
+ return (_jsx("html", { lang: lang, dir: dir, className: geistSans.variable, children: _jsx("body", { children: children }) }));
26
+ }
@@ -0,0 +1 @@
1
+ export default function RootPage(): Promise<void>;
@@ -0,0 +1,18 @@
1
+ import { redirect } from "next/navigation";
2
+ import { headers } from "next/headers";
3
+ const locales = ["en", "fa"];
4
+ const defaultLocale = "fa";
5
+ export default async function RootPage() {
6
+ const headerList = await headers();
7
+ const acceptLang = headerList.get("accept-language") || "";
8
+ let locale = defaultLocale;
9
+ const langs = acceptLang.split(",").map((l) => l.split(";")[0].trim());
10
+ for (const lang of langs) {
11
+ const base = lang.split("-")[0];
12
+ if (locales.includes(base)) {
13
+ locale = base;
14
+ break;
15
+ }
16
+ }
17
+ redirect(`/${locale}/home`);
18
+ }
@@ -0,0 +1,6 @@
1
+ import type { Metadata } from "next";
2
+ import "./globals.css";
3
+ export declare const metadata: Metadata;
4
+ export default function RootLayout({ children, }: {
5
+ children: React.ReactNode;
6
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
+ import "./globals.css";
3
+ export const metadata = {
4
+ title: "Create Next App",
5
+ description: "Generated by create next app",
6
+ };
7
+ export default function RootLayout({ children, }) {
8
+ return _jsx(_Fragment, { children: children });
9
+ }
@@ -0,0 +1 @@
1
+ export default function RootPage(): Promise<void>;
@@ -0,0 +1,17 @@
1
+ import { redirect } from "next/navigation";
2
+ import { headers } from "next/headers";
3
+ const defaultLocale = "en";
4
+ export default async function RootPage() {
5
+ const headerList = await headers();
6
+ const acceptLang = headerList.get("accept-language") || "";
7
+ let locale = defaultLocale;
8
+ const langs = acceptLang.split(",").map((l) => l.split(";")[0].trim());
9
+ for (const lang of langs) {
10
+ const base = lang.split("-")[0];
11
+ if (["fa", "en"].includes(base)) {
12
+ locale = base;
13
+ break;
14
+ }
15
+ }
16
+ redirect(`/${locale}/home`);
17
+ }
@@ -0,0 +1,7 @@
1
+ import { Lang } from "../config/language";
2
+ interface PostDetailPageProps {
3
+ id: string;
4
+ lang?: Lang;
5
+ }
6
+ export declare const PostDetailPage: ({ id, lang }: PostDetailPageProps) => import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,47 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useEffect, useState } from "react";
4
+ import { useAppStore } from "../store/appStore";
5
+ import { getDictionary } from "../dictionaries";
6
+ import { useRouter, usePathname, useSearchParams } from "next/navigation";
7
+ import { languages } from "../config/language";
8
+ export const PostDetailPage = ({ id, lang }) => {
9
+ const storeLang = useAppStore((state) => state.lang);
10
+ const setLang = useAppStore((state) => state.setLang);
11
+ const [dict, setDict] = useState(null);
12
+ const router = useRouter();
13
+ const pathname = usePathname();
14
+ const searchParams = useSearchParams();
15
+ // تعیین زبان: prop اولویت دارد
16
+ const currentLang = lang !== null && lang !== void 0 ? lang : storeLang;
17
+ useEffect(() => {
18
+ let isMounted = true;
19
+ getDictionary(currentLang).then((d) => {
20
+ if (isMounted)
21
+ setDict(d);
22
+ });
23
+ return () => {
24
+ isMounted = false;
25
+ };
26
+ }, [currentLang]);
27
+ const changeLang = (newLang) => {
28
+ if (newLang === currentLang)
29
+ return;
30
+ if (!lang) {
31
+ setLang(newLang);
32
+ const segments = pathname.split("/").slice(1);
33
+ if (segments.length > 0 && Object.keys(languages).includes(segments[0])) {
34
+ segments[0] = newLang;
35
+ }
36
+ else {
37
+ segments.unshift(newLang);
38
+ }
39
+ const newPath = "/" + segments.join("/");
40
+ const search = searchParams.toString();
41
+ router.push(search ? `${newPath}?${search}` : newPath);
42
+ }
43
+ };
44
+ if (!dict)
45
+ return _jsx("div", { children: "Loading..." });
46
+ return (_jsxs("div", { children: [_jsxs("h2", { children: [dict.posts.title, " - ", id] }), _jsx("p", { children: dict.posts.description }), !lang && (_jsxs("div", { children: [_jsx("button", { onClick: () => changeLang("fa"), children: "\u0641\u0627\u0631\u0633\u06CC" }), _jsx("button", { onClick: () => changeLang("en"), children: "English" })] }))] }));
47
+ };
@@ -0,0 +1,6 @@
1
+ import { Lang } from "../config/language";
2
+ interface PostsPageProps {
3
+ lang?: Lang;
4
+ }
5
+ export declare const PostsPage: ({ lang }: PostsPageProps) => import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,48 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useEffect, useState } from "react";
4
+ import { useAppStore } from "../store/appStore";
5
+ import { getDictionary } from "../dictionaries";
6
+ import { useRouter, usePathname, useSearchParams } from "next/navigation";
7
+ import { languages } from "../config/language";
8
+ export const PostsPage = ({ lang }) => {
9
+ const storeLang = useAppStore((state) => state.lang);
10
+ const setLang = useAppStore((state) => state.setLang);
11
+ const [dict, setDict] = useState(null);
12
+ const router = useRouter();
13
+ const pathname = usePathname();
14
+ const searchParams = useSearchParams();
15
+ // تصمیم می‌گیریم که کدام زبان استفاده شود: اول prop بعد store
16
+ const currentLang = lang !== null && lang !== void 0 ? lang : storeLang;
17
+ useEffect(() => {
18
+ let isMounted = true;
19
+ getDictionary(currentLang).then((d) => {
20
+ if (isMounted)
21
+ setDict(d);
22
+ });
23
+ return () => {
24
+ isMounted = false;
25
+ };
26
+ }, [currentLang]);
27
+ const changeLang = (newLang) => {
28
+ if (newLang === currentLang)
29
+ return;
30
+ // فقط وقتی prop نیست، store و URL را تغییر بده
31
+ if (!lang) {
32
+ setLang(newLang);
33
+ const segments = pathname.split("/").slice(1);
34
+ if (segments.length > 0 && Object.keys(languages).includes(segments[0])) {
35
+ segments[0] = newLang;
36
+ }
37
+ else {
38
+ segments.unshift(newLang);
39
+ }
40
+ const newPath = "/" + segments.join("/");
41
+ const search = searchParams.toString();
42
+ router.push(search ? `${newPath}?${search}` : newPath);
43
+ }
44
+ };
45
+ if (!dict)
46
+ return _jsx("div", { children: "Loading..." });
47
+ return (_jsxs("div", { children: [_jsx("h2", { children: dict.posts.title }), _jsx("p", { children: dict.posts.description }), !lang && (_jsxs("div", { children: [_jsx("button", { onClick: () => changeLang("fa"), children: "\u0641\u0627\u0631\u0633\u06CC" }), _jsx("button", { onClick: () => changeLang("en"), children: "English" })] }))] }));
48
+ };
@@ -0,0 +1 @@
1
+ export default function Footer(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ export default function Footer() {
3
+ return (_jsxs("footer", { className: "w-full bg-gradient-to-r from-gray-800 to-gray-900 text-gray-300 shadow-inner p-4 flex flex-col sm:flex-row items-center justify-between gap-2", children: [_jsx("p", { className: "text-sm sm:text-base", children: "\u00A9 2025 \u0647\u0645\u0647 \u062D\u0642\u0648\u0642 \u0645\u062D\u0641\u0648\u0638 \u0627\u0633\u062A" }), _jsxs("div", { className: "flex gap-4", children: [_jsx("a", { href: "#", className: "hover:text-white transition-colors duration-200 text-sm sm:text-base", children: "\u0633\u06CC\u0627\u0633\u062A \u062D\u0641\u0638 \u062D\u0631\u06CC\u0645 \u062E\u0635\u0648\u0635\u06CC" }), _jsx("a", { href: "#", className: "hover:text-white transition-colors duration-200 text-sm sm:text-base", children: "\u062A\u0645\u0627\u0633 \u0628\u0627 \u0645\u0627" })] })] }));
4
+ }
@@ -0,0 +1 @@
1
+ export default function Header(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ export default function Header() {
3
+ return (_jsxs("header", { className: "w-full bg-gradient-to-r from-indigo-600 to-purple-600 text-white shadow-md flex items-center justify-between p-4", children: [_jsx("h1", { className: "text-2xl font-bold tracking-wide", children: "\u26A1 \u067E\u0646\u0644 \u0645\u062F\u06CC\u0631\u06CC\u062A" }), _jsxs("div", { className: "flex items-center gap-4", children: [_jsxs("div", { className: "relative", children: [_jsx("div", { className: "w-6 h-6 bg-white bg-opacity-20 rounded-full flex items-center justify-center text-sm font-bold", children: "\uD83D\uDD14" }), _jsx("span", { className: "absolute -top-1 -right-1 w-3 h-3 bg-yellow-400 rounded-full border-2 border-indigo-600" })] }), _jsx("div", { className: "w-8 h-8 bg-gray-200 rounded-full flex items-center justify-center text-gray-700 font-bold", children: "A" })] })] }));
4
+ }
@@ -0,0 +1 @@
1
+ export default function Sidebar(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,28 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import Link from "next/link";
4
+ import { usePathname } from "next/navigation";
5
+ const links = [
6
+ { href: "/", label: "خانه" },
7
+ { href: "/en/home/button", label: "Button" },
8
+ { href: "/en/home/checkBox", label: "checkBox" },
9
+ { href: "/en/home/input", label: "input" },
10
+ { href: "/en/home/modal", label: "modal" },
11
+ { href: "/en/home/radioButton", label: "radioButton" },
12
+ { href: "/en/home/table", label: "table" },
13
+ { href: "/en/home/tab", label: "tab" },
14
+ { href: "/en/home/settings", label: "تنظیمات" },
15
+ ];
16
+ export default function Sidebar() {
17
+ const pathname = usePathname();
18
+ return (_jsxs("aside", { className: "w-64 h-screen flex flex-col bg-gradient-to-b from-gray-800 to-gray-900 text-gray-200 shadow-xl", children: [_jsx("div", { className: "p-6 font-bold text-2xl tracking-wide text-white border-b border-gray-700", children: "\u26A1 \u067E\u0646\u0644 \u0645\u0646" }), _jsx("nav", { className: "flex-1 p-4 flex flex-col gap-3", children: links.map((link) => {
19
+ const isActive = pathname === link.href;
20
+ return (_jsxs(Link, { href: link.href, className: `
21
+ relative px-4 py-3 rounded-lg flex items-center
22
+ transition-all duration-300
23
+ ${isActive
24
+ ? "bg-gradient-to-r from-indigo-600 to-indigo-400 text-white font-semibold shadow-lg"
25
+ : "hover:bg-gray-800 hover:text-white"}
26
+ `, children: [isActive && (_jsx("span", { className: "absolute left-0 top-0 h-full w-1 bg-yellow-400 rounded-r-md" })), _jsx("span", { className: "ml-2", children: link.label })] }, link.href));
27
+ }) })] }));
28
+ }
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ type ButtonProps = {
3
+ children: React.ReactNode;
4
+ variant?: "primary" | "secondary" | "outline" | "danger";
5
+ size?: "sm" | "md" | "lg";
6
+ onClick?: () => void;
7
+ };
8
+ export default function Button({ children, variant, size, onClick, }: ButtonProps): import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ export default function Button({ children, variant = "primary", size = "md", onClick, }) {
3
+ const base = "rounded-lg font-medium focus:outline-none transition";
4
+ const sizes = {
5
+ sm: "px-2 py-1 text-sm",
6
+ md: "px-4 py-2 text-base",
7
+ lg: "px-6 py-3 text-lg",
8
+ };
9
+ const variants = {
10
+ primary: "bg-blue-600 text-white hover:bg-blue-700",
11
+ secondary: "bg-gray-200 text-gray-800 hover:bg-gray-300",
12
+ outline: "border border-gray-400 text-gray-700 hover:bg-gray-100",
13
+ danger: "border border-gray-400 text-gray-700 hover:bg-gray-100",
14
+ };
15
+ return (_jsx("button", { className: `${base} ${sizes[size]} ${variants[variant]}`, onClick: onClick, children: children }));
16
+ }
@@ -0,0 +1,7 @@
1
+ type CheckboxProps = {
2
+ label: string;
3
+ checked?: boolean;
4
+ onChange?: (checked: boolean) => void;
5
+ };
6
+ export default function Checkbox({ label, checked, onChange }: CheckboxProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ export default function Checkbox({ label, checked, onChange }) {
3
+ return (_jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [_jsx("input", { type: "checkbox", checked: checked, onChange: (e) => onChange === null || onChange === void 0 ? void 0 : onChange(e.target.checked), className: "w-4 h-4 accent-blue-600 rounded" }), _jsx("span", { children: label })] }));
4
+ }
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ type InputProps = {
3
+ label?: string;
4
+ type?: string;
5
+ placeholder?: string;
6
+ value?: string;
7
+ onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
8
+ };
9
+ export default function Input({ label, type, placeholder, value, onChange, }: InputProps): import("react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ export default function Input({ label, type = "text", placeholder, value, onChange, }) {
3
+ return (_jsxs("div", { className: "flex flex-col gap-1", children: [label && _jsx("label", { className: "text-sm font-medium", children: label }), _jsx("input", { type: type, placeholder: placeholder, value: value, onChange: onChange, className: "border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-500 focus:outline-none" })] }));
4
+ }
@@ -0,0 +1,9 @@
1
+ import { ReactNode } from "react";
2
+ type ModalProps = {
3
+ isOpen: boolean;
4
+ onClose: () => void;
5
+ title?: string;
6
+ children: ReactNode;
7
+ };
8
+ export default function Modal({ isOpen, onClose, title, children }: ModalProps): import("react/jsx-runtime").JSX.Element | null;
9
+ export {};
@@ -0,0 +1,7 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ export default function Modal({ isOpen, onClose, title, children }) {
4
+ if (!isOpen)
5
+ return null;
6
+ return (_jsx("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50", onClick: onClose, children: _jsxs("div", { className: "bg-white rounded-lg shadow-lg max-w-lg w-full p-6 relative", onClick: (e) => e.stopPropagation(), children: [title && _jsx("h2", { className: "text-xl font-bold mb-4", children: title }), _jsx("div", { children: children }), _jsx("button", { onClick: onClose, className: "absolute top-2 right-2 text-gray-500 hover:text-gray-800 transition-colors", children: "\u2715" })] }) }));
7
+ }
@@ -0,0 +1,9 @@
1
+ type RadioProps = {
2
+ label: string;
3
+ name: string;
4
+ value: string;
5
+ checked?: boolean;
6
+ onChange?: (value: string) => void;
7
+ };
8
+ export default function RadioButton({ label, name, value, checked, onChange, }: RadioProps): import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ export default function RadioButton({ label, name, value, checked, onChange, }) {
3
+ return (_jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [_jsx("input", { type: "radio", name: name, value: value, checked: checked, onChange: () => onChange === null || onChange === void 0 ? void 0 : onChange(value), className: "hidden peer" }), _jsx("span", { className: "w-4 h-4 rounded-full border border-gray-500 flex items-center justify-center peer-checked:border-blue-600", children: _jsx("span", { className: "w-2 h-2 bg-blue-600 rounded-full peer-checked:block hidden" }) }), _jsx("span", { children: label })] }));
4
+ }
@@ -0,0 +1,10 @@
1
+ type Column<T> = {
2
+ header: string;
3
+ accessor: keyof T;
4
+ };
5
+ type TableProps<T> = {
6
+ columns: Column<T>[];
7
+ data: T[];
8
+ };
9
+ export default function Table<T>({ columns, data }: TableProps<T>): import("react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ export default function Table({ columns, data }) {
3
+ return (_jsx("div", { className: "overflow-x-auto rounded-lg shadow border border-gray-200", children: _jsxs("table", { className: "min-w-full divide-y divide-gray-200", children: [_jsx("thead", { className: "bg-gray-100", children: _jsx("tr", { children: columns.map((col, idx) => (_jsx("th", { className: "px-4 py-2 text-left text-gray-700 font-medium", children: col.header }, idx))) }) }), _jsx("tbody", { className: "bg-white divide-y divide-gray-200", children: data.map((row, idx) => (_jsx("tr", { className: "hover:bg-gray-50 transition-colors", children: columns.map((col, cidx) => (_jsx("td", { className: "px-4 py-2 text-gray-800", children: row[col.accessor] }, cidx))) }, idx))) })] }) }));
4
+ }
@@ -0,0 +1,10 @@
1
+ import { ReactNode } from "react";
2
+ type Tab = {
3
+ label: string;
4
+ content: ReactNode;
5
+ };
6
+ type TabsProps = {
7
+ tabs: Tab[];
8
+ };
9
+ export default function Tabs({ tabs }: TabsProps): import("react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -0,0 +1,9 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useState } from "react";
4
+ export default function Tabs({ tabs }) {
5
+ const [activeIndex, setActiveIndex] = useState(0);
6
+ return (_jsxs("div", { className: "w-full", children: [_jsx("div", { className: "flex border-b border-gray-300", children: tabs.map((tab, index) => (_jsx("button", { onClick: () => setActiveIndex(index), className: `px-4 py-2 -mb-px font-medium transition-colors duration-200 ${activeIndex === index
7
+ ? "border-b-2 border-blue-600 text-blue-600"
8
+ : "text-gray-600 hover:text-blue-600"}`, children: tab.label }, index))) }), _jsx("div", { className: "p-4 bg-gray-50 rounded-b-lg", children: tabs[activeIndex].content })] }));
9
+ }
@@ -0,0 +1,11 @@
1
+ export declare const languages: {
2
+ readonly en: {
3
+ readonly dir: "ltr";
4
+ readonly name: "English";
5
+ };
6
+ readonly fa: {
7
+ readonly dir: "rtl";
8
+ readonly name: "فارسی";
9
+ };
10
+ };
11
+ export type Lang = keyof typeof languages;
@@ -0,0 +1,6 @@
1
+ // src/config/language.ts
2
+ export const languages = {
3
+ en: { dir: "ltr", name: "English" },
4
+ fa: { dir: "rtl", name: "فارسی" },
5
+ // زبان‌های دیگر اضافه کنید
6
+ };