@datawire-ai/busyfile-design-library 1.17.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 +163 -4
- package/dist/index.js +518 -500
- package/dist/index.umd.cjs +15 -15
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -375,7 +375,6 @@ export default function Example() {
|
|
|
375
375
|
);
|
|
376
376
|
}
|
|
377
377
|
```
|
|
378
|
-
|
|
379
378
|
### Props
|
|
380
379
|
|
|
381
380
|
| Prop | Type | Default | Description |
|
|
@@ -388,6 +387,169 @@ export default function Example() {
|
|
|
388
387
|
| `className` | `string` | – | Tailwind/custom classes for the root wrapper. |
|
|
389
388
|
| `children` | `React.ReactNode` | – | One or more `<RadioGroupItem />`. |
|
|
390
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
|
+
|
|
423
|
+
|
|
424
|
+
## Badge
|
|
425
|
+
|
|
426
|
+
The `Badge` component is used to display small status indicators, tags, or labels.
|
|
427
|
+
It supports multiple variants, types `(filled / outline)`, and accepts custom children (icons, avatars, flags, etc.).
|
|
428
|
+
|
|
429
|
+
### Usage
|
|
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
|
+
|
|
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
|
+
|
|
391
553
|
## Badge
|
|
392
554
|
|
|
393
555
|
The `Badge` component is used to display small status indicators, tags, or labels.
|
|
@@ -674,7 +836,4 @@ pnpm build-storybook
|
|
|
674
836
|
````
|
|
675
837
|
|
|
676
838
|
Made with ❤️ by the BusyFile team
|
|
677
|
-
|
|
678
|
-
```
|
|
679
|
-
|
|
680
839
|
```
|