@stackloop/ui 3.0.0 → 3.1.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
@@ -163,7 +163,7 @@ import { Button, Modal } from '@stackloop/ui'
163
163
 
164
164
  Components with the `animate` prop:
165
165
 
166
- - `AudioRecorder`, `Badge`, `BottomSheet`, `Button`, `Card`, `CameraCapture`, `Checkbox`, `DatePicker`, `Drawer`, `Dropdown`, `DualSlider`, `FileUploader`, `FloatingActionButton`, `Input`, `Modal`, `Pagination`, `RadioPills`, `Select`, `Slider`, `Spinner`, `StepProgress`, `Table`, `Textarea`, `ThumbnailGrid`, `Toggle`, `ToastProvider`
166
+ - `AudioRecorder`, `Badge`, `BottomSheet`, `Button`, `Card`, `CameraCapture`, `Checkbox`, `DatePicker`, `Drawer`, `Dropdown`, `DualSlider`, `FileUploader`, `FloatingActionButton`, `Input`, `Modal`, `Pagination`, `PhoneInput`, `RadioPills`, `Select`, `Slider`, `Spinner`, `StepProgress`, `Table`, `Textarea`, `ThumbnailGrid`, `Toggle`, `ToastProvider`
167
167
 
168
168
  **Checkbox**:
169
169
  - **Description:** Accessible checkbox with optional label and description.
@@ -230,6 +230,33 @@ Components with the `animate` prop:
230
230
  />
231
231
  ```
232
232
 
233
+ **PhoneInput**:
234
+ - **Description:** Phone number input with a country calling code selector and optional locale-based default.
235
+ - **Props:**
236
+ - **`value`**: `string` — optional.
237
+ - **`onChange`**: `(value: string) => void` — optional.
238
+ - **`country`**: `string` — optional ISO2 override (e.g. `US`).
239
+ - **`defaultCountry`**: `string` — default: `'US'`.
240
+ - **`autoDetect`**: `boolean` — default: `true`. Uses `navigator.language` to select a country.
241
+ - **`onCountryChange`**: `(country: Country) => void` — optional.
242
+ - **`searchable`**: `boolean` — default: `true`.
243
+ - **`showFlags`**: `boolean` — default: `true`.
244
+ - **`animate`**: `boolean` — default: `true`.
245
+ - Inherits standard `input` HTML attributes.
246
+ - **Usage:**
247
+
248
+ ```jsx
249
+ import { PhoneInput } from '@stackloop/ui'
250
+
251
+ <PhoneInput
252
+ label="Phone"
253
+ value={phone}
254
+ onChange={setPhone}
255
+ searchable
256
+ autoDetect
257
+ />
258
+ ```
259
+
233
260
  **Modal**:
234
261
  - **Description:** Centered modal with backdrop, title and Escape-to-close handling.
235
262
  - **Props:**
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import { type Country } from './countries';
3
+ export interface PhoneInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'value' | 'onChange'> {
4
+ value?: string;
5
+ onChange?: (value: string) => void;
6
+ country?: string;
7
+ defaultCountry?: string;
8
+ autoDetect?: boolean;
9
+ onCountryChange?: (country: Country) => void;
10
+ label?: string;
11
+ error?: string;
12
+ hint?: string;
13
+ searchable?: boolean;
14
+ showFlags?: boolean;
15
+ animate?: boolean;
16
+ className?: string;
17
+ }
18
+ export declare const PhoneInput: React.FC<PhoneInputProps>;
@@ -0,0 +1,6 @@
1
+ export interface Country {
2
+ iso2: string;
3
+ name: string;
4
+ dialCode: string;
5
+ }
6
+ export declare const countries: Country[];