@stackloop/ui 3.3.1 → 3.3.2

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
@@ -234,7 +234,7 @@ Components with the `animate` prop:
234
234
  - **Description:** Phone number input with a country calling code selector and optional locale-based default.
235
235
  - **Props:**
236
236
  - **`value`**: `string` — optional.
237
- - **`onChange`**: `(value: string) => void` — optional.
237
+ - **`onChange`**: `(dialCode: string, value: string) => void` — optional.
238
238
  - **`country`**: `string` — optional ISO2 override (e.g. `US`).
239
239
  - **`defaultCountry`**: `string` — default: `'US'`.
240
240
  - **`autoDetect`**: `boolean` — default: `true`. Uses `navigator.language` to select a country.
@@ -251,7 +251,7 @@ Components with the `animate` prop:
251
251
  <PhoneInput
252
252
  label="Phone"
253
253
  value={phone}
254
- onChange={setPhone}
254
+ onChange={(dialCode, value) => setPhone(`${dialCode}${value}`)}
255
255
  searchable
256
256
  autoDetect
257
257
  />
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { type Country } from './countries';
3
3
  export interface PhoneInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'value' | 'onChange'> {
4
4
  value?: string;
5
- onChange?: (value: string) => void;
5
+ onChange?: (dialCode: string, value: string) => void;
6
6
  country?: string;
7
7
  defaultCountry?: string;
8
8
  autoDetect?: boolean;