@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 +10 -10
- package/dist/index.cjs +1180 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1135 -1
- package/dist/index.js.map +1 -1
- package/package.json +85 -75
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
|
-
|
|
5
|
+
Source, issues, and contributions: **[github.com/harshit-d3v/input-kit-phone](https://github.com/harshit-d3v/input-kit-phone)**
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Latest update
|
|
8
8
|
|
|
9
|
-
-
|
|
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
|
-
|
|
11
|
+
**0.2.2** — npm README cleanup: release notes stay inline; removed pointers to repo-only markdown files.
|
|
16
12
|
|
|
17
|
-
**0.2.
|
|
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
|
-
|
|
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
|