forma-ui 0.0.1 → 0.0.3
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/components/icon/icon.d.ts +19 -0
- package/dist/components/icon/icon.js +61 -0
- package/dist/components/ui/Accordion.d.ts +16 -0
- package/dist/components/ui/Accordion.js +32 -0
- package/dist/components/ui/Button.d.ts +12 -9
- package/dist/components/ui/Button.js +46 -14
- package/dist/index.d.ts +1 -2
- package/dist/index.js +1 -2
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.js +6 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +6 -2
- package/dist/app/[lang]/home/button/page.d.ts +0 -1
- package/dist/app/[lang]/home/button/page.js +0 -6
- package/dist/app/[lang]/home/checkBox/page.d.ts +0 -1
- package/dist/app/[lang]/home/checkBox/page.js +0 -8
- package/dist/app/[lang]/home/input/page.d.ts +0 -1
- package/dist/app/[lang]/home/input/page.js +0 -11
- package/dist/app/[lang]/home/layout.d.ts +0 -8
- package/dist/app/[lang]/home/layout.js +0 -12
- package/dist/app/[lang]/home/modal/page.d.ts +0 -1
- package/dist/app/[lang]/home/modal/page.js +0 -9
- package/dist/app/[lang]/home/page.d.ts +0 -1
- package/dist/app/[lang]/home/page.js +0 -4
- package/dist/app/[lang]/home/radioButton/page.d.ts +0 -1
- package/dist/app/[lang]/home/radioButton/page.js +0 -7
- package/dist/app/[lang]/home/settings/page.d.ts +0 -1
- package/dist/app/[lang]/home/settings/page.js +0 -4
- package/dist/app/[lang]/home/tab/page.d.ts +0 -2
- package/dist/app/[lang]/home/tab/page.js +0 -10
- package/dist/app/[lang]/home/table/page.d.ts +0 -1
- package/dist/app/[lang]/home/table/page.js +0 -14
- package/dist/app/[lang]/layout.d.ts +0 -14
- package/dist/app/[lang]/layout.js +0 -26
- package/dist/app/[lang]/page.d.ts +0 -1
- package/dist/app/[lang]/page.js +0 -18
- package/dist/app/layout.d.ts +0 -6
- package/dist/app/layout.js +0 -9
- package/dist/app/page.d.ts +0 -1
- package/dist/app/page.js +0 -17
- package/dist/components/app/Footer.d.ts +0 -1
- package/dist/components/app/Footer.js +0 -4
- package/dist/components/app/Header.d.ts +0 -1
- package/dist/components/app/Header.js +0 -4
- package/dist/components/app/Sidebar.d.ts +0 -1
- package/dist/components/app/Sidebar.js +0 -28
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "forma-ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -9,14 +9,18 @@
|
|
|
9
9
|
"private": false,
|
|
10
10
|
"scripts": {
|
|
11
11
|
"dev": "next dev --turbopack",
|
|
12
|
-
"build": "
|
|
12
|
+
"build": "npm run build:dist",
|
|
13
|
+
"build:dist": "tsc -p tsconfig.build.json",
|
|
14
|
+
"build:server": "tsc -p tsconfig.server.json",
|
|
13
15
|
"start": "next start",
|
|
14
16
|
"lint": "eslint"
|
|
15
17
|
},
|
|
16
18
|
"dependencies": {
|
|
19
|
+
"clsx": "^2.1.1",
|
|
17
20
|
"next": "15.5.4",
|
|
18
21
|
"react": "19.1.0",
|
|
19
22
|
"react-dom": "19.1.0",
|
|
23
|
+
"tailwind-merge": "^3.3.1",
|
|
20
24
|
"zustand": "^5.0.8"
|
|
21
25
|
},
|
|
22
26
|
"devDependencies": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function ButtonExample(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function CheckboxExample(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function InputExample(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,11 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function ModalExample(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function HomePage(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function RadioExample(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function SettingsPage(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +0,0 @@
|
|
|
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;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function TableExample(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,14 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,26 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function RootPage(): Promise<void>;
|
package/dist/app/[lang]/page.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
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
|
-
}
|
package/dist/app/layout.d.ts
DELETED
package/dist/app/layout.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
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
|
-
}
|
package/dist/app/page.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function RootPage(): Promise<void>;
|
package/dist/app/page.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function Footer(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function Header(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function Sidebar(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,28 +0,0 @@
|
|
|
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
|
-
}
|