@stackloop/ui 4.1.0 → 4.1.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
@@ -73,7 +73,7 @@ import '@stackloop/ui/theme.css'
73
73
  Import components from the package root:
74
74
 
75
75
  ```tsx
76
- import { Button, Modal, Input } from '@stackloop/ui'
76
+ import { Button, ButtonGroup, Modal, Input } from '@stackloop/ui'
77
77
  ```
78
78
 
79
79
  All components are **client-side** components with `'use client'` directive, making them compatible with Next.js App Router.
@@ -160,7 +160,7 @@ import { Button, Modal } from '@stackloop/ui'
160
160
 
161
161
  Components with the `animate` prop:
162
162
 
163
- - `Accordion`, `AudioRecorder`, `Badge`, `BottomSheet`, `Button`, `Card`, `CameraCapture`, `Checkbox`, `CountrySelect`, `DatePicker`, `Drawer`, `Dropdown`, `DualSlider`, `FileUploader`, `FloatingActionButton`, `Input`, `Modal`, `MultiSelect`, `Pagination`, `PhoneInput`, `RadioPills`, `Select`, `Slider`, `Spinner`, `StepProgress`, `Table`, `Textarea`, `ThumbnailGrid`, `Toggle`, `ToastProvider`
163
+ - `Accordion`, `AudioRecorder`, `Badge`, `BottomSheet`, `Button`, `ButtonGroup`, `Card`, `CameraCapture`, `Checkbox`, `CountrySelect`, `DatePicker`, `Drawer`, `Dropdown`, `DualSlider`, `FileUploader`, `FloatingActionButton`, `Input`, `Modal`, `MultiSelect`, `Pagination`, `PhoneInput`, `RadioPills`, `Select`, `Slider`, `Spinner`, `StepProgress`, `Table`, `Textarea`, `ThumbnailGrid`, `Toggle`, `ToastProvider`
164
164
 
165
165
  ## Ripple Behavior
166
166
 
@@ -222,6 +222,34 @@ Call `setupRippleEffects()` only once per app (for example in `main.tsx`) to avo
222
222
  <Button variant="outline" size="lg" onClick={() => {}}>Save</Button>
223
223
  ```
224
224
 
225
+ **ButtonGroup**:
226
+ - **Description:** Segmented button group with a rounded outer container and separate buttons divided by borders.
227
+ - **Props:**
228
+ - **`options`**: `{ value: string; label: string; icon?: ReactNode; disabled?: boolean }[]` — required.
229
+ - **`value`**: `string` — optional selected value.
230
+ - **`onChange`**: `(value: string) => void` — optional change callback.
231
+ - **`size`**: `'sm' | 'md' | 'lg'` — default: `'md'`.
232
+ - **`disabled`**: `boolean` — default: `false`.
233
+ - **`className`**: `string` — optional.
234
+ - **`animate`**: `boolean` — default: `true`.
235
+ - **Usage:**
236
+
237
+ ```jsx
238
+ import { ButtonGroup } from '@stackloop/ui'
239
+
240
+ const options = [
241
+ { label: 'Day', value: 'day' },
242
+ { label: 'Week', value: 'week' },
243
+ { label: 'Month', value: 'month' }
244
+ ]
245
+
246
+ <ButtonGroup
247
+ options={options}
248
+ value={selectedRange}
249
+ onChange={setSelectedRange}
250
+ />
251
+ ```
252
+
225
253
  **Input**:
226
254
  - **Description:** Unified input API with smart type routing. Supports native text/password/email/etc plus `phone`, `country`, and `date` while keeping a consistent `value` + `onChange` pattern.
227
255
  - **Props:**
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ export interface ButtonGroupOption {
3
+ value: string;
4
+ label: string;
5
+ icon?: React.ReactNode;
6
+ disabled?: boolean;
7
+ }
8
+ export interface ButtonGroupProps {
9
+ options: ButtonGroupOption[];
10
+ value?: string;
11
+ onChange?: (value: string) => void;
12
+ size?: 'sm' | 'md' | 'lg';
13
+ disabled?: boolean;
14
+ className?: string;
15
+ animate?: boolean;
16
+ }
17
+ export declare const ButtonGroup: React.FC<ButtonGroupProps>;