calcsuite-react 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.
Files changed (55) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/LICENSE +26 -0
  3. package/README.md +87 -0
  4. package/dist/calcsuite.js +6699 -0
  5. package/dist/core/calculators/deposits.d.ts +2 -0
  6. package/dist/core/calculators/investments.d.ts +2 -0
  7. package/dist/core/calculators/loans.d.ts +2 -0
  8. package/dist/core/calculators/retirement_us.d.ts +2 -0
  9. package/dist/core/calculators/returns.d.ts +2 -0
  10. package/dist/core/calculators/scientific.d.ts +2 -0
  11. package/dist/core/calculators/tax.d.ts +2 -0
  12. package/dist/core/calculators/utility.d.ts +2 -0
  13. package/dist/core/currency.d.ts +20 -0
  14. package/dist/core/decimal.d.ts +9 -0
  15. package/dist/core/finance.d.ts +30 -0
  16. package/dist/core/format.d.ts +16 -0
  17. package/dist/core/kit.d.ts +109 -0
  18. package/dist/core/liveRates.d.ts +11 -0
  19. package/dist/core/loan.d.ts +70 -0
  20. package/dist/core/registry.d.ts +10 -0
  21. package/dist/core/sci/evaluator.d.ts +14 -0
  22. package/dist/core/sci/index.d.ts +22 -0
  23. package/dist/core/sci/parser.d.ts +32 -0
  24. package/dist/core/sci/tokenizer.d.ts +10 -0
  25. package/dist/export/index.d.ts +56 -0
  26. package/dist/index.d.ts +49 -0
  27. package/dist/settings/SettingsContext.d.ts +20 -0
  28. package/dist/settings/settings.d.ts +72 -0
  29. package/dist/transport/client.d.ts +54 -0
  30. package/dist/transport/fx.d.ts +23 -0
  31. package/dist/transport/payload.d.ts +21 -0
  32. package/dist/transport/types.d.ts +198 -0
  33. package/dist/ui/CalculatorPanel.d.ts +14 -0
  34. package/dist/ui/Chart.d.ts +4 -0
  35. package/dist/ui/CommandPalette.d.ts +13 -0
  36. package/dist/ui/CurrencyConverter.d.ts +1 -0
  37. package/dist/ui/Dialog.d.ts +8 -0
  38. package/dist/ui/ExportMenu.d.ts +4 -0
  39. package/dist/ui/HistoryPanel.d.ts +6 -0
  40. package/dist/ui/IntegrationPanel.d.ts +8 -0
  41. package/dist/ui/Launcher.d.ts +34 -0
  42. package/dist/ui/LoanEmiPanel.d.ts +1 -0
  43. package/dist/ui/ResultCard.d.ts +4 -0
  44. package/dist/ui/SaveButton.d.ts +4 -0
  45. package/dist/ui/ScheduleTable.d.ts +4 -0
  46. package/dist/ui/SciCalculator.d.ts +4 -0
  47. package/dist/ui/SettingsPanel.d.ts +1 -0
  48. package/dist/ui/Shell.d.ts +5 -0
  49. package/dist/ui/fields.d.ts +9 -0
  50. package/dist/ui/history.d.ts +15 -0
  51. package/dist/ui/icons.d.ts +8 -0
  52. package/dist/ui/overlayStack.d.ts +3 -0
  53. package/dist/ui/themePresets.d.ts +19 -0
  54. package/package.json +94 -0
  55. package/src/theme.css +751 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,25 @@
1
+ # Changelog
2
+
3
+ All notable changes to **CalcSuite** are documented here. This project adheres to
4
+ [Semantic Versioning](https://semver.org/).
5
+
6
+ ## [1.0.0] โ€” 2026-09-04
7
+
8
+ Initial release. The financial-calculator module of **AceCBM (Ace Cloud Business Management)**.
9
+
10
+ ### Added
11
+ - **~55 calculators** across Loans, Investments, Returns, Tax, and Tools for ๐Ÿ‡ฎ๐Ÿ‡ณ India (โ‚น) and ๐Ÿ‡บ๐Ÿ‡ธ United States ($).
12
+ - **Decimal-exact engine** on `decimal.js` โ€” no floating-point in any money path.
13
+ - **Region model** (IN/US) as data: currency, grouping (lakh/crore vs western), terminology, day-count defaults.
14
+ - **Scientific calculator** โ€” tokenizer โ†’ shunting-yard โ†’ AST โ†’ Decimal evaluator; trig (deg/rad/grad), logs, memory, base modes.
15
+ - **Currency converter** โ€” live rates (no API key) with an offline toggle and a local rate book.
16
+ - **Export** โ€” CSV/TSV, JSON, share URL, clipboard, print, Markdown, ICS; lazy PDF/XLSX/PNG.
17
+ - **Transport** โ€” save/upload/list, retry, idempotency, offline queue, FX provider, and an integration panel.
18
+ - **UI** โ€” launcher (fully customizable trigger), focus-trapped dialog with host-shortcut isolation, command palette (โŒ˜K), settings, history, spring animations.
19
+ - **Full public API** โ€” `FinCalcProvider`, `FinCalcLauncher`, `CalculatorPanel`, hooks, engine namespaces (`loan`, `finance`, `currency`), registry/plugin API, and TypeScript types.
20
+ - Theme tokens with accent presets, fonts, light/dark/high-contrast, and accent-driven focus rings and scrollbars.
21
+
22
+ ### Notes
23
+ - ESM build with full `.d.ts` types.
24
+ - Peer deps: `react`, `react-dom` (18.3+ / 19). Optional peers for PDF/XLSX: `jspdf`, `xlsx`.
25
+ - Not financial advice โ€” figures are indicative, for planning only.
package/LICENSE ADDED
@@ -0,0 +1,26 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 AceCBM (Ace Cloud Business Management)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+ ---
24
+
25
+ CalcSuite provides indicative financial figures for planning only and is not
26
+ financial advice. See the README for details.
package/README.md ADDED
@@ -0,0 +1,87 @@
1
+ # CalcSuite
2
+
3
+ [![CI](https://github.com/ashish13377/calcsuite/actions/workflows/ci.yml/badge.svg)](https://github.com/ashish13377/calcsuite/actions/workflows/ci.yml)
4
+ [![npm version](https://img.shields.io/npm/v/calcsuite.svg)](https://www.npmjs.com/package/calcsuite)
5
+ [![license: MIT](https://img.shields.io/npm/l/calcsuite.svg)](LICENSE)
6
+
7
+ **Decimal-exact, offline-first financial calculator library for React** โ€” ~55 calculators for **๐Ÿ‡ฎ๐Ÿ‡ณ India (โ‚น)** and **๐Ÿ‡บ๐Ÿ‡ธ United States ($)**, a scientific calculator, live currency conversion, export, and a keyboard-first launcher/dialog. All money math runs on `decimal.js` โ€” no floating-point in any money path.
8
+
9
+ > ๐Ÿงฉ **Part of AceCBM โ€” Ace Cloud Business Management**, the unified platform for billing, inventory, finance, and specialized industry workflows (*tailored globally, customized for your local regulation*). CalcSuite is its embeddable financial-calculator module โ€” usable standalone or inside AceCBM.
10
+ >
11
+ > ๐Ÿ“ฆ A **package**, not an app. Install it, wrap your app in a provider, render its components โ€” or call its pure engine functions.
12
+
13
+ ## Install
14
+
15
+ ```bash
16
+ npm install calcsuite # yarn add calcsuite ยท pnpm add calcsuite
17
+ ```
18
+
19
+ `decimal.js` installs automatically; `react`/`react-dom` are peer deps (18.3+ / 19). Optional PDF/XLSX export: `npm install jspdf xlsx`.
20
+
21
+ ## Quickstart
22
+
23
+ ```tsx
24
+ import { FinCalcProvider, FinCalcLauncher } from 'calcsuite';
25
+ import 'calcsuite/theme.css';
26
+
27
+ export default function App() {
28
+ return (
29
+ <FinCalcProvider settings={{ region: 'IN' }}>
30
+ <YourApp />
31
+ <FinCalcLauncher /> {/* floating calculator button โ†’ the whole suite */}
32
+ </FinCalcProvider>
33
+ );
34
+ }
35
+ ```
36
+
37
+ Embed a single calculator:
38
+
39
+ ```tsx
40
+ import { CalculatorPanel } from 'calcsuite';
41
+ <CalculatorPanel id="loan.emi" /> // or "invest.sip", "tax.gst", "tools.scientific", โ€ฆ
42
+ ```
43
+
44
+ Use the engine with no UI:
45
+
46
+ ```ts
47
+ import { loan, finance } from 'calcsuite';
48
+ loan.solve({ region: 'IN', principal: '2500000', annualRatePct: '8.65', tenureMonths: 240 }).payment.toString(); // "21933.51"
49
+ finance.xirr([{ date: '2020-01-01', amount: '-10000' }, { date: '2021-01-01', amount: '12000' }]); // โ‰ˆ 0.20
50
+ ```
51
+
52
+ ## ๐Ÿ“š Documentation
53
+
54
+ Full docs in **[`docs/`](docs/README.md)** โ€” [installation](docs/getting-started.md) ยท [API reference](docs/api-reference.md) ยท [settings](docs/settings.md) ยท [features](docs/features.md) ยท [keyboard](docs/keyboard.md) ยท per-calculator guides ([loans](docs/calculators/loans.md) ยท [investments](docs/calculators/investments.md) ยท [returns](docs/calculators/returns.md) ยท [tax](docs/calculators/tax.md) ยท [tools](docs/calculators/tools.md)) ยท [extending](docs/developer.md) ยท [backend integration](docs/backend-integration.md).
55
+
56
+ ## What's inside
57
+
58
+ - ๐Ÿฆ **Loans** โ€” EMI/Monthly-Payment (solve any variable, full amortisation table), Compare, Prepayment, Balance transfer, Eligibility, Step-up, Moratorium, Overdraft, Refinance
59
+ - ๐Ÿ“ˆ **Investments** โ€” SIP, Step-up SIP, Lumpsum, SWP, Goal, FD, RD, PPF, NPS, EPF, SSY, 401(k), IRA, 529
60
+ - ๐Ÿงฎ **Returns** โ€” TVM, CAGR, XIRR, IRR, NPV, MIRR, Payback, Real return, Rule of 72
61
+ - ๐Ÿงพ **Tax** โ€” GST, TDS, Income tax (IN old/new & US), Capital gains, HRA, Advance tax, Sales tax, Mortgage deduction
62
+ - ๐Ÿ› ๏ธ **Tools** โ€” Scientific calculator, Currency converter (live+offline), Unit converter, Date/tenure, Number to words
63
+
64
+ ## Principles
65
+
66
+ - ๐ŸŽฏ **Decimal-exact** โ€” `decimal.js` everywhere; deterministic and reproducible.
67
+ - ๐Ÿ“ด **Offline-first** โ€” works with no network; live rates and backend sync are optional.
68
+ - ๐ŸŒ **Region as data** โ€” India vs US differences live in profiles, not scattered `if`s.
69
+ - โ™ฟ **Accessible** โ€” full keyboard operation, focus rings, `aria-live`, real `<table>` schedules (WCAG 2.2 AA target).
70
+ - ๐Ÿ”’ **No stored secrets** โ€” auth is a host callback; SSR-safe (no `window` at module scope).
71
+
72
+ ## Develop
73
+
74
+ ```bash
75
+ npm run dev # run the demo app (local development)
76
+ npm test # test suite (engine, golden values, UI)
77
+ npm run build # build the library โ†’ dist/ (ESM + .d.ts)
78
+ npm run demo:build # build the demo app
79
+ ```
80
+
81
+ ## About AceCBM
82
+
83
+ **CalcSuite** is developed as part of **AceCBM โ€” Ace Cloud Business Management**: *one platform for end-to-end business operations.* AceCBM empowers businesses with a unified ecosystem for **billing, inventory, finance, and specialized industry workflows** โ€” tailored globally and customized for your local regulation. CalcSuite provides the finance/calculation building blocks and is published for reuse in any React app.
84
+
85
+ ## License
86
+
87
+ MIT ยท **Not financial advice** โ€” figures are indicative, for planning only.