@datawire-ai/busyfile-design-library 1.16.0 → 1.18.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 +200 -0
- package/dist/index.js +2900 -2446
- 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,74 @@ 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
|
+
### Props
|
|
379
|
+
|
|
380
|
+
| Prop | Type | Default | Description |
|
|
381
|
+
| --------------- | ------------------------- | -------- | --------------------------------------------- |
|
|
382
|
+
| `value` | `string` | – | Controlled value of the selected radio. |
|
|
383
|
+
| `defaultValue` | `string` | – | Uncontrolled initial value. |
|
|
384
|
+
| `onValueChange` | `(value: string) => void` | – | Callback fired when the value changes. |
|
|
385
|
+
| `name` | `string` | auto-gen | Name for the underlying native radio inputs. |
|
|
386
|
+
| `disabled` | `boolean` | `false` | Disables all radios inside the group. |
|
|
387
|
+
| `className` | `string` | – | Tailwind/custom classes for the root wrapper. |
|
|
388
|
+
| `children` | `React.ReactNode` | – | One or more `<RadioGroupItem />`. |
|
|
389
|
+
|
|
390
|
+
|
|
391
|
+
The `Skeleton` component is used to display a placeholder while content is loading. It supports custom dimensions, border radius, and animations.
|
|
392
|
+
It also includes a SkeletonText variant for rendering multiple placeholder text lines.
|
|
393
|
+
|
|
394
|
+
## Usage
|
|
395
|
+
|
|
396
|
+
````tsx
|
|
397
|
+
import { Skeleton, SkeletonText } from "@/components/ui/skeleton";
|
|
398
|
+
|
|
399
|
+
// Basic skeleton block
|
|
400
|
+
<Skeleton width={120} height={20} />
|
|
401
|
+
|
|
402
|
+
// Rounded skeleton (e.g., avatar)
|
|
403
|
+
<Skeleton width={40} height={40} borderRadius="50%" />
|
|
404
|
+
|
|
405
|
+
// Animated skeleton
|
|
406
|
+
<Skeleton width="100%" height={16} animation="pulse" />
|
|
407
|
+
|
|
408
|
+
// Multi-line skeleton text
|
|
409
|
+
<SkeletonText lines={3} />
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
### Props
|
|
413
|
+
|
|
414
|
+
| Prop | Type | Default | Description |
|
|
415
|
+
| -------------- | ---------------------- | ------- | ------------------------------------ |
|
|
416
|
+
| `className` | `string` | `-` | Custom classes for styling. |
|
|
417
|
+
| `animation` | `"shimmer" \| "pulse"` | `-` | Animation style for skeleton. |
|
|
418
|
+
| `width` | `number \| string` | `-` | Width of the skeleton (px, %, etc.). |
|
|
419
|
+
| `height` | `number \| string` | `-` | Height of the skeleton. |
|
|
420
|
+
| `borderRadius` | `number \| string` | `4px` | Border radius (px or CSS value). |
|
|
421
|
+
| `style` | `React.CSSProperties` | `-` | Inline styles override. |
|
|
422
|
+
|
|
354
423
|
|
|
355
424
|
## Badge
|
|
356
425
|
|
|
@@ -359,7 +428,137 @@ It supports multiple variants, types `(filled / outline)`, and accepts custom ch
|
|
|
359
428
|
|
|
360
429
|
### Usage
|
|
361
430
|
|
|
431
|
+
````tsx
|
|
432
|
+
<div className="flex gap-2 flex-wrap">
|
|
433
|
+
<Badge variant="primary">Primary</Badge>
|
|
434
|
+
<Badge variant="success">Success</Badge>
|
|
435
|
+
<Badge variant="warning">Warning</Badge>
|
|
436
|
+
<Badge variant="error">Error</Badge>
|
|
437
|
+
<Badge variant="gray">Gray</Badge>
|
|
438
|
+
<Badge variant="blue">Blue</Badge>
|
|
439
|
+
<Badge variant="purple">Purple</Badge>
|
|
440
|
+
<Badge variant="pink">Pink</Badge>
|
|
441
|
+
<Badge variant="rose">Rose</Badge>
|
|
442
|
+
|
|
443
|
+
{/* Outline badges */}
|
|
444
|
+
<Badge variant="blue" type="outline">
|
|
445
|
+
Outlined
|
|
446
|
+
</Badge>
|
|
447
|
+
|
|
448
|
+
{/* With icons */}
|
|
449
|
+
<Badge variant="success">
|
|
450
|
+
<span className="mr-1">✔</span>
|
|
451
|
+
Success with Icon
|
|
452
|
+
</Badge>
|
|
453
|
+
</div>
|
|
454
|
+
```
|
|
455
|
+
|
|
456
|
+
| Prop | Type | Default | Description |
|
|
457
|
+
| ---------- | ----------------------------------------------------------------------------------------------------------------- | ----------- | ------------------------------------------------------------- |
|
|
458
|
+
| `variant` | `"primary" \| "success" \| "warning" \| "error" \| "gray" \| "neutral" \| "blue" \| "purple" \| "pink" \| "rose"` | `"primary"` | Color style of the badge. |
|
|
459
|
+
| `type` | `"filled" \| "outline"` | `"filled"` | Whether the badge is filled or outlined. |
|
|
460
|
+
| `children` | `React.ReactNode` | — | Content inside the badge (text, icons, avatars, flags, etc.). |
|
|
461
|
+
|
|
462
|
+
# Button
|
|
463
|
+
|
|
464
|
+
The `Button` component is a core interactive element in the design system. It supports multiple variants, sizes, and icons while ensuring accessibility and consistency.
|
|
465
|
+
|
|
466
|
+
## Usage
|
|
467
|
+
|
|
362
468
|
```tsx
|
|
469
|
+
<Button variant="default">Default</Button>
|
|
470
|
+
<Button variant="primary">Primary</Button>
|
|
471
|
+
<Button variant="outline" size="sm">Outline Small</Button>
|
|
472
|
+
<Button size="icon"><Icon /></Button>
|
|
473
|
+
```
|
|
474
|
+
|
|
475
|
+
### Typography
|
|
476
|
+
|
|
477
|
+
The BusyFile Design System provides a consistent typography scale based on Nunito with predefined sizes and line-heights from Figma.
|
|
478
|
+
|
|
479
|
+
| Token | Font Size | Line Height | Example Class |
|
|
480
|
+
| ------------------- | --------- | ----------- | ----------------- |
|
|
481
|
+
| `--text-display-lg` | 3rem | 1.2rem | `text-display-lg` |
|
|
482
|
+
| `--text-display-md` | 2.25rem | 1.2rem | `text-display-md` |
|
|
483
|
+
| `--text-display-sm` | 1.875rem | 1.2rem | `text-display-sm` |
|
|
484
|
+
| `--text-display-xs` | 1.5rem | 1.2rem | `text-display-xs` |
|
|
485
|
+
| `--text-xl` | 1.25rem | 1.6rem | `text-xl` |
|
|
486
|
+
| `--text-lg` | 1.125rem | 1.6rem | `text-lg` |
|
|
487
|
+
| `--text-md` | 1rem | 1.6rem | `text-md` |
|
|
488
|
+
| `--text-sm` | 0.875rem | 1.6rem | `text-sm` |
|
|
489
|
+
| `--text-xs` | 0.75rem | 1.6rem | `text-xs` |
|
|
490
|
+
|
|
491
|
+
### Usage
|
|
492
|
+
|
|
493
|
+
<p className="text-display-lg font-sans">
|
|
494
|
+
Large Display Heading
|
|
495
|
+
</p>
|
|
496
|
+
|
|
497
|
+
<p className="text-md font-sans">
|
|
498
|
+
Body text using medium size
|
|
499
|
+
</p>
|
|
500
|
+
|
|
501
|
+
### Colors
|
|
502
|
+
|
|
503
|
+
The BusyFile Design System defines a unified color palette for primary, neutral, and semantic states.
|
|
504
|
+
These tokens can be used directly as Tailwind utility classes like bg-primary-30 or text-neutral-60.
|
|
505
|
+
|
|
506
|
+
### Primary Colors
|
|
507
|
+
|
|
508
|
+
| Token | Hex | Example Class |
|
|
509
|
+
| -------------------- | --------- | --------------- |
|
|
510
|
+
| `--color-primary-0` | `#36060a` | `bg-primary-0` |
|
|
511
|
+
| `--color-primary-10` | `#6a131d` | `bg-primary-10` |
|
|
512
|
+
| `--color-primary-20` | `#a52432` | `bg-primary-20` |
|
|
513
|
+
| `--color-primary-30` | `#e33549` | `bg-primary-30` |
|
|
514
|
+
| `--color-primary-40` | `#f17b83` | `bg-primary-40` |
|
|
515
|
+
| `--color-primary-50` | `#f5b5b9` | `bg-primary-50` |
|
|
516
|
+
| `--color-primary-60` | `#fceaea` | `bg-primary-60` |
|
|
517
|
+
|
|
518
|
+
### Neutral Colors
|
|
519
|
+
|
|
520
|
+
| Token | Hex | Example Class |
|
|
521
|
+
| -------------------- | --------- | --------------- |
|
|
522
|
+
| `--color-neutral-0` | `#0a0a0a` | `bg-neutral-0` |
|
|
523
|
+
| `--color-neutral-10` | `#1f1f1f` | `bg-neutral-10` |
|
|
524
|
+
| `--color-neutral-20` | `#333333` | `bg-neutral-20` |
|
|
525
|
+
| `--color-neutral-30` | `#474747` | `bg-neutral-30` |
|
|
526
|
+
| `--color-neutral-40` | `#5c5c5c` | `bg-neutral-40` |
|
|
527
|
+
| `--color-neutral-50` | `#707070` | `bg-neutral-50` |
|
|
528
|
+
| `--color-neutral-60` | `#858585` | `bg-neutral-60` |
|
|
529
|
+
| `--color-neutral-70` | `#999999` | `bg-neutral-70` |
|
|
530
|
+
| `--color-neutral-80` | `#adadad` | `bg-neutral-80` |
|
|
531
|
+
| `--color-neutral-90` | `#c2c2c2` | `bg-neutral-90` |
|
|
532
|
+
| `--color-neutral-95` | `#d6d6d6` | `bg-neutral-95` |
|
|
533
|
+
| `--color-neutral-99` | `#f1f1f1` | `bg-neutral-99` |
|
|
534
|
+
|
|
535
|
+
### Semantic Colors
|
|
536
|
+
|
|
537
|
+
| State | Light | Dark | Example Classes |
|
|
538
|
+
| ----------- | --------- | --------- | ------------------------------ |
|
|
539
|
+
| **Error** | `#f9dcdf` | `#bf2234` | `bg-error-l`, `bg-error-d` |
|
|
540
|
+
| **Warning** | `#fbf2da` | `#e8b321` | `bg-warning-l`, `bg-warning-d` |
|
|
541
|
+
| **Success** | `#c5fce3` | `#099a59` | `bg-success-l`, `bg-success-d` |
|
|
542
|
+
|
|
543
|
+
### Usage
|
|
544
|
+
|
|
545
|
+
<div className="bg-primary-30 text-white p-4 rounded">
|
|
546
|
+
Primary Button
|
|
547
|
+
</div>
|
|
548
|
+
|
|
549
|
+
<div className="bg-error-d text-white p-4 rounded">
|
|
550
|
+
Error Alert
|
|
551
|
+
</div>
|
|
552
|
+
|
|
553
|
+
## Badge
|
|
554
|
+
|
|
555
|
+
The `Badge` component is used to display small status indicators, tags, or labels.
|
|
556
|
+
It supports multiple variants, types `(filled / outline)`, and accepts custom children (icons, avatars, flags, etc.).
|
|
557
|
+
|
|
558
|
+
### Usage
|
|
559
|
+
|
|
560
|
+
````
|
|
561
|
+
tsx
|
|
363
562
|
<div className="flex gap-2 flex-wrap">
|
|
364
563
|
<Badge variant="primary">Primary</Badge>
|
|
365
564
|
<Badge variant="success">Success</Badge>
|
|
@@ -637,3 +836,4 @@ pnpm build-storybook
|
|
|
637
836
|
````
|
|
638
837
|
|
|
639
838
|
Made with ❤️ by the BusyFile team
|
|
839
|
+
```
|