@input-kit/phone 0.2.1 → 0.3.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 CHANGED
@@ -2,19 +2,15 @@
2
2
 
3
3
  Headless React phone input with a complete world country-code dataset, searchable country selection, and `libphonenumber-js` powered formatting and validation.
4
4
 
5
- ## Latest update
5
+ Source, issues, and contributions: **[github.com/harshit-d3v/input-kit-phone](https://github.com/harshit-d3v/input-kit-phone)**
6
6
 
7
- **0.2.0** highlights:
7
+ ## Latest update
8
8
 
9
- - Structured validation: `ValidationReason`, unified `validatePhoneNumber` (`reason`, `message`, `error`), and `onValidationChange` on the hook
10
- - `parsePhoneValue(phone, country?)` for `{ country, nationalNumber, e164, isValid }`
11
- - `getCountryOptions()` for sorted, filterable country lists (locale and allow/exclude lists)
12
- - `PhoneInput` click-outside close, improved listbox ARIA (`aria-activedescendant`), and RTL coverage in tests
13
- - Integration guide ([docs/integrations.md](./docs/integrations.md)), CI on Bun, and refreshed 0.1.x migration notes in this README
9
+ **0.3.0** — auto-detect respects manual country selection, metadata-based length validation (no more false `too_long` in variable-length countries), input capped at the country's maximum length, `isPhoneTooLong()`, SSR-safe caret handling, dropdown `Home`/`End` + search→list keyboard navigation, unminified published output.
14
10
 
15
- Full release history: [CHANGELOG.md on GitHub](https://github.com/input-kit/input-kit-phone/blob/main/CHANGELOG.md) (not included in the npm package).
11
+ **0.2.2** npm README cleanup: release notes stay inline; removed pointers to repo-only markdown files.
16
12
 
17
- **0.2.1** — documentation only: README changelog link fix for npm readers.
13
+ **0.2.0** — structured validation (`ValidationReason`, `validatePhoneNumber`, `onValidationChange`), `parsePhoneValue`, `getCountryOptions()`, improved `PhoneInput` a11y (click-outside, listbox ARIA) and RTL tests.
18
14
 
19
15
  ## Features
20
16
 
@@ -108,7 +104,7 @@ Formatting, length checks, and validity follow **[libphonenumber-js](https://www
108
104
 
109
105
  ## Form integrations
110
106
 
111
- See **[docs/integrations.md](./docs/integrations.md)** for React Hook Form, Formik, Zod, and controlled-input patterns.
107
+ Controlled `value` / `onChange` with `usePhoneInput` or `PhoneInput`. React Hook Form: wrap with `Controller` and pass `field.value`, `field.onChange`, and `field.onBlur`. Use `onValidationChange` to sync `isValid` / `message` with form errors. Submit-time checks: `parsePhoneValue(phone, country)` or `validatePhoneNumber`.
112
108
 
113
109
  ## Styled example
114
110
 
@@ -145,6 +141,10 @@ bun run lint
145
141
 
146
142
  Manual browser check: `test-demo/` (static HTML).
147
143
 
144
+ ## Contributing
145
+
146
+ Bug reports, feature requests, and pull requests are welcome — see [CONTRIBUTING.md](https://github.com/harshit-d3v/input-kit-phone/blob/main/CONTRIBUTING.md). In short: open an issue with a minimal reproduction (include the exact phone number and country for formatting/validation bugs), and for PRs run `bun run test`, `bun run typecheck`, and `bun run lint` before submitting.
147
+
148
148
  ## Exports
149
149
 
150
150
  ### Components and hooks