forma-ui 0.0.8 → 0.0.9

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 +10 -0
  42. package/dist/index.js +12 -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,17 @@
1
+ import React, { ReactNode } from "react";
2
+ export type AccordionProps = {
3
+ parentClassName?: string;
4
+ className?: string;
5
+ circleLocation?: string;
6
+ secoundCircleLocation?: string;
7
+ children: ReactNode;
8
+ icon?: ReactNode;
9
+ title: string;
10
+ title_classname?: string;
11
+ open?: boolean;
12
+ onToggle?: () => void;
13
+ sliding?: boolean;
14
+ animation?: "scale" | "fade" | "slide" | "bounce";
15
+ };
16
+ declare const Accordion: React.FC<AccordionProps>;
17
+ export default Accordion;
@@ -0,0 +1,41 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
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]);
12
+ const toggleOpen = () => {
13
+ if (onToggle) {
14
+ onToggle(); // parent کنترل می‌کند
15
+ }
16
+ else if (sliding) {
17
+ setIsOpen(!isOpen); // internal state
18
+ }
19
+ };
20
+ const getAnimationClasses = () => {
21
+ switch (animation) {
22
+ case "scale":
23
+ return isOpen
24
+ ? "max-h-screen scale-100 opacity-100"
25
+ : "max-h-0 scale-95 opacity-0";
26
+ case "fade":
27
+ return isOpen ? "max-h-screen opacity-100" : "max-h-0 opacity-0";
28
+ case "bounce":
29
+ return isOpen
30
+ ? "max-h-screen opacity-100 animate-bounce"
31
+ : "max-h-0 opacity-0";
32
+ case "slide":
33
+ default:
34
+ return isOpen
35
+ ? "max-h-screen translate-y-0 opacity-100"
36
+ : "max-h-0 -translate-y-2 opacity-0";
37
+ }
38
+ };
39
+ return (_jsxs("div", { className: cn("relative overflow-hidden rounded-2xl", parentClassName), children: [_jsx("div", { className: cn("flex flex-row w-full items-start justify-between bg-white dark:bg-background-light border border-Neutral-100 dark:border-Neutral-400/50 rounded-2xl", className), children: _jsxs("div", { className: "flex flex-col w-full", children: [_jsxs("div", { onClick: toggleOpen, className: cn("p-4 flex flex-row justify-between items-center", sliding && "cursor-pointer"), children: [_jsxs("div", { className: "flex flex-row gap-2 items-center", children: [icon && (_jsx("span", { className: "bg-secondary-50 dark:bg-background-light rounded-full p-2", children: icon })), _jsx("div", { className: cn("text-Neutral-500 dark:text-white text-base font-medium inline-flex select-none", title_classname), children: title })] }), sliding && (_jsx("svg", { className: cn("w-4 h-4 transition-transform duration-300 text-gray-600", isOpen ? "rotate-180" : "rotate-90"), fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5l7 7-7 7" }) }))] }), _jsx("div", { className: cn("overflow-hidden transition-all duration-300 ease-in-out", getAnimationClasses()), children: _jsx("div", { className: "p-4", children: children }) })] }) }), circleLocation && isOpen && (_jsx("div", { className: "w-full", children: _jsx("div", { className: cn("absolute transition-all duration-700 ease-in-out w-40 h-40 opacity-50 bg-violet-300/30 rounded-full blur-2xl pointer-events-none", circleLocation) }) })), secoundCircleLocation && isOpen && (_jsx("div", { className: "w-full", children: _jsx("div", { className: cn("absolute transition-all duration-700 ease-in-out w-40 h-40 opacity-50 bg-violet-300/30 rounded-full blur-2xl pointer-events-none", secoundCircleLocation) }) }))] }));
40
+ };
41
+ export default Accordion;
@@ -0,0 +1,12 @@
1
+ import { ButtonHTMLAttributes } from "react";
2
+ interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
3
+ variant?: "primary" | "secondary" | "outline" | "danger" | "success" | "warning" | "icon";
4
+ size?: "sm" | "md" | "lg" | "xl";
5
+ loading?: boolean;
6
+ icon?: React.ReactNode;
7
+ iconPosition?: "left" | "right";
8
+ fullWidth?: boolean;
9
+ clickAnimation?: "none" | "scale" | "bounce" | "pulse" | "press";
10
+ }
11
+ declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
12
+ export default Button;
@@ -0,0 +1,48 @@
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
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ // components/ui/Button.tsx
14
+ import { forwardRef } from "react";
15
+ import { cn } from "../../libs/utils";
16
+ const Button = forwardRef((_a, ref) => {
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
+ const isDisabled = disabled || loading;
19
+ // Variant styles
20
+ const variantStyles = {
21
+ primary: "bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800 focus:ring-blue-500",
22
+ secondary: "bg-gray-600 text-white hover:bg-gray-700 active:bg-gray-800 focus:ring-gray-500",
23
+ outline: "border border-gray-300 bg-transparent hover:bg-gray-50 text-gray-700 focus:ring-blue-500",
24
+ danger: "bg-red-600 text-white hover:bg-red-700 active:bg-red-800 focus:ring-red-500",
25
+ success: "bg-green-600 text-white hover:bg-green-700 active:bg-green-800 focus:ring-green-500",
26
+ warning: "bg-yellow-500 text-white hover:bg-yellow-600 active:bg-yellow-700 focus:ring-yellow-500",
27
+ icon: "bg-transparent hover:bg-gray-100 text-gray-600 focus:ring-gray-500",
28
+ };
29
+ // Size styles
30
+ const sizeStyles = {
31
+ sm: "h-8 px-3 text-xs",
32
+ md: "h-10 px-4 py-2",
33
+ lg: "h-12 px-6 text-lg",
34
+ xl: "h-14 px-8 text-xl",
35
+ };
36
+ // Click animation styles
37
+ const animationStyles = {
38
+ none: "",
39
+ scale: "active:scale-95 transition-transform duration-150",
40
+ bounce: "active:scale-110 transition-transform duration-150",
41
+ pulse: "active:animate-pulse transition-all duration-150",
42
+ press: "active:translate-y-1 transition-transform duration-150",
43
+ };
44
+ const baseStyles = "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-white transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50";
45
+ return (_jsxs("button", Object.assign({ className: cn(baseStyles, variantStyles[variant], sizeStyles[size], animationStyles[clickAnimation], fullWidth && "w-full", loading && "cursor-wait", className), disabled: isDisabled, ref: ref }, props, { children: [loading && (_jsxs("svg", { className: "mr-2 h-4 w-4 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [_jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })] })), !loading && icon && iconPosition === "left" && (_jsx("span", { className: "mr-2", children: icon })), children, !loading && icon && iconPosition === "right" && (_jsx("span", { className: "ml-2", children: icon }))] })));
46
+ });
47
+ Button.displayName = "Button";
48
+ export default Button;
@@ -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,11 @@
1
+ import type { InputTextProps, InputEmailProps, InputMobileProps, InputPasswordProps, InputRePasswordProps, InputTextAreaProps, InputSearchProps, InputRadioButtonProps, InputToggleProps, InputDarkLightProps } from "./Input.types";
2
+ export declare function InputText({ label, className, id, disabled, value, onChange, onClear, ...props }: InputTextProps): import("react/jsx-runtime").JSX.Element;
3
+ export declare function InputEmail({ label, className, id, variant, error, disabled, placeholder, value, onChange, onClear, ...props }: InputEmailProps): import("react/jsx-runtime").JSX.Element;
4
+ export declare function InputMobile({ label, className, id, error, disabled, placeholder, value, onChange, onClear, ...props }: InputMobileProps): import("react/jsx-runtime").JSX.Element;
5
+ export declare function InputTextArea({ label, className, id, value, onChange, ...props }: InputTextAreaProps): import("react/jsx-runtime").JSX.Element;
6
+ export declare function InputSearch({ className, id, inputSearchRef, classNameParent, searchClassname, param, value, onChange, ...props }: InputSearchProps): import("react/jsx-runtime").JSX.Element;
7
+ export declare function InputPassword({ label, className, id, variant, error, buttonFirstId, buttonSecondId, value, onChange, onClear, ...props }: InputPasswordProps): import("react/jsx-runtime").JSX.Element;
8
+ export declare function InputRePassword({ label, id, buttonId, passwordFieldId, ...props }: InputRePasswordProps): import("react/jsx-runtime").JSX.Element;
9
+ export declare function InputDarkLight({ className }: InputDarkLightProps): import("react/jsx-runtime").JSX.Element;
10
+ export declare function InputRadioButton({ className, id, index, name, useIndex, onSortChange, ...props }: InputRadioButtonProps): import("react/jsx-runtime").JSX.Element;
11
+ export declare function InputToggle({ className, checked, onStatusChange, ...props }: InputToggleProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,176 @@
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
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
13
+ import { useState, useRef, useEffect } from "react";
14
+ import { CloseSquareIcon, EmailIcon, MobielIcon, SunIcon, HideIcon, LockIcon, SearchIcon, ShowIcon, MoonIcon, } from "../icon/icon";
15
+ import { cn } from "@/libs/utils";
16
+ // Simple translation function replacement (no external library)
17
+ const translate = (key) => {
18
+ const translations = {
19
+ error_invalid_email: "Please enter a valid email address",
20
+ error_invalid_mobile: "Please enter a valid mobile number",
21
+ error_min_length_password: "Password must be at least 5 characters",
22
+ error_re_password: "Passwords do not match",
23
+ };
24
+ return translations[key] || key;
25
+ };
26
+ // InputText Component
27
+ export function InputText(_a) {
28
+ var { label, className, id, disabled, value, onChange, onClear } = _a, props = __rest(_a, ["label", "className", "id", "disabled", "value", "onChange", "onClear"]);
29
+ const inputRef = useRef(null);
30
+ const handleClear = () => {
31
+ if (inputRef.current) {
32
+ inputRef.current.value = "";
33
+ const event = new Event("input", { bubbles: true });
34
+ inputRef.current.dispatchEvent(event);
35
+ }
36
+ onClear === null || onClear === void 0 ? void 0 : onClear();
37
+ };
38
+ return (_jsxs("div", { className: "flex flex-col w-full", children: [label && (_jsx("label", { htmlFor: id, className: "text-Neutral-300 text-[10px] font-medium px-3 mb-1", children: label })), _jsxs("div", { className: "relative", children: [_jsx("input", Object.assign({ ref: inputRef, id: id, type: "text", disabled: disabled, value: value, onChange: onChange, className: cn("autofill-input placeholder-Neutral-200 w-full px-[1rem] rtl:pl-[2.5rem] ltr:pr-[2.5rem] py-3 rounded-2xl bg-background-light border border-secondary-100 focus:outline-none focus:ring-0 focus:border-secondary-400 justify-between items-center relative", className) }, props)), !disabled && (_jsx("button", { type: "button", onClick: handleClear, className: "absolute inset-y-0 rtl:left-0 ltr:right-0 flex items-center p-2", children: _jsx(CloseSquareIcon, { className: "text-Nutral-500" }) }))] })] }));
39
+ }
40
+ // InputEmail Component
41
+ export function InputEmail(_a) {
42
+ var { label, className, id, variant = "default", error, disabled, placeholder, value, onChange, onClear } = _a, props = __rest(_a, ["label", "className", "id", "variant", "error", "disabled", "placeholder", "value", "onChange", "onClear"]);
43
+ const inputRef = useRef(null);
44
+ const [showError, setShowError] = useState(false);
45
+ const handleClear = () => {
46
+ if (inputRef.current) {
47
+ inputRef.current.value = "";
48
+ const event = new Event("input", { bubbles: true });
49
+ inputRef.current.dispatchEvent(event);
50
+ }
51
+ onClear === null || onClear === void 0 ? void 0 : onClear();
52
+ };
53
+ const emailPattern = "[\\-a-zA-Z0-9~!$%^&*_=+\\}\\{'?]+(\\.[-a-zA-Z0-9~!$%^&*_=+\\}\\{'?]+)*@[a-zA-Z0-9_][-a-zA-Z0-9_]*(\\.[-a-zA-Z0-9_]+)*\\.[a-zA-Z]{2,}(:[0-9]{1,5})?";
54
+ if (variant === "auth") {
55
+ return (_jsxs(_Fragment, { children: [label && (_jsx("label", { htmlFor: id, className: "text-Neutral-300 text-[10px] font-medium px-3 mb-1", children: label })), _jsxs("div", { className: "relative", children: [_jsx("input", Object.assign({ ref: inputRef, id: id, type: "email", pattern: emailPattern, placeholder: placeholder, disabled: disabled, value: value, onChange: onChange, onBlur: () => setShowError(false), onFocus: () => setShowError(false), 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", className) }, props)), !disabled && (_jsx("button", { type: "button", onClick: handleClear, className: "absolute inset-y-0 rtl:left-0 ltr:right-0 flex items-center p-2", children: _jsx(CloseSquareIcon, {}) })), _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(EmailIcon, {}) }), error && !showError && (_jsx("div", { className: "peer-focus:hidden absolute inset-x-0 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 mt-2 mx-3", children: _jsx("div", { className: "text-Error-400 text-xs font-medium", children: translate("error_invalid_email") }) })] })] }));
56
+ }
57
+ return (_jsxs(_Fragment, { children: [label && (_jsx("label", { htmlFor: id, className: "text-Neutral-300 text-[10px] font-medium px-3 mb-1", children: label })), _jsxs("div", { className: "flex flex-col relative", children: [_jsx("input", Object.assign({ ref: inputRef, id: id, type: "email", disabled: disabled, value: value, onChange: onChange, className: cn("autofill-input rounded-2xl px-[2.7rem] h-12 py-6 border-2 border-Neutral-50 focus:outline-none focus:ring-0 focus:border-secondary-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(EmailIcon, { className: "text-Nutral-500" }) }), !disabled && (_jsx("button", { type: "button", onClick: handleClear, className: "absolute inset-y-0 rtl:left-0 ltr:right-0 flex items-center p-2", children: _jsx(CloseSquareIcon, { className: "text-Nutral-500" }) }))] })] }));
58
+ }
59
+ // InputMobile Component
60
+ export function InputMobile(_a) {
61
+ var { label, className, id, error, disabled, placeholder, value, onChange, onClear } = _a, props = __rest(_a, ["label", "className", "id", "error", "disabled", "placeholder", "value", "onChange", "onClear"]);
62
+ const inputRef = useRef(null);
63
+ const [showError, setShowError] = useState(false);
64
+ const handleClear = () => {
65
+ if (inputRef.current) {
66
+ inputRef.current.value = "";
67
+ const event = new Event("input", { bubbles: true });
68
+ inputRef.current.dispatchEvent(event);
69
+ }
70
+ onClear === null || onClear === void 0 ? void 0 : onClear();
71
+ };
72
+ return (_jsxs(_Fragment, { children: [label && (_jsx("label", { htmlFor: id, className: "text-base font-medium text-Neutral-300 px-3 mb-1", children: label })), _jsxs("div", { className: "relative", children: [_jsx("input", Object.assign({ ref: inputRef, id: id, type: "tel", inputMode: "numeric", pattern: "^09[0-9]{9}$", maxLength: 11, placeholder: placeholder, disabled: disabled, value: value, onChange: onChange, onBlur: () => setShowError(false), onFocus: () => setShowError(false), 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", className) }, props)), !disabled && (_jsx("button", { type: "button", onClick: handleClear, className: "absolute inset-y-0 rtl:left-0 ltr:right-0 flex items-center p-2", children: _jsx(CloseSquareIcon, {}) })), _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(MobielIcon, {}) }), error && !showError && (_jsx("div", { className: "peer-focus:hidden absolute inset-x-0 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 mt-2 mx-3", children: _jsx("div", { className: "text-Error-400 text-xs font-medium", children: translate("error_invalid_mobile") }) })] })] }));
73
+ }
74
+ // InputTextArea Component
75
+ export function InputTextArea(_a) {
76
+ var { label, className, id, value, onChange } = _a, props = __rest(_a, ["label", "className", "id", "value", "onChange"]);
77
+ return (_jsxs("div", { className: "flex flex-col", children: [label && (_jsx("label", { htmlFor: id, className: "text-Neutral-300 text-[10px] font-medium px-3 mb-1", children: label })), _jsx("textarea", Object.assign({ id: id, value: value, onChange: onChange, className: cn("p-4 rounded-[20px] border-2 border-Neutral-50 focus:outline-none focus:ring-0 focus:border-secondary-400", className) }, props))] }));
78
+ }
79
+ // InputSearch Component
80
+ export function InputSearch(_a) {
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
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))] }));
85
+ }
86
+ // InputPassword Component
87
+ export function InputPassword(_a) {
88
+ var { label, className, id, variant = "password", error, buttonFirstId, buttonSecondId, value, onChange, onClear } = _a, props = __rest(_a, ["label", "className", "id", "variant", "error", "buttonFirstId", "buttonSecondId", "value", "onChange", "onClear"]);
89
+ const [showPassword, setShowPassword] = useState(false);
90
+ const inputRef = useRef(null);
91
+ const handleTogglePassword = () => {
92
+ setShowPassword(!showPassword);
93
+ };
94
+ const handleClear = () => {
95
+ if (inputRef.current) {
96
+ inputRef.current.value = "";
97
+ const event = new Event("input", { bubbles: true });
98
+ inputRef.current.dispatchEvent(event);
99
+ }
100
+ onClear === null || onClear === void 0 ? void 0 : onClear();
101
+ };
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") }) })] })] }));
104
+ }
105
+ // InputRePassword Component
106
+ export function InputRePassword(_a) {
107
+ var { label, id, buttonId, passwordFieldId = "ch_password" } = _a, props = __rest(_a, ["label", "id", "buttonId", "passwordFieldId"]);
108
+ const [showPassword, setShowPassword] = useState(false);
109
+ const [error, setError] = useState("");
110
+ const [value, setValue] = useState("");
111
+ const handleTogglePassword = () => {
112
+ setShowPassword(!showPassword);
113
+ };
114
+ const handleChange = (e) => {
115
+ const newValue = e.target.value;
116
+ setValue(newValue);
117
+ const passwordField = document.getElementById(passwordFieldId);
118
+ if (passwordField && passwordField.value !== newValue) {
119
+ setError("error_re_password");
120
+ }
121
+ else {
122
+ setError("");
123
+ }
124
+ };
125
+ 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({ id: id, type: showPassword ? "text" : "password", placeholder: "xxxx xxxx xxxx xxxx", value: value, onChange: handleChange, className: cn("autofill-input 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", error && "!border-Error-400 !focus:border-Error-400") }, props)), _jsx("button", { type: "button", onClick: handleTogglePassword, className: "absolute inset-y-0 rtl:left-0 ltr:right-0 px-3 flex items-center cursor-pointer", children: showPassword ? _jsx(HideIcon, {}) : _jsx(ShowIcon, {}) }), _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, {}) }), error && (_jsx("div", { className: "absolute mt-2 mx-3", children: _jsx("div", { className: "text-Error-400 text-xs font-medium", children: translate(error) }) }))] })] }));
126
+ }
127
+ // InputDarkLight Component
128
+ export function InputDarkLight({ className }) {
129
+ const [isDark, setIsDark] = useState(() => {
130
+ return document.documentElement.classList.contains("dark");
131
+ });
132
+ const toggleTheme = () => {
133
+ const newTheme = !isDark;
134
+ setIsDark(newTheme);
135
+ if (newTheme) {
136
+ document.documentElement.classList.add("dark");
137
+ localStorage.setItem("theme", "dark");
138
+ }
139
+ else {
140
+ document.documentElement.classList.remove("dark");
141
+ localStorage.setItem("theme", "light");
142
+ }
143
+ const themeColorMeta = document.querySelector('meta[name="theme-color"]');
144
+ if (themeColorMeta) {
145
+ themeColorMeta.setAttribute("content", "#e57c43");
146
+ }
147
+ };
148
+ return (_jsxs("div", { className: "inline-flex items-center relative cursor-pointer", onClick: toggleTheme, children: [_jsx("input", { className: "peer hidden", id: "toggle", type: "checkbox", checked: !isDark, onChange: () => { } }), _jsx("div", { className: "relative w-[4rem] h-[2rem] peer-checked:bg-white bg-background rounded-full after:absolute after:content-[''] after:w-[1.5rem] after:h-[1.5rem] after:rounded-full after:top-[0.25rem] after:left-[0.25rem] after:bg-[linear-gradient(to_right,_#444350,_#444350)] peer-checked:after:bg-[linear-gradient(to_right,_#f97316,_#facc15)] active:after:w-[1.875rem] peer-checked:after:left-[3.75rem] peer-checked:after:translate-x-[-100%] shadow-sm duration-500 after:duration-500 after:shadow-md" }), _jsx(MoonIcon, { width: "1.25rem", height: "1.25rem", color: "white", className: "peer-checked:fill-black opacity-60 peer-checked:opacity-70 fill-white absolute w-4 h-4 left-[0.5rem]" }), _jsx(SunIcon, { width: "1.25rem", height: "1.25rem", color: "white", className: "fill-white peer-checked:opacity-60 absolute w-4 h-4 right-[0.5rem]" })] }));
149
+ }
150
+ // InputRadioButton Component
151
+ export function InputRadioButton(_a) {
152
+ var { className, id, index = 0, name, useIndex = true, onSortChange } = _a, props = __rest(_a, ["className", "id", "index", "name", "useIndex", "onSortChange"]);
153
+ const handleClick = () => {
154
+ if (useIndex && onSortChange) {
155
+ onSortChange(index);
156
+ }
157
+ };
158
+ return (_jsxs("div", { className: "relative", children: [_jsx("input", Object.assign({ type: "radio", id: `${id}_RadioDropDownItem_${index}`, name: `RadioInput${name}`, onClick: handleClick, className: cn("peer appearance-none absolute top-[-0.5rem] ltr:right-0 rtl:left-0 w-5 h-5 transition-all !bg-transparent dark:bg-transparent border-2 border-Neutral-300 rounded-sm cursor-pointer checked:!bg-primary-400 checked:!border-primary-400 focus:ring-0 focus:ring-offset-0 after:content-[''] after:absolute after:inset-0 after:bg-[url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxwb2x5bGluZSBwb2ludHM9IjIwIDYgOSAxNyA0IDEyIj48L3BvbHlsaW5lPjwvc3ZnPg==')] after:bg-no-repeat after:bg-center after:opacity-0 checked:after:opacity-100 z-30", className) }, props)), _jsx("label", { htmlFor: `${id}_RadioDropDownItem_${index}`, className: "absolute top-[-1.15rem] ltr:right-[-0.525rem] rtl:left-[-0.625rem] rounded-full h-[2.5rem] w-[2.5rem] flex justify-center items-center peer-checked:bg-white dark:peer-checked:bg-background z-10" })] }));
159
+ }
160
+ // InputToggle Component
161
+ export function InputToggle(_a) {
162
+ var { className, checked = false, onStatusChange } = _a, props = __rest(_a, ["className", "checked", "onStatusChange"]);
163
+ const [isChecked, setIsChecked] = useState(() => {
164
+ return typeof checked === "string" ? checked === "true" : Boolean(checked);
165
+ });
166
+ useEffect(() => {
167
+ const newChecked = typeof checked === "string" ? checked === "true" : Boolean(checked);
168
+ setIsChecked(newChecked);
169
+ }, [checked]);
170
+ const handleToggle = (e) => {
171
+ const newValue = e.target.checked;
172
+ setIsChecked(newValue);
173
+ onStatusChange === null || onStatusChange === void 0 ? void 0 : onStatusChange(newValue);
174
+ };
175
+ return (_jsxs("label", { className: cn("inline-flex items-center cursor-pointer", className), children: [_jsx("input", Object.assign({ type: "checkbox", className: "sr-only peer", checked: isChecked, onChange: handleToggle }, props)), _jsx("div", { className: "relative w-11 h-6 bg-gray-200 rounded-full peer peer-focus:ring-2 peer-focus:ring-primary-300 dark:peer-focus:ring-primary-300 dark:bg-gray-700 peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:start-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-primary-400 dark:peer-checked:bg-primary-400" })] }));
176
+ }
@@ -0,0 +1,45 @@
1
+ import { InputHTMLAttributes, TextareaHTMLAttributes } from "react";
2
+ export type BaseInputProps = InputHTMLAttributes<HTMLInputElement> & {
3
+ label?: string;
4
+ error?: string;
5
+ };
6
+ export type InputTextProps = BaseInputProps & {
7
+ onClear?: () => void;
8
+ };
9
+ export type InputEmailProps = BaseInputProps & {
10
+ variant?: "auth" | "default";
11
+ onClear?: () => void;
12
+ };
13
+ export type InputMobileProps = BaseInputProps & {
14
+ onClear?: () => void;
15
+ };
16
+ export type InputPasswordProps = BaseInputProps & {
17
+ variant?: "password" | "change_password";
18
+ buttonFirstId?: string;
19
+ buttonSecondId?: string;
20
+ onClear?: () => void;
21
+ };
22
+ export type InputRePasswordProps = BaseInputProps & {
23
+ buttonId?: string;
24
+ passwordFieldId?: string;
25
+ };
26
+ export type InputTextAreaProps = TextareaHTMLAttributes<HTMLTextAreaElement> & {
27
+ label?: string;
28
+ };
29
+ export type InputSearchProps = BaseInputProps & {
30
+ inputSearchRef?: React.RefObject<HTMLDivElement>;
31
+ classNameParent?: string;
32
+ searchClassname?: string;
33
+ param?: string;
34
+ };
35
+ export type InputRadioButtonProps = InputHTMLAttributes<HTMLInputElement> & {
36
+ index?: number;
37
+ useIndex?: boolean;
38
+ onSortChange?: (index: number) => void;
39
+ };
40
+ export type InputToggleProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'onChange'> & {
41
+ onStatusChange?: (value: boolean) => void;
42
+ };
43
+ export type InputDarkLightProps = {
44
+ className?: string;
45
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
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;
@@ -0,0 +1,52 @@
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
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
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;
@@ -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,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
+ }