@datawire-ai/busyfile-design-library 1.24.0 → 1.26.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 +70 -79
- package/dist/index.js +3560 -3370
- package/dist/index.umd.cjs +72 -72
- package/dist/style.css +1 -1
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -327,30 +327,45 @@ A customizable and accessible `toggle button` (switch) component. Supports both
|
|
|
327
327
|
## Usage
|
|
328
328
|
|
|
329
329
|
```tsx
|
|
330
|
-
|
|
331
330
|
// Controlled toggle
|
|
332
|
-
|
|
331
|
+
'use client';
|
|
333
332
|
|
|
334
|
-
|
|
335
|
-
|
|
333
|
+
import * as React from 'react';
|
|
334
|
+
import { Toggle } from '@/components/ui/toggle-button';
|
|
336
335
|
|
|
337
|
-
|
|
338
|
-
|
|
336
|
+
export default function Example() {
|
|
337
|
+
const [checked, setChecked] = React.useState(false);
|
|
338
|
+
|
|
339
|
+
return (
|
|
340
|
+
<div className="flex items-center gap-3">
|
|
341
|
+
<Toggle
|
|
342
|
+
id="dark-mode"
|
|
343
|
+
checked={checked}
|
|
344
|
+
onCheckedChange={setChecked}
|
|
345
|
+
className="data-[state=checked]:bg-green-500 data-[state=unchecked]:bg-gray-300"
|
|
346
|
+
/>
|
|
347
|
+
<label
|
|
348
|
+
htmlFor="dark-mode"
|
|
349
|
+
className="cursor-pointer select-none text-sm font-medium"
|
|
350
|
+
>
|
|
351
|
+
Enable Dark Mode
|
|
352
|
+
</label>
|
|
353
|
+
</div>
|
|
354
|
+
);
|
|
355
|
+
}
|
|
339
356
|
```
|
|
340
357
|
|
|
341
358
|
### Props
|
|
342
359
|
|
|
343
|
-
| Prop | Type
|
|
344
|
-
| ----------------- |
|
|
345
|
-
| `checked` | `boolean`
|
|
346
|
-
| `
|
|
347
|
-
| `
|
|
348
|
-
| `disabled` | `boolean`
|
|
349
|
-
| `
|
|
350
|
-
| `
|
|
351
|
-
| `
|
|
352
|
-
| `aria-label` | `string` | `-` | Accessible label (required if no visible label is present). |
|
|
353
|
-
| `aria-labelledby` | `string` | `-` | ID of an element labeling the toggle. |
|
|
360
|
+
| Prop | Type | Default | Description |
|
|
361
|
+
| ----------------- | --------------------------------------------------- | ------- | --------------------------------------------------------------- |
|
|
362
|
+
| `checked` | `boolean` | `false` | Controls the switch state (on/off). |
|
|
363
|
+
| `defaultChecked` | `boolean` | `false` | Sets the initial state when using the switch uncontrolled. |
|
|
364
|
+
| `onCheckedChange` | `(checked: boolean) => void` | `—` | Callback function fired when the checked state changes. |
|
|
365
|
+
| `disabled` | `boolean` | `false` | Disables the switch if `true`. |
|
|
366
|
+
| `id` | `string` | `—` | Used to pair the switch with a `<label>` for accessibility. |
|
|
367
|
+
| `className` | `string` | `—` | Apply custom Tailwind/utility classes. |
|
|
368
|
+
| `...props` | `React.ComponentProps<typeof SwitchPrimitive.Root>` | `—` | Any additional props supported by Radix `SwitchPrimitive.Root`. |
|
|
354
369
|
|
|
355
370
|
# Radio Button
|
|
356
371
|
|
|
@@ -358,7 +373,7 @@ A `radio button` is a user interface element that allows the user to select one
|
|
|
358
373
|
|
|
359
374
|
## Usage
|
|
360
375
|
|
|
361
|
-
|
|
376
|
+
```tsx
|
|
362
377
|
'use client';
|
|
363
378
|
|
|
364
379
|
import { RadioGroup, RadioGroupItem } from './radio-button';
|
|
@@ -375,6 +390,7 @@ export default function Example() {
|
|
|
375
390
|
);
|
|
376
391
|
}
|
|
377
392
|
```
|
|
393
|
+
|
|
378
394
|
### Props
|
|
379
395
|
|
|
380
396
|
| Prop | Type | Default | Description |
|
|
@@ -387,13 +403,12 @@ export default function Example() {
|
|
|
387
403
|
| `className` | `string` | – | Tailwind/custom classes for the root wrapper. |
|
|
388
404
|
| `children` | `React.ReactNode` | – | One or more `<RadioGroupItem />`. |
|
|
389
405
|
|
|
390
|
-
|
|
391
406
|
The `Skeleton` component is used to display a placeholder while content is loading. It supports custom dimensions, border radius, and animations.
|
|
392
407
|
It also includes a SkeletonText variant for rendering multiple placeholder text lines.
|
|
393
408
|
|
|
394
409
|
## Usage
|
|
395
410
|
|
|
396
|
-
|
|
411
|
+
```tsx
|
|
397
412
|
import { Skeleton, SkeletonText } from "@/components/ui/skeleton";
|
|
398
413
|
|
|
399
414
|
// Basic skeleton block
|
|
@@ -420,58 +435,6 @@ import { Skeleton, SkeletonText } from "@/components/ui/skeleton";
|
|
|
420
435
|
| `borderRadius` | `number \| string` | `4px` | Border radius (px or CSS value). |
|
|
421
436
|
| `style` | `React.CSSProperties` | `-` | Inline styles override. |
|
|
422
437
|
|
|
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
438
|
### Typography
|
|
476
439
|
|
|
477
440
|
The BusyFile Design System provides a consistent typography scale based on Nunito with predefined sizes and line-heights from Figma.
|
|
@@ -542,6 +505,7 @@ These tokens can be used directly as Tailwind utility classes like bg-primary-30
|
|
|
542
505
|
|
|
543
506
|
### Usage
|
|
544
507
|
|
|
508
|
+
```tsx
|
|
545
509
|
<div className="bg-primary-30 text-white p-4 rounded">
|
|
546
510
|
Primary Button
|
|
547
511
|
</div>
|
|
@@ -557,7 +521,7 @@ It supports multiple variants, types `(filled / outline)`, and accepts custom ch
|
|
|
557
521
|
|
|
558
522
|
### Usage
|
|
559
523
|
|
|
560
|
-
|
|
524
|
+
```
|
|
561
525
|
|
|
562
526
|
tsx
|
|
563
527
|
|
|
@@ -586,13 +550,40 @@ Success with Icon
|
|
|
586
550
|
</div>
|
|
587
551
|
```
|
|
588
552
|
|
|
553
|
+
````
|
|
554
|
+
|
|
555
|
+
# Checkbox
|
|
556
|
+
|
|
557
|
+
The `Checkbox` is a user interface element that allows the user to select one or more options from a list of independent options. They are typically used in interfaces where the user needs to choose one or more options from a set of options, such as in a filter menu.
|
|
558
|
+
|
|
559
|
+
## Usage
|
|
560
|
+
|
|
589
561
|
```tsx
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
562
|
+
import { Checkbox } from '@/components/ui/checkbox';
|
|
563
|
+
|
|
564
|
+
export function Example() {
|
|
565
|
+
return (
|
|
566
|
+
<div className="flex items-center gap-2">
|
|
567
|
+
<Checkbox id="terms" />
|
|
568
|
+
<label htmlFor="terms" className="text-sm text-neutral-black-1">
|
|
569
|
+
Accept terms and conditions
|
|
570
|
+
</label>
|
|
571
|
+
</div>
|
|
572
|
+
);
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
### Props
|
|
576
|
+
|
|
577
|
+
| Prop | Type | Default | Description |
|
|
578
|
+
| ----------------- | ----------------------------------------------- | ------- | -------------------------------------------------------------- |
|
|
579
|
+
| `className` | `string` | `—` | Custom class names for styling. |
|
|
580
|
+
| `checked` | `boolean \| "indeterminate"` | `—` | Controlled state of the checkbox. |
|
|
581
|
+
| `defaultChecked` | `boolean` | `false` | Uncontrolled initial checked state. |
|
|
582
|
+
| `disabled` | `boolean` | `false` | Disables the checkbox when true. |
|
|
583
|
+
| `onCheckedChange` | `(checked: boolean \| "indeterminate") => void` | `—` | Callback fired when the checked state changes. |
|
|
584
|
+
| `id` | `string` | `—` | Used to associate the checkbox with a `<label>` via `htmlFor`. |
|
|
585
|
+
| `name` | `string` | `—` | Name of the checkbox input (useful in forms). |
|
|
586
|
+
| `value` | `string` | `—` | Value associated with the checkbox input. |
|
|
596
587
|
|
|
597
588
|
# Timeline
|
|
598
589
|
|