@datawire-ai/busyfile-design-library 1.12.0 → 1.14.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 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,6 +353,103 @@ It supports multiple variants, types `(filled / outline)`, and accepts custom ch
280
353
  </Badge>
281
354
  </div>
282
355
  ```
356
+ ```tsx
357
+ | Prop | Type | Default | Description |
358
+ | ---------- | ----------------------------------------------------------------------------------------------------------------- | ----------- | ------------------------------------------------------------- |
359
+ | `variant` | `"primary" \| "success" \| "warning" \| "error" \| "gray" \| "neutral" \| "blue" \| "purple" \| "pink" \| "rose"` | `"primary"` | Color style of the badge. |
360
+ | `type` | `"filled" \| "outline"` | `"filled"` | Whether the badge is filled or outlined. |
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. |
407
+
408
+ # Button
409
+
410
+ The `Button` component is a core interactive element in the design system. It supports multiple variants, sizes, and icons while ensuring accessibility and consistency.
411
+
412
+ ## Usage
413
+
414
+ ````tsx
415
+ ;
416
+ <Button variant="default">Default</Button>
417
+ <Button variant="primary">Primary</Button>
418
+ <Button variant="outline" size="sm">Outline Small</Button>
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>
445
+
446
+ {/* With icons */}
447
+ <Badge variant="success">
448
+ <span className="mr-1">✔</span>
449
+ Success with Icon
450
+ </Badge>
451
+ </div>
452
+ ```
283
453
 
284
454
  | Prop | Type | Default | Description |
285
455
  | ---------- | ------------------------------------------------------------------------------------------------------------------ | ----------- | -------------------------------------------------------------------- |
@@ -292,7 +462,7 @@ It supports multiple variants, types `(filled / outline)`, and accepts custom ch
292
462
  The `Divider` component is used to separate content visually.
293
463
  It supports `vertical` and `horizontal` orientations, with configurable thickness (size) and custom width/height.
294
464
 
295
- ```tsx
465
+ ````tsx
296
466
  <div className="flex flex-col gap-4">
297
467
  {/* Horizontal Divider */}
298
468
  <Divider orientation="horizontal" size={2} />
@@ -314,13 +484,23 @@ It supports `vertical` and `horizontal` orientations, with configurable thicknes
314
484
  | `color` | `string` | `#D9DAE4` | Color of the divider line.
315
485
 
316
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
+ ```
317
494
 
318
495
  ### Stepper
496
+
319
497
  A re-usable stepper component to lead users through multi-step workflows (checkout, sign-up, forms, etc.).
320
498
  Supports numeric, dots, progress, and labeled versions.
321
499
 
322
500
  ### Example
323
- ``` const steps = [
501
+
502
+ ````tsx
503
+ const steps = [
324
504
  { title: "Account Setup" },
325
505
  { title: "Profile Info" },
326
506
  { title: "Preferences" },
@@ -343,7 +523,8 @@ export default function Example() {
343
523
  <Stepper steps={steps} variant="labeled" />
344
524
  </div>
345
525
  );
346
- }```
526
+ }
527
+ ```
347
528
 
348
529
 
349
530
  | Prop | Type | Default | Description |
@@ -359,7 +540,8 @@ export default function Example() {
359
540
  A custom dropdown supporting single, multi(with chips), and grouped selections. Built with React and Tailwind CSS.
360
541
 
361
542
  ### Usage
362
- ```import { useState } from "react"
543
+ ````tsx
544
+ import { useState } from "react"
363
545
  import { SelectOption } from "@/components/select-option"
364
546
 
365
547
  const options = [
@@ -389,7 +571,8 @@ export default function Demo() {
389
571
  />
390
572
  </>
391
573
  )
392
- }; ```
574
+ };
575
+ ```
393
576
 
394
577
  ### Props
395
578
 
@@ -411,7 +594,8 @@ Full TypeScript support is included. No additional types package needed.
411
594
 
412
595
  ## Building
413
596
 
414
- ```bash
597
+ ````tsx
598
+ bash
415
599
  # Build for production
416
600
  pnpm build
417
601
 
@@ -422,7 +606,4 @@ pnpm build:types
422
606
  pnpm build-storybook
423
607
  ````
424
608
 
425
- ```
426
-
427
609
  Made with ❤️ by the BusyFile team
428
- ```