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.
- package/CHANGELOG.md +25 -0
- package/LICENSE +26 -0
- package/README.md +87 -0
- package/dist/calcsuite.js +6699 -0
- package/dist/core/calculators/deposits.d.ts +2 -0
- package/dist/core/calculators/investments.d.ts +2 -0
- package/dist/core/calculators/loans.d.ts +2 -0
- package/dist/core/calculators/retirement_us.d.ts +2 -0
- package/dist/core/calculators/returns.d.ts +2 -0
- package/dist/core/calculators/scientific.d.ts +2 -0
- package/dist/core/calculators/tax.d.ts +2 -0
- package/dist/core/calculators/utility.d.ts +2 -0
- package/dist/core/currency.d.ts +20 -0
- package/dist/core/decimal.d.ts +9 -0
- package/dist/core/finance.d.ts +30 -0
- package/dist/core/format.d.ts +16 -0
- package/dist/core/kit.d.ts +109 -0
- package/dist/core/liveRates.d.ts +11 -0
- package/dist/core/loan.d.ts +70 -0
- package/dist/core/registry.d.ts +10 -0
- package/dist/core/sci/evaluator.d.ts +14 -0
- package/dist/core/sci/index.d.ts +22 -0
- package/dist/core/sci/parser.d.ts +32 -0
- package/dist/core/sci/tokenizer.d.ts +10 -0
- package/dist/export/index.d.ts +56 -0
- package/dist/index.d.ts +49 -0
- package/dist/settings/SettingsContext.d.ts +20 -0
- package/dist/settings/settings.d.ts +72 -0
- package/dist/transport/client.d.ts +54 -0
- package/dist/transport/fx.d.ts +23 -0
- package/dist/transport/payload.d.ts +21 -0
- package/dist/transport/types.d.ts +198 -0
- package/dist/ui/CalculatorPanel.d.ts +14 -0
- package/dist/ui/Chart.d.ts +4 -0
- package/dist/ui/CommandPalette.d.ts +13 -0
- package/dist/ui/CurrencyConverter.d.ts +1 -0
- package/dist/ui/Dialog.d.ts +8 -0
- package/dist/ui/ExportMenu.d.ts +4 -0
- package/dist/ui/HistoryPanel.d.ts +6 -0
- package/dist/ui/IntegrationPanel.d.ts +8 -0
- package/dist/ui/Launcher.d.ts +34 -0
- package/dist/ui/LoanEmiPanel.d.ts +1 -0
- package/dist/ui/ResultCard.d.ts +4 -0
- package/dist/ui/SaveButton.d.ts +4 -0
- package/dist/ui/ScheduleTable.d.ts +4 -0
- package/dist/ui/SciCalculator.d.ts +4 -0
- package/dist/ui/SettingsPanel.d.ts +1 -0
- package/dist/ui/Shell.d.ts +5 -0
- package/dist/ui/fields.d.ts +9 -0
- package/dist/ui/history.d.ts +15 -0
- package/dist/ui/icons.d.ts +8 -0
- package/dist/ui/overlayStack.d.ts +3 -0
- package/dist/ui/themePresets.d.ts +19 -0
- package/package.json +94 -0
- 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
|
+
[](https://github.com/ashish13377/calcsuite/actions/workflows/ci.yml)
|
|
4
|
+
[](https://www.npmjs.com/package/calcsuite)
|
|
5
|
+
[](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.
|