@datawire-ai/busyfile-design-library 1.16.0 → 1.17.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 +42 -1
- package/dist/index.js +2866 -2430
- package/dist/index.umd.cjs +44 -44
- package/dist/style.css +1 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -327,6 +327,7 @@ A customizable and accessible `toggle button` (switch) component. Supports both
|
|
|
327
327
|
## Usage
|
|
328
328
|
|
|
329
329
|
```tsx
|
|
330
|
+
|
|
330
331
|
// Controlled toggle
|
|
331
332
|
<Toggle checked={enabled} onChange={setEnabled} variant="classic" />
|
|
332
333
|
|
|
@@ -351,6 +352,41 @@ A customizable and accessible `toggle button` (switch) component. Supports both
|
|
|
351
352
|
| `aria-label` | `string` | `-` | Accessible label (required if no visible label is present). |
|
|
352
353
|
| `aria-labelledby` | `string` | `-` | ID of an element labeling the toggle. |
|
|
353
354
|
|
|
355
|
+
# Radio Button
|
|
356
|
+
|
|
357
|
+
A `radio button` is a user interface element that allows the user to select one option from a list of mutually exclusive options. They are typically used in interfaces where the user needs to choose a single option from a set of options, such as in a survey or form.
|
|
358
|
+
|
|
359
|
+
## Usage
|
|
360
|
+
|
|
361
|
+
````tsx
|
|
362
|
+
'use client';
|
|
363
|
+
|
|
364
|
+
import { RadioGroup, RadioGroupItem } from './radio-button';
|
|
365
|
+
|
|
366
|
+
export default function Example() {
|
|
367
|
+
return (
|
|
368
|
+
<RadioGroup defaultValue="option1" className="flex flex-col gap-3">
|
|
369
|
+
<RadioGroupItem value="option1">Option 1</RadioGroupItem>
|
|
370
|
+
<RadioGroupItem value="option2">Option 2</RadioGroupItem>
|
|
371
|
+
<RadioGroupItem value="option3" disabled>
|
|
372
|
+
Option 3 (Disabled)
|
|
373
|
+
</RadioGroupItem>
|
|
374
|
+
</RadioGroup>
|
|
375
|
+
);
|
|
376
|
+
}
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
### Props
|
|
380
|
+
|
|
381
|
+
| Prop | Type | Default | Description |
|
|
382
|
+
| --------------- | ------------------------- | -------- | --------------------------------------------- |
|
|
383
|
+
| `value` | `string` | – | Controlled value of the selected radio. |
|
|
384
|
+
| `defaultValue` | `string` | – | Uncontrolled initial value. |
|
|
385
|
+
| `onValueChange` | `(value: string) => void` | – | Callback fired when the value changes. |
|
|
386
|
+
| `name` | `string` | auto-gen | Name for the underlying native radio inputs. |
|
|
387
|
+
| `disabled` | `boolean` | `false` | Disables all radios inside the group. |
|
|
388
|
+
| `className` | `string` | – | Tailwind/custom classes for the root wrapper. |
|
|
389
|
+
| `children` | `React.ReactNode` | – | One or more `<RadioGroupItem />`. |
|
|
354
390
|
|
|
355
391
|
## Badge
|
|
356
392
|
|
|
@@ -359,7 +395,8 @@ It supports multiple variants, types `(filled / outline)`, and accepts custom ch
|
|
|
359
395
|
|
|
360
396
|
### Usage
|
|
361
397
|
|
|
362
|
-
|
|
398
|
+
````
|
|
399
|
+
tsx
|
|
363
400
|
<div className="flex gap-2 flex-wrap">
|
|
364
401
|
<Badge variant="primary">Primary</Badge>
|
|
365
402
|
<Badge variant="success">Success</Badge>
|
|
@@ -637,3 +674,7 @@ pnpm build-storybook
|
|
|
637
674
|
````
|
|
638
675
|
|
|
639
676
|
Made with ❤️ by the BusyFile team
|
|
677
|
+
|
|
678
|
+
```
|
|
679
|
+
|
|
680
|
+
```
|