@abstraks-dev/ui-library 2.1.0 → 2.1.1
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 +258 -3
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -5,27 +5,282 @@ A comprehensive React UI component library with modern styling and robust testin
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm install ui-library
|
|
8
|
+
npm install @abstraks-dev/ui-library
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
13
|
```jsx
|
|
14
|
-
import {
|
|
15
|
-
|
|
14
|
+
import {
|
|
15
|
+
Button,
|
|
16
|
+
Card,
|
|
17
|
+
TextInput,
|
|
18
|
+
Header,
|
|
19
|
+
Hero,
|
|
20
|
+
Alert,
|
|
21
|
+
} from '@abstraks-dev/ui-library';
|
|
22
|
+
import '@abstraks-dev/ui-library/dist/styles/main.css';
|
|
16
23
|
|
|
17
24
|
function App() {
|
|
18
25
|
return (
|
|
19
26
|
<div>
|
|
27
|
+
<Header />
|
|
28
|
+
<Hero title='Welcome' subtitle='Get started with our UI library' />
|
|
29
|
+
<Alert type='success' message='Library loaded successfully!' />
|
|
20
30
|
<Card>
|
|
21
31
|
<TextInput label='Name' placeholder='Enter your name' />
|
|
22
32
|
<Button variant='primary'>Submit</Button>
|
|
33
|
+
<Button variant='transparent'>Cancel</Button>
|
|
23
34
|
</Card>
|
|
24
35
|
</div>
|
|
25
36
|
);
|
|
26
37
|
}
|
|
27
38
|
```
|
|
28
39
|
|
|
40
|
+
## Available Components
|
|
41
|
+
|
|
42
|
+
### Core Components
|
|
43
|
+
|
|
44
|
+
#### Button
|
|
45
|
+
|
|
46
|
+
Multiple variants and sizes with accessibility support.
|
|
47
|
+
|
|
48
|
+
```jsx
|
|
49
|
+
<Button variant="primary" size="md">Primary Button</Button>
|
|
50
|
+
<Button variant="secondary" size="lg">Secondary Button</Button>
|
|
51
|
+
<Button variant="transparent" size="sm">Transparent Button</Button>
|
|
52
|
+
<Button variant="error" isOutline={true}>Error Outline</Button>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Available variants: `primary`, `secondary`, `success`, `error`, `warning`, `transparent`
|
|
56
|
+
Available sizes: `xs`, `sm`, `md`, `lg`, `xl`
|
|
57
|
+
|
|
58
|
+
#### Card
|
|
59
|
+
|
|
60
|
+
Container component for grouping related content.
|
|
61
|
+
|
|
62
|
+
```jsx
|
|
63
|
+
<Card>
|
|
64
|
+
<h3>Card Title</h3>
|
|
65
|
+
<p>Card content goes here</p>
|
|
66
|
+
</Card>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
#### Header
|
|
70
|
+
|
|
71
|
+
Navigation header with authentication support.
|
|
72
|
+
|
|
73
|
+
```jsx
|
|
74
|
+
<Header />
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
#### Hero
|
|
78
|
+
|
|
79
|
+
Hero section component for landing pages.
|
|
80
|
+
|
|
81
|
+
```jsx
|
|
82
|
+
<Hero
|
|
83
|
+
title='Welcome to Our App'
|
|
84
|
+
subtitle='Build amazing experiences with our UI library'
|
|
85
|
+
/>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Form Components
|
|
89
|
+
|
|
90
|
+
#### TextInput
|
|
91
|
+
|
|
92
|
+
Text input with label and validation support.
|
|
93
|
+
|
|
94
|
+
```jsx
|
|
95
|
+
<TextInput label='Email' placeholder='Enter your email' type='email' />
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
#### TextArea
|
|
99
|
+
|
|
100
|
+
Multi-line text input.
|
|
101
|
+
|
|
102
|
+
```jsx
|
|
103
|
+
<TextArea label='Message' placeholder='Enter your message' rows={4} />
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
#### Checkbox
|
|
107
|
+
|
|
108
|
+
Checkbox input with label.
|
|
109
|
+
|
|
110
|
+
```jsx
|
|
111
|
+
<Checkbox name='subscribe' label='Subscribe to newsletter' />
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
#### Radio
|
|
115
|
+
|
|
116
|
+
Radio button input.
|
|
117
|
+
|
|
118
|
+
```jsx
|
|
119
|
+
<Radio name="gender" value="male" label="Male" />
|
|
120
|
+
<Radio name="gender" value="female" label="Female" />
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
#### Select
|
|
124
|
+
|
|
125
|
+
Dropdown select component.
|
|
126
|
+
|
|
127
|
+
```jsx
|
|
128
|
+
<Select
|
|
129
|
+
label='Country'
|
|
130
|
+
options={[
|
|
131
|
+
{ value: 'us', label: 'United States' },
|
|
132
|
+
{ value: 'ca', label: 'Canada' },
|
|
133
|
+
]}
|
|
134
|
+
/>
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
#### FileInput
|
|
138
|
+
|
|
139
|
+
File upload component.
|
|
140
|
+
|
|
141
|
+
```jsx
|
|
142
|
+
<FileInput label='Upload Document' accept='.pdf,.doc,.docx' />
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Layout Components
|
|
146
|
+
|
|
147
|
+
#### Form
|
|
148
|
+
|
|
149
|
+
Form wrapper with validation support.
|
|
150
|
+
|
|
151
|
+
```jsx
|
|
152
|
+
<Form onSubmit={handleSubmit}>
|
|
153
|
+
<TextInput label='Name' />
|
|
154
|
+
<Button type='submit'>Submit</Button>
|
|
155
|
+
</Form>
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
#### Tabs
|
|
159
|
+
|
|
160
|
+
Tabbed content component.
|
|
161
|
+
|
|
162
|
+
```jsx
|
|
163
|
+
<Tabs>
|
|
164
|
+
<Tab label='Tab 1'>Content 1</Tab>
|
|
165
|
+
<Tab label='Tab 2'>Content 2</Tab>
|
|
166
|
+
</Tabs>
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Feedback Components
|
|
170
|
+
|
|
171
|
+
#### Alert
|
|
172
|
+
|
|
173
|
+
Alert messages with different types.
|
|
174
|
+
|
|
175
|
+
```jsx
|
|
176
|
+
<Alert type="success" message="Operation completed!" />
|
|
177
|
+
<Alert type="error" message="Something went wrong!" />
|
|
178
|
+
<Alert type="warning" message="Please check your input!" />
|
|
179
|
+
<Alert type="info" message="New features available!" />
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
#### Error
|
|
183
|
+
|
|
184
|
+
Error message component.
|
|
185
|
+
|
|
186
|
+
```jsx
|
|
187
|
+
<Error severity='error'>Please fill in all required fields</Error>
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
#### Loader
|
|
191
|
+
|
|
192
|
+
Loading spinner component.
|
|
193
|
+
|
|
194
|
+
```jsx
|
|
195
|
+
<Loader size='large' />
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### Navigation Components
|
|
199
|
+
|
|
200
|
+
#### Search
|
|
201
|
+
|
|
202
|
+
Search input with results.
|
|
203
|
+
|
|
204
|
+
```jsx
|
|
205
|
+
<Search placeholder='Search...' onSearch={handleSearch} />
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
#### SideMenu
|
|
209
|
+
|
|
210
|
+
Collapsible side navigation menu.
|
|
211
|
+
|
|
212
|
+
```jsx
|
|
213
|
+
<SideMenu />
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### Utility Components
|
|
217
|
+
|
|
218
|
+
#### Avatar
|
|
219
|
+
|
|
220
|
+
User avatar component.
|
|
221
|
+
|
|
222
|
+
```jsx
|
|
223
|
+
<Avatar src='user-photo.jpg' alt='John Doe' size='large' />
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
#### Anchor
|
|
227
|
+
|
|
228
|
+
Accessible link component.
|
|
229
|
+
|
|
230
|
+
```jsx
|
|
231
|
+
<Anchor href='/about'>About Us</Anchor>
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### Typography Components
|
|
235
|
+
|
|
236
|
+
#### Heading
|
|
237
|
+
|
|
238
|
+
Semantic heading component.
|
|
239
|
+
|
|
240
|
+
```jsx
|
|
241
|
+
<Heading level={1} variant="primary">Main Title</Heading>
|
|
242
|
+
<Heading level={2} variant="secondary">Subtitle</Heading>
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
#### Paragraph
|
|
246
|
+
|
|
247
|
+
Paragraph text component.
|
|
248
|
+
|
|
249
|
+
```jsx
|
|
250
|
+
<Paragraph size='large'>This is a paragraph with large text.</Paragraph>
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
#### Label
|
|
254
|
+
|
|
255
|
+
Form label component.
|
|
256
|
+
|
|
257
|
+
```jsx
|
|
258
|
+
<Label htmlFor='email' required>
|
|
259
|
+
Email Address
|
|
260
|
+
</Label>
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
### Icons
|
|
264
|
+
|
|
265
|
+
The library includes a comprehensive set of icons:
|
|
266
|
+
|
|
267
|
+
```jsx
|
|
268
|
+
import {
|
|
269
|
+
Heart,
|
|
270
|
+
Home,
|
|
271
|
+
Search,
|
|
272
|
+
ArrowRight,
|
|
273
|
+
CheckCircle,
|
|
274
|
+
LoadingSpinner
|
|
275
|
+
} from '@abstraks-dev/ui-library';
|
|
276
|
+
|
|
277
|
+
<Heart size={24} color="red" />
|
|
278
|
+
<Home size={20} />
|
|
279
|
+
<ArrowRight dimensions={16} />
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
Available icons: `AccountBox`, `AccountCircle`, `ArrowIcon`, `ArrowRight`, `BookOpen`, `CameraIcon`, `CaretDown`, `CheckCircle`, `ChevronDown`, `Close`, `Comment`, `EditSquare`, `Ellipses`, `Explore`, `Filter`, `Group`, `GroupReview`, `Hamburger`, `Heart`, `Home`, `LoadingSpinner`, `LogOut`, `Magnify`, `News`, `PlusCircle`, `Review`, `SaveIcon`, `TrashX`
|
|
283
|
+
|
|
29
284
|
## Development
|
|
30
285
|
|
|
31
286
|
### Setup
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abstraks-dev/ui-library",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "User Interface library",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"files": [
|
|
@@ -78,8 +78,8 @@
|
|
|
78
78
|
"animate.css": "^4.1.1",
|
|
79
79
|
"libphonenumber-js": "^1.12.10",
|
|
80
80
|
"react-transition-group": "^4.4.5",
|
|
81
|
-
"uuid": "^
|
|
82
|
-
"validator": "^13.15.
|
|
81
|
+
"uuid": "^13.0.0",
|
|
82
|
+
"validator": "^13.15.20"
|
|
83
83
|
},
|
|
84
84
|
"bugs": {
|
|
85
85
|
"url": "https://github.com/Abstraks-co/ui-library/issues"
|