mehdi-akbari-map 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.
package/README.md ADDED
@@ -0,0 +1,111 @@
1
+
2
+ Markdown# Mehdi Akbari Calendar
3
+
4
+ ![npm](https://img.shields.io/npm/v/mehdi-akbari-calendar?color=3b82f6&style=flat-square)
5
+ ![npm downloads](https://img.shields.io/npm/dm/mehdi-akbari-calendar?style=flat-square)
6
+ ![license](https://img.shields.io/npm/l/mehdi-akbari-calendar?style=flat-square)
7
+ ![TypeScript](https://img.shields.io/badge/TypeScript-Ready-blue?style=flat-square)
8
+
9
+ یک **تقویم شمسی (جلالی) حرفه‌ای، زیبا و کاملاً قابل سفارشی‌سازی** برای React — ساخته‌شده با توسط مهدی اکبری.
10
+
11
+ ویژگی‌های کلیدی:
12
+ - پشتیبانی کامل از تقویم **شمسی** و **میلادی** با سوئیچ آسان
13
+ - انتخاب تک تاریخ و بازه (Range Selection)
14
+ - DatePicker کامل با popover و بسته شدن هوشمند
15
+ - استایل مدرن و مینیمال با CSS Variables
16
+ - RTL/LTR هوشمند
17
+ - بدون وابستگی سنگین (فقط date-fns و date-fns-jalali)
18
+ - تایپ‌اسکریپت کامل
19
+ - بیلد ESM + CJS
20
+
21
+ > **این پروژه همواره در حال توسعه است** — ویژگی‌های جدید، بهبود عملکرد و رفع باگ‌ها به طور مداوم اضافه می‌شوند. پیشنهادات و مشارکت شما بسیار استقبال می‌شود! 🚀
22
+
23
+ ## نصب
24
+
25
+ ```bash
26
+ npm install mehdi-akbari-calendar
27
+
28
+ # یا با yarn
29
+ yarn add mehdi-akbari-calendar
30
+
31
+ # یا با pnpm
32
+ pnpm add mehdi-akbari-calendar
33
+ استفاده سریع
34
+ 1. تقویم مستقل (PersianCalendar)
35
+ tsximport { PersianCalendar } from 'mehdi-akbari-calendar/react';
36
+ // یا
37
+ import { PersianCalendar } from 'mehdi-akbari-calendar/react';
38
+
39
+ function App() {
40
+ const [date, setDate] = useState<Date | null>(null);
41
+
42
+ return (
43
+ <div style={{ padding: '50px', direction: 'rtl' }}>
44
+ <PersianCalendar
45
+ initialDate={date ?? new Date()}
46
+ onDateSelect={(selected) => {
47
+ setDate(selected);
48
+ console.log('تاریخ انتخاب شده:', selected);
49
+ }}
50
+ />
51
+ </div>
52
+ );
53
+ }
54
+ 2. DatePicker کامل (PersianDatePicker)
55
+ tsximport { PersianDatePicker } from 'mehdi-akbari-calendar/react';
56
+ // یا
57
+ import { PersianDatePicker } from 'mehdi-akbari-calendar';
58
+
59
+ function App() {
60
+ const [date, setDate] = useState<Date | null>(null);
61
+
62
+ return (
63
+ <div style={{ padding: '50px', direction: 'rtl' }}>
64
+ <PersianDatePicker
65
+ initialDate={date}
66
+ onDateSelect={setDate}
67
+ placeholder="انتخاب تاریخ"
68
+ />
69
+
70
+ {date && (
71
+ <p style={{ marginTop: '20px' }}>
72
+ تاریخ انتخاب‌شده: {date.toLocaleDateString('fa-IR')}
73
+ </p>
74
+ )}
75
+ </div>
76
+ );
77
+ }
78
+ ویژگی‌ها
79
+
80
+ سوئیچ بین تقویم جلالی و میلادی با آیکون زیبا
81
+ پشتیبانی از انتخاب بازه (range) با استایل حرفه‌ای
82
+ popover هوشمند در DatePicker (بسته شدن با کلیک بیرون)
83
+ استایل کاملاً قابل سفارشی‌سازی با CSS Variables
84
+ فوتر زیبا با نسخه پکیج و لینک‌های ارتباطی
85
+
86
+ سفارشی‌سازی استایل
87
+ می‌تونی با override کردن CSS Variables استایل رو تغییر بدی:
88
+ CSS.prc-container {
89
+ --prc-brand-primary: #10b981; /* رنگ اصلی سبز */
90
+ --prc-bg-surface: #1f2937; /* پس‌زمینه تیره */
91
+ --prc-text-primary: #f3f4f6;
92
+ --prc-width: 350px;
93
+ }
94
+ پروژه در حال توسعه
95
+ این پکیج به طور فعال در حال توسعه است. ویژگی‌های آینده:
96
+
97
+ پشتیبانی از چند انتخاب (multiple dates)
98
+ تم‌های آماده (dark, light, custom)
99
+ ادغام با فرم‌ها (React Hook Form, Zod)
100
+ قابلیت disable تاریخ‌های خاص
101
+ localization بیشتر
102
+
103
+ پیشنهادات، گزارش باگ و pull request بسیار خوشحال‌کننده است! ❤️
104
+ ارتباط با من
105
+
106
+ Gmail: mehdiakbarideveloper@gmail.com
107
+ Telegram: @MehdiAkbariDev
108
+
109
+ لایسنس
110
+ MIT © Mehdi Akbari
111
+
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { MapProps } from '../types';
3
+ declare const Map: React.FC<MapProps>;
4
+ export default Map;
5
+ //# sourceMappingURL=Map.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Map.d.ts","sourceRoot":"","sources":["../../src/components/Map.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAyB,MAAM,UAAU,CAAC;AAE3D,QAAA,MAAM,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC,QAAQ,CA2F3B,CAAC;AAEF,eAAe,GAAG,CAAC"}
package/dist/index.cjs ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/dist/index.css ADDED
@@ -0,0 +1,2 @@
1
+ /* src/styles.css */
2
+ /*# sourceMappingURL=index.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,2 @@
1
+ import './styles.css';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,cAAc,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/dist/react.cjs ADDED
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ "use client";
3
+ //# sourceMappingURL=react.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=react.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":""}
package/dist/react.js ADDED
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ //# sourceMappingURL=react.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
File without changes
@@ -0,0 +1,33 @@
1
+ import type { LngLatLike, LngLatBoundsLike, Map as MapboxMap, Marker as MapboxMarker, PointLike } from 'mapbox-gl';
2
+ export interface MapOptions {
3
+ mapKey: string;
4
+ mapType?: 'neshan' | 'neshanVector' | 'osm' | string;
5
+ center?: LngLatLike;
6
+ zoom?: number;
7
+ [key: string]: any;
8
+ }
9
+ export interface MarkerData {
10
+ id: string | number;
11
+ lat: number;
12
+ lng: number;
13
+ name?: string;
14
+ price?: string;
15
+ city?: string;
16
+ performance?: string;
17
+ desc?: string;
18
+ phone?: string;
19
+ whatsapp?: string;
20
+ [key: string]: any;
21
+ }
22
+ export interface MapProps {
23
+ options: MapOptions;
24
+ markers?: MarkerData[];
25
+ selectedMarkerId?: string | number | null;
26
+ onMarkerClick?: (marker: MarkerData, index: number, map: MapboxMap) => void;
27
+ onMapLoad?: (map: MapboxMap) => void;
28
+ children?: React.ReactNode;
29
+ className?: string;
30
+ style?: React.CSSProperties;
31
+ }
32
+ export type { LngLatLike, LngLatBoundsLike, MapboxMap, MapboxMarker, PointLike };
33
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,UAAU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AK,CAAC,aAAa,CAAC;CAC7B;AAED,YAAY,EAAE,UAAU,EAAE,gBAAgB,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC"}
package/package.json ADDED
@@ -0,0 +1,76 @@
1
+ {
2
+ "name": "mehdi-akbari-map",
3
+ "version": "0.0.1",
4
+ "description": "A professional Map",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.mjs",
8
+ "types": "./dist/index.d.ts",
9
+ "files": [
10
+ "dist",
11
+ "react.js",
12
+ "react.mjs",
13
+ "react.d.ts"
14
+ ],
15
+ "exports": {
16
+ ".": {
17
+ "import": {
18
+ "types": "./dist/index.d.ts",
19
+ "default": "./dist/index.mjs"
20
+ },
21
+ "require": {
22
+ "types": "./dist/index.d.ts",
23
+ "default": "./dist/index.js"
24
+ }
25
+ },
26
+ "./react": {
27
+ "import": {
28
+ "types": "./react.d.ts",
29
+ "default": "./react.mjs"
30
+ },
31
+ "require": {
32
+ "types": "./react.d.ts",
33
+ "default": "./react.js"
34
+ }
35
+ },
36
+ "./styles.css": "./dist/styles.css"
37
+ },
38
+ "scripts": {
39
+ "clean": "npx rimraf dist",
40
+ "build:js": "tsup",
41
+ "build:types": "tsc --project tsconfig.dts.json",
42
+ "build": "npm run clean && npm run build:js && npm run build:types && copyfiles -u 1 src/styles.css dist",
43
+ "dev": "tsup --watch",
44
+ "prepublishOnly": "npm run build"
45
+ },
46
+ "peerDependencies": {
47
+ "react": ">=18",
48
+ "react-dom": ">=18"
49
+ },
50
+ "dependencies": {
51
+ "@neshan-maps-platform/mapbox-gl": "^1.1.5",
52
+ "clsx": "^2.1.1",
53
+ "date-fns": "^3.6.0",
54
+ "date-fns-jalali": "^2.30.0-0"
55
+ },
56
+ "devDependencies": {
57
+ "@types/mapbox-gl": "^3.4.1",
58
+ "@types/react": "^18.3.3",
59
+ "@types/react-dom": "^18.3.0",
60
+ "copyfiles": "^2.4.1",
61
+ "react": "^18.3.1",
62
+ "react-dom": "^18.3.1",
63
+ "rimraf": "^5.0.7",
64
+ "tsup": "^8.1.0",
65
+ "typescript": "^5.4.5"
66
+ },
67
+ "keywords": [
68
+ "react",
69
+ "map",
70
+ "googlemap",
71
+ "neshan",
72
+ "ui-component"
73
+ ],
74
+ "author": "Mehdi Akbari",
75
+ "license": "MIT"
76
+ }
package/react.d.ts ADDED
@@ -0,0 +1,2 @@
1
+
2
+ export * from './dist/react'
package/react.js ADDED
@@ -0,0 +1,3 @@
1
+ 'use strict'
2
+
3
+ module.exports = require('./dist/react')
package/react.mjs ADDED
@@ -0,0 +1,2 @@
1
+
2
+ export * from './dist/react'