feat(deps): react-number-format replaces hand-rolled CurrencyInput parser

The old CurrencyInput had ~100 LOC of regex-based parsing,
display-state syncing, and caret/focus juggling. react-number-format
ships a 17-LOC equivalent (NumericFormat with customInput pointing
at our shared Input shell) that handles the edge cases the hand-
rolled version missed: paste sanitisation, IME composition,
selection-caret preservation, locale separator switching.

Same external API on CurrencyInput so all 3 call sites
(berth-form, invoice-line-items, expense-form-dialog) keep working
without changes.

Verified: tsc clean, vitest 1315/1315, next build green.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-12 22:53:18 +02:00
parent 9868c68f8f
commit 75920a2540
3 changed files with 39 additions and 92 deletions

View File

@@ -101,6 +101,7 @@
"react-email": "^6.1.3",
"react-hook-form": "^7.75.0",
"react-image-crop": "^11.0.10",
"react-number-format": "^5.4.5",
"react-resizable-panels": "^3.0.6",
"recharts": "^3.8.1",
"sharp": "^0.34.5",