@datawire-ai/busyfile-design-library 1.11.0 → 1.13.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 +202 -9
- package/dist/index.js +1835 -1644
- package/dist/index.umd.cjs +32 -32
- package/dist/style.css +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -4,6 +4,10 @@ Design system library for Busyfile Applications
|
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
|
+
Design system library for Busyfile Applications
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
7
11
|
```bash
|
|
8
12
|
# Using npm
|
|
9
13
|
npm install busyfile-design-system
|
|
@@ -14,8 +18,12 @@ pnpm add busyfile-design-system
|
|
|
14
18
|
|
|
15
19
|
## Development
|
|
16
20
|
|
|
21
|
+
## Development
|
|
22
|
+
|
|
17
23
|
### Prerequisites
|
|
18
24
|
|
|
25
|
+
- Node.js - v22.19
|
|
26
|
+
- pnpm - v10.15
|
|
19
27
|
- Node.js - v22.19
|
|
20
28
|
- pnpm - v10.15
|
|
21
29
|
|
|
@@ -67,6 +75,31 @@ pnpm test
|
|
|
67
75
|
- [ ] Repeat until the PR is ready for merge into `main`
|
|
68
76
|
- [ ] **Do not publish from your local on npm**
|
|
69
77
|
|
|
78
|
+
### Development Workflow
|
|
79
|
+
|
|
80
|
+
1. Fork the repository
|
|
81
|
+
2. Create a feature branch
|
|
82
|
+
3. Make your changes
|
|
83
|
+
4. Create changeset `pnpm changeset:add` & `pnpm changeset version`
|
|
84
|
+
5. Submit a pull request
|
|
85
|
+
|
|
86
|
+
## PRs & Changeset Process
|
|
87
|
+
|
|
88
|
+
- [ ] **Do not run `changeset` until your PR is ready for merge**
|
|
89
|
+
- [ ] Complete all required changes
|
|
90
|
+
- [ ] Apply PR review feedback
|
|
91
|
+
- [ ] Get the PR reviewed
|
|
92
|
+
- [ ] **Once reviews are done and PR is approved**
|
|
93
|
+
- [ ] Run the `changeset` scripts
|
|
94
|
+
- [ ] Get the PR reviewed and approved again
|
|
95
|
+
- [ ] Merge into `main`
|
|
96
|
+
- [ ] **If you receive comments after creating a `changeset`**
|
|
97
|
+
- [ ] Delete the generated `changeset` files
|
|
98
|
+
- [ ] Apply PR feedback
|
|
99
|
+
- [ ] Push the changes and get them reviewed again
|
|
100
|
+
- [ ] Repeat until the PR is ready for merge into `main`
|
|
101
|
+
- [ ] **Do not publish from your local on npm**
|
|
102
|
+
|
|
70
103
|
### Project Structure
|
|
71
104
|
|
|
72
105
|
```
|
|
@@ -99,10 +132,39 @@ src/
|
|
|
99
132
|
├── main.tsx # Application entry point
|
|
100
133
|
└── index.ts # Main package exports
|
|
101
134
|
|
|
135
|
+
│ └── ui/
|
|
136
|
+
│ ├── badge/ # Badge component
|
|
137
|
+
│ │ ├── badge.tsx
|
|
138
|
+
│ │ ├── badge.types.ts
|
|
139
|
+
│ │ ├── badge.utils.ts
|
|
140
|
+
│ │ └── badge.test.tsx
|
|
141
|
+
├── badge.stories.tsx
|
|
142
|
+
│ ├── button/ # Button component
|
|
143
|
+
│ │ ├── button.tsx
|
|
144
|
+
│ │ ├── button.types.ts
|
|
145
|
+
│ │ ├── button.utils.ts
|
|
146
|
+
│ │ └── button.test.tsx
|
|
147
|
+
| ├── button.stories.tsx
|
|
148
|
+
│ ├── divider/ # Divider component
|
|
149
|
+
│ │ ├── divider.tsx
|
|
150
|
+
│ │ ├── divider.types.ts
|
|
151
|
+
│ │ └── divider.test.tsx
|
|
152
|
+
| ├── divider.stories.tsx
|
|
153
|
+
│ └── index.ts # Component exports
|
|
154
|
+
├── lib/ # Utility functions
|
|
155
|
+
│ └── utils.ts
|
|
156
|
+
├── styles/
|
|
157
|
+
│ └── style.css # Global styles
|
|
158
|
+
├── App.tsx # Demo application
|
|
159
|
+
├── main.tsx # Application entry point
|
|
160
|
+
└── index.ts # Main package exports
|
|
161
|
+
|
|
102
162
|
```
|
|
103
163
|
|
|
104
164
|
## Testing
|
|
105
165
|
|
|
166
|
+
## Testing
|
|
167
|
+
|
|
106
168
|
```bash
|
|
107
169
|
# Run all tests
|
|
108
170
|
pnpm test
|
|
@@ -119,6 +181,8 @@ pnpm test:browser
|
|
|
119
181
|
|
|
120
182
|
## Storybook
|
|
121
183
|
|
|
184
|
+
## Storybook
|
|
185
|
+
|
|
122
186
|
Storybook provides an interactive playground for all components:
|
|
123
187
|
|
|
124
188
|
```bash
|
|
@@ -133,6 +197,8 @@ Visit http://localhost:6006 to explore components, test props, and see examples.
|
|
|
133
197
|
|
|
134
198
|
## Configuration
|
|
135
199
|
|
|
200
|
+
## Configuration
|
|
201
|
+
|
|
136
202
|
### Tailwind CSS
|
|
137
203
|
|
|
138
204
|
The design system includes a pre-configured Tailwind CSS setup. You can extend it in your project:
|
|
@@ -143,13 +209,18 @@ module.exports = {
|
|
|
143
209
|
content: [
|
|
144
210
|
'./src/**/*.{js,ts,jsx,tsx}',
|
|
145
211
|
'./node_modules/busyfile-design-system/**/*.{js,ts,jsx,tsx}',
|
|
212
|
+
'./src/**/*.{js,ts,jsx,tsx}',
|
|
213
|
+
'./node_modules/busyfile-design-system/**/*.{js,ts,jsx,tsx}',
|
|
146
214
|
],
|
|
147
215
|
theme: {
|
|
148
216
|
extend: {
|
|
149
217
|
// Your custom theme extensions
|
|
150
218
|
},
|
|
219
|
+
},
|
|
151
220
|
},
|
|
152
221
|
plugins: [],
|
|
222
|
+
};
|
|
223
|
+
plugins: [],
|
|
153
224
|
};
|
|
154
225
|
```
|
|
155
226
|
|
|
@@ -223,6 +294,7 @@ These tokens can be used directly as Tailwind utility classes like bg-primary-30
|
|
|
223
294
|
|
|
224
295
|
### Usage
|
|
225
296
|
|
|
297
|
+
```tsx
|
|
226
298
|
<div className="bg-primary-30 text-white p-4 rounded">
|
|
227
299
|
Primary Button
|
|
228
300
|
</div>
|
|
@@ -230,6 +302,7 @@ These tokens can be used directly as Tailwind utility classes like bg-primary-30
|
|
|
230
302
|
<div className="bg-error-d text-white p-4 rounded">
|
|
231
303
|
Error Alert
|
|
232
304
|
</div>
|
|
305
|
+
```
|
|
233
306
|
|
|
234
307
|
# Card
|
|
235
308
|
|
|
@@ -280,12 +353,57 @@ It supports multiple variants, types `(filled / outline)`, and accepts custom ch
|
|
|
280
353
|
</Badge>
|
|
281
354
|
</div>
|
|
282
355
|
```
|
|
283
|
-
|
|
356
|
+
```tsx
|
|
284
357
|
| Prop | Type | Default | Description |
|
|
285
358
|
| ---------- | ----------------------------------------------------------------------------------------------------------------- | ----------- | ------------------------------------------------------------- |
|
|
286
359
|
| `variant` | `"primary" \| "success" \| "warning" \| "error" \| "gray" \| "neutral" \| "blue" \| "purple" \| "pink" \| "rose"` | `"primary"` | Color style of the badge. |
|
|
287
360
|
| `type` | `"filled" \| "outline"` | `"filled"` | Whether the badge is filled or outlined. |
|
|
288
361
|
| `children` | `React.ReactNode` | — | Content inside the badge (text, icons, avatars, flags, etc.). |
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
# Timeline
|
|
365
|
+
|
|
366
|
+
A flexible and customizable timeline component built with React. Supports different visual styles (`filled`, `outlined`, and `icon`), visited/unvisited states, connectors, and custom content.
|
|
367
|
+
|
|
368
|
+
## Usage
|
|
369
|
+
|
|
370
|
+
```tsx
|
|
371
|
+
import { Timeline } from '@/components/timeline';
|
|
372
|
+
import { CheckCircle } from 'lucide-react';
|
|
373
|
+
|
|
374
|
+
<Timeline
|
|
375
|
+
variant="icon"
|
|
376
|
+
items={[
|
|
377
|
+
{
|
|
378
|
+
id: 'step-1',
|
|
379
|
+
title: 'Step 1',
|
|
380
|
+
description: 'This is the first step of the process.',
|
|
381
|
+
icon: <CheckCircle size={16} />,
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
id: 'step-2',
|
|
385
|
+
title: 'Step 2',
|
|
386
|
+
description: 'This step contains extra details.',
|
|
387
|
+
content: <CustomComponent />,
|
|
388
|
+
icon: <CheckCircle size={16} />,
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
id: 'step-3',
|
|
392
|
+
title: 'Step 3',
|
|
393
|
+
notVisited: true,
|
|
394
|
+
icon: <CheckCircle size={16} />,
|
|
395
|
+
},
|
|
396
|
+
]}
|
|
397
|
+
/>;
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
### Props
|
|
401
|
+
|
|
402
|
+
| Prop | Type | Default | Description |
|
|
403
|
+
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
404
|
+
| `items` | `Array<{ id: string; title: string; description?: string; content?: React.ReactNode; icon?: React.ReactNode; notVisited?: boolean }>` | **Required** | Timeline steps data. Each item requires a unique `id` and `title`. Optional fields include `description`, `content`, `icon`, and `notVisited`. |
|
|
405
|
+
| `variant` | `"filled" \| "outlined" \| "icon"` | `"filled"` | Style variant of the timeline dot. `"icon"` allows passing a custom `icon` for each item. |
|
|
406
|
+
| `className` | `string` | `-` | Custom classes for the root wrapper. |
|
|
289
407
|
|
|
290
408
|
# Button
|
|
291
409
|
|
|
@@ -299,16 +417,90 @@ The `Button` component is a core interactive element in the design system. It su
|
|
|
299
417
|
<Button variant="primary">Primary</Button>
|
|
300
418
|
<Button variant="outline" size="sm">Outline Small</Button>
|
|
301
419
|
<Button size="icon"><Icon /></Button>
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
## Badge
|
|
423
|
+
|
|
424
|
+
The `Badge` component is used to display small status indicators, tags, or labels.
|
|
425
|
+
It supports multiple variants, types `(filled / outline)`, and accepts custom children (icons, avatars, flags, etc.).
|
|
426
|
+
|
|
427
|
+
### Usage
|
|
428
|
+
|
|
429
|
+
````tsx
|
|
430
|
+
<div className="flex gap-2 flex-wrap">
|
|
431
|
+
<Badge variant="primary">Primary</Badge>
|
|
432
|
+
<Badge variant="success">Success</Badge>
|
|
433
|
+
<Badge variant="warning">Warning</Badge>
|
|
434
|
+
<Badge variant="error">Error</Badge>
|
|
435
|
+
<Badge variant="gray">Gray</Badge>
|
|
436
|
+
<Badge variant="blue">Blue</Badge>
|
|
437
|
+
<Badge variant="purple">Purple</Badge>
|
|
438
|
+
<Badge variant="pink">Pink</Badge>
|
|
439
|
+
<Badge variant="rose">Rose</Badge>
|
|
440
|
+
|
|
441
|
+
{/* Outline badges */}
|
|
442
|
+
<Badge variant="blue" type="outline">
|
|
443
|
+
Outlined
|
|
444
|
+
</Badge>
|
|
302
445
|
|
|
446
|
+
{/* With icons */}
|
|
447
|
+
<Badge variant="success">
|
|
448
|
+
<span className="mr-1">✔</span>
|
|
449
|
+
Success with Icon
|
|
450
|
+
</Badge>
|
|
451
|
+
</div>
|
|
452
|
+
```
|
|
303
453
|
|
|
454
|
+
| Prop | Type | Default | Description |
|
|
455
|
+
| ---------- | ------------------------------------------------------------------------------------------------------------------ | ----------- | -------------------------------------------------------------------- |
|
|
456
|
+
| `variant` | `"primary" \| "success" \| "warning" \| "error" \| "secondary" \| "neutral"` | `"primary"` | Color style of the badge. |
|
|
457
|
+
| `type` | `"filled" \| "outline"` | `"filled"` | Whether the badge is filled or outlined. |
|
|
458
|
+
| `children` | `React.ReactNode` | — | Content inside the badge (text, icons, avatars, flags, etc.). |
|
|
304
459
|
|
|
305
460
|
|
|
461
|
+
## Divider
|
|
462
|
+
The `Divider` component is used to separate content visually.
|
|
463
|
+
It supports `vertical` and `horizontal` orientations, with configurable thickness (size) and custom width/height.
|
|
464
|
+
|
|
465
|
+
````tsx
|
|
466
|
+
<div className="flex flex-col gap-4">
|
|
467
|
+
{/* Horizontal Divider */}
|
|
468
|
+
<Divider orientation="horizontal" size={2} />
|
|
469
|
+
|
|
470
|
+
{/* Vertical Divider */}
|
|
471
|
+
<div className="flex items-center gap-4">
|
|
472
|
+
<span>Left</span>
|
|
473
|
+
<Divider orientation="vertical" size={2} height={40} />
|
|
474
|
+
<span>Right</span>
|
|
475
|
+
</div>
|
|
476
|
+
</div>
|
|
477
|
+
|
|
478
|
+
```
|
|
479
|
+
|
|
480
|
+
| Prop | Type | Default | Description |
|
|
481
|
+
| ------------- | ---------------------------------------- | -------------- | --------------------------------------------------------------------- |
|
|
482
|
+
| `orientation` | `"horizontal" \| "vertical"` | `"horizontal"` | Orientation of the divider.
|
|
483
|
+
| `size` | `1 \| 2 \| 3 \| 4` | `1` | Thickness of the divider (height for horizontal, width for vertical).
|
|
484
|
+
| `color` | `string` | `#D9DAE4` | Color of the divider line.
|
|
485
|
+
|
|
486
|
+
|
|
487
|
+
````tsx
|
|
488
|
+
;
|
|
489
|
+
<Button variant="default">Default</Button>
|
|
490
|
+
<Button variant="primary">Primary</Button>
|
|
491
|
+
<Button variant="outline" size="sm">Outline Small</Button>
|
|
492
|
+
<Button size="icon"><Icon /></Button>
|
|
493
|
+
```
|
|
494
|
+
|
|
306
495
|
### Stepper
|
|
496
|
+
|
|
307
497
|
A re-usable stepper component to lead users through multi-step workflows (checkout, sign-up, forms, etc.).
|
|
308
498
|
Supports numeric, dots, progress, and labeled versions.
|
|
309
499
|
|
|
310
500
|
### Example
|
|
311
|
-
|
|
501
|
+
|
|
502
|
+
````tsx
|
|
503
|
+
const steps = [
|
|
312
504
|
{ title: "Account Setup" },
|
|
313
505
|
{ title: "Profile Info" },
|
|
314
506
|
{ title: "Preferences" },
|
|
@@ -331,7 +523,8 @@ export default function Example() {
|
|
|
331
523
|
<Stepper steps={steps} variant="labeled" />
|
|
332
524
|
</div>
|
|
333
525
|
);
|
|
334
|
-
}
|
|
526
|
+
}
|
|
527
|
+
```
|
|
335
528
|
|
|
336
529
|
|
|
337
530
|
| Prop | Type | Default | Description |
|
|
@@ -347,7 +540,8 @@ export default function Example() {
|
|
|
347
540
|
A custom dropdown supporting single, multi(with chips), and grouped selections. Built with React and Tailwind CSS.
|
|
348
541
|
|
|
349
542
|
### Usage
|
|
350
|
-
|
|
543
|
+
````tsx
|
|
544
|
+
import { useState } from "react"
|
|
351
545
|
import { SelectOption } from "@/components/select-option"
|
|
352
546
|
|
|
353
547
|
const options = [
|
|
@@ -377,7 +571,8 @@ export default function Demo() {
|
|
|
377
571
|
/>
|
|
378
572
|
</>
|
|
379
573
|
)
|
|
380
|
-
};
|
|
574
|
+
};
|
|
575
|
+
```
|
|
381
576
|
|
|
382
577
|
### Props
|
|
383
578
|
|
|
@@ -399,7 +594,8 @@ Full TypeScript support is included. No additional types package needed.
|
|
|
399
594
|
|
|
400
595
|
## Building
|
|
401
596
|
|
|
402
|
-
|
|
597
|
+
````tsx
|
|
598
|
+
bash
|
|
403
599
|
# Build for production
|
|
404
600
|
pnpm build
|
|
405
601
|
|
|
@@ -410,7 +606,4 @@ pnpm build:types
|
|
|
410
606
|
pnpm build-storybook
|
|
411
607
|
````
|
|
412
608
|
|
|
413
|
-
```
|
|
414
|
-
|
|
415
609
|
Made with ❤️ by the BusyFile team
|
|
416
|
-
```
|