@datawire-ai/busyfile-design-library 1.7.1 → 1.9.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 +93 -0
- package/dist/index.js +4163 -2123
- package/dist/index.umd.cjs +67 -27
- package/dist/style.css +1 -1
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -281,6 +281,99 @@ The `Button` component is a core interactive element in the design system. It su
|
|
|
281
281
|
<Button variant="outline" size="sm">Outline Small</Button>
|
|
282
282
|
<Button size="icon"><Icon /></Button>
|
|
283
283
|
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
### Stepper
|
|
288
|
+
A re-usable stepper component to lead users through multi-step workflows (checkout, sign-up, forms, etc.).
|
|
289
|
+
Supports numeric, dots, progress, and labeled versions.
|
|
290
|
+
|
|
291
|
+
### Example
|
|
292
|
+
``` const steps = [
|
|
293
|
+
{ title: "Account Setup" },
|
|
294
|
+
{ title: "Profile Info" },
|
|
295
|
+
{ title: "Preferences" },
|
|
296
|
+
{ title: "Confirmation" },
|
|
297
|
+
];
|
|
298
|
+
|
|
299
|
+
export default function Example() {
|
|
300
|
+
return (
|
|
301
|
+
<div className="space-y-6">
|
|
302
|
+
{/* Numeric */}
|
|
303
|
+
<Stepper steps={steps} variant="numeric" />
|
|
304
|
+
|
|
305
|
+
{/* Dots */}
|
|
306
|
+
<Stepper steps={steps} variant="dots" />
|
|
307
|
+
|
|
308
|
+
{/* Progress */}
|
|
309
|
+
<Stepper steps={steps} variant="progress" />
|
|
310
|
+
|
|
311
|
+
{/* Labeled */}
|
|
312
|
+
<Stepper steps={steps} variant="labeled" />
|
|
313
|
+
</div>
|
|
314
|
+
);
|
|
315
|
+
}```
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
| Prop | Type | Default | Description |
|
|
319
|
+
| -------------- | ------------------------------------------------ | ----------- | ---------------------------------- |
|
|
320
|
+
| `steps` | `{ title?: string }[]` | `[]` | Steps with optional labels |
|
|
321
|
+
| `variant` | `"numeric" | "dots" | "progress" | "labeled"` | `"numeric"` | Visual style of the stepper |
|
|
322
|
+
| `initialStep` | `number` | `0` | Starting step index |
|
|
323
|
+
| `onStepChange` | `(step: number) => void` | `undefined` | Callback when step changes |
|
|
324
|
+
| `showControls` | `boolean` | `true` | Show back/next navigation controls |
|
|
325
|
+
| `className` | `string` | `undefined` | Additional Tailwind classes |
|
|
326
|
+
|
|
327
|
+
### SelectOption
|
|
328
|
+
A custom dropdown supporting single, multi(with chips), and grouped selections. Built with React and Tailwind CSS.
|
|
329
|
+
|
|
330
|
+
### Usage
|
|
331
|
+
```import { useState } from "react"
|
|
332
|
+
import { SelectOption } from "@/components/select-option"
|
|
333
|
+
|
|
334
|
+
const options = [
|
|
335
|
+
{ label: "Option 1", value: "opt1" },
|
|
336
|
+
{ label: "Option 2", value: "opt2" },
|
|
337
|
+
]
|
|
338
|
+
|
|
339
|
+
export default function Demo() {
|
|
340
|
+
const [single, setSingle] = useState("")
|
|
341
|
+
const [multi, setMulti] = useState<string[]>([])
|
|
342
|
+
|
|
343
|
+
return (
|
|
344
|
+
<>
|
|
345
|
+
<SelectOption
|
|
346
|
+
options={options}
|
|
347
|
+
value={single}
|
|
348
|
+
onChange={val => setSingle(val as string)}
|
|
349
|
+
placeholder="Single select"
|
|
350
|
+
/>
|
|
351
|
+
|
|
352
|
+
<SelectOption
|
|
353
|
+
options={options}
|
|
354
|
+
multiple
|
|
355
|
+
value={multi}
|
|
356
|
+
onChange={val => setMulti(val as string[])}
|
|
357
|
+
placeholder="Multi select"
|
|
358
|
+
/>
|
|
359
|
+
</>
|
|
360
|
+
)
|
|
361
|
+
}; ```
|
|
362
|
+
|
|
363
|
+
### Props
|
|
364
|
+
|
|
365
|
+
| Prop | Type | Default | Description |
|
|
366
|
+
| ------------- | ----------------------------------------- | ------------- | ------------------------------------------ |
|
|
367
|
+
| `options` | `SelectOptionType[] \| SelectGroupType[]` | required | List of options (flat or grouped) |
|
|
368
|
+
| `multiple` | `boolean` | `false` | Enables multi-select with chips |
|
|
369
|
+
| `placeholder` | `string` | `"Select..."` | Placeholder text when no value is selected |
|
|
370
|
+
| `disabled` | `boolean` | `false` | Disables the select |
|
|
371
|
+
| `error` | `string` | `undefined` | Error message, highlights border |
|
|
372
|
+
| `helperText` | `string` | `undefined` | Helper text shown below the select |
|
|
373
|
+
| `value` | `string \| string[]` | internal | Controlled value |
|
|
374
|
+
| `onChange` | `(value: string \| string[]) => void` | optional | Callback when value changes |
|
|
375
|
+
|
|
376
|
+
|
|
284
377
|
### TypeScript
|
|
285
378
|
|
|
286
379
|
Full TypeScript support is included. No additional types package needed.
|