@xsolla/xui-input-phone 0.96.0 → 0.97.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.
Files changed (2) hide show
  1. package/README.md +41 -0
  2. package/package.json +3 -3
package/README.md ADDED
@@ -0,0 +1,41 @@
1
+ # @xsolla/xui-input-phone
2
+
3
+ Phone number input with country selector dropdown and searchable country list.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ yarn add @xsolla/xui-input-phone
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```tsx
14
+ import { InputPhone, defaultCountries } from '@xsolla/xui-input-phone';
15
+
16
+ <InputPhone
17
+ value={phone}
18
+ onChange={(e) => setPhone(e.target.value)}
19
+ selectedCountry={country}
20
+ onCountryChange={setCountry}
21
+ countries={defaultCountries}
22
+ />
23
+ ```
24
+
25
+ ## Props
26
+
27
+ ### InputPhone
28
+
29
+ | Prop | Type | Default | Description |
30
+ |------|------|---------|-------------|
31
+ | `value` | `string` | — | Controlled phone number value |
32
+ | `placeholder` | `string` | `'+1 (000) 000-0000'` | Placeholder text |
33
+ | `onChange` | `(e: ChangeEvent) => void` | — | Change handler |
34
+ | `onChangeText` | `(text: string) => void` | — | Alternative change handler receiving the string value |
35
+ | `size` | `'xl' \| 'lg' \| 'md' \| 'sm' \| 'xs'` | `'md'` | Input size |
36
+ | `disabled` | `boolean` | `false` | Disables the input and country selector |
37
+ | `errorMessage` | `string` | — | Error text displayed below; also sets invalid state |
38
+ | `error` | `boolean` | — | Sets invalid state without a message |
39
+ | `countries` | `Country[]` | All 200+ countries | Countries shown in the dropdown |
40
+ | `selectedCountry` | `Country` | — | Currently selected country |
41
+ | `onCountryChange` | `(country: Country) => void` | — | Called when a country is selected |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xsolla/xui-input-phone",
3
- "version": "0.96.0",
3
+ "version": "0.97.0",
4
4
  "main": "./web/index.js",
5
5
  "module": "./web/index.mjs",
6
6
  "types": "./web/index.d.ts",
@@ -13,8 +13,8 @@
13
13
  "test:coverage": "vitest run --coverage"
14
14
  },
15
15
  "dependencies": {
16
- "@xsolla/xui-core": "0.96.0",
17
- "@xsolla/xui-primitives-core": "0.96.0",
16
+ "@xsolla/xui-core": "0.97.0",
17
+ "@xsolla/xui-primitives-core": "0.97.0",
18
18
  "libphonenumber-js": "^1.10.56"
19
19
  },
20
20
  "peerDependencies": {