zabi-components 1.0.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 +146 -0
- package/dist/KeyValueForm-CC2AhAxK.js +634 -0
- package/dist/NotificationManager-BGzRVJn7.js +74 -0
- package/dist/Skeleton-CaVpFsgI.js +620 -0
- package/dist/Toggle-q1tBzXDR.js +2508 -0
- package/dist/atoms/index.d.ts +15 -0
- package/dist/atoms/index.js +18 -0
- package/dist/index/index.js +27 -0
- package/dist/index-DInFKA3g.js +2645 -0
- package/dist/index.d.ts +14 -0
- package/dist/molecules/KeyValueForm.types.d.ts +11 -0
- package/dist/molecules/index.d.ts +10 -0
- package/dist/molecules/index.js +10 -0
- package/dist/organisms/index.d.ts +2 -0
- package/dist/organisms/index.js +4 -0
- package/dist/vite.svg +1 -0
- package/package.json +91 -0
package/README.md
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# Zabi Components
|
|
2
|
+
|
|
3
|
+
A modern SvelteKit component library with TypeScript and Tailwind CSS support.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- 🎨 **Modern Design**: Built with Tailwind CSS for consistent, responsive styling
|
|
8
|
+
- 🔧 **TypeScript**: Full TypeScript support with comprehensive type definitions
|
|
9
|
+
- 📦 **Modular**: Import only what you need with tree-shaking support
|
|
10
|
+
- ♿ **Accessible**: Built with accessibility best practices
|
|
11
|
+
- 🚀 **Performance**: Optimized for production with minimal bundle size
|
|
12
|
+
- 📱 **Responsive**: Mobile-first design approach
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install zabi-components
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
### Import All Components
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
import { Button, Card, Input, Modal } from 'zabi-components';
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Import by Category
|
|
29
|
+
|
|
30
|
+
```typescript
|
|
31
|
+
// Atomic components
|
|
32
|
+
import { Button, Input, Card } from 'zabi-components/atoms';
|
|
33
|
+
|
|
34
|
+
// Molecular components
|
|
35
|
+
import { Modal, Alert, Dropdown } from 'zabi-components/molecules';
|
|
36
|
+
|
|
37
|
+
// Organism components
|
|
38
|
+
import { ToastContainer } from 'zabi-components/organisms';
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Basic Example
|
|
42
|
+
|
|
43
|
+
```svelte
|
|
44
|
+
<script lang="ts">
|
|
45
|
+
import { Button, Card, Input } from 'zabi-components';
|
|
46
|
+
|
|
47
|
+
let name = '';
|
|
48
|
+
let showCard = false;
|
|
49
|
+
</script>
|
|
50
|
+
|
|
51
|
+
<Input bind:value={name} placeholder="Enter your name" />
|
|
52
|
+
<Button on:click={() => showCard = !showCard}>
|
|
53
|
+
Toggle Card
|
|
54
|
+
</Button>
|
|
55
|
+
|
|
56
|
+
{#if showCard}
|
|
57
|
+
<Card>
|
|
58
|
+
<h2>Hello, {name}!</h2>
|
|
59
|
+
</Card>
|
|
60
|
+
{/if}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Component Categories
|
|
64
|
+
|
|
65
|
+
### Atoms
|
|
66
|
+
Basic building blocks of your UI:
|
|
67
|
+
- `Badge` - Status indicators and labels
|
|
68
|
+
- `Button` - Interactive buttons with variants
|
|
69
|
+
- `Card` - Content containers
|
|
70
|
+
- `Checkbox` - Form checkboxes
|
|
71
|
+
- `ColorPicker` - Color selection input
|
|
72
|
+
- `Heading` - Typography headings
|
|
73
|
+
- `Input` - Text input fields
|
|
74
|
+
- `OptimizedImage` - Performance-optimized images
|
|
75
|
+
- `Select` - Dropdown selections
|
|
76
|
+
- `Skeleton` - Loading placeholders
|
|
77
|
+
- `Textarea` - Multi-line text input
|
|
78
|
+
- `TextAlignment` - Text alignment controls
|
|
79
|
+
- `Toggle` - Switch controls
|
|
80
|
+
|
|
81
|
+
### Molecules
|
|
82
|
+
Simple combinations of atoms:
|
|
83
|
+
- `Alert` - Notification messages
|
|
84
|
+
- `Modal` - Overlay dialogs
|
|
85
|
+
- `FileUpload` - File upload interface
|
|
86
|
+
- `DynamicForm` - Dynamic form builder
|
|
87
|
+
- `Dropdown` - Dropdown menus
|
|
88
|
+
- `SlideUp` - Slide-up animations
|
|
89
|
+
|
|
90
|
+
### Organisms
|
|
91
|
+
Complex components with state management:
|
|
92
|
+
- `ToastContainer` - Notification management system
|
|
93
|
+
|
|
94
|
+
## TypeScript Support
|
|
95
|
+
|
|
96
|
+
The library includes comprehensive TypeScript definitions:
|
|
97
|
+
|
|
98
|
+
```typescript
|
|
99
|
+
import type { FieldConfig } from 'zabi-components';
|
|
100
|
+
|
|
101
|
+
const formConfig: FieldConfig[] = [
|
|
102
|
+
{
|
|
103
|
+
key: 'email',
|
|
104
|
+
type: 'email',
|
|
105
|
+
label: 'Email Address',
|
|
106
|
+
required: true
|
|
107
|
+
}
|
|
108
|
+
];
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Styling
|
|
112
|
+
|
|
113
|
+
Components are styled with Tailwind CSS. Make sure to include Tailwind in your project:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
npm install -D tailwindcss
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Development
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
# Install dependencies
|
|
123
|
+
npm install
|
|
124
|
+
|
|
125
|
+
# Start development server
|
|
126
|
+
npm run dev
|
|
127
|
+
|
|
128
|
+
# Build library
|
|
129
|
+
npm run build:lib
|
|
130
|
+
|
|
131
|
+
# Run Storybook
|
|
132
|
+
npm run storybook
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Publishing
|
|
136
|
+
|
|
137
|
+
To publish your component library:
|
|
138
|
+
|
|
139
|
+
1. **Update version** in `package.json`
|
|
140
|
+
2. **Build the library**: `npm run build:lib`
|
|
141
|
+
3. **Test locally**: `npm pack` to create a tarball
|
|
142
|
+
4. **Publish**: `npm publish`
|
|
143
|
+
|
|
144
|
+
## License
|
|
145
|
+
|
|
146
|
+
MIT
|