react-intl-number-input 0.8.4 → 0.8.6

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 CHANGED
@@ -1,125 +1,144 @@
1
- # Changelog
2
-
3
- All notable changes to this project are documented in this file.
4
-
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
-
8
- ## [Unreleased]
9
-
10
- ## [0.8.4] - 2026-09-03
11
-
12
- ### Fixed
13
-
14
- - Finalized demo and build scripts migration to TypeScript.
15
- - Corrected package entry points for better ESM compatibility.
16
-
17
- ## [0.8.3] - 2026-09-03
18
-
19
- ### Added
20
-
21
- - Dual build support: the package now ships both CommonJS (`dist/index.js`) and ESM (`dist/esm/index.js`) versions.
22
- - Sourcemaps with inline sources included in the package for better debugging experience.
23
- - `CHANGELOG.md` and `CONTRIBUTING.md` are now included in the npm package.
24
- - `engines` field added to `package.json` specifying Node.js >= 20.
25
- - Proper accessibility support: the input now has `role="spinbutton"` and relevant `aria-valuenow`, `aria-valuemin`, and `aria-valuemax` attributes.
26
- - Full `forwardRef` support: `ref` now correctly points to the underlying `<input>` element and supports imperative methods via `useImperativeHandle`.
27
- - Demo and build scripts migrated to TypeScript and modern ES modules.
28
-
29
- ### Changed
30
-
31
- - Improved cursor management: typing within the masked input now correctly preserves the cursor position instead of jumping to the end.
32
- - Enhanced synthetic events: `onChange` events triggered by step buttons or `setValue` now include more standard event properties (`currentTarget`, `persist`, etc.) for better compatibility.
33
- - Build process updated to use multiple `tsc` configurations for CJS and ESM.
34
- - `package.json` `exports` updated to support modern ESM resolution while maintaining CJS compatibility.
35
-
36
- ## [0.8.2] - 2026-08-15
37
-
38
- This is a maintainer/toolchain release. The published component API, peer dependency (`react >=16.8.0 <20`), and CommonJS entry are unchanged.
39
-
40
- ### Security
41
-
42
- - Pinned transitive `js-yaml` to `4.3.1` ([GHSA-5p4m-2wfm-xmqj](https://github.com/advisories/GHSA-5p4m-2wfm-xmqj))
43
-
44
- ### Changed
45
-
46
- - Replaced the Babel + Webpack toolchain with TypeScript (`tsc`) for the library and esbuild for the demo
47
- - Dropped the `fast-uri` override (it only existed for webpack-dev-server)
48
- - Contributor Node.js requirement is now 20+ (no longer tied to Babel 8)
49
-
50
- ## [0.8.1] - 2026-08-13
51
-
52
- ### Changed
53
-
54
- - Updated development dependencies: React `19.2.8`, webpack `5.109.2`, webpack-cli `7.2.2`, html-webpack-plugin `5.6.8`, `@types/react` `19.2.18`
55
- - Upgraded `@testing-library/jest-dom` from `6.9.1` to `7.0.1`
56
-
57
- ## [0.8.0] - 2026-07-27
58
-
59
- ### Added
60
-
61
- - `renderControls` render prop with exported `ControlsRenderProps` for custom stepper UI (`increment`, `decrement`, `setValue`, bounds, and formatted value)
62
-
63
- ### Changed
64
-
65
- - Step increments now use display units: `step={1}` with `precision={2}` adds `0.01` (previously added `100` to the numeric value)
66
- - `renderControls` renders the input and controls as siblings without an opinionated wrapper — layout is controlled by the consumer
67
- - When both `renderControls` and `showStepButtons` are set, `renderControls` takes precedence
68
- - Development toolchain upgraded: Babel 8, TypeScript 7, Webpack 5.108, webpack-cli 7.2, webpack-dev-server 6
69
- - Babel config updated for Babel 8 defaults (`modules: "commonjs"`, classic JSX runtime) so the published CJS build remains compatible with React 16.8+
70
- - Contributor Node.js requirement updated to `^22.18.0 || >=24.11.0` (Babel 8)
71
-
72
- ### Fixed
73
-
74
- - Step buttons and custom controls now read the numeric value from an internal ref instead of re-parsing the masked string (fixes incorrect steps with prefix/suffix or locale formatting)
75
- - Controlled `value` prop updates now apply `minValue`/`maxValue` clamping before formatting
76
- - Resolved transitive security advisories in the dev dependency tree (`npm audit` clean)
77
-
78
- ## [0.7.0] - 2026-06-20
79
-
80
- ### Added
81
-
82
- - TypeScript source and published type declarations (`IntlNumberInputProps`)
83
- - `forwardRef` support for the underlying `<input>`
84
- - Standard HTML input attribute passthrough (`onFocus`, `aria-*`, `data-*`, `autoComplete`, etc.)
85
- - Step buttons (`showStepButtons`, `step`)
86
- - `minValue` / `maxValue` constraints
87
- - `onBlur` callback
88
- - `inputMode` prop
89
- - Prefix/suffix HTML sanitization
90
- - Redesigned interactive demo page with labeled examples and independent state
91
- - `CONTRIBUTING.md` and `CHANGELOG.md` documentation
92
-
93
- ### Changed
94
-
95
- - Migrated from JSX to TypeScript
96
- - Removed runtime `prop-types` dependency (TypeScript types are the source of truth)
97
- - `onBlur` now returns clamped numeric values consistent with `onChange`
98
- - Prefix/suffix sanitization is SSR-safe (no `document` access)
99
- - `peerDependencies` now require only `react` (not `react-dom`)
100
- - Split consumer and maintainer documentation (`README.md`, `CONTRIBUTING.md`)
101
-
102
- ### Fixed
103
-
104
- - SSR crash when rendering on the server
105
- - `onBlur` returning unclamped values while display was clamped
106
-
107
- ## [0.6.0] - 2025
108
-
109
- ### Changed
110
-
111
- - Updated build toolchain to Babel 7 and Webpack 5
112
- - Added Jest test suite
113
- - Updated demo to React 19
114
- - Security updates for vulnerable dependencies
115
-
116
- ## [0.5.0] and earlier
117
-
118
- See [git history](https://github.com/nandorip/react-intl-number-input/commits/master) for changes prior to 0.6.0.
119
-
120
- [Unreleased]: https://github.com/nandorip/react-intl-number-input/compare/v0.8.2...HEAD
121
- [0.8.2]: https://github.com/nandorip/react-intl-number-input/compare/v0.8.1...v0.8.2
122
- [0.8.1]: https://github.com/nandorip/react-intl-number-input/compare/v0.8.0...v0.8.1
123
- [0.8.0]: https://github.com/nandorip/react-intl-number-input/compare/v0.7.0...v0.8.0
124
- [0.7.0]: https://github.com/nandorip/react-intl-number-input/compare/v0.6.0...v0.7.0
125
- [0.6.0]: https://github.com/nandorip/react-intl-number-input/releases/tag/v0.6.0
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [0.8.6] - 2026-09-23
11
+
12
+ This is a maintainer/toolchain release. The published component API is unchanged.
13
+
14
+ ### Security
15
+
16
+ - Bumped transitive `js-yaml` override to `4.3.2` ([GHSA-2883-xcg3-v3hh](https://github.com/advisories/GHSA-2883-xcg3-v3hh))
17
+
18
+ ### Changed
19
+
20
+ - Updated development dependencies: React `19.3.0`, Jest `30.5.2`, `@testing-library/react` `16.3.3`, `@types/react` `19.3.0`
21
+ - Allowed install scripts for `esbuild` and `unrs-resolver` via `allowScripts`
22
+
23
+ ## [0.8.5] - 2026-09-03
24
+
25
+ ### Fixed
26
+
27
+ - Finalized demo and build scripts migration to TypeScript.
28
+ - Corrected package entry points for better ESM compatibility.
29
+
30
+ ## [0.8.4] - 2026-09-03
31
+
32
+ ### Fixed
33
+
34
+ - Attempted publish (version skipped due to registry timeout).
35
+
36
+ ## [0.8.3] - 2026-09-03
37
+
38
+ ### Added
39
+
40
+ - Dual build support: the package now ships both CommonJS (`dist/index.js`) and ESM (`dist/esm/index.js`) versions.
41
+ - Sourcemaps with inline sources included in the package for better debugging experience.
42
+ - `CHANGELOG.md` and `CONTRIBUTING.md` are now included in the npm package.
43
+ - `engines` field added to `package.json` specifying Node.js >= 20.
44
+ - Proper accessibility support: the input now has `role="spinbutton"` and relevant `aria-valuenow`, `aria-valuemin`, and `aria-valuemax` attributes.
45
+ - Full `forwardRef` support: `ref` now correctly points to the underlying `<input>` element and supports imperative methods via `useImperativeHandle`.
46
+ - Demo and build scripts migrated to TypeScript and modern ES modules.
47
+
48
+ ### Changed
49
+
50
+ - Improved cursor management: typing within the masked input now correctly preserves the cursor position instead of jumping to the end.
51
+ - Enhanced synthetic events: `onChange` events triggered by step buttons or `setValue` now include more standard event properties (`currentTarget`, `persist`, etc.) for better compatibility.
52
+ - Build process updated to use multiple `tsc` configurations for CJS and ESM.
53
+ - `package.json` `exports` updated to support modern ESM resolution while maintaining CJS compatibility.
54
+
55
+ ## [0.8.2] - 2026-08-15
56
+
57
+ This is a maintainer/toolchain release. The published component API, peer dependency (`react >=16.8.0 <20`), and CommonJS entry are unchanged.
58
+
59
+ ### Security
60
+
61
+ - Pinned transitive `js-yaml` to `4.3.1` ([GHSA-5p4m-2wfm-xmqj](https://github.com/advisories/GHSA-5p4m-2wfm-xmqj))
62
+
63
+ ### Changed
64
+
65
+ - Replaced the Babel + Webpack toolchain with TypeScript (`tsc`) for the library and esbuild for the demo
66
+ - Dropped the `fast-uri` override (it only existed for webpack-dev-server)
67
+ - Contributor Node.js requirement is now 20+ (no longer tied to Babel 8)
68
+
69
+ ## [0.8.1] - 2026-08-13
70
+
71
+ ### Changed
72
+
73
+ - Updated development dependencies: React `19.2.8`, webpack `5.109.2`, webpack-cli `7.2.2`, html-webpack-plugin `5.6.8`, `@types/react` `19.2.18`
74
+ - Upgraded `@testing-library/jest-dom` from `6.9.1` to `7.0.1`
75
+
76
+ ## [0.8.0] - 2026-07-27
77
+
78
+ ### Added
79
+
80
+ - `renderControls` render prop with exported `ControlsRenderProps` for custom stepper UI (`increment`, `decrement`, `setValue`, bounds, and formatted value)
81
+
82
+ ### Changed
83
+
84
+ - Step increments now use display units: `step={1}` with `precision={2}` adds `0.01` (previously added `100` to the numeric value)
85
+ - `renderControls` renders the input and controls as siblings without an opinionated wrapper — layout is controlled by the consumer
86
+ - When both `renderControls` and `showStepButtons` are set, `renderControls` takes precedence
87
+ - Development toolchain upgraded: Babel 8, TypeScript 7, Webpack 5.108, webpack-cli 7.2, webpack-dev-server 6
88
+ - Babel config updated for Babel 8 defaults (`modules: "commonjs"`, classic JSX runtime) so the published CJS build remains compatible with React 16.8+
89
+ - Contributor Node.js requirement updated to `^22.18.0 || >=24.11.0` (Babel 8)
90
+
91
+ ### Fixed
92
+
93
+ - Step buttons and custom controls now read the numeric value from an internal ref instead of re-parsing the masked string (fixes incorrect steps with prefix/suffix or locale formatting)
94
+ - Controlled `value` prop updates now apply `minValue`/`maxValue` clamping before formatting
95
+ - Resolved transitive security advisories in the dev dependency tree (`npm audit` clean)
96
+
97
+ ## [0.7.0] - 2026-06-20
98
+
99
+ ### Added
100
+
101
+ - TypeScript source and published type declarations (`IntlNumberInputProps`)
102
+ - `forwardRef` support for the underlying `<input>`
103
+ - Standard HTML input attribute passthrough (`onFocus`, `aria-*`, `data-*`, `autoComplete`, etc.)
104
+ - Step buttons (`showStepButtons`, `step`)
105
+ - `minValue` / `maxValue` constraints
106
+ - `onBlur` callback
107
+ - `inputMode` prop
108
+ - Prefix/suffix HTML sanitization
109
+ - Redesigned interactive demo page with labeled examples and independent state
110
+ - `CONTRIBUTING.md` and `CHANGELOG.md` documentation
111
+
112
+ ### Changed
113
+
114
+ - Migrated from JSX to TypeScript
115
+ - Removed runtime `prop-types` dependency (TypeScript types are the source of truth)
116
+ - `onBlur` now returns clamped numeric values consistent with `onChange`
117
+ - Prefix/suffix sanitization is SSR-safe (no `document` access)
118
+ - `peerDependencies` now require only `react` (not `react-dom`)
119
+ - Split consumer and maintainer documentation (`README.md`, `CONTRIBUTING.md`)
120
+
121
+ ### Fixed
122
+
123
+ - SSR crash when rendering on the server
124
+ - `onBlur` returning unclamped values while display was clamped
125
+
126
+ ## [0.6.0] - 2025
127
+
128
+ ### Changed
129
+
130
+ - Updated build toolchain to Babel 7 and Webpack 5
131
+ - Added Jest test suite
132
+ - Updated demo to React 19
133
+ - Security updates for vulnerable dependencies
134
+
135
+ ## [0.5.0] and earlier
136
+
137
+ See [git history](https://github.com/nandorip/react-intl-number-input/commits/master) for changes prior to 0.6.0.
138
+
139
+ [Unreleased]: https://github.com/nandorip/react-intl-number-input/compare/v0.8.2...HEAD
140
+ [0.8.2]: https://github.com/nandorip/react-intl-number-input/compare/v0.8.1...v0.8.2
141
+ [0.8.1]: https://github.com/nandorip/react-intl-number-input/compare/v0.8.0...v0.8.1
142
+ [0.8.0]: https://github.com/nandorip/react-intl-number-input/compare/v0.7.0...v0.8.0
143
+ [0.7.0]: https://github.com/nandorip/react-intl-number-input/compare/v0.6.0...v0.7.0
144
+ [0.6.0]: https://github.com/nandorip/react-intl-number-input/releases/tag/v0.6.0
package/CONTRIBUTING.md CHANGED
@@ -1,120 +1,120 @@
1
- # Contributing
2
-
3
- Thank you for your interest in contributing to `react-intl-number-input`.
4
-
5
- ## Requirements
6
-
7
- - Node.js 20+ (recommended: current Active LTS)
8
- - npm 10+
9
-
10
- These versions are required to build and test the library. Consumers of the published npm package are not constrained by this.
11
-
12
- ## Getting started
13
-
14
- ```bash
15
- git clone https://github.com/nandorip/react-intl-number-input.git
16
- cd react-intl-number-input
17
- npm install
18
- ```
19
-
20
- ## Local development
21
-
22
- Start the demo app with live rebuild:
23
-
24
- ```bash
25
- npm start
26
- ```
27
-
28
- Open [http://localhost:3001](http://localhost:3001). The demo lives in `example/` and imports the component from `src/`.
29
-
30
- ## Scripts
31
-
32
- | Command | Description |
33
- | --- | --- |
34
- | `npm start` | esbuild dev server for the demo |
35
- | `npm test` | Run unit tests with Jest |
36
- | `npm run build:lib` | Compile `src/` to CommonJS, ESM, and types in `dist/` |
37
- | `npm run build` | Build the demo bundle in `example/dist` |
38
- | `npm run publish-demo` | Build and deploy the demo to GitHub Pages |
39
-
40
- ## Project structure
41
-
42
- ```
43
- src/ Library source (TypeScript)
44
- dist/ Published build output (generated, not committed)
45
- example/ Demo app and GitHub Pages bundle
46
- ```
47
-
48
- The npm package ships `dist/`, `README.md`, `LICENSE`, `CHANGELOG.md`, and `CONTRIBUTING.md` (see `files` in `package.json`).
49
-
50
- ## Testing
51
-
52
- Run the full test suite before opening a pull request:
53
-
54
- ```bash
55
- npm test
56
- ```
57
-
58
- Tests live alongside the source in `src/index.test.tsx`.
59
-
60
- ## Building the library
61
-
62
- To produce the publishable artifacts locally:
63
-
64
- ```bash
65
- npm run build:lib
66
- ```
67
-
68
- This generates:
69
-
70
- - `dist/index.js` — CommonJS build (`tsc`)
71
- - `dist/esm/index.js` — ESM build (`tsc`)
72
- - `dist/index.d.ts` — TypeScript declarations
73
-
74
- ## Publishing to npm
75
-
76
- ### Prerequisites
77
-
78
- - npm account with publish access to `react-intl-number-input`
79
- - logged in: `npm login`
80
-
81
- ### Release checklist
82
-
83
- 1. Update `CHANGELOG.md` with the new version and changes.
84
- 2. Bump the version in `package.json` following [semver](https://semver.org/):
85
- ```bash
86
- npm version patch # 0.7.0 → 0.7.1
87
- npm version minor # 0.7.0 → 0.8.0
88
- npm version major # 0.7.0 → 1.0.0
89
- ```
90
- 3. Publish:
91
- ```bash
92
- npm publish
93
- ```
94
-
95
- The `prepublishOnly` script runs automatically before publish:
96
-
97
- ```
98
- npm test → npm run build:lib
99
- ```
100
-
101
- Do not commit `dist/` — it is built during publish and excluded via `.gitignore`.
102
-
103
- ### Deploying the demo
104
-
105
- To update the live demo on GitHub Pages:
106
-
107
- ```bash
108
- npm run publish-demo
109
- ```
110
-
111
- ## Pull requests
112
-
113
- 1. Fork the repository and create a feature branch.
114
- 2. Make your changes with tests where applicable.
115
- 3. Run `npm test` and ensure it passes.
116
- 4. Open a pull request with a clear description of the change.
117
-
118
- ## Reporting issues
119
-
1
+ # Contributing
2
+
3
+ Thank you for your interest in contributing to `react-intl-number-input`.
4
+
5
+ ## Requirements
6
+
7
+ - Node.js 20+ (recommended: current Active LTS)
8
+ - npm 10+
9
+
10
+ These versions are required to build and test the library. Consumers of the published npm package are not constrained by this.
11
+
12
+ ## Getting started
13
+
14
+ ```bash
15
+ git clone https://github.com/nandorip/react-intl-number-input.git
16
+ cd react-intl-number-input
17
+ npm install
18
+ ```
19
+
20
+ ## Local development
21
+
22
+ Start the demo app with live rebuild:
23
+
24
+ ```bash
25
+ npm start
26
+ ```
27
+
28
+ Open [http://localhost:3001](http://localhost:3001). The demo lives in `example/` and imports the component from `src/`.
29
+
30
+ ## Scripts
31
+
32
+ | Command | Description |
33
+ | --- | --- |
34
+ | `npm start` | esbuild dev server for the demo |
35
+ | `npm test` | Run unit tests with Jest |
36
+ | `npm run build:lib` | Compile `src/` to CommonJS, ESM, and types in `dist/` |
37
+ | `npm run build` | Build the demo bundle in `example/dist` |
38
+ | `npm run publish-demo` | Build and deploy the demo to GitHub Pages |
39
+
40
+ ## Project structure
41
+
42
+ ```
43
+ src/ Library source (TypeScript)
44
+ dist/ Published build output (generated, not committed)
45
+ example/ Demo app and GitHub Pages bundle
46
+ ```
47
+
48
+ The npm package ships `dist/`, `README.md`, `LICENSE`, `CHANGELOG.md`, and `CONTRIBUTING.md` (see `files` in `package.json`).
49
+
50
+ ## Testing
51
+
52
+ Run the full test suite before opening a pull request:
53
+
54
+ ```bash
55
+ npm test
56
+ ```
57
+
58
+ Tests live alongside the source in `src/index.test.tsx`.
59
+
60
+ ## Building the library
61
+
62
+ To produce the publishable artifacts locally:
63
+
64
+ ```bash
65
+ npm run build:lib
66
+ ```
67
+
68
+ This generates:
69
+
70
+ - `dist/index.js` — CommonJS build (`tsc`)
71
+ - `dist/esm/index.js` — ESM build (`tsc`)
72
+ - `dist/index.d.ts` — TypeScript declarations
73
+
74
+ ## Publishing to npm
75
+
76
+ ### Prerequisites
77
+
78
+ - npm account with publish access to `react-intl-number-input`
79
+ - logged in: `npm login`
80
+
81
+ ### Release checklist
82
+
83
+ 1. Update `CHANGELOG.md` with the new version and changes.
84
+ 2. Bump the version in `package.json` following [semver](https://semver.org/):
85
+ ```bash
86
+ npm version patch # 0.7.0 → 0.7.1
87
+ npm version minor # 0.7.0 → 0.8.0
88
+ npm version major # 0.7.0 → 1.0.0
89
+ ```
90
+ 3. Publish:
91
+ ```bash
92
+ npm publish
93
+ ```
94
+
95
+ The `prepublishOnly` script runs automatically before publish:
96
+
97
+ ```
98
+ npm test → npm run build:lib
99
+ ```
100
+
101
+ Do not commit `dist/` — it is built during publish and excluded via `.gitignore`.
102
+
103
+ ### Deploying the demo
104
+
105
+ To update the live demo on GitHub Pages:
106
+
107
+ ```bash
108
+ npm run publish-demo
109
+ ```
110
+
111
+ ## Pull requests
112
+
113
+ 1. Fork the repository and create a feature branch.
114
+ 2. Make your changes with tests where applicable.
115
+ 3. Run `npm test` and ensure it passes.
116
+ 4. Open a pull request with a clear description of the change.
117
+
118
+ ## Reporting issues
119
+
120
120
  Open an issue at [github.com/nandorip/react-intl-number-input/issues](https://github.com/nandorip/react-intl-number-input/issues).