pure-react-ui 1.5.5 → 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.
Files changed (2) hide show
  1. package/README.md +57 -4
  2. package/package.json +6 -3
package/README.md CHANGED
@@ -8,6 +8,12 @@ A pure React UI component library built with TypeScript. No external dependencie
8
8
  npm install pure-react-ui
9
9
  ```
10
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
+
11
17
  ## Components
12
18
 
13
19
  ### Button
@@ -323,11 +329,17 @@ import { Textarea } from 'pure-react-ui';
323
329
 
324
330
  #### Select
325
331
 
326
- Dropdown select component.
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
+ ```
327
338
 
328
339
  ```tsx
329
340
  import { Select } from 'pure-react-ui';
330
341
 
342
+ // Basic Select
331
343
  <Select
332
344
  label="Country"
333
345
  options={[
@@ -337,17 +349,58 @@ import { Select } from 'pure-react-ui';
337
349
  placeholder="Choose a country"
338
350
  fullWidth
339
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
+ />
340
383
  ```
341
384
 
342
385
  **Props:**
343
386
  - `label`: string (optional)
344
387
  - `error`: string (optional)
345
388
  - `helpText`: string (optional)
346
- - `options`: SelectOption[] (required)
347
- - `placeholder`: 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)
348
397
  - `fullWidth`: boolean (default: false)
349
398
  - `size`: 'small' | 'medium' | 'large' (default: 'medium')
350
- - All standard select HTML attributes
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)
351
404
 
352
405
  #### Checkbox
353
406
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pure-react-ui",
3
- "version": "1.5.5",
3
+ "version": "1.5.6",
4
4
  "description": "A pure React UI component library with Button, Card, Modal, Icon, Space, Flex, Text, and Form components",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -30,12 +30,15 @@
30
30
  "license": "MIT",
31
31
  "peerDependencies": {
32
32
  "react": ">=16.8.0",
33
- "react-dom": ">=16.8.0"
33
+ "react-dom": ">=16.8.0",
34
+ "react-select": ">=5.0.0"
34
35
  },
35
36
  "devDependencies": {
36
37
  "@types/react": "^18.2.0",
37
38
  "@types/react-dom": "^18.2.0",
38
- "typescript": "^5.0.0"
39
+ "typescript": "^5.0.0",
40
+ "react-select": "^5.8.0",
41
+ "@types/react-select": "^5.0.0"
39
42
  }
40
43
  }
41
44