kundli-generator 1.0.0
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 +92 -0
- package/dist/components/KundliPage/KundliPage.d.ts +15 -0
- package/dist/components/KundliPage/index.d.ts +2 -0
- package/dist/dev/main.d.ts +1 -0
- package/dist/i18n/I18nContext.d.ts +13 -0
- package/dist/i18n/index.d.ts +2 -0
- package/dist/i18n/translations.d.ts +4 -0
- package/dist/index.d.ts +2 -0
- package/dist/kundli-generator.js +766 -0
- package/dist/kundli-generator.js.map +1 -0
- package/dist/kundli-generator.umd.cjs +32 -0
- package/dist/kundli-generator.umd.cjs.map +1 -0
- package/dist/style.css +1 -0
- package/package.json +58 -0
package/README.md
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# kundli-generator
|
|
2
|
+
|
|
3
|
+
A React NPM package for Kundli (birth chart) generation. Built with Vite, TypeScript, Tailwind CSS, and SASS.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- React 18
|
|
8
|
+
- TypeScript
|
|
9
|
+
- Tailwind CSS
|
|
10
|
+
- SASS (`.module.scss`)
|
|
11
|
+
- Storybook
|
|
12
|
+
- Vite for bundling
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install kundli-generator
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
import { KundliPage } from 'kundli-generator';
|
|
24
|
+
import 'kundli-generator/style.css';
|
|
25
|
+
|
|
26
|
+
function App() {
|
|
27
|
+
return (
|
|
28
|
+
<KundliPage
|
|
29
|
+
name="Rahul Sharma"
|
|
30
|
+
birthDate="15th March 1990, 10:30 AM"
|
|
31
|
+
/>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Using with Hanuman (Next.js) Project
|
|
37
|
+
|
|
38
|
+
Add to your `package.json`:
|
|
39
|
+
|
|
40
|
+
```json
|
|
41
|
+
{
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"kundli-generator": "file:../kundli-generator"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Or use npm link during development:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
# In kundli-generator directory
|
|
52
|
+
npm run build
|
|
53
|
+
npm link
|
|
54
|
+
|
|
55
|
+
# In hanuman directory
|
|
56
|
+
npm link kundli-generator
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Then in any Next.js page or component:
|
|
60
|
+
|
|
61
|
+
```tsx
|
|
62
|
+
'use client';
|
|
63
|
+
|
|
64
|
+
import { KundliPage } from 'kundli-generator';
|
|
65
|
+
import 'kundli-generator/style.css';
|
|
66
|
+
|
|
67
|
+
export default function Kundli() {
|
|
68
|
+
return <KundliPage name="User" birthDate="1st Jan 1990" />;
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
> **Note:** Use `'use client'` since KundliPage is a client component. Import the CSS in your layout or `_app.tsx` for global styles.
|
|
73
|
+
|
|
74
|
+
## Development
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
# Install dependencies
|
|
78
|
+
npm install
|
|
79
|
+
|
|
80
|
+
# Run Storybook
|
|
81
|
+
npm run storybook
|
|
82
|
+
|
|
83
|
+
# Run dev server
|
|
84
|
+
npm run dev
|
|
85
|
+
|
|
86
|
+
# Build
|
|
87
|
+
npm run build
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Storybook
|
|
91
|
+
|
|
92
|
+
Run `npm run storybook` to view and develop components in isolation.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SupportedLocale } from '../../i18n/translations';
|
|
3
|
+
export interface KundliPageProps {
|
|
4
|
+
/** Person's name */
|
|
5
|
+
name?: string;
|
|
6
|
+
/** Birth date for the Kundli */
|
|
7
|
+
birthDate?: string;
|
|
8
|
+
/** Optional CSS class name */
|
|
9
|
+
className?: string;
|
|
10
|
+
/** Language (en, hi, ta, te). Overrides I18nProvider if set. Initial value when using dropdown. */
|
|
11
|
+
locale?: SupportedLocale;
|
|
12
|
+
/** Show language dropdown. Default true. */
|
|
13
|
+
showLanguageSelector?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare const KundliPage: React.FC<KundliPageProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SupportedLocale } from './translations';
|
|
3
|
+
interface I18nContextValue {
|
|
4
|
+
locale: SupportedLocale;
|
|
5
|
+
t: (key: string) => string;
|
|
6
|
+
}
|
|
7
|
+
interface I18nProviderProps {
|
|
8
|
+
locale: SupportedLocale;
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export declare const I18nProvider: React.FC<I18nProviderProps>;
|
|
12
|
+
export declare function useI18n(): I18nContextValue | null;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type SupportedLocale = 'en' | 'hi' | 'ta' | 'te';
|
|
2
|
+
export declare const SUPPORTED_LOCALES: SupportedLocale[];
|
|
3
|
+
export declare const LOCALE_LABELS: Record<SupportedLocale, string>;
|
|
4
|
+
export declare const translations: Record<SupportedLocale, Record<string, string>>;
|
package/dist/index.d.ts
ADDED