@stackloop/ui 2.4.3 → 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
@@ -147,6 +147,24 @@ You can add dark mode variants:
147
147
 
148
148
  - For each component below you'll find a short description, props (type, default, notes) and a minimal usage example.
149
149
 
150
+ ## Animation Control
151
+
152
+ Most components support an `animate?: boolean` prop to enable or disable built-in Framer Motion animations. The default is `true`.
153
+
154
+ ```jsx
155
+ import { Button, Modal } from '@stackloop/ui'
156
+
157
+ <Button animate={false}>No animation</Button>
158
+
159
+ <Modal isOpen={open} onClose={() => setOpen(false)} animate={false}>
160
+ ...
161
+ </Modal>
162
+ ```
163
+
164
+ Components with the `animate` prop:
165
+
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
+
150
168
  **Checkbox**:
151
169
  - **Description:** Accessible checkbox with optional label and description.
152
170
  - **Props:**
@@ -212,6 +230,33 @@ You can add dark mode variants:
212
230
  />
213
231
  ```
214
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
+
215
260
  **Modal**:
216
261
  - **Description:** Centered modal with backdrop, title and Escape-to-close handling.
217
262
  - **Props:**
@@ -5,5 +5,6 @@ export interface AudioRecorderProps {
5
5
  maxDuration?: number;
6
6
  disabled?: boolean;
7
7
  className?: string;
8
+ animate?: boolean;
8
9
  }
9
10
  export declare const AudioRecorder: React.FC<AudioRecorderProps>;
package/dist/Badge.d.ts CHANGED
@@ -7,6 +7,7 @@ export interface BadgeProps {
7
7
  size?: BadgeSize;
8
8
  className?: string;
9
9
  dot?: boolean;
10
+ animate?: boolean;
10
11
  }
11
12
  export declare const Badge: React.FC<BadgeProps>;
12
13
  export {};
@@ -6,5 +6,6 @@ export interface BottomSheetProps {
6
6
  children: React.ReactNode;
7
7
  showCloseButton?: boolean;
8
8
  className?: string;
9
+ animate?: boolean;
9
10
  }
10
11
  export declare const BottomSheet: React.FC<BottomSheetProps>;
package/dist/Button.d.ts CHANGED
@@ -5,6 +5,7 @@ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElemen
5
5
  size?: 'sm' | 'md' | 'lg';
6
6
  loading?: boolean;
7
7
  icon?: React.ReactNode;
8
+ animate?: boolean;
8
9
  }
9
10
  type MotionButtonProps = Omit<ButtonProps, 'children' | keyof HTMLMotionProps<'button'>> & {
10
11
  children?: React.ReactNode;
package/dist/Card.d.ts CHANGED
@@ -6,6 +6,7 @@ export interface CardProps {
6
6
  className?: string;
7
7
  onClick?: () => void;
8
8
  hover?: boolean;
9
+ animate?: boolean;
9
10
  }
10
11
  export declare const Card: React.FC<CardProps>;
11
12
  export declare const CardHeader: React.FC<{
@@ -3,5 +3,6 @@ export interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputE
3
3
  label?: string;
4
4
  description?: string;
5
5
  onChange?: (checked: boolean) => void;
6
+ animate?: boolean;
6
7
  }
7
8
  export declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLInputElement>>;
@@ -9,5 +9,6 @@ export interface DatePickerProps {
9
9
  minDate?: Date;
10
10
  maxDate?: Date;
11
11
  className?: string;
12
+ animate?: boolean;
12
13
  }
13
14
  export declare const DatePicker: React.FC<DatePickerProps>;
package/dist/Drawer.d.ts CHANGED
@@ -6,5 +6,6 @@ export interface DrawerProps {
6
6
  title?: string;
7
7
  position?: 'left' | 'right';
8
8
  className?: string;
9
+ animate?: boolean;
9
10
  }
10
11
  export declare const Drawer: React.FC<DrawerProps>;
@@ -15,5 +15,6 @@ export interface DropdownProps {
15
15
  clearable?: boolean;
16
16
  disabled?: boolean;
17
17
  className?: string;
18
+ animate?: boolean;
18
19
  }
19
20
  export declare const Dropdown: React.FC<DropdownProps>;
@@ -11,5 +11,6 @@ export interface DualSliderProps {
11
11
  unit?: string;
12
12
  disabled?: boolean;
13
13
  className?: string;
14
+ animate?: boolean;
14
15
  }
15
16
  export declare const DualSlider: React.FC<DualSliderProps>;
@@ -6,6 +6,7 @@ export interface CameraCaptureProps {
6
6
  label?: string;
7
7
  disabled?: boolean;
8
8
  className?: string;
9
+ animate?: boolean;
9
10
  }
10
11
  export declare const CameraCapture: React.FC<CameraCaptureProps>;
11
12
  export interface FileUploaderProps {
@@ -15,5 +16,6 @@ export interface FileUploaderProps {
15
16
  label?: string;
16
17
  disabled?: boolean;
17
18
  className?: string;
19
+ animate?: boolean;
18
20
  }
19
21
  export declare const FileUploader: React.FC<FileUploaderProps>;
@@ -16,6 +16,7 @@ export interface FloatingActionButtonProps {
16
16
  position?: 'bottom-right' | 'bottom-left' | 'bottom-center';
17
17
  disabled?: boolean;
18
18
  className?: string;
19
+ animate?: boolean;
19
20
  }
20
21
  export declare const FloatingActionButton: React.FC<FloatingActionButtonProps>;
21
22
  export declare const FAB: React.FC<FloatingActionButtonProps>;
package/dist/Input.d.ts CHANGED
@@ -5,5 +5,6 @@ export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement>
5
5
  hint?: string;
6
6
  leftIcon?: React.ReactNode;
7
7
  rightIcon?: React.ReactNode;
8
+ animate?: boolean;
8
9
  }
9
10
  export declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
package/dist/Modal.d.ts CHANGED
@@ -6,6 +6,7 @@ export interface ModalProps {
6
6
  title?: string;
7
7
  size?: 'sm' | 'md' | 'lg' | 'xl' | 'full';
8
8
  className?: string;
9
+ animate?: boolean;
9
10
  }
10
11
  export declare const Modal: React.FC<ModalProps>;
11
12
  export declare const ModalContent: React.FC<{
@@ -6,5 +6,6 @@ export interface PaginationProps {
6
6
  totalItems?: number;
7
7
  itemsPerPage?: number;
8
8
  className?: string;
9
+ animate?: boolean;
9
10
  }
10
11
  export declare const Pagination: React.FC<PaginationProps>;
@@ -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>;
@@ -10,5 +10,6 @@ export interface RadioPillsProps {
10
10
  name: string;
11
11
  disabled?: boolean;
12
12
  className?: string;
13
+ animate?: boolean;
13
14
  }
14
15
  export declare const RadioPills: React.FC<RadioPillsProps>;
package/dist/Select.d.ts CHANGED
@@ -16,5 +16,6 @@ export interface SelectProps extends Omit<React.SelectHTMLAttributes<HTMLSelectE
16
16
  searchable?: boolean;
17
17
  clearable?: boolean;
18
18
  className?: string;
19
+ animate?: boolean;
19
20
  }
20
21
  export declare const Select: React.ForwardRefExoticComponent<SelectProps & React.RefAttributes<HTMLDivElement>>;
package/dist/Slider.d.ts CHANGED
@@ -10,5 +10,6 @@ export interface SliderProps {
10
10
  unit?: string;
11
11
  disabled?: boolean;
12
12
  className?: string;
13
+ animate?: boolean;
13
14
  }
14
15
  export declare const Slider: React.FC<SliderProps>;
package/dist/Spinner.d.ts CHANGED
@@ -4,5 +4,6 @@ export interface SpinnerProps {
4
4
  variant?: 'primary' | 'secondary' | 'white';
5
5
  className?: string;
6
6
  label?: string;
7
+ animate?: boolean;
7
8
  }
8
9
  export declare const Spinner: React.FC<SpinnerProps>;
@@ -2,11 +2,13 @@ import React from 'react';
2
2
  export interface OfflineBadgeProps {
3
3
  isOffline: boolean;
4
4
  className?: string;
5
+ animate?: boolean;
5
6
  }
6
7
  export declare const OfflineBadge: React.FC<OfflineBadgeProps>;
7
8
  export interface SyncIndicatorProps {
8
9
  status: 'synced' | 'syncing' | 'unsynced' | 'error';
9
10
  count?: number;
10
11
  className?: string;
12
+ animate?: boolean;
11
13
  }
12
14
  export declare const SyncIndicator: React.FC<SyncIndicatorProps>;
@@ -7,5 +7,6 @@ export interface StepProgressProps {
7
7
  steps: Step[];
8
8
  currentStep: number;
9
9
  className?: string;
10
+ animate?: boolean;
10
11
  }
11
12
  export declare const StepProgress: React.FC<StepProgressProps>;
package/dist/Table.d.ts CHANGED
@@ -14,5 +14,6 @@ export interface TableProps<T> {
14
14
  onRowClick?: (item: T) => void;
15
15
  keyExtractor: (item: T) => string;
16
16
  className?: string;
17
+ animate?: boolean;
17
18
  }
18
- export declare function Table<T>({ data, columns, loading, onRowClick, keyExtractor, className }: TableProps<T>): import("react/jsx-runtime").JSX.Element;
19
+ export declare function Table<T>({ data, columns, loading, onRowClick, keyExtractor, className, animate }: TableProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -3,5 +3,6 @@ export interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextArea
3
3
  label?: string;
4
4
  error?: string;
5
5
  helperText?: string;
6
+ animate?: boolean;
6
7
  }
7
8
  export declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
@@ -12,5 +12,6 @@ export interface ThumbnailGridProps {
12
12
  onView?: (item: ThumbnailItem) => void;
13
13
  columns?: 2 | 3 | 4;
14
14
  className?: string;
15
+ animate?: boolean;
15
16
  }
16
17
  export declare const ThumbnailGrid: React.FC<ThumbnailGridProps>;
package/dist/Toast.d.ts CHANGED
@@ -21,6 +21,7 @@ interface ToastProviderProps {
21
21
  children: React.ReactNode;
22
22
  position?: ToastPosition;
23
23
  maxToasts?: number;
24
+ animate?: boolean;
24
25
  }
25
26
  export declare const ToastProvider: React.FC<ToastProviderProps>;
26
27
  export {};
package/dist/Toggle.d.ts CHANGED
@@ -3,5 +3,6 @@ export interface ToggleProps extends Omit<React.InputHTMLAttributes<HTMLInputEle
3
3
  label?: string;
4
4
  description?: string;
5
5
  onChange?: (checked: boolean) => void;
6
+ animate?: boolean;
6
7
  }
7
8
  export declare const Toggle: React.ForwardRefExoticComponent<ToggleProps & React.RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,6 @@
1
+ export interface Country {
2
+ iso2: string;
3
+ name: string;
4
+ dialCode: string;
5
+ }
6
+ export declare const countries: Country[];