pure-react-ui 1.5.4 → 1.5.6

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
@@ -1,505 +1,558 @@
1
- # Pure React UI
2
-
3
- A pure React UI component library built with TypeScript. No external dependencies required (except React and ReactDOM as peer dependencies).
4
-
5
- ## Installation
6
-
7
- ```bash
8
- npm install pure-react-ui
9
- ```
10
-
11
- ## Components
12
-
13
- ### Button
14
-
15
- A versatile button component with multiple variants and sizes.
16
-
17
- ```tsx
18
- import { Button } from 'pure-react-ui';
19
-
20
- <Button variant="primary" size="medium" onClick={handleClick}>
21
- Click Me
22
- </Button>
23
- ```
24
-
25
- **Props:**
26
- - `variant`: 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' (default: 'primary')
27
- - `size`: 'small' | 'medium' | 'large' (default: 'medium')
28
- - `fullWidth`: boolean (default: false)
29
- - `loading`: boolean (default: false)
30
- - All standard button HTML attributes
31
-
32
- ### Card
33
-
34
- A flexible card component for displaying content.
35
-
36
- ```tsx
37
- import { Card } from 'pure-react-ui';
38
-
39
- <Card
40
- title="Card Title"
41
- subtitle="Card Subtitle"
42
- image="/path/to/image.jpg"
43
- hoverable
44
- shadow="medium"
45
- >
46
- Card content goes here
47
- </Card>
48
- ```
49
-
50
- **Props:**
51
- - `title`: string (optional)
52
- - `subtitle`: string (optional)
53
- - `image`: string (optional)
54
- - `imageAlt`: string (optional)
55
- - `footer`: React.ReactNode (optional)
56
- - `hoverable`: boolean (default: false)
57
- - `shadow`: 'none' | 'small' | 'medium' | 'large' (default: 'medium')
58
- - `onClick`: () => void (optional)
59
-
60
- ### Modal
61
-
62
- A modal dialog component with overlay and keyboard support.
63
-
64
- ```tsx
65
- import { Modal } from 'pure-react-ui';
66
-
67
- <Modal
68
- isOpen={isOpen}
69
- onClose={() => setIsOpen(false)}
70
- title="Modal Title"
71
- size="medium"
72
- >
73
- Modal content goes here
74
- </Modal>
75
- ```
76
-
77
- **Props:**
78
- - `isOpen`: boolean (required)
79
- - `onClose`: () => void (required)
80
- - `title`: string | React.ReactNode (optional) - Modal title or custom header content
81
- - `size`: 'small' | 'medium' | 'large' | 'fullscreen' (default: 'medium')
82
- - `position`: 'center' | 'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' (default: 'center')
83
- - `variant`: 'default' | 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'gradient-primary' | 'gradient-success' | 'gradient-danger' | 'gradient-info' (default: 'default')
84
- - `closeOnOverlayClick`: boolean (default: true)
85
- - `closeOnEscape`: boolean (default: true)
86
- - `showCloseButton`: boolean (default: true)
87
- - `scrollable`: boolean (default: true) - Enable scrolling for modal body
88
- - `topMargin`: number | string (optional) - Custom top margin for modal
89
- - `className`: string (optional) - Additional CSS classes
90
- - `overlayClassName`: string (optional) - Additional CSS classes for overlay
91
- - `headerClassName`: string (optional) - Additional CSS classes for header
92
- - `bodyClassName`: string (optional) - Additional CSS classes for body
93
-
94
- ### Icon
95
-
96
- A comprehensive icon component library with 100+ SVG icons.
97
-
98
- ```tsx
99
- import { Icon } from 'pure-react-ui';
100
-
101
- <Icon name="Home" size={24} color="#007bff" />
102
- <Icon name="Search" size={32} onClick={handleClick} />
103
- ```
104
-
105
- **Props:**
106
- - `name`: IconName (required) - Name of the icon to display
107
- - `size`: number | string (default: 24) - Size of the icon
108
- - `color`: string (default: 'currentColor') - Color of the icon
109
- - `className`: string (optional) - Additional CSS classes
110
- - `onClick`: () => void (optional) - Click handler (makes icon clickable)
111
-
112
- **Available Icons:**
113
-
114
- **Arrows & Navigation:**
115
- ArrowLeft, ArrowRight, ArrowUp, ArrowDown, ArrowUpRight, ArrowDownRight, ChevronLeft, ChevronRight, ChevronUp, ChevronDown, DoubleChevronLeft, DoubleChevronRight, Home, Menu, Close, Search, Filter
116
-
117
- **Actions:**
118
- Plus, Minus, Check, X, Edit, Trash, Save, Download, Upload, Copy, Share
119
-
120
- **Media:**
121
- Play, Pause, Stop, VolumeUp, VolumeDown, VolumeOff, Image, Video, Camera
122
-
123
- **Communication:**
124
- Mail, Message, Phone, Bell, Notification
125
-
126
- **Files:**
127
- File, Folder, FolderOpen, FileText, FilePdf
128
-
129
- **User:**
130
- User, Users, UserPlus, UserMinus, Settings, Logout
131
-
132
- **Status:**
133
- CheckCircle, XCircle, AlertCircle, Info, Warning, Star, Heart, Bookmark
134
-
135
- **Social:**
136
- Facebook, Twitter, Instagram, Linkedin, Github, Youtube
137
-
138
- **Technology:**
139
- Wifi, Bluetooth, Battery, Zap, Lock, Unlock, Shield
140
-
141
- **Shopping:**
142
- ShoppingCart, ShoppingBag, CreditCard, Gift
143
-
144
- **Time:**
145
- Clock, Calendar, Timer
146
-
147
- **Location:**
148
- MapPin, Globe, Navigation
149
-
150
- **Weather:**
151
- Sun, Moon, Cloud
152
-
153
- **Utility:**
154
- Eye, EyeOff, Refresh, MoreVertical, MoreHorizontal, Grid, List
155
-
156
- You can also import individual icons directly:
157
- ```tsx
158
- import { Home, Search, User } from 'pure-react-ui';
159
-
160
- <Home size={24} color="#007bff" />
161
- ```
162
-
163
- ### Space
164
-
165
- A layout component for adding consistent spacing between elements.
166
-
167
- ```tsx
168
- import { Space } from 'pure-react-ui';
169
-
170
- <Space size="medium" direction="horizontal">
171
- <Button>Button 1</Button>
172
- <Button>Button 2</Button>
173
- <Button>Button 3</Button>
174
- </Space>
175
-
176
- <Space size={20} direction="vertical" align="start">
177
- <Card>Card 1</Card>
178
- <Card>Card 2</Card>
179
- </Space>
180
- ```
181
-
182
- **Props:**
183
- - `size`: 'small' | 'medium' | 'large' | number (default: 'medium') - Spacing size between items
184
- - `direction`: 'horizontal' | 'vertical' (default: 'horizontal') - Direction of spacing
185
- - `align`: 'start' | 'end' | 'center' | 'baseline' | 'stretch' (default: 'center') - Alignment of items
186
- - `wrap`: boolean (default: false) - Whether items should wrap to next line
187
- - `className`: string (optional) - Additional CSS classes
188
-
189
- ### Flex
190
-
191
- A flexible container component based on CSS Flexbox.
192
-
193
- ```tsx
194
- import { Flex } from 'pure-react-ui';
195
-
196
- <Flex direction="row" justify="between" align="center" gap="medium">
197
- <Button>Left</Button>
198
- <Button>Center</Button>
199
- <Button>Right</Button>
200
- </Flex>
201
-
202
- <Flex direction="column" justify="start" align="stretch" gap={16}>
203
- <Card>Card 1</Card>
204
- <Card>Card 2</Card>
205
- </Flex>
206
- ```
207
-
208
- **Props:**
209
- - `direction`: 'row' | 'column' | 'row-reverse' | 'column-reverse' (default: 'row') - Flex direction
210
- - `justify`: 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly' (default: 'start') - Justify content
211
- - `align`: 'start' | 'end' | 'center' | 'baseline' | 'stretch' (default: 'start') - Align items
212
- - `wrap`: boolean | 'wrap' | 'nowrap' | 'wrap-reverse' (default: false) - Flex wrap behavior
213
- - `gap`: 'none' | 'small' | 'medium' | 'large' | number (default: 'none') - Gap between items
214
- - `className`: string (optional) - Additional CSS classes
215
- - `style`: React.CSSProperties (optional) - Additional inline styles
216
-
217
- ### Text
218
-
219
- A typography component for consistent text styling with various options.
220
-
221
- ```tsx
222
- import { Text } from 'pure-react-ui';
223
-
224
- <Text as="h1" size="2xl" weight="bold" color="primary">
225
- Heading Text
226
- </Text>
227
-
228
- <Text size="lg" color="muted" align="center">
229
- Centered paragraph text
230
- </Text>
231
-
232
- <Text as="span" size="sm" decoration="underline" transform="uppercase">
233
- Styled Text
234
- </Text>
235
- ```
236
-
237
- **Props:**
238
- - `as`: 'p' | 'span' | 'div' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'label' | 'small' | 'strong' | 'em' | 'code' | 'pre' (default: 'p') - HTML element to render
239
- - `size`: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' (default: 'md') - Font size
240
- - `weight`: 'light' | 'normal' | 'medium' | 'semibold' | 'bold' (default: 'normal') - Font weight
241
- - `color`: 'default' | 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'muted' (default: 'default') - Text color
242
- - `align`: 'left' | 'center' | 'right' | 'justify' (default: 'left') - Text alignment
243
- - `transform`: 'none' | 'uppercase' | 'lowercase' | 'capitalize' (default: 'none') - Text transform
244
- - `decoration`: 'none' | 'underline' | 'line-through' | 'overline' (default: 'none') - Text decoration
245
- - `truncate`: boolean (default: false) - Truncate text with ellipsis
246
- - `className`: string (optional) - Additional CSS classes
247
-
248
- ### Form Components
249
-
250
- A comprehensive form component system with all form elements.
251
-
252
- #### Form
253
-
254
- The main form container component.
255
-
256
- ```tsx
257
- import { Form } from 'pure-react-ui';
258
-
259
- <Form layout="vertical" onSubmit={handleSubmit}>
260
- {/* Form fields */}
261
- </Form>
262
- ```
263
-
264
- **Props:**
265
- - `layout`: 'vertical' | 'horizontal' | 'inline' (default: 'vertical')
266
- - `size`: 'small' | 'medium' | 'large' (default: 'medium')
267
- - `onSubmit`: (e: React.FormEvent) => void (optional)
268
- - All standard form HTML attributes
269
-
270
- #### Input
271
-
272
- Text input field with validation and icons.
273
-
274
- ```tsx
275
- import { Input } from 'pure-react-ui';
276
-
277
- <Input
278
- label="Email"
279
- type="email"
280
- placeholder="Enter email"
281
- error={errors.email}
282
- helpText="We'll never share your email"
283
- leftIcon={<Icon name="Mail" />}
284
- fullWidth
285
- />
286
- ```
287
-
288
- **Props:**
289
- - `label`: string (optional)
290
- - `error`: string (optional) - Error message
291
- - `helpText`: string (optional) - Help text
292
- - `leftIcon`: React.ReactNode (optional)
293
- - `rightIcon`: React.ReactNode (optional)
294
- - `fullWidth`: boolean (default: false)
295
- - `size`: 'small' | 'medium' | 'large' (default: 'medium')
296
- - All standard input HTML attributes
297
-
298
- #### Textarea
299
-
300
- Multi-line text input.
301
-
302
- ```tsx
303
- import { Textarea } from 'pure-react-ui';
304
-
305
- <Textarea
306
- label="Message"
307
- placeholder="Enter your message"
308
- rows={4}
309
- resize="vertical"
310
- fullWidth
311
- />
312
- ```
313
-
314
- **Props:**
315
- - `label`: string (optional)
316
- - `error`: string (optional)
317
- - `helpText`: string (optional)
318
- - `fullWidth`: boolean (default: false)
319
- - `size`: 'small' | 'medium' | 'large' (default: 'medium')
320
- - `rows`: number (default: 4)
321
- - `resize`: 'none' | 'both' | 'horizontal' | 'vertical' (default: 'vertical')
322
- - All standard textarea HTML attributes
323
-
324
- #### Select
325
-
326
- Dropdown select component.
327
-
328
- ```tsx
329
- import { Select } from 'pure-react-ui';
330
-
331
- <Select
332
- label="Country"
333
- options={[
334
- { value: 'us', label: 'United States' },
335
- { value: 'uk', label: 'United Kingdom' }
336
- ]}
337
- placeholder="Choose a country"
338
- fullWidth
339
- />
340
- ```
341
-
342
- **Props:**
343
- - `label`: string (optional)
344
- - `error`: string (optional)
345
- - `helpText`: string (optional)
346
- - `options`: SelectOption[] (required)
347
- - `placeholder`: string (optional)
348
- - `fullWidth`: boolean (default: false)
349
- - `size`: 'small' | 'medium' | 'large' (default: 'medium')
350
- - All standard select HTML attributes
351
-
352
- #### Checkbox
353
-
354
- Checkbox input with custom styling.
355
-
356
- ```tsx
357
- import { Checkbox } from 'pure-react-ui';
358
-
359
- <Checkbox
360
- label="I agree to terms"
361
- checked={checked}
362
- onChange={(e) => setChecked(e.target.checked)}
363
- />
364
- ```
365
-
366
- **Props:**
367
- - `label`: string (optional)
368
- - `error`: string (optional)
369
- - `helpText`: string (optional)
370
- - `fullWidth`: boolean (default: false)
371
- - `size`: 'small' | 'medium' | 'large' (default: 'medium')
372
- - All standard checkbox HTML attributes
373
-
374
- #### Radio
375
-
376
- Radio button input.
377
-
378
- ```tsx
379
- import { Radio } from 'pure-react-ui';
380
-
381
- <Radio
382
- label="Option 1"
383
- name="option"
384
- value="1"
385
- checked={selected === '1'}
386
- onChange={(e) => setSelected(e.target.value)}
387
- />
388
- ```
389
-
390
- **Props:**
391
- - `label`: string (optional)
392
- - `error`: string (optional)
393
- - `helpText`: string (optional)
394
- - `fullWidth`: boolean (default: false)
395
- - `size`: 'small' | 'medium' | 'large' (default: 'medium')
396
- - All standard radio HTML attributes
397
-
398
- #### Switch
399
-
400
- Toggle switch component.
401
-
402
- ```tsx
403
- import { Switch } from 'pure-react-ui';
404
-
405
- <Switch
406
- label="Enable notifications"
407
- checked={enabled}
408
- onChange={(e) => setEnabled(e.target.checked)}
409
- />
410
- ```
411
-
412
- **Props:**
413
- - `label`: string (optional)
414
- - `error`: string (optional)
415
- - `helpText`: string (optional)
416
- - `fullWidth`: boolean (default: false)
417
- - `size`: 'small' | 'medium' | 'large' (default: 'medium')
418
- - All standard checkbox HTML attributes (used as switch)
419
-
420
- #### FormGroup
421
-
422
- Container for grouping form fields.
423
-
424
- ```tsx
425
- import { FormGroup } from 'pure-react-ui';
426
-
427
- <FormGroup label="Personal Information" required>
428
- <Input label="Name" />
429
- <Input label="Email" />
430
- </FormGroup>
431
- ```
432
-
433
- **Props:**
434
- - `label`: string (optional)
435
- - `error`: string (optional)
436
- - `helpText`: string (optional)
437
- - `required`: boolean (default: false)
438
- - `className`: string (optional)
439
-
440
- #### FormRow
441
-
442
- Horizontal row for form fields.
443
-
444
- ```tsx
445
- import { FormRow } from 'pure-react-ui';
446
-
447
- <FormRow gap="medium">
448
- <Input label="First Name" fullWidth />
449
- <Input label="Last Name" fullWidth />
450
- </FormRow>
451
- ```
452
-
453
- **Props:**
454
- - `gap`: 'small' | 'medium' | 'large' | number (default: 'medium')
455
- - `className`: string (optional)
456
-
457
- ## Styling
458
-
459
- All components include their own CSS files and use CSS classes with the `pure-` prefix. The CSS files are automatically imported with each component. You can also style them by targeting these classes:
460
-
461
- - **Button**: `pure-button`, `pure-button--primary`, `pure-button--secondary`, etc.
462
- - **Card**: `pure-card`, `pure-card--hoverable`, `pure-card--shadow-medium`, etc.
463
- - **Modal**: `pure-modal`, `pure-modal__overlay`, `pure-modal__header`, etc.
464
- - **Icon**: `pure-icon`, `pure-icon--clickable`, `pure-icon--small`, etc.
465
- - **Space**: `pure-space`, `pure-space--horizontal`, `pure-space--vertical`, etc.
466
- - **Flex**: `pure-flex`, `pure-flex--row`, `pure-flex--column`, etc.
467
- - **Text**: `pure-text`, `pure-text--lg`, `pure-text--bold`, etc.
468
- - **Form**: `pure-form`, `pure-form--vertical`, `pure-form--horizontal`, etc.
469
- - **Input**: `pure-input`, `pure-input--error`, `pure-input--small`, etc.
470
- - **Textarea**: `pure-textarea`, `pure-textarea--error`, etc.
471
- - **Select**: `pure-select`, `pure-select--error`, etc.
472
- - **Checkbox**: `pure-checkbox`, `pure-checkbox--error`, etc.
473
- - **Radio**: `pure-radio`, `pure-radio--error`, etc.
474
- - **Switch**: `pure-switch`, `pure-switch--error`, etc.
475
-
476
- Each component has its own CSS file located in:
477
- - `lib/components/Button/Button.css`
478
- - `lib/components/Card/Card.css`
479
- - `lib/components/Modal/Modal.css`
480
- - `lib/components/Icon/Icon.css`
481
- - `lib/components/Space/Space.css`
482
- - `lib/components/Flex/Flex.css`
483
- - `lib/components/Text/Text.css`
484
- - `lib/components/Form/Form.css`
485
-
486
- ## Examples
487
-
488
- A complete example application is available in the `example` directory. To run it:
489
-
490
- ```bash
491
- # From the root directory, build the package first
492
- npm run build
493
-
494
- # Then navigate to example directory
495
- cd example
496
- npm install
497
- npm run dev
498
- ```
499
-
500
- Or check out `EXAMPLES.md` for code examples and usage patterns.
501
-
502
- ## License
503
-
504
- MIT
505
-
1
+ # Pure React UI
2
+
3
+ A pure React UI component library built with TypeScript. No external dependencies required (except React and ReactDOM as peer dependencies).
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install pure-react-ui
9
+ ```
10
+
11
+ **Note:** The `Select` component requires `react-select` as a peer dependency. If you're using the Select component, make sure to install it:
12
+
13
+ ```bash
14
+ npm install react-select
15
+ ```
16
+
17
+ ## Components
18
+
19
+ ### Button
20
+
21
+ A versatile button component with multiple variants and sizes.
22
+
23
+ ```tsx
24
+ import { Button } from 'pure-react-ui';
25
+
26
+ <Button variant="primary" size="medium" onClick={handleClick}>
27
+ Click Me
28
+ </Button>
29
+ ```
30
+
31
+ **Props:**
32
+ - `variant`: 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' (default: 'primary')
33
+ - `size`: 'small' | 'medium' | 'large' (default: 'medium')
34
+ - `fullWidth`: boolean (default: false)
35
+ - `loading`: boolean (default: false)
36
+ - All standard button HTML attributes
37
+
38
+ ### Card
39
+
40
+ A flexible card component for displaying content.
41
+
42
+ ```tsx
43
+ import { Card } from 'pure-react-ui';
44
+
45
+ <Card
46
+ title="Card Title"
47
+ subtitle="Card Subtitle"
48
+ image="/path/to/image.jpg"
49
+ hoverable
50
+ shadow="medium"
51
+ >
52
+ Card content goes here
53
+ </Card>
54
+ ```
55
+
56
+ **Props:**
57
+ - `title`: string (optional)
58
+ - `subtitle`: string (optional)
59
+ - `image`: string (optional)
60
+ - `imageAlt`: string (optional)
61
+ - `footer`: React.ReactNode (optional)
62
+ - `hoverable`: boolean (default: false)
63
+ - `shadow`: 'none' | 'small' | 'medium' | 'large' (default: 'medium')
64
+ - `onClick`: () => void (optional)
65
+
66
+ ### Modal
67
+
68
+ A modal dialog component with overlay and keyboard support.
69
+
70
+ ```tsx
71
+ import { Modal } from 'pure-react-ui';
72
+
73
+ <Modal
74
+ isOpen={isOpen}
75
+ onClose={() => setIsOpen(false)}
76
+ title="Modal Title"
77
+ size="medium"
78
+ >
79
+ Modal content goes here
80
+ </Modal>
81
+ ```
82
+
83
+ **Props:**
84
+ - `isOpen`: boolean (required)
85
+ - `onClose`: () => void (required)
86
+ - `title`: string | React.ReactNode (optional) - Modal title or custom header content
87
+ - `size`: 'small' | 'medium' | 'large' | 'fullscreen' (default: 'medium')
88
+ - `position`: 'center' | 'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' (default: 'center')
89
+ - `variant`: 'default' | 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'gradient-primary' | 'gradient-success' | 'gradient-danger' | 'gradient-info' (default: 'default')
90
+ - `closeOnOverlayClick`: boolean (default: true)
91
+ - `closeOnEscape`: boolean (default: true)
92
+ - `showCloseButton`: boolean (default: true)
93
+ - `scrollable`: boolean (default: true) - Enable scrolling for modal body
94
+ - `topMargin`: number | string (optional) - Custom top margin for modal
95
+ - `className`: string (optional) - Additional CSS classes
96
+ - `overlayClassName`: string (optional) - Additional CSS classes for overlay
97
+ - `headerClassName`: string (optional) - Additional CSS classes for header
98
+ - `bodyClassName`: string (optional) - Additional CSS classes for body
99
+
100
+ ### Icon
101
+
102
+ A comprehensive icon component library with 100+ SVG icons.
103
+
104
+ ```tsx
105
+ import { Icon } from 'pure-react-ui';
106
+
107
+ <Icon name="Home" size={24} color="#007bff" />
108
+ <Icon name="Search" size={32} onClick={handleClick} />
109
+ ```
110
+
111
+ **Props:**
112
+ - `name`: IconName (required) - Name of the icon to display
113
+ - `size`: number | string (default: 24) - Size of the icon
114
+ - `color`: string (default: 'currentColor') - Color of the icon
115
+ - `className`: string (optional) - Additional CSS classes
116
+ - `onClick`: () => void (optional) - Click handler (makes icon clickable)
117
+
118
+ **Available Icons:**
119
+
120
+ **Arrows & Navigation:**
121
+ ArrowLeft, ArrowRight, ArrowUp, ArrowDown, ArrowUpRight, ArrowDownRight, ChevronLeft, ChevronRight, ChevronUp, ChevronDown, DoubleChevronLeft, DoubleChevronRight, Home, Menu, Close, Search, Filter
122
+
123
+ **Actions:**
124
+ Plus, Minus, Check, X, Edit, Trash, Save, Download, Upload, Copy, Share
125
+
126
+ **Media:**
127
+ Play, Pause, Stop, VolumeUp, VolumeDown, VolumeOff, Image, Video, Camera
128
+
129
+ **Communication:**
130
+ Mail, Message, Phone, Bell, Notification
131
+
132
+ **Files:**
133
+ File, Folder, FolderOpen, FileText, FilePdf
134
+
135
+ **User:**
136
+ User, Users, UserPlus, UserMinus, Settings, Logout
137
+
138
+ **Status:**
139
+ CheckCircle, XCircle, AlertCircle, Info, Warning, Star, Heart, Bookmark
140
+
141
+ **Social:**
142
+ Facebook, Twitter, Instagram, Linkedin, Github, Youtube
143
+
144
+ **Technology:**
145
+ Wifi, Bluetooth, Battery, Zap, Lock, Unlock, Shield
146
+
147
+ **Shopping:**
148
+ ShoppingCart, ShoppingBag, CreditCard, Gift
149
+
150
+ **Time:**
151
+ Clock, Calendar, Timer
152
+
153
+ **Location:**
154
+ MapPin, Globe, Navigation
155
+
156
+ **Weather:**
157
+ Sun, Moon, Cloud
158
+
159
+ **Utility:**
160
+ Eye, EyeOff, Refresh, MoreVertical, MoreHorizontal, Grid, List
161
+
162
+ You can also import individual icons directly:
163
+ ```tsx
164
+ import { Home, Search, User } from 'pure-react-ui';
165
+
166
+ <Home size={24} color="#007bff" />
167
+ ```
168
+
169
+ ### Space
170
+
171
+ A layout component for adding consistent spacing between elements.
172
+
173
+ ```tsx
174
+ import { Space } from 'pure-react-ui';
175
+
176
+ <Space size="medium" direction="horizontal">
177
+ <Button>Button 1</Button>
178
+ <Button>Button 2</Button>
179
+ <Button>Button 3</Button>
180
+ </Space>
181
+
182
+ <Space size={20} direction="vertical" align="start">
183
+ <Card>Card 1</Card>
184
+ <Card>Card 2</Card>
185
+ </Space>
186
+ ```
187
+
188
+ **Props:**
189
+ - `size`: 'small' | 'medium' | 'large' | number (default: 'medium') - Spacing size between items
190
+ - `direction`: 'horizontal' | 'vertical' (default: 'horizontal') - Direction of spacing
191
+ - `align`: 'start' | 'end' | 'center' | 'baseline' | 'stretch' (default: 'center') - Alignment of items
192
+ - `wrap`: boolean (default: false) - Whether items should wrap to next line
193
+ - `className`: string (optional) - Additional CSS classes
194
+
195
+ ### Flex
196
+
197
+ A flexible container component based on CSS Flexbox.
198
+
199
+ ```tsx
200
+ import { Flex } from 'pure-react-ui';
201
+
202
+ <Flex direction="row" justify="between" align="center" gap="medium">
203
+ <Button>Left</Button>
204
+ <Button>Center</Button>
205
+ <Button>Right</Button>
206
+ </Flex>
207
+
208
+ <Flex direction="column" justify="start" align="stretch" gap={16}>
209
+ <Card>Card 1</Card>
210
+ <Card>Card 2</Card>
211
+ </Flex>
212
+ ```
213
+
214
+ **Props:**
215
+ - `direction`: 'row' | 'column' | 'row-reverse' | 'column-reverse' (default: 'row') - Flex direction
216
+ - `justify`: 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly' (default: 'start') - Justify content
217
+ - `align`: 'start' | 'end' | 'center' | 'baseline' | 'stretch' (default: 'start') - Align items
218
+ - `wrap`: boolean | 'wrap' | 'nowrap' | 'wrap-reverse' (default: false) - Flex wrap behavior
219
+ - `gap`: 'none' | 'small' | 'medium' | 'large' | number (default: 'none') - Gap between items
220
+ - `className`: string (optional) - Additional CSS classes
221
+ - `style`: React.CSSProperties (optional) - Additional inline styles
222
+
223
+ ### Text
224
+
225
+ A typography component for consistent text styling with various options.
226
+
227
+ ```tsx
228
+ import { Text } from 'pure-react-ui';
229
+
230
+ <Text as="h1" size="2xl" weight="bold" color="primary">
231
+ Heading Text
232
+ </Text>
233
+
234
+ <Text size="lg" color="muted" align="center">
235
+ Centered paragraph text
236
+ </Text>
237
+
238
+ <Text as="span" size="sm" decoration="underline" transform="uppercase">
239
+ Styled Text
240
+ </Text>
241
+ ```
242
+
243
+ **Props:**
244
+ - `as`: 'p' | 'span' | 'div' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'label' | 'small' | 'strong' | 'em' | 'code' | 'pre' (default: 'p') - HTML element to render
245
+ - `size`: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' (default: 'md') - Font size
246
+ - `weight`: 'light' | 'normal' | 'medium' | 'semibold' | 'bold' (default: 'normal') - Font weight
247
+ - `color`: 'default' | 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'muted' (default: 'default') - Text color
248
+ - `align`: 'left' | 'center' | 'right' | 'justify' (default: 'left') - Text alignment
249
+ - `transform`: 'none' | 'uppercase' | 'lowercase' | 'capitalize' (default: 'none') - Text transform
250
+ - `decoration`: 'none' | 'underline' | 'line-through' | 'overline' (default: 'none') - Text decoration
251
+ - `truncate`: boolean (default: false) - Truncate text with ellipsis
252
+ - `className`: string (optional) - Additional CSS classes
253
+
254
+ ### Form Components
255
+
256
+ A comprehensive form component system with all form elements.
257
+
258
+ #### Form
259
+
260
+ The main form container component.
261
+
262
+ ```tsx
263
+ import { Form } from 'pure-react-ui';
264
+
265
+ <Form layout="vertical" onSubmit={handleSubmit}>
266
+ {/* Form fields */}
267
+ </Form>
268
+ ```
269
+
270
+ **Props:**
271
+ - `layout`: 'vertical' | 'horizontal' | 'inline' (default: 'vertical')
272
+ - `size`: 'small' | 'medium' | 'large' (default: 'medium')
273
+ - `onSubmit`: (e: React.FormEvent) => void (optional)
274
+ - All standard form HTML attributes
275
+
276
+ #### Input
277
+
278
+ Text input field with validation and icons.
279
+
280
+ ```tsx
281
+ import { Input } from 'pure-react-ui';
282
+
283
+ <Input
284
+ label="Email"
285
+ type="email"
286
+ placeholder="Enter email"
287
+ error={errors.email}
288
+ helpText="We'll never share your email"
289
+ leftIcon={<Icon name="Mail" />}
290
+ fullWidth
291
+ />
292
+ ```
293
+
294
+ **Props:**
295
+ - `label`: string (optional)
296
+ - `error`: string (optional) - Error message
297
+ - `helpText`: string (optional) - Help text
298
+ - `leftIcon`: React.ReactNode (optional)
299
+ - `rightIcon`: React.ReactNode (optional)
300
+ - `fullWidth`: boolean (default: false)
301
+ - `size`: 'small' | 'medium' | 'large' (default: 'medium')
302
+ - All standard input HTML attributes
303
+
304
+ #### Textarea
305
+
306
+ Multi-line text input.
307
+
308
+ ```tsx
309
+ import { Textarea } from 'pure-react-ui';
310
+
311
+ <Textarea
312
+ label="Message"
313
+ placeholder="Enter your message"
314
+ rows={4}
315
+ resize="vertical"
316
+ fullWidth
317
+ />
318
+ ```
319
+
320
+ **Props:**
321
+ - `label`: string (optional)
322
+ - `error`: string (optional)
323
+ - `helpText`: string (optional)
324
+ - `fullWidth`: boolean (default: false)
325
+ - `size`: 'small' | 'medium' | 'large' (default: 'medium')
326
+ - `rows`: number (default: 4)
327
+ - `resize`: 'none' | 'both' | 'horizontal' | 'vertical' (default: 'vertical')
328
+ - All standard textarea HTML attributes
329
+
330
+ #### Select
331
+
332
+ Advanced dropdown select component powered by react-select with search, multi-select, and more features.
333
+
334
+ **Note:** This component requires `react-select` to be installed as a peer dependency:
335
+ ```bash
336
+ npm install react-select
337
+ ```
338
+
339
+ ```tsx
340
+ import { Select } from 'pure-react-ui';
341
+
342
+ // Basic Select
343
+ <Select
344
+ label="Country"
345
+ options={[
346
+ { value: 'us', label: 'United States' },
347
+ { value: 'uk', label: 'United Kingdom' }
348
+ ]}
349
+ placeholder="Choose a country"
350
+ fullWidth
351
+ />
352
+
353
+ // Searchable Select
354
+ <Select
355
+ label="Search Country"
356
+ options={countries}
357
+ placeholder="Search and select"
358
+ isSearchable
359
+ isClearable
360
+ fullWidth
361
+ />
362
+
363
+ // Multi Select
364
+ <Select
365
+ label="Select Frameworks"
366
+ options={frameworks}
367
+ placeholder="Select multiple"
368
+ isMulti
369
+ isSearchable
370
+ fullWidth
371
+ />
372
+
373
+ // Select with Icons
374
+ <Select
375
+ label="Framework"
376
+ options={[
377
+ { value: 'react', label: 'React', icon: <Icon name="Zap" /> },
378
+ { value: 'vue', label: 'Vue.js', icon: <Icon name="Zap" /> }
379
+ ]}
380
+ placeholder="Choose framework"
381
+ fullWidth
382
+ />
383
+ ```
384
+
385
+ **Props:**
386
+ - `label`: string (optional)
387
+ - `error`: string (optional)
388
+ - `helpText`: string (optional)
389
+ - `options`: SelectOption[] (required) - Array of options with `value`, `label`, optional `disabled`, and optional `icon`
390
+ - `placeholder`: string (optional, default: 'Select...')
391
+ - `value`: string | number | (string | number)[] (optional) - Controlled value
392
+ - `defaultValue`: string | number | (string | number)[] (optional) - Uncontrolled default value
393
+ - `multiple` or `isMulti`: boolean (default: false) - Enable multi-select
394
+ - `searchable` or `isSearchable`: boolean (default: false) - Enable search functionality
395
+ - `allowClear` or `isClearable`: boolean (default: false) - Show clear button
396
+ - `disabled`: boolean (default: false)
397
+ - `fullWidth`: boolean (default: false)
398
+ - `size`: 'small' | 'medium' | 'large' (default: 'medium')
399
+ - `onChange`: (value: string | number | (string | number)[]) => void (optional)
400
+ - `onSearch`: (searchText: string) => void (optional) - Callback when search text changes
401
+ - `name`: string (optional) - Form field name
402
+ - `id`: string (optional) - Custom ID for the select
403
+ - `className`: string (optional)
404
+
405
+ #### Checkbox
406
+
407
+ Checkbox input with custom styling.
408
+
409
+ ```tsx
410
+ import { Checkbox } from 'pure-react-ui';
411
+
412
+ <Checkbox
413
+ label="I agree to terms"
414
+ checked={checked}
415
+ onChange={(e) => setChecked(e.target.checked)}
416
+ />
417
+ ```
418
+
419
+ **Props:**
420
+ - `label`: string (optional)
421
+ - `error`: string (optional)
422
+ - `helpText`: string (optional)
423
+ - `fullWidth`: boolean (default: false)
424
+ - `size`: 'small' | 'medium' | 'large' (default: 'medium')
425
+ - All standard checkbox HTML attributes
426
+
427
+ #### Radio
428
+
429
+ Radio button input.
430
+
431
+ ```tsx
432
+ import { Radio } from 'pure-react-ui';
433
+
434
+ <Radio
435
+ label="Option 1"
436
+ name="option"
437
+ value="1"
438
+ checked={selected === '1'}
439
+ onChange={(e) => setSelected(e.target.value)}
440
+ />
441
+ ```
442
+
443
+ **Props:**
444
+ - `label`: string (optional)
445
+ - `error`: string (optional)
446
+ - `helpText`: string (optional)
447
+ - `fullWidth`: boolean (default: false)
448
+ - `size`: 'small' | 'medium' | 'large' (default: 'medium')
449
+ - All standard radio HTML attributes
450
+
451
+ #### Switch
452
+
453
+ Toggle switch component.
454
+
455
+ ```tsx
456
+ import { Switch } from 'pure-react-ui';
457
+
458
+ <Switch
459
+ label="Enable notifications"
460
+ checked={enabled}
461
+ onChange={(e) => setEnabled(e.target.checked)}
462
+ />
463
+ ```
464
+
465
+ **Props:**
466
+ - `label`: string (optional)
467
+ - `error`: string (optional)
468
+ - `helpText`: string (optional)
469
+ - `fullWidth`: boolean (default: false)
470
+ - `size`: 'small' | 'medium' | 'large' (default: 'medium')
471
+ - All standard checkbox HTML attributes (used as switch)
472
+
473
+ #### FormGroup
474
+
475
+ Container for grouping form fields.
476
+
477
+ ```tsx
478
+ import { FormGroup } from 'pure-react-ui';
479
+
480
+ <FormGroup label="Personal Information" required>
481
+ <Input label="Name" />
482
+ <Input label="Email" />
483
+ </FormGroup>
484
+ ```
485
+
486
+ **Props:**
487
+ - `label`: string (optional)
488
+ - `error`: string (optional)
489
+ - `helpText`: string (optional)
490
+ - `required`: boolean (default: false)
491
+ - `className`: string (optional)
492
+
493
+ #### FormRow
494
+
495
+ Horizontal row for form fields.
496
+
497
+ ```tsx
498
+ import { FormRow } from 'pure-react-ui';
499
+
500
+ <FormRow gap="medium">
501
+ <Input label="First Name" fullWidth />
502
+ <Input label="Last Name" fullWidth />
503
+ </FormRow>
504
+ ```
505
+
506
+ **Props:**
507
+ - `gap`: 'small' | 'medium' | 'large' | number (default: 'medium')
508
+ - `className`: string (optional)
509
+
510
+ ## Styling
511
+
512
+ All components include their own CSS files and use CSS classes with the `pure-` prefix. The CSS files are automatically imported with each component. You can also style them by targeting these classes:
513
+
514
+ - **Button**: `pure-button`, `pure-button--primary`, `pure-button--secondary`, etc.
515
+ - **Card**: `pure-card`, `pure-card--hoverable`, `pure-card--shadow-medium`, etc.
516
+ - **Modal**: `pure-modal`, `pure-modal__overlay`, `pure-modal__header`, etc.
517
+ - **Icon**: `pure-icon`, `pure-icon--clickable`, `pure-icon--small`, etc.
518
+ - **Space**: `pure-space`, `pure-space--horizontal`, `pure-space--vertical`, etc.
519
+ - **Flex**: `pure-flex`, `pure-flex--row`, `pure-flex--column`, etc.
520
+ - **Text**: `pure-text`, `pure-text--lg`, `pure-text--bold`, etc.
521
+ - **Form**: `pure-form`, `pure-form--vertical`, `pure-form--horizontal`, etc.
522
+ - **Input**: `pure-input`, `pure-input--error`, `pure-input--small`, etc.
523
+ - **Textarea**: `pure-textarea`, `pure-textarea--error`, etc.
524
+ - **Select**: `pure-select`, `pure-select--error`, etc.
525
+ - **Checkbox**: `pure-checkbox`, `pure-checkbox--error`, etc.
526
+ - **Radio**: `pure-radio`, `pure-radio--error`, etc.
527
+ - **Switch**: `pure-switch`, `pure-switch--error`, etc.
528
+
529
+ Each component has its own CSS file located in:
530
+ - `lib/components/Button/Button.css`
531
+ - `lib/components/Card/Card.css`
532
+ - `lib/components/Modal/Modal.css`
533
+ - `lib/components/Icon/Icon.css`
534
+ - `lib/components/Space/Space.css`
535
+ - `lib/components/Flex/Flex.css`
536
+ - `lib/components/Text/Text.css`
537
+ - `lib/components/Form/Form.css`
538
+
539
+ ## Examples
540
+
541
+ A complete example application is available in the `example` directory. To run it:
542
+
543
+ ```bash
544
+ # From the root directory, build the package first
545
+ npm run build
546
+
547
+ # Then navigate to example directory
548
+ cd example
549
+ npm install
550
+ npm run dev
551
+ ```
552
+
553
+ Or check out `EXAMPLES.md` for code examples and usage patterns.
554
+
555
+ ## License
556
+
557
+ MIT
558
+